From 618b5d14d1773d331fb6ba940f0db69c2003a19b Mon Sep 17 00:00:00 2001 From: David MacKenzie Date: Tue, 12 Nov 1996 07:17:30 +0000 Subject: [PATCH] more improvements from the net --- ChangeLog | 18 +++++++++++++++++- NEWS | 9 +++++++++ TODO | 15 +++++++++------ acgeneral.m4 | 35 +++++++++++++++++++++++++++-------- acspecific.m4 | 9 ++++----- autoconf.texi | 2 +- doc/autoconf.texi | 2 +- lib/autoconf/general.m4 | 35 +++++++++++++++++++++++++++-------- lib/autoconf/specific.m4 | 9 ++++----- testsuite/config/unix.exp | 2 +- 10 files changed, 100 insertions(+), 36 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4b0d3c74..ee8e3ca6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +Tue Nov 12 00:06:14 1996 David J MacKenzie + + * acspecific.m4 (AC_PROG_CC, AC_PROG_CXX) [GCC]: Use -O2 instead + of -O. Suggested by fnf@ninemoons.com (Fred Fish). + + * acgeneral.m4 (AC_OUTPUT_HEADER): Support passing + AC_CONFIG_HEADER a value containing shell variables. Suggested by + Markku Savela and Julian Onions + . + * acgeneral.m4 (AC_TRY_RUN_NATIVE, AC_TRY_LINK, AC_TRY_COMPILE, + AC_TRY_CPP): Show the test program in config.log if the test fails. + From Karl Berry . + + * testsuite/config/unix.exp: Run the configure script as "./script" + in case the user doesn't have "." in their PATH. + Mon Nov 11 18:02:58 1996 David J MacKenzie * acgeneral.m4 (AC_TRY_COMPILE, AC_TRY_LINK): Deal with smart @@ -22,7 +38,7 @@ Sat Nov 9 01:54:04 1996 David J MacKenzie * Test release 2.10.1. * acspecific.m4 (AC_PROG_CC_WORKS, AC_PROG_CXX_WORKS): New macros - adapted from Jim Meyering and automake. + adapted from Bruno Haible . (AC_PROG_CC, AC_PROG_CXX): Use them. * acgeneral.m4 (AC_TRY_RUN_NATIVE): Split out of AC_TRY_RUN. (AC_TRY_LINK): Check that the executable exists after linking. diff --git a/NEWS b/NEWS index 0e8a6293..6b74dca9 100644 --- a/NEWS +++ b/NEWS @@ -1,8 +1,17 @@ +Issues to resolve before release: + +1. sed command limitation. +2. autoreconf problem with finding nested acconfig.h. +3. test the new features. + Major changes in release 2.11: * AC_PROG_CC and AC_PROG_CXX check whether the compiler works. + They default CFLAGS/CXXFLAGS to "-g -O2" for gcc, instead of "-g -O". * AC_REPLACE_FUNCS defines HAVE_@var{function} if the system has the function. +* The argument to AC_CONFIG_HEADER can contain shell variables. * New macros: AC_FUNC_FNMATCH, AC_FUNC_SETPGRP. +* The source code for test programs that fail is saved in config.log. * config.sub and config.guess recognize more system types. * autoheader.sh adds multiple-inclusion protection for config.h. * Bug fixes. diff --git a/TODO b/TODO index 8de81da2..df6e99b9 100644 --- a/TODO +++ b/TODO @@ -113,12 +113,6 @@ just as for X includes and libraries. Should they be cached all in one variable, or three? In that case, what if only one or two of the cache variables are set? ------------------------------------------------------------------------------- - -Look at contributions: - ac_include (Karl Berry) - aclocal.h tom@basil.icce.rug.NL (Tom R.Hageman) - ------------------------------------------------------------------------------ The argument HELP-STRING is a description of the option which @@ -429,6 +423,7 @@ Mention automake, libtool, etc. in the autoconf manual. ------------------------------------------------------------------------------ configure-time pasting together of output files from multiple pieces. +Or ac_include? ------------------------------------------------------------------------------ @@ -448,3 +443,11 @@ done. From Jim Meyering ------------------------------------------------------------------------------ + +Question: at least one common UNIX variant has a "cc" that is old K&R +and "c89" for ANSI C. Is there any reason why AC_PROG_CC couldn't +check for c89 before cc if it can't find gcc? + +hpa@yggdrasil.com (H. Peter Anvin) + +------------------------------------------------------------------------------ diff --git a/acgeneral.m4 b/acgeneral.m4 index 26fb579c..cd0028e3 100644 --- a/acgeneral.m4 +++ b/acgeneral.m4 @@ -1521,6 +1521,8 @@ if test -z "$ac_err"; then $2]) else echo "$ac_err" >&AC_FD_CC + echo "configure: input program was:" >&AC_FD_CC + cat conftest.$ac_ext >&AC_FD_CC ifelse([$3], , , [ rm -rf conftest* $3 ])dnl @@ -1580,8 +1582,10 @@ EOF if AC_TRY_EVAL(ac_compile); then ifelse([$3], , :, [rm -rf conftest* $3]) -ifelse([$4], , , [else - rm -rf conftest* +else + echo "configure: input program was:" >&AC_FD_CC + cat conftest.$ac_ext >&AC_FD_CC +ifelse([$4], , , [ rm -rf conftest* $4 ])dnl fi @@ -1617,8 +1621,10 @@ EOF if AC_TRY_EVAL(ac_link) && test -s conftest; then ifelse([$3], , :, [rm -rf conftest* $3]) -ifelse([$4], , , [else - rm -rf conftest* +else + echo "configure: input program was:" >&AC_FD_CC + cat conftest.$ac_ext >&AC_FD_CC +ifelse([$4], , , [ rm -rf conftest* $4 ])dnl fi @@ -1659,8 +1665,10 @@ EOF AC_TRY_EVAL(ac_link) if test -s conftest && (./conftest; exit) 2>/dev/null; then ifelse([$2], , :, [$2]) -ifelse([$3], , , [else - rm -fr conftest* +else + echo "configure: input program was:" >&AC_FD_CC + cat conftest.$ac_ext >&AC_FD_CC +ifelse([$3], , , [ rm -fr conftest* $3 ])dnl fi @@ -1927,6 +1935,7 @@ dnl config.status should not do recursion. ifdef([AC_LIST_SUBDIRS], [AC_OUTPUT_SUBDIRS(AC_LIST_SUBDIRS)])dnl ])dnl +dnl Set the DEFS variable to the -D options determined earlier. dnl This is a subroutine of AC_OUTPUT. dnl It is called inside configure, outside of config.status. dnl AC_OUTPUT_MAKE_DEFS() @@ -1948,8 +1957,10 @@ DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` rm -f conftest.defs ]) +dnl Do the variable substitutions to create the Makefiles or whatever. dnl This is a subroutine of AC_OUTPUT. It is called inside an unquoted -dnl here document whose contents are going into config.status. +dnl here document whose contents are going into config.status, but +dnl upon returning, the here document is being quoted. dnl AC_OUTPUT_FILES(FILE...) define(AC_OUTPUT_FILES, [# Protect against being on the right side of a sed subst in config.status. @@ -2044,6 +2055,7 @@ fi; done rm -f conftest.subs ]) +dnl Create the config.h files from the config.h.in files. dnl This is a subroutine of AC_OUTPUT. It is called inside a quoted dnl here document whose contents are going into config.status. dnl AC_OUTPUT_HEADER(HEADER-FILE...) @@ -2069,7 +2081,14 @@ ac_eC=' ' ac_eD='%g' changequote([, ])dnl -CONFIG_HEADERS=${CONFIG_HEADERS-"$1"} +if test -z "$CONFIG_HEADERS"; then +EOF +dnl Support passing AC_CONFIG_HEADER a value containing shell variables. +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +fi for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then # Support "outfile[:infile]", defaulting infile="outfile.in". case "$ac_file" in diff --git a/acspecific.m4 b/acspecific.m4 index e896fb34..8ff07aeb 100644 --- a/acspecific.m4 +++ b/acspecific.m4 @@ -111,9 +111,9 @@ rm -f conftest* if test "$ac_test_CFLAGS" = set; then CFLAGS="$ac_save_CFLAGS" elif test $ac_cv_prog_gcc_g = yes; then - CFLAGS="-g -O" + CFLAGS="-g -O2" else - CFLAGS="-O" + CFLAGS="-O2" fi else GCC= @@ -160,9 +160,9 @@ dnl if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS="$ac_save_CXXFLAGS" elif test $ac_cv_prog_gxx_g = yes; then - CXXFLAGS="-g -O" + CXXFLAGS="-g -O2" else - CXXFLAGS="-O" + CXXFLAGS="-O2" fi else GXX= @@ -172,7 +172,6 @@ fi AC_PROG_CXX_WORKS ]) -dnl This check is derived from macros from Bruno Haible and Cygnus. AC_DEFUN(AC_PROG_CC_WORKS, [AC_MSG_CHECKING([whether the C compiler ($CC $CFLAGS $LDFLAGS) works]) AC_LANG_SAVE diff --git a/autoconf.texi b/autoconf.texi index 982ab417..5edc3057 100644 --- a/autoconf.texi +++ b/autoconf.texi @@ -1186,7 +1186,7 @@ however, you can override the input file name by appending it to AC_CONFIG_HEADER(defines.h:defines.hin) @end example @noindent -Doing this allows you to keep your filenames acceptable to MS-DOS. +Doing this allows you to keep your file names acceptable to MS-DOS. @end defmac @menu diff --git a/doc/autoconf.texi b/doc/autoconf.texi index 982ab417..5edc3057 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -1186,7 +1186,7 @@ however, you can override the input file name by appending it to AC_CONFIG_HEADER(defines.h:defines.hin) @end example @noindent -Doing this allows you to keep your filenames acceptable to MS-DOS. +Doing this allows you to keep your file names acceptable to MS-DOS. @end defmac @menu diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4 index 26fb579c..cd0028e3 100644 --- a/lib/autoconf/general.m4 +++ b/lib/autoconf/general.m4 @@ -1521,6 +1521,8 @@ if test -z "$ac_err"; then $2]) else echo "$ac_err" >&AC_FD_CC + echo "configure: input program was:" >&AC_FD_CC + cat conftest.$ac_ext >&AC_FD_CC ifelse([$3], , , [ rm -rf conftest* $3 ])dnl @@ -1580,8 +1582,10 @@ EOF if AC_TRY_EVAL(ac_compile); then ifelse([$3], , :, [rm -rf conftest* $3]) -ifelse([$4], , , [else - rm -rf conftest* +else + echo "configure: input program was:" >&AC_FD_CC + cat conftest.$ac_ext >&AC_FD_CC +ifelse([$4], , , [ rm -rf conftest* $4 ])dnl fi @@ -1617,8 +1621,10 @@ EOF if AC_TRY_EVAL(ac_link) && test -s conftest; then ifelse([$3], , :, [rm -rf conftest* $3]) -ifelse([$4], , , [else - rm -rf conftest* +else + echo "configure: input program was:" >&AC_FD_CC + cat conftest.$ac_ext >&AC_FD_CC +ifelse([$4], , , [ rm -rf conftest* $4 ])dnl fi @@ -1659,8 +1665,10 @@ EOF AC_TRY_EVAL(ac_link) if test -s conftest && (./conftest; exit) 2>/dev/null; then ifelse([$2], , :, [$2]) -ifelse([$3], , , [else - rm -fr conftest* +else + echo "configure: input program was:" >&AC_FD_CC + cat conftest.$ac_ext >&AC_FD_CC +ifelse([$3], , , [ rm -fr conftest* $3 ])dnl fi @@ -1927,6 +1935,7 @@ dnl config.status should not do recursion. ifdef([AC_LIST_SUBDIRS], [AC_OUTPUT_SUBDIRS(AC_LIST_SUBDIRS)])dnl ])dnl +dnl Set the DEFS variable to the -D options determined earlier. dnl This is a subroutine of AC_OUTPUT. dnl It is called inside configure, outside of config.status. dnl AC_OUTPUT_MAKE_DEFS() @@ -1948,8 +1957,10 @@ DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` rm -f conftest.defs ]) +dnl Do the variable substitutions to create the Makefiles or whatever. dnl This is a subroutine of AC_OUTPUT. It is called inside an unquoted -dnl here document whose contents are going into config.status. +dnl here document whose contents are going into config.status, but +dnl upon returning, the here document is being quoted. dnl AC_OUTPUT_FILES(FILE...) define(AC_OUTPUT_FILES, [# Protect against being on the right side of a sed subst in config.status. @@ -2044,6 +2055,7 @@ fi; done rm -f conftest.subs ]) +dnl Create the config.h files from the config.h.in files. dnl This is a subroutine of AC_OUTPUT. It is called inside a quoted dnl here document whose contents are going into config.status. dnl AC_OUTPUT_HEADER(HEADER-FILE...) @@ -2069,7 +2081,14 @@ ac_eC=' ' ac_eD='%g' changequote([, ])dnl -CONFIG_HEADERS=${CONFIG_HEADERS-"$1"} +if test -z "$CONFIG_HEADERS"; then +EOF +dnl Support passing AC_CONFIG_HEADER a value containing shell variables. +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +fi for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then # Support "outfile[:infile]", defaulting infile="outfile.in". case "$ac_file" in diff --git a/lib/autoconf/specific.m4 b/lib/autoconf/specific.m4 index e896fb34..8ff07aeb 100644 --- a/lib/autoconf/specific.m4 +++ b/lib/autoconf/specific.m4 @@ -111,9 +111,9 @@ rm -f conftest* if test "$ac_test_CFLAGS" = set; then CFLAGS="$ac_save_CFLAGS" elif test $ac_cv_prog_gcc_g = yes; then - CFLAGS="-g -O" + CFLAGS="-g -O2" else - CFLAGS="-O" + CFLAGS="-O2" fi else GCC= @@ -160,9 +160,9 @@ dnl if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS="$ac_save_CXXFLAGS" elif test $ac_cv_prog_gxx_g = yes; then - CXXFLAGS="-g -O" + CXXFLAGS="-g -O2" else - CXXFLAGS="-O" + CXXFLAGS="-O2" fi else GXX= @@ -172,7 +172,6 @@ fi AC_PROG_CXX_WORKS ]) -dnl This check is derived from macros from Bruno Haible and Cygnus. AC_DEFUN(AC_PROG_CC_WORKS, [AC_MSG_CHECKING([whether the C compiler ($CC $CFLAGS $LDFLAGS) works]) AC_LANG_SAVE diff --git a/testsuite/config/unix.exp b/testsuite/config/unix.exp index cf4f08af..31cc117b 100644 --- a/testsuite/config/unix.exp +++ b/testsuite/config/unix.exp @@ -89,7 +89,7 @@ proc autoconf_load { args } { } # Capture only stderr in exec_output, not "creating Makefile" etc. - catch "exec $args --cache=/dev/null >/dev/null" exec_output + catch "exec ./$args --cache=/dev/null >/dev/null" exec_output if $verbose>1 then { send_user "Executed $args --cache=/dev/null\n" }