From: Akim Demaille Date: Wed, 25 Oct 2000 15:04:29 +0000 (+0000) Subject: * acgeneral.m4 (AC_SHELL_DIRNAME): Split its code into... X-Git-Tag: autoconf-2.50~522 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=35853557ac10564edbefb06695449c698cc352f9;p=thirdparty%2Fautoconf.git * acgeneral.m4 (AC_SHELL_DIRNAME): Split its code into... (AC_SHELL_DIRNAME_EXPR, AC_SHELL_DIRNAME_SED): these new macros. * tests/base.m4 (AC_SHELL_DIRNAME & AC_SHELL_DIRNAME_SED): New test. --- diff --git a/ChangeLog b/ChangeLog index a552cbafa..21304f574 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2000-10-25 Akim Demaille + + * acgeneral.m4 (AC_SHELL_DIRNAME): Split its code into... + (AC_SHELL_DIRNAME_EXPR, AC_SHELL_DIRNAME_SED): these new macros. + * tests/base.m4 (AC_SHELL_DIRNAME & AC_SHELL_DIRNAME_SED): New + test. + 2000-10-25 Pavel Roskin * tests/aclocal.m4 (AC_ENV_SAVE): Rename to ... diff --git a/Makefile.in b/Makefile.in index 80a7a7987..94f0e005b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -88,7 +88,7 @@ nodistpkgdataDATA = autoconf.m4f pkgdata_DATA = $(distpkgdataDATA) $(nodistpkgdataDATA) OLDCHANGELOGS = ChangeLog.0 ChangeLog.1 -EXTRA_DIST = $(OLDCHANGELOGS) autoconf.sh autoheader.sh autoreconf.sh autoupdate.sh ifnames.sh autoscan.pl INSTALL.txt $(distpkgdataDATA) +EXTRA_DIST = $(OLDCHANGELOGS) acversion.m4.in autoconf.sh autoheader.sh autoreconf.sh autoupdate.sh ifnames.sh autoscan.pl INSTALL.txt $(distpkgdataDATA) # Files that should be removed, but which Automake does not know: diff --git a/acgeneral.m4 b/acgeneral.m4 index 684e54700..59a953c93 100644 --- a/acgeneral.m4 +++ b/acgeneral.m4 @@ -920,19 +920,25 @@ done; } # a silly length limit that causes expr to fail if the matched # substring is longer than 120 bytes. So fall back on echo|sed if # expr fails. -define([AC_SHELL_DIRNAME], +define([AC_SHELL_DIRNAME_EXPR], [expr X[]$1 : 'X\(.*[[^/]]\)//*[[^/][^/]]*/*$' \| \ X[]$1 : 'X\(//\)[[^/]]' \| \ X[]$1 : 'X\(//\)$' \| \ X[]$1 : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo "X[]$1" | + . : '\(.\)']) + +define([AC_SHELL_DIRNAME_SED], +[echo "X[]$1" | sed ['/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q']]) +define([AC_SHELL_DIRNAME], +[AC_SHELL_DIRNAME_EXPR([$1]) 2>/dev/null || +AC_SHELL_DIRNAME_SED([$1])]) + ## --------------------------------------------------- ## ## Common m4/sh handling of variables (indirections). ## diff --git a/configure b/configure index a14613b5c..f805eb1f9 100755 --- a/configure +++ b/configure @@ -50,13 +50,26 @@ cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} + # Maximum number of lines to put in a shell here document. # This variable seems obsolete. It should probably be removed, and # only ac_max_sed_lines should be used. : ${ac_max_here_lines=38} + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# Avoid depending upon Character Ranges. +ac_cr_az='abcdefghijklmnopqrstuvwxyz' +ac_cr_AZ='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +ac_cr_09='0123456789' +ac_cr_alnum=$ac_cr_az$ac_cr_AZ$ac_cr_09 + # Sed expression to map a string onto a valid sh and CPP variable names. -ac_tr_sh='sed y%*+%pp%;s%[^a-zA-Z0-9_]%_%g' -ac_tr_cpp='sed y%*abcdefghijklmnopqrstuvwxyz%PABCDEFGHIJKLMNOPQRSTUVWXYZ%;s%[^A-Z0-9_]%_%g' +ac_tr_sh="sed y%*+%pp%;s%[^_$ac_cr_alnum]%_%g" +ac_tr_cpp="sed y%*$ac_cr_az%P$ac_cr_AZ%;s%[^_$ac_cr_alnum]%_%g" # By default always use an empty string as the executable extension. # Only change it if the script calls AC_EXEEXT. @@ -171,16 +184,20 @@ do -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-a-zA-Z0-9_]" >/dev/null && - { echo "configure: error: invalid feature name: $ac_feature" >&2; exit 1; } + expr "x$ac_feature" : ".*[^-_$ac_cr_alnum]" >/dev/null && + { echo "configure:188: error: invalid feature name: $ac_feature" >&5 + echo "configure: error: invalid feature name: $ac_feature" >&2 + exit 1; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-a-zA-Z0-9_]" >/dev/null && - { echo "configure: error: invalid feature name: $ac_feature" >&2; exit 1; } + expr "x$ac_feature" : ".*[^-_$ac_cr_alnum]" >/dev/null && + { echo "configure:198: error: invalid feature name: $ac_feature" >&5 + echo "configure: error: invalid feature name: $ac_feature" >&2 + exit 1; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; @@ -360,8 +377,10 @@ do -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-a-zA-Z0-9_]" >/dev/null && - { echo "configure: error: invalid package name: $ac_package" >&2; exit 1; } + expr "x$ac_package" : ".*[^-_$ac_cr_alnum]" >/dev/null && + { echo "configure:381: error: invalid package name: $ac_package" >&5 + echo "configure: error: invalid package name: $ac_package" >&2 + exit 1; } ac_package=`echo $ac_package| sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; @@ -372,8 +391,10 @@ do -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-a-zA-Z0-9_]" >/dev/null && - { echo "configure: error: invalid package name: $ac_package" >&2; exit 1; } + expr "x$ac_package" : ".*[^-_$ac_cr_alnum]" >/dev/null && + { echo "configure:395: error: invalid package name: $ac_package" >&5 + echo "configure: error: invalid package name: $ac_package" >&2 + exit 1; } ac_package=`echo $ac_package | sed 's/-/_/g'` eval "with_$ac_package=no" ;; @@ -395,24 +416,31 @@ do | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; - -*) { echo "configure: error: unrecognized option: $ac_option -Try \`configure --help' for more information." >&2; exit 1; } + -*) { echo "configure:419: error: unrecognized option: $ac_option +Try \`configure --help' for more information." >&5 + echo "configure: error: unrecognized option: $ac_option +Try \`configure --help' for more information." >&2 + exit 1; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. - expr "x$ac_envvar" : ".*[^a-zA-Z0-9_]" >/dev/null && - { echo "configure: error: invalid variable name: $ac_envvar" >&2; exit 1; } + expr "x$ac_envvar" : ".*[^_$ac_cr_alnum]" >/dev/null && + { echo "configure:430: error: invalid variable name: $ac_envvar" >&5 + echo "configure: error: invalid variable name: $ac_envvar" >&2 + exit 1; } ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. - echo "configure: WARNING: you should use --build, --host, --target" >&2 - expr "x$ac_option" : ".*[^a-zA-Z0-9.]" >/dev/null && - echo "configure: WARNING: invalid host type: $ac_option" >&2 + echo "configure:439: WARNING: you should use --build, --host, --target" >&5 +echo "configure: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^.$ac_cr_alnum]" >/dev/null && + echo "configure:442: WARNING: invalid host type: $ac_option" >&5 +echo "configure: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; @@ -421,7 +449,9 @@ done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` - { echo "configure: error: missing argument to $ac_option" >&2; exit 1; } + { echo "configure:452: error: missing argument to $ac_option" >&5 + echo "configure: error: missing argument to $ac_option" >&2 + exit 1; } fi # Be sure to have absolute paths. @@ -433,7 +463,9 @@ do case $ac_val in [\\/$]* | ?:[\\/]* ) ;; NONE ) ;; - *) { echo "configure: error: expected an absolute path for --$ac_var: $ac_val" >&2; exit 1; };; + *) { echo "configure:466: error: expected an absolute path for --$ac_var: $ac_val" >&5 + echo "configure: error: expected an absolute path for --$ac_var: $ac_val" >&2 + exit 1; };; esac done @@ -447,7 +479,9 @@ target=$target_alias if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - echo "configure: WARNING: If you wanted to set the --build type, don't use --host. + echo "configure:482: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&5 +echo "configure: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes @@ -473,9 +507,13 @@ else fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then - { echo "configure: error: cannot find sources in $ac_confdir or .." >&2; exit 1; } + { echo "configure:510: error: cannot find sources in $ac_confdir or .." >&5 + echo "configure: error: cannot find sources in $ac_confdir or .." >&2 + exit 1; } else - { echo "configure: error: cannot find sources in $srcdir" >&2; exit 1; } + { echo "configure:514: error: cannot find sources in $srcdir" >&5 + echo "configure: error: cannot find sources in $srcdir" >&2 + exit 1; } fi fi srcdir=`echo "$srcdir" | sed 's%\([^/]\)/*$%\1%'` @@ -598,7 +636,8 @@ if test "$ac_init_help" = "recursive"; then echo $ac_configure --help else - echo "configure: WARNING: no configuration information is in $ac_subdir" >&2 + echo "configure:639: WARNING: no configuration information is in $ac_subdir" >&5 +echo "configure: WARNING: no configuration information is in $ac_subdir" >&2 fi cd $ac_popdir done @@ -617,8 +656,6 @@ EOF exit 0 fi -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Also quote any args containing shell meta-characters. @@ -662,8 +699,40 @@ running configure, to aid debugging if configure makes a mistake. It was created by configure (Autoconf 2.49b) 2.49b, executed with > $0 $ac_configure_args + +on $ac_hostname: + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` " >&5 +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. +trap ' + exit_status=$? + test "$ac_signal" != 0 && + echo "configure: caught signal $ac_signal" >&5 + echo "configure: exit $exit_status" >&5 + rm -rf conftest* confdefs* core core.* *.core $ac_clean_files && + exit $exit_status + ' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_status=$?; ac_signal='$ac_signal'; exit $ac_status' $ac_signal +done +ac_signal=0 + # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. @@ -711,24 +780,31 @@ for ac_var in `(set) 2>&1 | eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) - echo "configure: WARNING: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2 + echo "configure:783: WARNING: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +echo "configure: WARNING: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2 ac_suggest_removing_cache=: ;; ,set) - echo "configure: WARNING: \`$ac_var' was not set in the previous run" >&2 + echo "configure:787: WARNING: \`$ac_var' was not set in the previous run" >&5 +echo "configure: WARNING: \`$ac_var' was not set in the previous run" >&2 ac_suggest_removing_cache=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then - echo "configure: WARNING: \`$ac_var' has changed since the previous run:" >&2 - echo "configure: WARNING: former value: $ac_old_val" >&2 - echo "configure: WARNING: current value: $ac_new_val" >&2 + echo "configure:793: WARNING: \`$ac_var' has changed since the previous run:" >&5 +echo "configure: WARNING: \`$ac_var' has changed since the previous run:" >&2 + echo "configure:795: WARNING: former value: $ac_old_val" >&5 +echo "configure: WARNING: former value: $ac_old_val" >&2 + echo "configure:797: WARNING: current value: $ac_new_val" >&5 +echo "configure: WARNING: current value: $ac_new_val" >&2 ac_suggest_removing_cache=: fi;; esac done if $ac_suggest_removing_cache; then - echo "configure: WARNING: changes in the environment can compromise the build" >&2 - echo "configure: WARNING: consider removing $cache_file and starting over" >&2 + echo "configure:804: WARNING: changes in the environment can compromise the build" >&5 +echo "configure: WARNING: changes in the environment can compromise the build" >&2 + echo "configure:806: WARNING: consider removing $cache_file and starting over" >&5 +echo "configure: WARNING: consider removing $cache_file and starting over" >&2 fi ac_ext=c @@ -761,7 +837,9 @@ for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do fi done if test -z "$ac_aux_dir"; then - { echo "configure: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2; exit 1; } + { echo "configure:840: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 + echo "configure: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2 + exit 1; } fi ac_config_guess="$SHELL $ac_aux_dir/config.guess" ac_config_sub="$SHELL $ac_aux_dir/config.sub" @@ -779,7 +857,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # 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. -echo "configure:782: checking for a BSD compatible install" >&5 +echo "configure:860: checking for a BSD compatible install" >&5 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then @@ -828,7 +906,7 @@ fi INSTALL=$ac_install_sh fi fi -echo "configure:831: result: $INSTALL" >&5 +echo "configure:909: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. @@ -839,7 +917,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' -echo "configure:842: checking whether build environment is sane" >&5 +echo "configure:920: checking whether build environment is sane" >&5 echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 # Just in case sleep 1 @@ -862,8 +940,11 @@ if ( # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". - { echo "configure: error: ls -t appears to fail. Make sure there is not a broken -alias in your environment" >&2; exit 1; } + { echo "configure:943: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&5 + echo "configure: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&2 + exit 1; } fi test "$2" = conftestfile @@ -872,11 +953,14 @@ then # Ok. : else - { echo "configure: error: newly created file is older than distributed files! -Check your system clock" >&2; exit 1; } + { echo "configure:956: error: newly created file is older than distributed files! +Check your system clock" >&5 + echo "configure: error: newly created file is older than distributed files! +Check your system clock" >&2 + exit 1; } fi rm -f conftest* -echo "configure:879: result: yes" >&5 +echo "configure:963: result: yes" >&5 echo "${ECHO_T}yes" >&6 if test "$program_transform_name" = s,x,x,; then program_transform_name= @@ -897,7 +981,7 @@ test "$program_suffix" != NONE && # sed with no file args requires a program. test -z "$program_transform_name" && program_transform_name="s,x,x," -echo "configure:900: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:984: checking whether ${MAKE-make} sets \${MAKE}" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then @@ -917,11 +1001,11 @@ fi rm -f conftestmake fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "configure:920: result: yes" >&5 + echo "configure:1004: result: yes" >&5 echo "${ECHO_T}yes" >&6 SET_MAKE= else - echo "configure:924: result: no" >&5 + echo "configure:1008: result: no" >&5 echo "${ECHO_T}no" >&6 SET_MAKE="MAKE=${MAKE-make}" fi @@ -931,7 +1015,9 @@ PACKAGE=autoconf VERSION=2.49b if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then - { echo "configure: error: source directory already configured; run \"make distclean\" there first" >&2; exit 1; } + { echo "configure:1018: error: source directory already configured; run \"make distclean\" there first" >&5 + echo "configure: error: source directory already configured; run \"make distclean\" there first" >&2 + exit 1; } fi cat >>confdefs.h <>confdefs.h <&5 +echo "configure:1032: checking for working aclocal" >&5 echo $ECHO_N "checking for working aclocal... $ECHO_C" >&6 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if (aclocal --version) < /dev/null > /dev/null 2>&1; then ACLOCAL=aclocal - echo "configure:953: result: found" >&5 + echo "configure:1039: result: found" >&5 echo "${ECHO_T}found" >&6 else ACLOCAL="$SHELL $missing_dir/missing aclocal" - echo "configure:957: result: missing" >&5 + echo "configure:1043: result: missing" >&5 echo "${ECHO_T}missing" >&6 fi -echo "configure:961: checking for working autoconf" >&5 +echo "configure:1047: checking for working autoconf" >&5 echo $ECHO_N "checking for working autoconf... $ECHO_C" >&6 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if (autoconf --version) < /dev/null > /dev/null 2>&1; then AUTOCONF=autoconf - echo "configure:968: result: found" >&5 + echo "configure:1054: result: found" >&5 echo "${ECHO_T}found" >&6 else AUTOCONF="$SHELL $missing_dir/missing autoconf" - echo "configure:972: result: missing" >&5 + echo "configure:1058: result: missing" >&5 echo "${ECHO_T}missing" >&6 fi -echo "configure:976: checking for working automake" >&5 +echo "configure:1062: checking for working automake" >&5 echo $ECHO_N "checking for working automake... $ECHO_C" >&6 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if (automake --version) < /dev/null > /dev/null 2>&1; then AUTOMAKE=automake - echo "configure:983: result: found" >&5 + echo "configure:1069: result: found" >&5 echo "${ECHO_T}found" >&6 else AUTOMAKE="$SHELL $missing_dir/missing automake" - echo "configure:987: result: missing" >&5 + echo "configure:1073: result: missing" >&5 echo "${ECHO_T}missing" >&6 fi -echo "configure:991: checking for working autoheader" >&5 +echo "configure:1077: checking for working autoheader" >&5 echo $ECHO_N "checking for working autoheader... $ECHO_C" >&6 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if (autoheader --version) < /dev/null > /dev/null 2>&1; then AUTOHEADER=autoheader - echo "configure:998: result: found" >&5 + echo "configure:1084: result: found" >&5 echo "${ECHO_T}found" >&6 else AUTOHEADER="$SHELL $missing_dir/missing autoheader" - echo "configure:1002: result: missing" >&5 + echo "configure:1088: result: missing" >&5 echo "${ECHO_T}missing" >&6 fi -echo "configure:1006: checking for working makeinfo" >&5 +echo "configure:1092: checking for working makeinfo" >&5 echo $ECHO_N "checking for working makeinfo... $ECHO_C" >&6 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if (makeinfo --version) < /dev/null > /dev/null 2>&1; then MAKEINFO=makeinfo - echo "configure:1013: result: found" >&5 + echo "configure:1099: result: found" >&5 echo "${ECHO_T}found" >&6 else MAKEINFO="$SHELL $missing_dir/missing makeinfo" - echo "configure:1017: result: missing" >&5 + echo "configure:1103: result: missing" >&5 echo "${ECHO_T}missing" >&6 fi @@ -1029,7 +1115,7 @@ for ac_prog in gm4 gnum4 m4 do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "configure:1032: checking for $ac_word" >&5 +echo "configure:1118: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_M4+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -1056,10 +1142,10 @@ fi M4=$ac_cv_path_M4 if test -n "$M4"; then - echo "configure:1059: result: $M4" >&5 + echo "configure:1145: result: $M4" >&5 echo "${ECHO_T}$M4" >&6 else - echo "configure:1062: result: no" >&5 + echo "configure:1148: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -1067,7 +1153,7 @@ fi done test -n "$M4" || M4="m4" -echo "configure:1070: checking whether m4 supports frozen files" >&5 +echo "configure:1156: checking whether m4 supports frozen files" >&5 echo $ECHO_N "checking whether m4 supports frozen files... $ECHO_C" >&6 if test "${ac_cv_prog_gnu_m4+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -1079,10 +1165,12 @@ if test x"$M4" != x; then esac fi fi -echo "configure:1082: result: $ac_cv_prog_gnu_m4" >&5 +echo "configure:1168: result: $ac_cv_prog_gnu_m4" >&5 echo "${ECHO_T}$ac_cv_prog_gnu_m4" >&6 if test x"$ac_cv_prog_gnu_m4" != xyes; then - { echo "configure: error: GNU m4 1.4 is required" >&2; exit 1; } + { echo "configure:1171: error: GNU m4 1.4 is required" >&5 + echo "configure: error: GNU m4 1.4 is required" >&2 + exit 1; } fi # This is needed because Automake does not seem to realize there is # an AC_SUBST inside AC_PROG_GNU_M4. Grmph! @@ -1092,7 +1180,7 @@ for ac_prog in mawk gawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "configure:1095: checking for $ac_word" >&5 +echo "configure:1183: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -1114,10 +1202,10 @@ fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then - echo "configure:1117: result: $AWK" >&5 + echo "configure:1205: result: $AWK" >&5 echo "${ECHO_T}$AWK" >&6 else - echo "configure:1120: result: no" >&5 + echo "configure:1208: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -1125,25 +1213,25 @@ fi done # Generating man pages. -echo "configure:1128: checking for working help2man" >&5 +echo "configure:1216: checking for working help2man" >&5 echo $ECHO_N "checking for working help2man... $ECHO_C" >&6 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if (help2man --version) < /dev/null > /dev/null 2>&1; then HELP2MAN=help2man - echo "configure:1135: result: found" >&5 + echo "configure:1223: result: found" >&5 echo "${ECHO_T}found" >&6 else HELP2MAN="$SHELL $missing_dir/missing help2man" - echo "configure:1139: result: missing" >&5 + echo "configure:1227: result: missing" >&5 echo "${ECHO_T}missing" >&6 fi # We use a path for perl so the #! line in autoscan will work. # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 -echo "configure:1146: checking for $ac_word" >&5 +echo "configure:1234: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_PERL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -1171,17 +1259,18 @@ fi PERL=$ac_cv_path_PERL if test -n "$PERL"; then - echo "configure:1174: result: $PERL" >&5 + echo "configure:1262: result: $PERL" >&5 echo "${ECHO_T}$PERL" >&6 else - echo "configure:1177: result: no" >&5 + echo "configure:1265: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test "$PERL" != no; then PERLSCRIPTS=autoscan else - echo "configure: WARNING: autoscan will not be built since perl is not found" >&2 + echo "configure:1272: WARNING: autoscan will not be built since perl is not found" >&5 +echo "configure: WARNING: autoscan will not be built since perl is not found" >&2 fi # Find a good install program. We prefer a C program (faster), @@ -1196,7 +1285,7 @@ fi # 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. -echo "configure:1199: checking for a BSD compatible install" >&5 +echo "configure:1288: checking for a BSD compatible install" >&5 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then @@ -1245,7 +1334,7 @@ fi INSTALL=$ac_install_sh fi fi -echo "configure:1248: result: $INSTALL" >&5 +echo "configure:1337: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. @@ -1263,7 +1352,6 @@ fi ac_config_files="$ac_config_files Makefile m4/Makefile man/Makefile doc/Makefile tests/Makefile tests/atconfig" -trap '' 1 2 15 cat >confcache <<\EOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure @@ -1288,15 +1376,16 @@ EOF (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote substitution - # turns \\\\ into \\, and sed turns \\ into \). + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ - -e "s/'/'\\\\''/g" \ - -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1='\\2'/p" + "s/'/'\\\\''/g; + s/^\\([_$ac_cr_alnum]*_cv_[_$ac_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=\2/p' + sed -n \ + "s/^\\([_$ac_cr_alnum]*_cv_[_$ac_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | @@ -1310,7 +1399,6 @@ if cmp -s $cache_file confcache; then :; else fi fi rm -f confcache -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. @@ -1364,15 +1452,16 @@ echo "Cache variables:" >&5 (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote substitution - # turns \\\\ into \\, and sed turns \\ into \). + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ - -e "s/'/'\\\\''/g" \ - -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1='\\2'/p" + "s/'/'\\\\''/g; + s/^\\([_$ac_cr_alnum]*_cv_[_$ac_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=\2/p' + sed -n \ + "s/^\\([_$ac_cr_alnum]*_cv_[_$ac_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed 's/^/| /' >&5 @@ -1471,7 +1560,7 @@ EOF cat >>$CONFIG_STATUS </dev/null || -echo "X"$ac_file"" | sed ' - /^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/p; q; } - /^X\(\/\/\)[^/].*/{ s//\1/p; q; } - /^X\(\/\/\)$/{ s//\1/p; q; } - /^X\(\/\).*/{ s//\1/p; q; } - s/.*/./p; q'` + . : '\(.\)' 2>/dev/null || +echo "X"$ac_file"" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then { case "$ac_dir" in [\\/]* | ?:[\\/]* ) ac_incr_dir=;; @@ -1753,7 +1842,9 @@ done; } -) echo $tmp/stdin ;; [\\/$]* | ?:[\\/]*) # Absolute - test -f "$f" || { echo "configure: error: cannot find input file \\\`$f'" >&2; exit 1; } + test -f "$f" || { echo "configure:1845: error: cannot find input file \\\`$f'" >&5 + echo "configure: error: cannot find input file \\\`$f'" >&2 + exit 1; } echo $f;; *) # Relative if test -f "$f"; then @@ -1764,7 +1855,9 @@ done; } echo $ac_given_srcdir/$f else # /dev/null tree - { echo "configure: error: cannot find input file \\\`$f'" >&2; exit 1; } + { echo "configure:1858: error: cannot find input file \\\`$f'" >&5 + echo "configure: error: cannot find input file \\\`$f'" >&2 + exit 1; } fi;; esac done` || { (exit 1); exit; } diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4 index 684e54700..59a953c93 100644 --- a/lib/autoconf/general.m4 +++ b/lib/autoconf/general.m4 @@ -920,19 +920,25 @@ done; } # a silly length limit that causes expr to fail if the matched # substring is longer than 120 bytes. So fall back on echo|sed if # expr fails. -define([AC_SHELL_DIRNAME], +define([AC_SHELL_DIRNAME_EXPR], [expr X[]$1 : 'X\(.*[[^/]]\)//*[[^/][^/]]*/*$' \| \ X[]$1 : 'X\(//\)[[^/]]' \| \ X[]$1 : 'X\(//\)$' \| \ X[]$1 : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo "X[]$1" | + . : '\(.\)']) + +define([AC_SHELL_DIRNAME_SED], +[echo "X[]$1" | sed ['/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q']]) +define([AC_SHELL_DIRNAME], +[AC_SHELL_DIRNAME_EXPR([$1]) 2>/dev/null || +AC_SHELL_DIRNAME_SED([$1])]) + ## --------------------------------------------------- ## ## Common m4/sh handling of variables (indirections). ## diff --git a/tests/base.m4 b/tests/base.m4 index e15e41580..a53c3209d 100644 --- a/tests/base.m4 +++ b/tests/base.m4 @@ -6,8 +6,9 @@ Base layer. EOF -# m4_wrap -# ------- +## ------- ## +## m4_wrap ## +## ------- ## AT_SETUP(m4_wrap) @@ -54,8 +55,9 @@ AT_CLEANUP() -# AC_REQUIRE -# ---------- +## ------------ ## +## AC_REQUIRE. ## +## ------------ ## # Check that dependencies are always properly honored. @@ -94,8 +96,9 @@ AT_CHECK([./configure], 0) AT_CLEANUP(configure) -# AC_SHELL_MKDIR_P -# ---------------- +## ------------------ ## +## AC_SHELL_MKDIR_P. ## +## ------------------ ## # Build nested dirs. @@ -118,3 +121,75 @@ AT_CHECK([../autoconf --autoconf-dir .. -l $at_srcdir], 0, [], []) AT_CHECK([./configure], 0) AT_CLEANUP(configure 1 a) + + + +## ----------------------------------------- ## +## AC_SHELL_DIRNAME & AC_SHELL_DIRNAME_SED. ## +## ----------------------------------------- ## + +# Build nested dirs. + +AT_SETUP(AC_SHELL_DIRNAME & AC_SHELL_DIRNAME_SED) + +AT_DATA(configure.in, +[[ + +define([AC_SHELL_DIRNAME_TEST], +[dir=`AC_SHELL_DIRNAME([$1])` +test "$dir" = "$2" || + echo "dirname($1) = $dir instead of $2" >&2]) +define([AC_SHELL_DIRNAME_SED_TEST], +[dir=`AC_SHELL_DIRNAME_SED([$1])` +test "$dir" = "$2" || + echo "dirname_sed($1) = $dir instead of $2" >&2]) + +AC_PLAIN_SCRIPT +AC_SHELL_DIRNAME_TEST([//1], [//]) +AC_SHELL_DIRNAME_TEST([/1], [/]) +AC_SHELL_DIRNAME_TEST([./1], [.]) +AC_SHELL_DIRNAME_TEST([../../2], [../..]) +AC_SHELL_DIRNAME_TEST([//1/], [//]) +AC_SHELL_DIRNAME_TEST([/1/], [/]) +AC_SHELL_DIRNAME_TEST([./1/], [.]) +AC_SHELL_DIRNAME_TEST([../../2], [../..]) +AC_SHELL_DIRNAME_TEST([//1/3], [//1]) +AC_SHELL_DIRNAME_TEST([/1/3], [/1]) +AC_SHELL_DIRNAME_TEST([./1/3], [./1]) +AC_SHELL_DIRNAME_TEST([../../2/3], [../../2]) +AC_SHELL_DIRNAME_TEST([//1/3///], [//1]) +AC_SHELL_DIRNAME_TEST([/1/3///], [/1]) +AC_SHELL_DIRNAME_TEST([./1/3///], [./1]) +AC_SHELL_DIRNAME_TEST([../../2/3///], [../../2]) +AC_SHELL_DIRNAME_TEST([//1//3/], [//1]) +AC_SHELL_DIRNAME_TEST([/1//3/], [/1]) +AC_SHELL_DIRNAME_TEST([./1//3/], [./1]) +AC_SHELL_DIRNAME_TEST([../../2//3/], [../../2]) + +AC_SHELL_DIRNAME_SED_TEST([//1], [//]) +AC_SHELL_DIRNAME_SED_TEST([/1], [/]) +AC_SHELL_DIRNAME_SED_TEST([./1], [.]) +AC_SHELL_DIRNAME_SED_TEST([../../2], [../..]) +AC_SHELL_DIRNAME_SED_TEST([//1/], [//]) +AC_SHELL_DIRNAME_SED_TEST([/1/], [/]) +AC_SHELL_DIRNAME_SED_TEST([./1/], [.]) +AC_SHELL_DIRNAME_SED_TEST([../../2], [../..]) +AC_SHELL_DIRNAME_SED_TEST([//1/3], [//1]) +AC_SHELL_DIRNAME_SED_TEST([/1/3], [/1]) +AC_SHELL_DIRNAME_SED_TEST([./1/3], [./1]) +AC_SHELL_DIRNAME_SED_TEST([../../2/3], [../../2]) +AC_SHELL_DIRNAME_SED_TEST([//1/3///], [//1]) +AC_SHELL_DIRNAME_SED_TEST([/1/3///], [/1]) +AC_SHELL_DIRNAME_SED_TEST([./1/3///], [./1]) +AC_SHELL_DIRNAME_SED_TEST([../../2/3///], [../../2]) +AC_SHELL_DIRNAME_SED_TEST([//1//3/], [//1]) +AC_SHELL_DIRNAME_SED_TEST([/1//3/], [/1]) +AC_SHELL_DIRNAME_SED_TEST([./1//3/], [./1]) +AC_SHELL_DIRNAME_SED_TEST([../../2//3/], [../../2]) +exit 0 +]]) + +AT_CHECK([../autoconf --autoconf-dir .. -l $at_srcdir], 0, [], []) +AT_CHECK([./configure], 0) + +AT_CLEANUP(configure) diff --git a/tests/suite.m4 b/tests/suite.m4 index 248e3198c..32f345c79 100644 --- a/tests/suite.m4 +++ b/tests/suite.m4 @@ -1,6 +1,6 @@ #!/bin/sh # Validation suite for Autoconf -# Copyright (C) 2000 Free Software Foundation, Inc. +# Copyright 2000 Free Software Foundation, Inc. # Still many parts of `autoconf' are not exercised by the test suite. A few # FIXME's, below, are used to list tests that we would need. Do you feel