[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: global 5.4 build failed on sunos5.6
From: |
Shigio YAMAGUCHI |
Subject: |
Re: global 5.4 build failed on sunos5.6 |
Date: |
Tue, 06 Feb 2007 08:36:02 +0900 |
Hi paul,
> global 5.4 build failed on sunos5.6
> Previous 5.3 built ok with no problem.
>
> gcc -g -O2 -o global global.o ../libutil/libgloutil.a ...
> Undefined first referenced
> symbol in file
> setenv ../libutil/libgloutil.a(env.o)
> ld: fatal: Symbol referencing errors. No output written to global
> collect2: ld returned 1 exit status
I revived the use of putenv(3) like follows.
Thank you for your report.
Index: configure.ac
===================================================================
RCS file: /sources/global/global/configure.ac,v
retrieving revision 1.79
diff -c -r1.79 configure.ac
*** configure.ac 29 Jan 2007 00:54:07 -0000 1.79
--- configure.ac 5 Feb 2007 23:29:46 -0000
***************
*** 97,103 ****
AC_FUNC_MEMCMP
AC_TYPE_SIGNAL
AC_FUNC_STRFTIME
! AC_CHECK_FUNCS(getcwd lstat snprintf)
AC_CHECK_FUNCS(index rindex bzero bcmp bcopy strchr strrchr memset memcmp
memmove)
AC_CHECK_FUNCS(putc_unlocked getc_unlocked)
AG_DJGPP
--- 97,103 ----
AC_FUNC_MEMCMP
AC_TYPE_SIGNAL
AC_FUNC_STRFTIME
! AC_CHECK_FUNCS(getcwd putenv lstat snprintf)
AC_CHECK_FUNCS(index rindex bzero bcmp bcopy strchr strrchr memset memcmp
memmove)
AC_CHECK_FUNCS(putc_unlocked getc_unlocked)
AG_DJGPP
Index: libutil/env.c
===================================================================
RCS file: /sources/global/global/libutil/env.c,v
retrieving revision 1.14
diff -c -r1.14 env.c
*** libutil/env.c 30 Nov 2006 02:25:12 -0000 1.14
--- libutil/env.c 5 Feb 2007 23:29:46 -0000
***************
*** 48,54 ****
--- 48,65 ----
void
set_env(const char *var, const char *val)
{
+ /*
+ * sparc-sun-solaris2.6 doesn't have setenv(3).
+ */
+ #ifdef HAVE_PUTENV
+ STRBUF *sb = strbuf_open(0);
+
+ strbuf_sprintf(sb, "%s=%s", var, val);
+ putenv(strbuf_value(sb));
+ /* Don't free memory. putenv(3) require it. */
+ #else
setenv(var, val, 1);
+ #endif
}
/*
* get_home_directory: get environment dependent home directory.
--
Shigio YAMAGUCHI <address@hidden> - Tama Communications Corporation
PGP fingerprint: D1CB 0B89 B346 4AB6 5663 C4B6 3CA5 BBB3 57BE DDA3