+Thu Jun 22 22:33:23 1995 David J. MacKenzie <djm@catapult.va.pubnix.com>
+
+ * acspecific.m4 (AC_PROG_INSTALL): Don't cache a shell script path.
+
+ * acgeneral.m4 (AC_CHECK_LIB): Allow lib name to contain a . or /,
+ by fixing the cache variable name.
+
Wed Jun 14 23:07:20 1995 David J. MacKenzie <djm@geech.gnu.ai.mit.edu>
* Version 2.4.
ls -lt configure configure.in | sort
doesn't work right if configure.in is from a symlink farm, where the
-symlink has either a timestamp of it's own, or under BSD 4.4, it has
+symlink has either a timestamp of its own, or under BSD 4.4, it has
the timestamp of the current directory, neither of which
helps. Changing it to
ls -Llt 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.
+that has target dependent libraries and host dependent tools. So I
+don'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
------------------------------------------------------------------------------
-We probably shouldn't cache a path for INSTALL within a source
-directory, because that will break other packages using the cache if
-that directory is removed.
-
-------------------------------------------------------------------------------
-
-Document this trick:
-
->> Half my time these days seems to be spent porting
->> configure.in files to new OS releases.) Alas, there doesn't seem to
->> be any way to turn off caching (with a configure.in directive).
-
-define([AC_CACHE_LOAD], )dnl
-define([AC_CACHE_SAVE], )dnl
-AC_INIT(whatever)
- ... rest of configure.in ...
-
-------------------------------------------------------------------------------
-
Testing for ANSI header files (AC_HEADER_STDC) fails under linux when
using the latest libraries (libc-4.6.30, at least libc-4.6.27 works
ok) when LC_CTYPE is set to ISO-8859-1. The islower/toupper test
------------------------------------------------------------------------------
-A number of people have tried to fix configuration problems by editing
-acconfig.h. (Despite comments at the top of the file.) I think they're
-confused because anything.h looks like a regular source file name.
-Maybe acconfig.h could be called acconfig.extra or something?
-From: kb@cs.umb.edu (K. Berry)
+* 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,
+ and so does AC_CONFIG_HEADER when autoconf is run.
------------------------------------------------------------------------------
-Using the macro AC_CHECK_LIB, if the library name contains a dot (which is
-the case of the library complib.sgimath on Irix 5.x) a syntax error occurs
-because the corresponding cache variable name contains a dot.
-Should dots be converted to underlines in variable names by autoconf?
-From: Frederic.DEvernay@sophia.inria.fr (Frederic Devernay)
+On Sun, 18 Jun 1995 12:59:01 -0400, Richard Stallman <rms@gnu.ai.mit.edu> said:
-------------------------------------------------------------------------------
+> When a configure script includes nonstandard tests,
+> is there an easy way to arrange to cache the result?
-* 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,
- and so does AC_CONFIG_HEADER when autoconf is run.
+Yes, such a shorthand macro is possible. Here's a definition for it.
+
+dnl AC_CHECK_CACHE(cache-var, message, check)
+AC_DEFUN([AC_CHECK_CACHE],
+[AC_MSG_CHECKING($2)
+AC_CACHE_VAL($1, $3)
+AC_MSG_RESULT([$]$1)])
------------------------------------------------------------------------------
dnl [, OTHER-LIBRARIES]]])
AC_DEFUN(AC_CHECK_LIB,
[AC_MSG_CHECKING([for -l$1])
-AC_CACHE_VAL(ac_cv_lib_$1,
+changequote(, )dnl
+ac_lib_var=`echo $1 | tr '[./]' '[__]'`
+changequote([, ])dnl
+AC_CACHE_VAL(ac_cv_lib_$ac_lib_var,
[ac_save_LIBS="$LIBS"
LIBS="-l$1 $5 $LIBS"
-AC_TRY_LINK(, [$2()], eval "ac_cv_lib_$1=yes", eval "ac_cv_lib_$1=no")dnl
+AC_TRY_LINK(, [$2()], eval "ac_cv_lib_$ac_lib_var=yes",
+ eval "ac_cv_lib_$ac_lib_var=no")dnl
LIBS="$ac_save_LIBS"
])dnl
-if eval "test \"`echo '$ac_cv_lib_'$1`\" = yes"; then
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
AC_MSG_RESULT(yes)
ifelse([$3], ,
[changequote(, )dnl
/|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
*)
# OSF1 and SCO ODT 3.0 have their own names for install.
- for ac_prog in ginstall installbsd scoinst install; do
+ for ac_prog in ginstall installbsd scoinst Install; do
if test -f $ac_dir/$ac_prog; then
if test $ac_prog = install &&
grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
esac
done
IFS="$ac_save_ifs"
- # As a last resort, use the slow shell script.
-dnl FIXME We probably shouldn't cache a path within a source directory,
-dnl because that will break other packages using the cache if
-dnl that directory is removed.
- test -z "$ac_cv_path_install" && ac_cv_path_install="$ac_install_sh"])dnl
- INSTALL="$ac_cv_path_install"
+])dnl
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL="$ac_cv_path_install"
+ else
+ # As a last resort, use the slow shell script. We don't cache a
+ # path for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the path is relative.
+ INSTALL="$ac_install_sh"
+ fi
fi
dnl We do special magic for INSTALL instead of AC_SUBST, to get
dnl relative paths right.
@set EDITION 2.3
@set VERSION 2.3
-@set UPDATED March 1995
+@set UPDATED June 1995
@iftex
@finalout
@example
ac_save_path="$PATH"
-PATH=/usr/libexec:/usr/sbin:/usr/etc:/etc
+PATH=/usr/libexec:/usr/sbin:/usr/etc:/etc:/usr/bin:/bin
AC_PATH_PROG(INETD, inetd, /usr/libexec/inetd)
PATH="$ac_save_path"
@end example
+@noindent
+Keep @file{/usr/bin:/bin} in the @code{PATH} so if if the @code{echo} or
+@code{test} command is in one of those directories, @code{configure} can
+still find it.
+
@defmac AC_CHECK_PROG (@var{variable}, @var{prog-to-check-for}, @var{value-if-found} @r{[}, @var{value-if-not-found}@r{]})
@maindex CHECK_PROG
Check whether program @var{prog-to-check-for} exists in @code{PATH}. If
creating it if it does not exist already. @code{configure} accepts the
@samp{--cache-file=@var{file}} option to use a different cache file;
that is what @code{configure} does when it calls @code{configure}
-scripts in subdirectories, so they share the cache. Giving
-@samp{--cache-file=/dev/null} disables caching, for debugging
-@code{configure}. @xref{Subdirectories}, for information on configuring
-subdirectories with the @code{AC_CONFIG_SUBDIRS} macro.
-@file{config.status} only pays attention to the cache file if it is
-given the @samp{--recheck} option, which makes it rerun
-@code{configure}.
+scripts in subdirectories, so they share the cache.
+@xref{Subdirectories}, for information on configuring subdirectories
+with the @code{AC_CONFIG_SUBDIRS} macro.
+
+Giving @samp{--cache-file=/dev/null} disables caching, for debugging
+@code{configure}. @file{config.status} only pays attention to the cache
+file if it is given the @samp{--recheck} option, which makes it rerun
+@code{configure}. If you are anticipating a long debugging period, you
+can also disable cache loading and saving for a @code{configure} script
+by redefining the cache macros at the start of @file{configure.in}:
+
+@example
+define([AC_CACHE_LOAD], )dnl
+define([AC_CACHE_SAVE], )dnl
+AC_INIT(@r{whatever})
+@r{ ... rest of configure.in ...}
+@end example
It is wrong to try to distribute cache files for particular system types.
There is too much room for error in doing that, and too much
@set EDITION 2.3
@set VERSION 2.3
-@set UPDATED March 1995
+@set UPDATED June 1995
@iftex
@finalout
@example
ac_save_path="$PATH"
-PATH=/usr/libexec:/usr/sbin:/usr/etc:/etc
+PATH=/usr/libexec:/usr/sbin:/usr/etc:/etc:/usr/bin:/bin
AC_PATH_PROG(INETD, inetd, /usr/libexec/inetd)
PATH="$ac_save_path"
@end example
+@noindent
+Keep @file{/usr/bin:/bin} in the @code{PATH} so if if the @code{echo} or
+@code{test} command is in one of those directories, @code{configure} can
+still find it.
+
@defmac AC_CHECK_PROG (@var{variable}, @var{prog-to-check-for}, @var{value-if-found} @r{[}, @var{value-if-not-found}@r{]})
@maindex CHECK_PROG
Check whether program @var{prog-to-check-for} exists in @code{PATH}. If
creating it if it does not exist already. @code{configure} accepts the
@samp{--cache-file=@var{file}} option to use a different cache file;
that is what @code{configure} does when it calls @code{configure}
-scripts in subdirectories, so they share the cache. Giving
-@samp{--cache-file=/dev/null} disables caching, for debugging
-@code{configure}. @xref{Subdirectories}, for information on configuring
-subdirectories with the @code{AC_CONFIG_SUBDIRS} macro.
-@file{config.status} only pays attention to the cache file if it is
-given the @samp{--recheck} option, which makes it rerun
-@code{configure}.
+scripts in subdirectories, so they share the cache.
+@xref{Subdirectories}, for information on configuring subdirectories
+with the @code{AC_CONFIG_SUBDIRS} macro.
+
+Giving @samp{--cache-file=/dev/null} disables caching, for debugging
+@code{configure}. @file{config.status} only pays attention to the cache
+file if it is given the @samp{--recheck} option, which makes it rerun
+@code{configure}. If you are anticipating a long debugging period, you
+can also disable cache loading and saving for a @code{configure} script
+by redefining the cache macros at the start of @file{configure.in}:
+
+@example
+define([AC_CACHE_LOAD], )dnl
+define([AC_CACHE_SAVE], )dnl
+AC_INIT(@r{whatever})
+@r{ ... rest of configure.in ...}
+@end example
It is wrong to try to distribute cache files for particular system types.
There is too much room for error in doing that, and too much
dnl [, OTHER-LIBRARIES]]])
AC_DEFUN(AC_CHECK_LIB,
[AC_MSG_CHECKING([for -l$1])
-AC_CACHE_VAL(ac_cv_lib_$1,
+changequote(, )dnl
+ac_lib_var=`echo $1 | tr '[./]' '[__]'`
+changequote([, ])dnl
+AC_CACHE_VAL(ac_cv_lib_$ac_lib_var,
[ac_save_LIBS="$LIBS"
LIBS="-l$1 $5 $LIBS"
-AC_TRY_LINK(, [$2()], eval "ac_cv_lib_$1=yes", eval "ac_cv_lib_$1=no")dnl
+AC_TRY_LINK(, [$2()], eval "ac_cv_lib_$ac_lib_var=yes",
+ eval "ac_cv_lib_$ac_lib_var=no")dnl
LIBS="$ac_save_LIBS"
])dnl
-if eval "test \"`echo '$ac_cv_lib_'$1`\" = yes"; then
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
AC_MSG_RESULT(yes)
ifelse([$3], ,
[changequote(, )dnl
/|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
*)
# OSF1 and SCO ODT 3.0 have their own names for install.
- for ac_prog in ginstall installbsd scoinst install; do
+ for ac_prog in ginstall installbsd scoinst Install; do
if test -f $ac_dir/$ac_prog; then
if test $ac_prog = install &&
grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
esac
done
IFS="$ac_save_ifs"
- # As a last resort, use the slow shell script.
-dnl FIXME We probably shouldn't cache a path within a source directory,
-dnl because that will break other packages using the cache if
-dnl that directory is removed.
- test -z "$ac_cv_path_install" && ac_cv_path_install="$ac_install_sh"])dnl
- INSTALL="$ac_cv_path_install"
+])dnl
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL="$ac_cv_path_install"
+ else
+ # As a last resort, use the slow shell script. We don't cache a
+ # path for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the path is relative.
+ INSTALL="$ac_install_sh"
+ fi
fi
dnl We do special magic for INSTALL instead of AC_SUBST, to get
dnl relative paths right.