diff --git a/NEWS b/NEWS index 3f455581505ec8ad949855a7bc29f8f2cb3faaf4..eacad40f7bc4f0732063358cda20ccb4d55f7df9 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,11 @@ +20040220: +--------- + + - Version 4.1.4 + - Several bugfixes + - Added --with-broken-putenv=[auto/no/yes] to configure to make + libxfce4util cross-compilable again. + 20040212: --------- diff --git a/README b/README index 05639cb66e8a113a1e7247d6ffd87c72cd91acb8..668e41bed70444e0ad31d304d945ef6b287ca24f 100644 --- a/README +++ b/README @@ -1 +1,47 @@ + $Id$ + + Basic utility library for Xfce4. + + +Installation: +------------- + + Simply run + + ./configure + make + make install + + For a list of available configure options, see the list as returned + by + + ./configure --help + + +Notes to cross-compilers: +------------------------- + + The check for "broken putenv" will fail for cross-compiling. Therefore + you'll need to supply the --with-broken-putenv option to configure + with a parameter of either yes or no (see the ./configure --help + output). To determine if your plattform's putenv() is ok or + broken, you can use the following test program: + + #include <stdlib.h> + #include <string.h> + int main(int argc, char *argv[]) + { + char *buffer = (char *)malloc(8); + strcpy(buffer, "foo=bar"); + putenv(buffer); + strcpy(buffer, "foo=rab"); + return(strcmp(getenv("foo"), "bar") == 0 ? 0 : 1); + } + + Just compile the program and run it. If it returns 0, then your + plattform's putenv() is ok, and you should add --with-broken-putenv=no + to ./configure, else you need --with-broken-putenv=yes. + + All glibc based plattforms (nearly all GNU/Linux systems, and GNU/Hurd, + etc.) and Solaris plattforms are known to have the putenv() problem. diff --git a/aclocal.m4 b/aclocal.m4 index afbc1e6ef8347530e8964e3b4890a6bf9c91a834..f2bc653c1fc742153e5bf05c03a14007f088b228 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -979,27 +979,27 @@ AC_DEFUN([GTK_DOC_CHECK], enable_gtk_doc=no) have_gtk_doc=no - if test -z "$PKG_CONFIG"; then - AC_PATH_PROG(PKG_CONFIG, pkg-config, no) - fi - if test "$PKG_CONFIG" != "no" && $PKG_CONFIG --exists gtk-doc; then - have_gtk_doc=yes - fi + if test x$enable_gtk_doc = xyes; then + if test -z "$PKG_CONFIG"; then + AC_PATH_PROG(PKG_CONFIG, pkg-config, no) + fi + if test "$PKG_CONFIG" != "no" && $PKG_CONFIG --exists gtk-doc; then + have_gtk_doc=yes + fi dnl do we want to do a version check? ifelse([$1],[],, - [gtk_doc_min_version=$1 - if test "$have_gtk_doc" = yes; then - AC_MSG_CHECKING([gtk-doc version >= $gtk_doc_min_version]) - if $PKG_CONFIG --atleast-version $gtk_doc_min_version gtk-doc; then - AC_MSG_RESULT(yes) - else - AC_MSG_RESULT(no) - have_gtk_doc=no + [gtk_doc_min_version=$1 + if test "$have_gtk_doc" = yes; then + AC_MSG_CHECKING([gtk-doc version >= $gtk_doc_min_version]) + if $PKG_CONFIG --atleast-version $gtk_doc_min_version gtk-doc; then + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) + have_gtk_doc=no + fi fi - fi ]) - if test x$enable_gtk_doc = xyes; then if test "$have_gtk_doc" != yes; then enable_gtk_doc=no fi diff --git a/config.h.in b/config.h.in index 386d3d960f76a7a5d4fa26177a7cf929459ff766..cf5c0b07c91ed571af78840a470e9f0b66f6bb08 100644 --- a/config.h.in +++ b/config.h.in @@ -6,7 +6,7 @@ /* Define for tracing support */ #undef DEBUG_TRACE -/* Define if putenv() is broken */ +/* Define if putenv(3) is broken */ #undef HAVE_BROKEN_PUTENV /* Define to 1 if you have the <dlfcn.h> header file. */ @@ -42,6 +42,9 @@ /* Define to 1 if you have the <stdlib.h> header file. */ #undef HAVE_STDLIB_H +/* Define to 1 if you have the `strdup' function. */ +#undef HAVE_STRDUP + /* Define to 1 if you have the <strings.h> header file. */ #undef HAVE_STRINGS_H diff --git a/configure b/configure index b6e27e282eb773e0822e633f0ecf36ad2c3b4728..87da39eba2e7d0f9bff3d1adc43ddfe9b50c522b 100755 --- a/configure +++ b/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.ac Id: configure.ac,v 1.29 2004/02/03 18:06:07 benny Exp . +# From configure.ac Id: configure.ac,v 1.30 2004/02/12 00:59:56 benny Exp . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.59 for libxfce4util 4.1.3. # @@ -8,7 +8,7 @@ # Copyright (c) 2002-2004 # The Xfce development team. All rights reserved. # -# Written for XFce by Benedikt Meurer <benny@xfce.org>. +# Written for Xfce by Benedikt Meurer <benny@xfce.org>. # # Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation @@ -1061,6 +1061,7 @@ Optional Packages: --with-tags[=TAGS] include additional configurations [automatic] --with-html-dir=PATH path to installed docs + --with-broken-putenv=[auto/yes/no] broken putenv(3) default=auto Some influential environment variables: CC C compiler command @@ -1185,7 +1186,7 @@ gives unlimited permission to copy, distribute and modify it. Copyright (c) 2002-2004 The Xfce development team. All rights reserved. -Written for XFce by Benedikt Meurer <benny@xfce.org>. +Written for Xfce by Benedikt Meurer <benny@xfce.org>. _ACEOF exit 0 fi @@ -5418,7 +5419,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 5421 "configure"' > conftest.$ac_ext + echo '#line 5422 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -6510,7 +6511,7 @@ fi # Provide some information about the compiler. -echo "$as_me:6513:" \ +echo "$as_me:6514:" \ "checking for Fortran 77 compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5 @@ -7537,11 +7538,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7540: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7541: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7544: \$? = $ac_status" >&5 + echo "$as_me:7545: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -7769,11 +7770,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7772: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7773: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7776: \$? = $ac_status" >&5 + echo "$as_me:7777: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -7836,11 +7837,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7839: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7840: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:7843: \$? = $ac_status" >&5 + echo "$as_me:7844: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -9221,7 +9222,7 @@ linux*) libsuff= case "$host_cpu" in x86_64*|s390x*|powerpc64*) - echo '#line 9224 "configure"' > conftest.$ac_ext + echo '#line 9225 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -10003,7 +10004,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF -#line 10006 "configure" +#line 10007 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -10101,7 +10102,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF -#line 10104 "configure" +#line 10105 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12253,11 +12254,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:12256: $lt_compile\"" >&5) + (eval echo "\"\$as_me:12257: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:12260: \$? = $ac_status" >&5 + echo "$as_me:12261: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -12320,11 +12321,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:12323: $lt_compile\"" >&5) + (eval echo "\"\$as_me:12324: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:12327: \$? = $ac_status" >&5 + echo "$as_me:12328: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -12891,7 +12892,7 @@ linux*) libsuff= case "$host_cpu" in x86_64*|s390x*|powerpc64*) - echo '#line 12894 "configure"' > conftest.$ac_ext + echo '#line 12895 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -13673,7 +13674,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF -#line 13676 "configure" +#line 13677 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -13771,7 +13772,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF -#line 13774 "configure" +#line 13775 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -14593,11 +14594,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14596: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14597: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:14600: \$? = $ac_status" >&5 + echo "$as_me:14601: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -14660,11 +14661,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14663: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14664: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:14667: \$? = $ac_status" >&5 + echo "$as_me:14668: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -16025,7 +16026,7 @@ linux*) libsuff= case "$host_cpu" in x86_64*|s390x*|powerpc64*) - echo '#line 16028 "configure"' > conftest.$ac_ext + echo '#line 16029 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -16671,11 +16672,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16674: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16675: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:16678: \$? = $ac_status" >&5 + echo "$as_me:16679: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -16903,11 +16904,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16906: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16907: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:16910: \$? = $ac_status" >&5 + echo "$as_me:16911: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -16970,11 +16971,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16973: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16974: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:16977: \$? = $ac_status" >&5 + echo "$as_me:16978: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -18355,7 +18356,7 @@ linux*) libsuff= case "$host_cpu" in x86_64*|s390x*|powerpc64*) - echo '#line 18358 "configure"' > conftest.$ac_ext + echo '#line 18359 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -19137,7 +19138,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF -#line 19140 "configure" +#line 19141 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -19235,7 +19236,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF -#line 19238 "configure" +#line 19239 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -20568,7 +20569,9 @@ done -for ac_func in __unaliasname gethostname setenv setlocale strlcat strlcpy + +for ac_func in __unaliasname gethostname setenv setlocale strdup \ + strlcat strlcpy do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 @@ -20794,8 +20797,9 @@ else fi; have_gtk_doc=no - if test -z "$PKG_CONFIG"; then - # Extract the first word of "pkg-config", so it can be a program name with args. + if test x$enable_gtk_doc = xyes; then + if test -z "$PKG_CONFIG"; then + # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 @@ -20835,26 +20839,25 @@ else echo "${ECHO_T}no" >&6 fi - fi - if test "$PKG_CONFIG" != "no" && $PKG_CONFIG --exists gtk-doc; then - have_gtk_doc=yes - fi + fi + if test "$PKG_CONFIG" != "no" && $PKG_CONFIG --exists gtk-doc; then + have_gtk_doc=yes + fi gtk_doc_min_version=1.0 - if test "$have_gtk_doc" = yes; then - echo "$as_me:$LINENO: checking gtk-doc version >= $gtk_doc_min_version" >&5 + if test "$have_gtk_doc" = yes; then + echo "$as_me:$LINENO: checking gtk-doc version >= $gtk_doc_min_version" >&5 echo $ECHO_N "checking gtk-doc version >= $gtk_doc_min_version... $ECHO_C" >&6 - if $PKG_CONFIG --atleast-version $gtk_doc_min_version gtk-doc; then - echo "$as_me:$LINENO: result: yes" >&5 + if $PKG_CONFIG --atleast-version $gtk_doc_min_version gtk-doc; then + echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 - else - echo "$as_me:$LINENO: result: no" >&5 + else + echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 - have_gtk_doc=no + have_gtk_doc=no + fi fi - fi - if test x$enable_gtk_doc = xyes; then if test "$have_gtk_doc" != yes; then enable_gtk_doc=no fi @@ -20963,7 +20966,14 @@ echo "${ECHO_T}yes" >&6 # be hit by this problem. echo "$as_me:$LINENO: checking whether putenv() implementation is broken" >&5 echo $ECHO_N "checking whether putenv() implementation is broken... $ECHO_C" >&6 -if test "$cross_compiling" = yes; then + +# Check whether --with-broken-putenv or --without-broken-putenv was given. +if test "${with_broken_putenv+set}" = set; then + withval="$with_broken_putenv" + +fi; +if test x"$with_broken_putenv" != x"yes" -a x"$with_broken_putenv" != x"no"; then + if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling @@ -20972,16 +20982,16 @@ See \`config.log' for more details." >&2;} else cat >conftest.$ac_ext <<_ACEOF -#include <stdlib.h> -#include <string.h> -int main(int argc, char *argv) -{ - char *buffer = (char *)malloc(8); - strcpy(buffer, "foo=bar"); - putenv(buffer); - strcpy(buffer, "foo=rab"); - return(strcmp(getenv("foo"), "bar") == 0 ? 0 : 1); -} + #include <stdlib.h> + #include <string.h> + int main(int argc, char *argv) + { + char *buffer = (char *)malloc(8); + strcpy(buffer, "foo=bar"); + putenv(buffer); + strcpy(buffer, "foo=rab"); + return(strcmp(getenv("foo"), "bar") == 0 ? 0 : 1); + } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 @@ -20994,26 +21004,27 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + with_broken_putenv=no else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) - +with_broken_putenv=yes +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +if test x"$with_broken_putenv" = x"yes"; then cat >>confdefs.h <<\_ACEOF #define HAVE_BROKEN_PUTENV 1 _ACEOF - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi +echo "$as_me:$LINENO: result: $with_broken_putenv" >&5 +echo "${ECHO_T}$with_broken_putenv" >&6 ac_config_files="$ac_config_files Makefile docs/version.xml docs/Makefile i18n/Makefile libxfce4util.spec libxfce4util/libxfce4util-1.0.pc libxfce4util/Makefile m4/Makefile" cat >confcache <<\_ACEOF diff --git a/configure.ac b/configure.ac index 8d616cd105cfd4562d3eecbb299963b0b501b347..db307a93c06164673566c123ec0a0033b5918756 100644 --- a/configure.ac +++ b/configure.ac @@ -10,7 +10,7 @@ dnl Version information m4_define([libxfce4util_verinfo], [1:3:0]) m4_define([libxfce4util_version_major], [4]) m4_define([libxfce4util_version_minor], [1]) -m4_define([libxfce4util_version_micro], [3]) +m4_define([libxfce4util_version_micro], [4]) m4_define([libxfce4util_version], [libxfce4util_version_major.libxfce4util_version_minor.libxfce4util_version_micro]) dnl Overall XFce version, modify this when making releases @@ -20,7 +20,8 @@ dnl Initialize autoconf AC_COPYRIGHT([Copyright (c) 2002-2004 The Xfce development team. All rights reserved. -Written for XFce by Benedikt Meurer <benny@xfce.org>.]) +Written for Xfce by Benedikt Meurer <benny@xfce.org> and +Jasper Huijsman <jasper@xfce.org>.]) AC_INIT([libxfce4util], [libxfce4util_version], [xfce4-dev@xfce.org]) AC_PREREQ([2.50]) AC_REVISION([$Id$]) @@ -52,7 +53,8 @@ AC_PROG_LIBTOOL dnl check for standard header files AC_HEADER_STDC AC_CHECK_HEADERS([err.h limits.h locale.h sys/utsname.h sys/wait.h]) -AC_CHECK_FUNCS([__unaliasname gethostname setenv setlocale strlcat strlcpy]) +AC_CHECK_FUNCS([__unaliasname gethostname setenv setlocale strdup \ + strlcat strlcpy]) dnl Check for GObject >= 2.0.0 installed (GObject in turn depends on GLib) BM_DEPEND([GOBJECT], [gobject-2.0], [2.0.0]) @@ -68,22 +70,27 @@ BM_DEBUG_SUPPORT # Solaris is known to have such an implementation, also glibc seems to # be hit by this problem. AC_MSG_CHECKING([whether putenv() implementation is broken]) -AC_RUN_IFELSE([ -#include <stdlib.h> -#include <string.h> -int main(int argc, char *argv[]) -{ - char *buffer = (char *)malloc(8); - strcpy(buffer, "foo=bar"); - putenv(buffer); - strcpy(buffer, "foo=rab"); - return(strcmp(getenv("foo"), "bar") == 0 ? 0 : 1); -}], -[AC_MSG_RESULT([no])], -[ - AC_DEFINE([HAVE_BROKEN_PUTENV], [1], [Define if putenv() is broken]) - AC_MSG_RESULT([yes]) -]) +AC_ARG_WITH([broken-putenv], + [ --with-broken-putenv=[[auto/yes/no]] broken putenv(3) [default=auto]]) +if test x"$with_broken_putenv" != x"yes" -a x"$with_broken_putenv" != x"no"; then + AC_RUN_IFELSE([ + #include <stdlib.h> + #include <string.h> + int main(int argc, char *argv[]) + { + char *buffer = (char *)malloc(8); + strcpy(buffer, "foo=bar"); + putenv(buffer); + strcpy(buffer, "foo=rab"); + return(strcmp(getenv("foo"), "bar") == 0 ? 0 : 1); + }], + [with_broken_putenv=no], + [with_broken_putenv=yes]) +fi +if test x"$with_broken_putenv" = x"yes"; then + AC_DEFINE([HAVE_BROKEN_PUTENV], [1], [Define if putenv(3) is broken]) +fi +AC_MSG_RESULT([$with_broken_putenv]) AC_OUTPUT([ Makefile