-*- 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
------------------------------------------------------------------------------
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
------------------------------------------------------------------------------
+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,
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
[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
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
])
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.
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.
@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
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
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
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
@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
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
[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
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
])
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.
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.