]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
more little bug fixes
authorDavid MacKenzie <djm@djmnet.org>
Tue, 21 Feb 1995 20:39:40 +0000 (20:39 +0000)
committerDavid MacKenzie <djm@djmnet.org>
Tue, 21 Feb 1995 20:39:40 +0000 (20:39 +0000)
TODO
acgeneral.m4
acspecific.m4
autoconf.texi
autoheader.in
autoheader.sh
bin/autoheader.in
doc/autoconf.texi
lib/autoconf/general.m4
lib/autoconf/specific.m4

diff --git a/TODO b/TODO
index 7660d4c9b7f0ae6d46c38d9a07e30fde768f2847..900c43f4d8a084d4c01a5cf1b32b99797e3024cc 100644 (file)
--- 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,
index 663c4a249c4481e711b3c05289fbd6b7e854b516..0e816b5e77ac6dbd7503db362107e90f350ff1db 100644 (file)
@@ -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
index 65c1444db49a8394bf5c02490999aad10b2037b2..4d792d4a3758f821feb6b1b3c59f6b4880f24463 100644 (file)
@@ -596,24 +596,26 @@ AC_DEFUN(AC_HEADER_STAT,
 AC_CACHE_VAL(ac_cv_header_stat_broken,
 [AC_EGREP_CPP([You lose], [#include <sys/types.h>
 #include <sys/stat.h>
-#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 <dwarf.h>, because Solaris 2 does not use dwarf (it
-# uses stabs), but it is still SVR4.  We cannot check for <elf.h> 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 <dwarf.h>, because Solaris 2 does not use dwarf (it
+  # uses stabs), but it is still SVR4.  We cannot check for <elf.h> 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 <nlist.h>],
-[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 <nlist.h>],
+  [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.
index cef13d1ee21c2162936edfb8576e562f9bf85974..b75a3d94b3297cdc6f0bb932bd602fdeb1156160 100644 (file)
@@ -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
index 19517488b11dd27279e560d106f449ba912bebc3..3fbec2c07f7f3e54e76a6736cc38721a50f0f569 100644 (file)
@@ -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
index 19517488b11dd27279e560d106f449ba912bebc3..3fbec2c07f7f3e54e76a6736cc38721a50f0f569 100644 (file)
@@ -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
index 19517488b11dd27279e560d106f449ba912bebc3..3fbec2c07f7f3e54e76a6736cc38721a50f0f569 100644 (file)
@@ -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
index cef13d1ee21c2162936edfb8576e562f9bf85974..b75a3d94b3297cdc6f0bb932bd602fdeb1156160 100644 (file)
@@ -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
index 663c4a249c4481e711b3c05289fbd6b7e854b516..0e816b5e77ac6dbd7503db362107e90f350ff1db 100644 (file)
@@ -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
index 65c1444db49a8394bf5c02490999aad10b2037b2..4d792d4a3758f821feb6b1b3c59f6b4880f24463 100644 (file)
@@ -596,24 +596,26 @@ AC_DEFUN(AC_HEADER_STAT,
 AC_CACHE_VAL(ac_cv_header_stat_broken,
 [AC_EGREP_CPP([You lose], [#include <sys/types.h>
 #include <sys/stat.h>
-#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 <dwarf.h>, because Solaris 2 does not use dwarf (it
-# uses stabs), but it is still SVR4.  We cannot check for <elf.h> 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 <dwarf.h>, because Solaris 2 does not use dwarf (it
+  # uses stabs), but it is still SVR4.  We cannot check for <elf.h> 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 <nlist.h>],
-[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 <nlist.h>],
+  [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.