From: David MacKenzie Date: Tue, 23 Aug 1994 06:01:14 +0000 (+0000) Subject: clean up substitutions and bugs X-Git-Tag: fsf-origin~547 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a30c1ef188bda04b44d2bfa9388715e6d7fd9151;p=thirdparty%2Fautoconf.git clean up substitutions and bugs --- diff --git a/Makefile.in b/Makefile.in index 5f02d58ba..96ffc7055 100644 --- a/Makefile.in +++ b/Makefile.in @@ -52,8 +52,8 @@ SUBDIRS = testsuite # Files that can be generated, but should be up to date for a distribution. DISTDEP = info Makefile # Files to distribute. -DISTFILES = COPYING ChangeLog ChangeLog.1 INSTALL Makefile.in NEWS \ - README TODO \ +DISTFILES = COPYING ChangeLog ChangeLog.1 ChangeLog.0 INSTALL \ + Makefile.in NEWS README TODO \ acconfig.h acfunctions acgeneral.m4 acheaders acidentifiers \ acmakevars acoldnames.m4 acprograms acspecific.m4 autoconf.info* \ autoconf.sh autoconf.texi install.texi \ diff --git a/NEWS b/NEWS index fbe009b52..9f2734f8d 100644 --- a/NEWS +++ b/NEWS @@ -20,14 +20,8 @@ Major changes in release 2.0: support deciding unguessable features based on the host and target types. * AC_CONFIG_SUBDIRS to recursively configure a source tree. * AC_CHECK_TYPE, which checks whether sys/types.h defines a given type. -* AC_TRY_LINK, which obsoletes AC_COMPILE_CHECK. * AC_MSG_CHECKING and AC_MSG_RESULT to print test results, on a single line, whether or not the test succeeds. They obsolete AC_CHECKING and AC_VERBOSE. - configure --verbose no longer has any effect. -* AC_PREFIX_PROGRAM, which obsoletes AC_PREFIX. -* AC_HEADER_DIRENT, which obsoletes AC_DIR_HEADER. -* AC_CHECK_LIB, which obsoletes AC_HAVE_LIBRARY. -* AC_ARG_ENABLE and AC_ARG_WITH, which obsolete AC_ENABLE and AC_WITH. * AC_SUBST_FILE, to insert one file into another. ** Changed macros: @@ -44,8 +38,8 @@ Major changes in release 2.0: * AC_DEFINE no longer prints anything, because of the new result reporting mechanism (AC_MSG_CHECKING and AC_MSG_RESULT). * AC_VERBOSE pays attention to --quiet/--silent, not --verbose. -* AC_CHECK_FUNCS and AC_CHECK_HEADERS take an optional arg to execute - on a match. +* AC_CHECK_FUNCS and AC_CHECK_HEADERS take optional shell commands to + execute on success. ** New utilities: * autoscan to generate a preliminary configure.in for a package by @@ -59,7 +53,7 @@ Major changes in release 2.0: * ifnames to list the symbols used in #if and #ifdef directives in a source tree. -* Changed utilities: +** Changed utilities: * autoheader can take pieces of acconfig.h to replace config.h.{top,bot}. Major changes in release 1.11: diff --git a/acgeneral.m4 b/acgeneral.m4 index d0e1a3105..c7ae93a50 100644 --- a/acgeneral.m4 +++ b/acgeneral.m4 @@ -47,7 +47,6 @@ dnl dnl m4 diversions: define(AC_DIVERSION_NORMAL, 0)dnl normal output define(AC_DIVERSION_SED, 1)dnl sed substitutions for config.status -define(AC_DIVERSION_VAR, 2)dnl variable assignments for config.status define(AC_DIVERSION_HELP, 3)dnl --enable/--with help strings define(AC_DIVERSION_ARG, 4)dnl --enable/--with actions divert(AC_DIVERSION_NORMAL)dnl @@ -918,8 +917,6 @@ AC_DEFUN(AC_SUBST, [define([AC_SUBST_$1], )dnl divert(AC_DIVERSION_SED)dnl s%@$1@%[$]$1%g -divert(AC_DIVERSION_VAR)dnl -$1='[$]$1' divert(AC_DIVERSION_NORMAL)dnl ])])dnl dnl @@ -939,8 +936,6 @@ AC_DEFUN(AC_INSERT_FILE, divert(AC_DIVERSION_SED)dnl /@$1@/r [$]$1 s%@$1@%%g -divert(AC_DIVERSION_VAR)dnl -$1='$2' divert(AC_DIVERSION_NORMAL)dnl ])])dnl dnl @@ -971,7 +966,7 @@ AC_DEFUN(AC_MSG_WARN, dnl dnl AC_MSG_ERROR(ERROR-DESCRIPTION) AC_DEFUN(AC_MSG_ERROR, -[echo "configure: $1" 1>&2; exit 1])dnl +[{ echo "configure: $1" 1>&2; exit 1; }])dnl dnl dnl dnl ### Selecting which language to use for testing @@ -1315,10 +1310,11 @@ dnl AC_CHECK_FUNCS(FUNCTION... [, ACTION]) AC_DEFUN(AC_CHECK_FUNCS, [for ac_func in $1 do -changequote(, )dnl -ac_tr_func=HAVE_`echo $ac_func | tr '[a-z]' '[A-Z]'` +AC_CHECK_FUNC(${ac_func}, +[changequote(, )dnl + ac_tr_func=HAVE_`echo $ac_func | tr '[a-z]' '[A-Z]'` changequote([, ])dnl -AC_CHECK_FUNC(${ac_func}, AC_DEFINE(${ac_tr_func}) $2)dnl + AC_DEFINE(${ac_tr_func}) $2])dnl done ])dnl dnl @@ -1327,10 +1323,11 @@ AC_DEFUN(AC_CHECK_HEADERS, [AC_REQUIRE_CPP()dnl Make sure the cpp check happens outside the loop. for ac_hdr in $1 do -changequote(, )dnl -ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./' '[A-Z]__'` +AC_CHECK_HEADER(${ac_hdr}, +[changequote(, )dnl + ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./' '[A-Z]__'` changequote([, ])dnl -AC_CHECK_HEADER(${ac_hdr}, AC_DEFINE(${ac_tr_hdr}) $2)dnl + AC_DEFINE(${ac_tr_hdr}) $2])dnl done ])dnl dnl @@ -1408,8 +1405,6 @@ rm -f conftest.def # Substitute for predefined variables. changequote([, ])dnl AC_SUBST(LIBS)dnl -AC_SUBST(srcdir)dnl -AC_SUBST(top_srcdir)dnl AC_SUBST(prefix)dnl AC_SUBST(exec_prefix)dnl dnl Substituting for DEFS would confuse sed if it contains multiple lines. @@ -1418,12 +1413,7 @@ ifdef([AC_LIST_HEADERS], s%@DEFS@%-DHAVE_CONFIG_H%], [divert(AC_DIVERSION_SED)dnl s%@DEFS@%$DEFS% -divert(AC_DIVERSION_VAR)dnl -DEFS='$DEFS' ])dnl -divert(AC_DIVERSION_VAR)dnl -ac_vpsub='$ac_vpsub' -extrasub='$extrasub' divert(AC_DIVERSION_NORMAL)dnl # Without the "./", some shells look in PATH for config.status. @@ -1467,13 +1457,10 @@ done ifdef([AC_LIST_HEADERS], [trap 'rm -fr $1 AC_LIST_HEADERS conftest*; exit 1' 1 2 15], [trap 'rm -f $1; exit 1' 1 2 15]) -dnl Insert the variable assignments. -undivert(AC_DIVERSION_VAR)dnl -EOF -cat >> ${CONFIG_STATUS} <<\EOF ac_given_srcdir=$srcdir -ac_given_INSTALL=$INSTALL +EOF +cat >> ${CONFIG_STATUS} <<\EOF CONFIG_FILES=${CONFIG_FILES-"$1"} for ac_file in .. ${CONFIG_FILES}; do if test "x$ac_file" != x..; then @@ -1510,18 +1497,19 @@ changequote([, ])dnl top_srcdir="$ac_dots$ac_given_srcdir" ;; esac - case "$ac_given_INSTALL" in +ifdef([AC_PROVIDE_AC_PROG_INSTALL], +[ case "$ac_given_INSTALL" in changequote(, )dnl [/$]*) INSTALL="$ac_given_INSTALL" ;; changequote([, ])dnl *) INSTALL="$ac_dots$ac_given_INSTALL" ;; esac - +])dnl echo creating "$ac_file" rm -f "$ac_file" comment_str="Generated automatically from `echo $ac_file_in|sed 's|.*/||'` by configure." case "$ac_file" in - *.c | *.h | *.C | *.cc | *.m ) + *.c | *.h | *.C | *.cc | *.cpp | *.hpp | *.m ) ac_comsub="1i\\ /* $comment_str */" ;; * ) # Add the comment on the second line of scripts, first line of others. @@ -1541,11 +1529,19 @@ a\\ esac sed -e " $ac_comsub +EOF +cat >> ${CONFIG_STATUS} <> ${CONFIG_STATUS} <<\EOF " $ac_given_srcdir/$ac_file_in > $ac_file fi; done ifdef([AC_LIST_HEADERS], [AC_OUTPUT_HEADER(AC_LIST_HEADERS)])dnl diff --git a/acspecific.m4 b/acspecific.m4 index 447cee9e9..181ca4457 100644 --- a/acspecific.m4 +++ b/acspecific.m4 @@ -271,29 +271,21 @@ AC_SUBST(LEX_OUTPUT_ROOT)dnl dnl AC_DEFUN(AC_PROG_INSTALL, [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl -# Make sure to not get the incompatible SysV /etc/install and -# /usr/sbin/install, which might be in PATH before a BSD-like install, -# or the SunOS /usr/etc/install directory, or the AIX /bin/install, -# or the AFS install, which mishandles nonexistent args, or -# /usr/ucb/install on SVR4, which tries to use the nonexistent group -# "staff", or /sbin/install on IRIX which has incompatible command-line -# syntax. Sigh. -# -# On most BSDish systems install is in /usr/bin, not /usr/ucb -# anyway. -# This turns out not to be true, so the mere pathname is not an indication -# of whether the program works. What we really need is a set of tests for -# the install program to see if it actually works in all the required ways. -# -# Avoid using ./install, which might have been erroneously created -# by make from ./install.sh. +# Make sure to not get an incompatible install: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. AC_MSG_CHECKING(for a BSD compatible install) if test -z "${INSTALL}"; then AC_CACHE_VAL(ac_cv_path_install, [ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do case "$ac_dir" in - ''|.|/etc|/sbin|/usr/sbin|/usr/etc|/usr/afsws/bin|/usr/ucb) ;; + ''|.|/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 @@ -317,8 +309,9 @@ AC_CACHE_VAL(ac_cv_path_install, test -z "$ac_cv_path_install" && ac_cv_path_install="$ac_install_sh"])dnl INSTALL="$ac_cv_path_install" fi +dnl We do this instead of AC_SUBST, to get relative paths right. +ac_given_INSTALL=$INSTALL AC_MSG_RESULT($INSTALL) -AC_SUBST(INSTALL)dnl # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. diff --git a/bin/ifnames.in b/bin/ifnames.in index da6619738..41ac7ec1b 100644 --- a/bin/ifnames.in +++ b/bin/ifnames.in @@ -90,4 +90,4 @@ s,/\*[^/]*,,g ' $arg | sort -u | sed 's,$, '$arg',' done | awk ' { files[$1] = files[$1] " " $2 } -END { for (n in files) print n files[n] }' | sort +END { for (sym in files) print sym files[sym] }' | sort diff --git a/configure.in b/configure.in index a0c792048..d5bb7051c 100644 --- a/configure.in +++ b/configure.in @@ -5,23 +5,23 @@ dnl We use a path for GNU m4 so even if users have another m4 first in dnl their path, the installer can configure with a path that has GNU m4 dnl first and get that path embedded in the installed autoconf and dnl autoheader scripts. -AC_PROGRAMS_PATH(M4, gnum4 gm4 m4, m4) +AC_PATH_PROGS(M4, gnum4 gm4 m4, m4) dnl We use a path for perl so the #! line in autoscan will work. -AC_PROGRAM_PATH(PERL, perl, no-perl) +AC_PATH_PROG(PERL, perl, no-perl) AC_SUBST(PERL)dnl AC_SUBST(PROGS)dnl if test "$PERL" != no-perl; then PROGS=autoscan else - AC_WARN(autoscan will not be built since perl is not found) + AC_MSG_WARN(autoscan will not be built since perl is not found) fi -AC_PROGRAM_CHECK(BASH, bash, no-bash) +AC_CHECK_PROG(BASH, bash, no-bash) if test "$BASH" != no-bash; then PROGS="$PROGS shindent" else - AC_WARN(shindent will not be built since bash is not found) + AC_MSG_WARN(shindent will not be built since bash is not found) fi AC_PROG_INSTALL diff --git a/doc/Makefile.in b/doc/Makefile.in index 5f02d58ba..96ffc7055 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -52,8 +52,8 @@ SUBDIRS = testsuite # Files that can be generated, but should be up to date for a distribution. DISTDEP = info Makefile # Files to distribute. -DISTFILES = COPYING ChangeLog ChangeLog.1 INSTALL Makefile.in NEWS \ - README TODO \ +DISTFILES = COPYING ChangeLog ChangeLog.1 ChangeLog.0 INSTALL \ + Makefile.in NEWS README TODO \ acconfig.h acfunctions acgeneral.m4 acheaders acidentifiers \ acmakevars acoldnames.m4 acprograms acspecific.m4 autoconf.info* \ autoconf.sh autoconf.texi install.texi \ diff --git a/ifnames.in b/ifnames.in index da6619738..41ac7ec1b 100644 --- a/ifnames.in +++ b/ifnames.in @@ -90,4 +90,4 @@ s,/\*[^/]*,,g ' $arg | sort -u | sed 's,$, '$arg',' done | awk ' { files[$1] = files[$1] " " $2 } -END { for (n in files) print n files[n] }' | sort +END { for (sym in files) print sym files[sym] }' | sort diff --git a/ifnames.sh b/ifnames.sh index da6619738..41ac7ec1b 100644 --- a/ifnames.sh +++ b/ifnames.sh @@ -90,4 +90,4 @@ s,/\*[^/]*,,g ' $arg | sort -u | sed 's,$, '$arg',' done | awk ' { files[$1] = files[$1] " " $2 } -END { for (n in files) print n files[n] }' | sort +END { for (sym in files) print sym files[sym] }' | sort diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4 index d0e1a3105..c7ae93a50 100644 --- a/lib/autoconf/general.m4 +++ b/lib/autoconf/general.m4 @@ -47,7 +47,6 @@ dnl dnl m4 diversions: define(AC_DIVERSION_NORMAL, 0)dnl normal output define(AC_DIVERSION_SED, 1)dnl sed substitutions for config.status -define(AC_DIVERSION_VAR, 2)dnl variable assignments for config.status define(AC_DIVERSION_HELP, 3)dnl --enable/--with help strings define(AC_DIVERSION_ARG, 4)dnl --enable/--with actions divert(AC_DIVERSION_NORMAL)dnl @@ -918,8 +917,6 @@ AC_DEFUN(AC_SUBST, [define([AC_SUBST_$1], )dnl divert(AC_DIVERSION_SED)dnl s%@$1@%[$]$1%g -divert(AC_DIVERSION_VAR)dnl -$1='[$]$1' divert(AC_DIVERSION_NORMAL)dnl ])])dnl dnl @@ -939,8 +936,6 @@ AC_DEFUN(AC_INSERT_FILE, divert(AC_DIVERSION_SED)dnl /@$1@/r [$]$1 s%@$1@%%g -divert(AC_DIVERSION_VAR)dnl -$1='$2' divert(AC_DIVERSION_NORMAL)dnl ])])dnl dnl @@ -971,7 +966,7 @@ AC_DEFUN(AC_MSG_WARN, dnl dnl AC_MSG_ERROR(ERROR-DESCRIPTION) AC_DEFUN(AC_MSG_ERROR, -[echo "configure: $1" 1>&2; exit 1])dnl +[{ echo "configure: $1" 1>&2; exit 1; }])dnl dnl dnl dnl ### Selecting which language to use for testing @@ -1315,10 +1310,11 @@ dnl AC_CHECK_FUNCS(FUNCTION... [, ACTION]) AC_DEFUN(AC_CHECK_FUNCS, [for ac_func in $1 do -changequote(, )dnl -ac_tr_func=HAVE_`echo $ac_func | tr '[a-z]' '[A-Z]'` +AC_CHECK_FUNC(${ac_func}, +[changequote(, )dnl + ac_tr_func=HAVE_`echo $ac_func | tr '[a-z]' '[A-Z]'` changequote([, ])dnl -AC_CHECK_FUNC(${ac_func}, AC_DEFINE(${ac_tr_func}) $2)dnl + AC_DEFINE(${ac_tr_func}) $2])dnl done ])dnl dnl @@ -1327,10 +1323,11 @@ AC_DEFUN(AC_CHECK_HEADERS, [AC_REQUIRE_CPP()dnl Make sure the cpp check happens outside the loop. for ac_hdr in $1 do -changequote(, )dnl -ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./' '[A-Z]__'` +AC_CHECK_HEADER(${ac_hdr}, +[changequote(, )dnl + ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./' '[A-Z]__'` changequote([, ])dnl -AC_CHECK_HEADER(${ac_hdr}, AC_DEFINE(${ac_tr_hdr}) $2)dnl + AC_DEFINE(${ac_tr_hdr}) $2])dnl done ])dnl dnl @@ -1408,8 +1405,6 @@ rm -f conftest.def # Substitute for predefined variables. changequote([, ])dnl AC_SUBST(LIBS)dnl -AC_SUBST(srcdir)dnl -AC_SUBST(top_srcdir)dnl AC_SUBST(prefix)dnl AC_SUBST(exec_prefix)dnl dnl Substituting for DEFS would confuse sed if it contains multiple lines. @@ -1418,12 +1413,7 @@ ifdef([AC_LIST_HEADERS], s%@DEFS@%-DHAVE_CONFIG_H%], [divert(AC_DIVERSION_SED)dnl s%@DEFS@%$DEFS% -divert(AC_DIVERSION_VAR)dnl -DEFS='$DEFS' ])dnl -divert(AC_DIVERSION_VAR)dnl -ac_vpsub='$ac_vpsub' -extrasub='$extrasub' divert(AC_DIVERSION_NORMAL)dnl # Without the "./", some shells look in PATH for config.status. @@ -1467,13 +1457,10 @@ done ifdef([AC_LIST_HEADERS], [trap 'rm -fr $1 AC_LIST_HEADERS conftest*; exit 1' 1 2 15], [trap 'rm -f $1; exit 1' 1 2 15]) -dnl Insert the variable assignments. -undivert(AC_DIVERSION_VAR)dnl -EOF -cat >> ${CONFIG_STATUS} <<\EOF ac_given_srcdir=$srcdir -ac_given_INSTALL=$INSTALL +EOF +cat >> ${CONFIG_STATUS} <<\EOF CONFIG_FILES=${CONFIG_FILES-"$1"} for ac_file in .. ${CONFIG_FILES}; do if test "x$ac_file" != x..; then @@ -1510,18 +1497,19 @@ changequote([, ])dnl top_srcdir="$ac_dots$ac_given_srcdir" ;; esac - case "$ac_given_INSTALL" in +ifdef([AC_PROVIDE_AC_PROG_INSTALL], +[ case "$ac_given_INSTALL" in changequote(, )dnl [/$]*) INSTALL="$ac_given_INSTALL" ;; changequote([, ])dnl *) INSTALL="$ac_dots$ac_given_INSTALL" ;; esac - +])dnl echo creating "$ac_file" rm -f "$ac_file" comment_str="Generated automatically from `echo $ac_file_in|sed 's|.*/||'` by configure." case "$ac_file" in - *.c | *.h | *.C | *.cc | *.m ) + *.c | *.h | *.C | *.cc | *.cpp | *.hpp | *.m ) ac_comsub="1i\\ /* $comment_str */" ;; * ) # Add the comment on the second line of scripts, first line of others. @@ -1541,11 +1529,19 @@ a\\ esac sed -e " $ac_comsub +EOF +cat >> ${CONFIG_STATUS} <> ${CONFIG_STATUS} <<\EOF " $ac_given_srcdir/$ac_file_in > $ac_file fi; done ifdef([AC_LIST_HEADERS], [AC_OUTPUT_HEADER(AC_LIST_HEADERS)])dnl diff --git a/lib/autoconf/specific.m4 b/lib/autoconf/specific.m4 index 447cee9e9..181ca4457 100644 --- a/lib/autoconf/specific.m4 +++ b/lib/autoconf/specific.m4 @@ -271,29 +271,21 @@ AC_SUBST(LEX_OUTPUT_ROOT)dnl dnl AC_DEFUN(AC_PROG_INSTALL, [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl -# Make sure to not get the incompatible SysV /etc/install and -# /usr/sbin/install, which might be in PATH before a BSD-like install, -# or the SunOS /usr/etc/install directory, or the AIX /bin/install, -# or the AFS install, which mishandles nonexistent args, or -# /usr/ucb/install on SVR4, which tries to use the nonexistent group -# "staff", or /sbin/install on IRIX which has incompatible command-line -# syntax. Sigh. -# -# On most BSDish systems install is in /usr/bin, not /usr/ucb -# anyway. -# This turns out not to be true, so the mere pathname is not an indication -# of whether the program works. What we really need is a set of tests for -# the install program to see if it actually works in all the required ways. -# -# Avoid using ./install, which might have been erroneously created -# by make from ./install.sh. +# Make sure to not get an incompatible install: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. AC_MSG_CHECKING(for a BSD compatible install) if test -z "${INSTALL}"; then AC_CACHE_VAL(ac_cv_path_install, [ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do case "$ac_dir" in - ''|.|/etc|/sbin|/usr/sbin|/usr/etc|/usr/afsws/bin|/usr/ucb) ;; + ''|.|/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 @@ -317,8 +309,9 @@ AC_CACHE_VAL(ac_cv_path_install, test -z "$ac_cv_path_install" && ac_cv_path_install="$ac_install_sh"])dnl INSTALL="$ac_cv_path_install" fi +dnl We do this instead of AC_SUBST, to get relative paths right. +ac_given_INSTALL=$INSTALL AC_MSG_RESULT($INSTALL) -AC_SUBST(INSTALL)dnl # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution.