There seems to be a bug in Gnulib's setenv module on Mac OS X. At configure time it says: checking whether setenv validates arguments ... no (The test program it is running is: | int | main () | { | | if (setenv ("", "", 0) != -1) return 1; | if (errno != EINVAL) return 2; | if (setenv ("a", "=", 1) != 0) return 3; | if (strcmp (getenv ("a"), "=") != 0) return 4; | | ; | return 0; | } and this returns status code 4) As a result, in stdlib.h, this: #if @GNULIB_SETENV@ # if @REPLACE_SETENV@ # undef setenv # define setenv rpl_setenv is replaced by: #if 1 # if 1 # undef setenv # define setenv rpl_setenv However, no rpl_setenv function is getting generated in libgnu.a, so of course the program fails to link. Any ideas? Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones New in Fedora 11: Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 70 libraries supprt'd http://fedoraproject.org/wiki/MinGW http://www.annexia.org/fedora_mingw
Hi, Richard W.M. Jones wrote:> There seems to be a bug in Gnulib's setenv module on Mac OS X. At > configure time it says: > > checking whether setenv validates arguments ... no > > (The test program it is running is: > > | int > | main () > | { > | > | if (setenv ("", "", 0) != -1) return 1; > | if (errno != EINVAL) return 2; > | if (setenv ("a", "=", 1) != 0) return 3; > | if (strcmp (getenv ("a"), "=") != 0) return 4; > | > | ; > | return 0; > | } > > and this returns status code 4)This is normal. It's a small bug in the system's setenv routine.> As a result, in stdlib.h, this: > > #if @GNULIB_SETENV@ > # if @REPLACE_SETENV@ > # undef setenv > # define setenv rpl_setenv > > is replaced by: > > #if 1 > # if 1 > # undef setenv > # define setenv rpl_setenvThis is expected too.> However, no rpl_setenv function is getting generated in libgnu.aIf you do $ grep LIBOBJ config.status you should see something like this: S["gl_LTLIBOBJS"]=" setenv.lo" S["gl_LIBOBJS"]=" setenv.o" If you do $ grep -i _setenv config.status you should see something like this (among others): S["REPLACE_SETENV"]="1" S["HAVE_SETENV"]="1" S["GNULIB_SETENV"]="1" If not, then please show the details. Bruno
On Sun, Mar 21, 2010 at 11:18:16PM +0100, Bruno Haible wrote:> If you do > $ grep LIBOBJ config.status > you should see something like this: > S["gl_LTLIBOBJS"]=" setenv.lo" > S["gl_LIBOBJS"]=" setenv.o"$ grep LIBOBJ config.status | grep -i setenv s, at gltests_LIBOBJS@,|#_!!_#| getugroups.o imaxtostr.o mgetgroups.o offtostr.o putenv.o setenv.o symlink.o uinttostr.o umaxtostr.o unlinkdir.o,g s, at gltests_LTLIBOBJS@,|#_!!_#| getugroups.lo imaxtostr.lo mgetgroups.lo offtostr.lo putenv.lo setenv.lo symlink.lo uinttostr.lo umaxtostr.lo unlinkdir.lo,g> If you do > $ grep -i _setenv config.status > you should see something like this (among others): > S["REPLACE_SETENV"]="1" > S["HAVE_SETENV"]="1" > S["GNULIB_SETENV"]="1"$ grep -i _setenv config.status s, at GNULIB_SETENV@,|#_!!_#|1,g s, at HAVE_SETENV@,|#_!!_#|1,g s, at REPLACE_SETENV@,|#_!!_#|1,g s,^\([ #]*\)[^ ]*\([ ]*HAVE_SETENV\)[ (].*,\1define\2 1 , s,^\([ #]*\)[^ ]*\([ ]*HAVE_RAW_DECL_SETENV\)[ (].*,\1define\2 1 , Hope that helps. BTW, OS X by default comes with an ancient version of autoconf, 2.61, if that affects things. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming blog: http://rwmj.wordpress.com Fedora now supports 80 OCaml packages (the OPEN alternative to F#) http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora