From: David MacKenzie Date: Tue, 21 Feb 1995 20:39:40 +0000 (+0000) Subject: more little bug fixes X-Git-Tag: fsf-origin~312 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=555069628e837f8a91edb6bc0240d4c5ae7db5ed;p=thirdparty%2Fautoconf.git more little bug fixes --- diff --git a/TODO b/TODO index 7660d4c9b..900c43f4d 100644 --- a/TODO +++ b/TODO @@ -1,6 +1,9 @@ -*- outline -*- -Things it might be nice to do someday: +Things it might be nice to do someday. I haven't evaluated all of +these suggestions... their presence here doesn't imply my endorsement, +just that I haven't looked at them closely enough to reject them yet. +-djm ------------------------------------------------------------------------------ @@ -207,6 +210,12 @@ a bit verbose to write if it's actually superfluous. From Roland McGrath. [I'd call it AC_CHECK_VAR, I think. -djm] +------------------------------------------------------------------------------ + +In a future version (after 2.2), make AC_PROG_{CC,RANLIB,anything else} +use AC_CHECK_TOOL. +From Roland McGrath. + ------------------------------------------------------------------------------ ls -lt configure configure.in | sort @@ -251,6 +260,61 @@ From: Randall Winchester ------------------------------------------------------------------------------ +AC_C_CROSS assumes that configure was +called like 'CC=target-gcc; ./configure'. I want to write a package +that has target dependend libraries and host dependend tools. So I +dont't like to lose the distinction between CC and [G]CC_FOR_TARGET. +AC_C_CROSS should check for equality of target and host. + +It would be great if + +GCC_FOR_TARGET +AR_FOR_TARGET +RANLIB_FOR_TARGET + +would be set automatically if host != target. +AC_LANG_CROSS_C would be nice too, to check header files +etc. with GCC_FOR_TARGET instead of CC + +Here is one simple test + +if test "x$host" != "x$target"; then +AC_PROGRAMS_CHECK(AR_FOR_TARGET, $target-ar, $target-ar, ar) +AC_PROGRAMS_CHECK(RANLIB_FOR_TARGET, $target-ranlib, $target-ranlib, ranlib) +AC_PROGRAMS_CHECK(GCC_FOR_TARGET, $target-gcc, $target-gcc, gcc) +fi + +This could be improved to also look for gcc in PATH, but require the +prefix to contain the target e.g.: + +target=m68k-coff -->GCC_FOR_TARGET = /usr/gnu/m68k-coff/bin/gcc + +From: nennker@cs.tu-berlin.DE (Axel Nennker) + +------------------------------------------------------------------------------ + +The problem occurs with the following libc functions in SunOS 5.4: + + fnmatch glob globfree regcomp regexec regerror regfree wordexp wordfree + +It also occurs with a bunch more libposix4 functions that most people +probably aren't worried about yet, e.g. shm_open. + +All of these functions fail with errno set to 59. errno 59 is not +documented and is not in /usr/include/sys/errno.h, but perror claims +that it means ``Operation not applicable''. + +Perhaps autoconf should have a +specific macro for fnmatch, another for glob+globfree, another for +regcomp+regexec+regerror+regfree, and another for wordexp+wordfree. +This wouldn't solve the problem in general, but it should work for +Solaris 2.4. Or autoconf could limit itself to fnmatch and regcomp, +the only two functions that I know have been a problem so far. + +From Paul Eggert. + +------------------------------------------------------------------------------ + * Test suite: more things to test: ** That the shell scripts produce correct output on some simple data. ** Configuration header files. That autoheader does the right thing, diff --git a/acgeneral.m4 b/acgeneral.m4 index 663c4a249..0e816b5e7 100644 --- a/acgeneral.m4 +++ b/acgeneral.m4 @@ -51,7 +51,7 @@ dnl divert(-1)dnl Throw away output until AC_INIT is called. changequote([, ]) -define(AC_ACVERSION, 2.1.1) +define(AC_ACVERSION, 2.1.2) dnl Some old m4's don't support m4exit. But they provide dnl equivalent functionality by core dumping because of the @@ -926,7 +926,8 @@ define(AC_CACHE_VAL, [dnl We used to use the below line, but it fails if the 1st arg is a dnl shell variable, so we need the eval. dnl if test "${$1+set}" = set; then -if eval "test \"`echo '${'$1'+set}'`\" = set"; then +dnl the '' avoids an AIX 4.1 sh bug ("invalid expansion"). +if eval "test \"`echo '$''{'$1'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&AC_FD_MSG else $2 diff --git a/acspecific.m4 b/acspecific.m4 index 65c1444db..4d792d4a3 100644 --- a/acspecific.m4 +++ b/acspecific.m4 @@ -596,24 +596,26 @@ AC_DEFUN(AC_HEADER_STAT, AC_CACHE_VAL(ac_cv_header_stat_broken, [AC_EGREP_CPP([You lose], [#include #include -#ifdef S_ISBLK + +#if defined(S_ISBLK) && defined(S_IFDIR) # if S_ISBLK (S_IFDIR) You lose. # endif -# ifdef S_IFCHR -# if S_ISBLK (S_IFCHR) +#endif + +#if defined(S_ISBLK) && defined(S_IFCHR) +# if S_ISBLK (S_IFCHR) You lose. -# endif # endif #endif -#ifdef S_ISLNK +#if defined(S_ISLNK) && defined(S_IFREG) # if S_ISLNK (S_IFREG) You lose. # endif #endif -#ifdef S_ISSOCK +#if defined(S_ISSOCK) && defined(S_IFREG) # if S_ISSOCK (S_IFREG) You lose. # endif @@ -1160,19 +1162,23 @@ AC_SUBST(ALLOCA)dnl ]) AC_DEFUN(AC_FUNC_GETLOADAVG, -[ac_have_func=no +[ac_have_func=no # yes means we've found a way to get the load average. # Some systems with -lutil have (and need) -lkvm as well, some do not. -AC_CHECK_LIB(kvm, kvm_open, LIBS="-lkvm $LIBS") +# On Solaris, -lkvm requires nlist from -lelf, so check that first +# to get the right answer into the cache. +AC_CHECK_LIB(elf, elf_begin, LIBS="-lelf $LIBS") +AC_CHECK_LIB(kvm, kvm_open, LIBS="-lkvm $LIBS") # Check for the 4.4BSD definition of getloadavg. AC_CHECK_LIB(util, getloadavg, [LIBS="-lutil $LIBS" ac_have_func=yes ac_cv_func_getloadavg_setgid=yes]) if test $ac_have_func = no; then -# There is a commonly available library for RS/6000 AIX. -# Since it is not a standard part of AIX, it might be installed locally. -ac_save_LIBS="$LIBS" LIBS="-L/usr/local/lib $LIBS" -AC_CHECK_LIB(getloadavg, getloadavg, LIBS="-lgetloadavg $LIBS", LIBS="$ac_save_LIBS") + # There is a commonly available library for RS/6000 AIX. + # Since it is not a standard part of AIX, it might be installed locally. + ac_save_LIBS="$LIBS" LIBS="-L/usr/local/lib $LIBS" + AC_CHECK_LIB(getloadavg, getloadavg, + LIBS="-lgetloadavg $LIBS", LIBS="$ac_save_LIBS") fi # Make sure it is really in the library, if we think we found it. @@ -1180,44 +1186,48 @@ AC_REPLACE_FUNCS(getloadavg) if test $ac_cv_func_getloadavg = yes; then AC_DEFINE(HAVE_GETLOADAVG) + ac_have_func=yes else -ac_have_func=no -AC_CHECK_HEADER(sys/dg_sys_info.h, -[ac_have_func=yes; AC_DEFINE(DGUX) -AC_CHECK_LIB(dgc, dg_sys_info)]) -if test $ac_have_func = no; then -# We cannot check for , because Solaris 2 does not use dwarf (it -# uses stabs), but it is still SVR4. We cannot check for because -# Irix 4.0.5F has the header but not the library. -AC_CHECK_LIB(elf, elf_begin, - [LIBS="-lelf $LIBS" ac_have_func=yes; AC_DEFINE(SVR4)]) -fi -if test $ac_have_func = no; then -AC_CHECK_HEADER(inq_stats/cpustats.h, - [ac_have_func=yes; AC_DEFINE(UMAX) - AC_DEFINE(UMAX4_3)]) -fi -if test $ac_have_func = no; then -AC_CHECK_HEADER(sys/cpustats.h, - [ac_have_func=yes; AC_DEFINE(UMAX)]) -fi -if test $ac_have_func = no; then -AC_CHECK_HEADERS(mach/mach.h) -fi + # Figure out what our getloadavg.c needs. + ac_have_func=no + AC_CHECK_HEADER(sys/dg_sys_info.h, + [ac_have_func=yes; AC_DEFINE(DGUX) + AC_CHECK_LIB(dgc, dg_sys_info)]) + + # We cannot check for , because Solaris 2 does not use dwarf (it + # uses stabs), but it is still SVR4. We cannot check for because + # Irix 4.0.5F has the header but not the library. + if test $ac_have_func = no && test $ac_cv_lib_elf = yes; then + ac_have_func=yes; AC_DEFINE(SVR4) + fi -AC_CHECK_HEADER(nlist.h, -[AC_DEFINE(NLIST_STRUCT) -AC_MSG_CHECKING([for n_un in struct nlist]) -AC_CACHE_VAL(ac_cv_struct_nlist_n_un, -[AC_TRY_COMPILE([#include ], -[struct nlist n; n.n_un.n_name = 0;], -ac_cv_struct_nlist_n_un=yes, ac_cv_struct_nlist_n_un=no)])dnl -AC_MSG_RESULT($ac_cv_struct_nlist_n_un) -if test $ac_cv_struct_nlist_n_un = yes; then - AC_DEFINE(NLIST_NAME_UNION) -fi -])dnl + if test $ac_have_func = no; then + AC_CHECK_HEADER(inq_stats/cpustats.h, + [ac_have_func=yes; AC_DEFINE(UMAX) + AC_DEFINE(UMAX4_3)]) + fi + if test $ac_have_func = no; then + AC_CHECK_HEADER(sys/cpustats.h, + [ac_have_func=yes; AC_DEFINE(UMAX)]) + fi + + if test $ac_have_func = no; then + AC_CHECK_HEADERS(mach/mach.h) + fi + + AC_CHECK_HEADER(nlist.h, + [AC_DEFINE(NLIST_STRUCT) + AC_MSG_CHECKING([for n_un in struct nlist]) + AC_CACHE_VAL(ac_cv_struct_nlist_n_un, + [AC_TRY_COMPILE([#include ], + [struct nlist n; n.n_un.n_name = 0;], + ac_cv_struct_nlist_n_un=yes, ac_cv_struct_nlist_n_un=no)])dnl + AC_MSG_RESULT($ac_cv_struct_nlist_n_un) + if test $ac_cv_struct_nlist_n_un = yes; then + AC_DEFINE(NLIST_NAME_UNION) + fi + ])dnl fi # Do not have getloadavg in system libraries. # Some definitions of getloadavg require that the program be installed setgid. diff --git a/autoconf.texi b/autoconf.texi index cef13d1ee..b75a3d94b 100644 --- a/autoconf.texi +++ b/autoconf.texi @@ -6,8 +6,8 @@ @c @setchapternewpage odd @c %**end of header -@set EDITION 2.1.1 -@set VERSION 2.1.1 +@set EDITION 2.1.2 +@set VERSION 2.1.2 @set UPDATED February 1995 @iftex diff --git a/autoheader.in b/autoheader.in index 19517488b..3fbec2c07 100644 --- a/autoheader.in +++ b/autoheader.in @@ -217,10 +217,10 @@ if test -n "$libs"; then done fi -# The echo and cat are in case @BOTTOM@ is the first line of acconfig.h. +# Handle the case where @BOTTOM@ is the first line of acconfig.h. test -r $localdir/acconfig.h && grep @BOTTOM@ $localdir/acconfig.h >/dev/null && - (echo; cat $localdir/acconfig.h | sed '1,/@BOTTOM@/d') + sed -n '/@BOTTOM@/,${/@BOTTOM@/!p;}' $localdir/acconfig.h test -f ${config_h}.bot && cat ${config_h}.bot status=0 diff --git a/autoheader.sh b/autoheader.sh index 19517488b..3fbec2c07 100644 --- a/autoheader.sh +++ b/autoheader.sh @@ -217,10 +217,10 @@ if test -n "$libs"; then done fi -# The echo and cat are in case @BOTTOM@ is the first line of acconfig.h. +# Handle the case where @BOTTOM@ is the first line of acconfig.h. test -r $localdir/acconfig.h && grep @BOTTOM@ $localdir/acconfig.h >/dev/null && - (echo; cat $localdir/acconfig.h | sed '1,/@BOTTOM@/d') + sed -n '/@BOTTOM@/,${/@BOTTOM@/!p;}' $localdir/acconfig.h test -f ${config_h}.bot && cat ${config_h}.bot status=0 diff --git a/bin/autoheader.in b/bin/autoheader.in index 19517488b..3fbec2c07 100644 --- a/bin/autoheader.in +++ b/bin/autoheader.in @@ -217,10 +217,10 @@ if test -n "$libs"; then done fi -# The echo and cat are in case @BOTTOM@ is the first line of acconfig.h. +# Handle the case where @BOTTOM@ is the first line of acconfig.h. test -r $localdir/acconfig.h && grep @BOTTOM@ $localdir/acconfig.h >/dev/null && - (echo; cat $localdir/acconfig.h | sed '1,/@BOTTOM@/d') + sed -n '/@BOTTOM@/,${/@BOTTOM@/!p;}' $localdir/acconfig.h test -f ${config_h}.bot && cat ${config_h}.bot status=0 diff --git a/doc/autoconf.texi b/doc/autoconf.texi index cef13d1ee..b75a3d94b 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -6,8 +6,8 @@ @c @setchapternewpage odd @c %**end of header -@set EDITION 2.1.1 -@set VERSION 2.1.1 +@set EDITION 2.1.2 +@set VERSION 2.1.2 @set UPDATED February 1995 @iftex diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4 index 663c4a249..0e816b5e7 100644 --- a/lib/autoconf/general.m4 +++ b/lib/autoconf/general.m4 @@ -51,7 +51,7 @@ dnl divert(-1)dnl Throw away output until AC_INIT is called. changequote([, ]) -define(AC_ACVERSION, 2.1.1) +define(AC_ACVERSION, 2.1.2) dnl Some old m4's don't support m4exit. But they provide dnl equivalent functionality by core dumping because of the @@ -926,7 +926,8 @@ define(AC_CACHE_VAL, [dnl We used to use the below line, but it fails if the 1st arg is a dnl shell variable, so we need the eval. dnl if test "${$1+set}" = set; then -if eval "test \"`echo '${'$1'+set}'`\" = set"; then +dnl the '' avoids an AIX 4.1 sh bug ("invalid expansion"). +if eval "test \"`echo '$''{'$1'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&AC_FD_MSG else $2 diff --git a/lib/autoconf/specific.m4 b/lib/autoconf/specific.m4 index 65c1444db..4d792d4a3 100644 --- a/lib/autoconf/specific.m4 +++ b/lib/autoconf/specific.m4 @@ -596,24 +596,26 @@ AC_DEFUN(AC_HEADER_STAT, AC_CACHE_VAL(ac_cv_header_stat_broken, [AC_EGREP_CPP([You lose], [#include #include -#ifdef S_ISBLK + +#if defined(S_ISBLK) && defined(S_IFDIR) # if S_ISBLK (S_IFDIR) You lose. # endif -# ifdef S_IFCHR -# if S_ISBLK (S_IFCHR) +#endif + +#if defined(S_ISBLK) && defined(S_IFCHR) +# if S_ISBLK (S_IFCHR) You lose. -# endif # endif #endif -#ifdef S_ISLNK +#if defined(S_ISLNK) && defined(S_IFREG) # if S_ISLNK (S_IFREG) You lose. # endif #endif -#ifdef S_ISSOCK +#if defined(S_ISSOCK) && defined(S_IFREG) # if S_ISSOCK (S_IFREG) You lose. # endif @@ -1160,19 +1162,23 @@ AC_SUBST(ALLOCA)dnl ]) AC_DEFUN(AC_FUNC_GETLOADAVG, -[ac_have_func=no +[ac_have_func=no # yes means we've found a way to get the load average. # Some systems with -lutil have (and need) -lkvm as well, some do not. -AC_CHECK_LIB(kvm, kvm_open, LIBS="-lkvm $LIBS") +# On Solaris, -lkvm requires nlist from -lelf, so check that first +# to get the right answer into the cache. +AC_CHECK_LIB(elf, elf_begin, LIBS="-lelf $LIBS") +AC_CHECK_LIB(kvm, kvm_open, LIBS="-lkvm $LIBS") # Check for the 4.4BSD definition of getloadavg. AC_CHECK_LIB(util, getloadavg, [LIBS="-lutil $LIBS" ac_have_func=yes ac_cv_func_getloadavg_setgid=yes]) if test $ac_have_func = no; then -# There is a commonly available library for RS/6000 AIX. -# Since it is not a standard part of AIX, it might be installed locally. -ac_save_LIBS="$LIBS" LIBS="-L/usr/local/lib $LIBS" -AC_CHECK_LIB(getloadavg, getloadavg, LIBS="-lgetloadavg $LIBS", LIBS="$ac_save_LIBS") + # There is a commonly available library for RS/6000 AIX. + # Since it is not a standard part of AIX, it might be installed locally. + ac_save_LIBS="$LIBS" LIBS="-L/usr/local/lib $LIBS" + AC_CHECK_LIB(getloadavg, getloadavg, + LIBS="-lgetloadavg $LIBS", LIBS="$ac_save_LIBS") fi # Make sure it is really in the library, if we think we found it. @@ -1180,44 +1186,48 @@ AC_REPLACE_FUNCS(getloadavg) if test $ac_cv_func_getloadavg = yes; then AC_DEFINE(HAVE_GETLOADAVG) + ac_have_func=yes else -ac_have_func=no -AC_CHECK_HEADER(sys/dg_sys_info.h, -[ac_have_func=yes; AC_DEFINE(DGUX) -AC_CHECK_LIB(dgc, dg_sys_info)]) -if test $ac_have_func = no; then -# We cannot check for , because Solaris 2 does not use dwarf (it -# uses stabs), but it is still SVR4. We cannot check for because -# Irix 4.0.5F has the header but not the library. -AC_CHECK_LIB(elf, elf_begin, - [LIBS="-lelf $LIBS" ac_have_func=yes; AC_DEFINE(SVR4)]) -fi -if test $ac_have_func = no; then -AC_CHECK_HEADER(inq_stats/cpustats.h, - [ac_have_func=yes; AC_DEFINE(UMAX) - AC_DEFINE(UMAX4_3)]) -fi -if test $ac_have_func = no; then -AC_CHECK_HEADER(sys/cpustats.h, - [ac_have_func=yes; AC_DEFINE(UMAX)]) -fi -if test $ac_have_func = no; then -AC_CHECK_HEADERS(mach/mach.h) -fi + # Figure out what our getloadavg.c needs. + ac_have_func=no + AC_CHECK_HEADER(sys/dg_sys_info.h, + [ac_have_func=yes; AC_DEFINE(DGUX) + AC_CHECK_LIB(dgc, dg_sys_info)]) + + # We cannot check for , because Solaris 2 does not use dwarf (it + # uses stabs), but it is still SVR4. We cannot check for because + # Irix 4.0.5F has the header but not the library. + if test $ac_have_func = no && test $ac_cv_lib_elf = yes; then + ac_have_func=yes; AC_DEFINE(SVR4) + fi -AC_CHECK_HEADER(nlist.h, -[AC_DEFINE(NLIST_STRUCT) -AC_MSG_CHECKING([for n_un in struct nlist]) -AC_CACHE_VAL(ac_cv_struct_nlist_n_un, -[AC_TRY_COMPILE([#include ], -[struct nlist n; n.n_un.n_name = 0;], -ac_cv_struct_nlist_n_un=yes, ac_cv_struct_nlist_n_un=no)])dnl -AC_MSG_RESULT($ac_cv_struct_nlist_n_un) -if test $ac_cv_struct_nlist_n_un = yes; then - AC_DEFINE(NLIST_NAME_UNION) -fi -])dnl + if test $ac_have_func = no; then + AC_CHECK_HEADER(inq_stats/cpustats.h, + [ac_have_func=yes; AC_DEFINE(UMAX) + AC_DEFINE(UMAX4_3)]) + fi + if test $ac_have_func = no; then + AC_CHECK_HEADER(sys/cpustats.h, + [ac_have_func=yes; AC_DEFINE(UMAX)]) + fi + + if test $ac_have_func = no; then + AC_CHECK_HEADERS(mach/mach.h) + fi + + AC_CHECK_HEADER(nlist.h, + [AC_DEFINE(NLIST_STRUCT) + AC_MSG_CHECKING([for n_un in struct nlist]) + AC_CACHE_VAL(ac_cv_struct_nlist_n_un, + [AC_TRY_COMPILE([#include ], + [struct nlist n; n.n_un.n_name = 0;], + ac_cv_struct_nlist_n_un=yes, ac_cv_struct_nlist_n_un=no)])dnl + AC_MSG_RESULT($ac_cv_struct_nlist_n_un) + if test $ac_cv_struct_nlist_n_un = yes; then + AC_DEFINE(NLIST_NAME_UNION) + fi + ])dnl fi # Do not have getloadavg in system libraries. # Some definitions of getloadavg require that the program be installed setgid.