]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
make it work again
authorDavid MacKenzie <djm@djmnet.org>
Tue, 19 Jul 1994 22:14:03 +0000 (22:14 +0000)
committerDavid MacKenzie <djm@djmnet.org>
Tue, 19 Jul 1994 22:14:03 +0000 (22:14 +0000)
Makefile.in
acgeneral.m4
acspecific.m4
doc/Makefile.in
lib/autoconf/general.m4
lib/autoconf/specific.m4
testsuite/Makefile.in
testsuite/config/unix.exp
testsuite/lib/common.exp

index 83241422b04064f77d11be3f15fad7728da20cd8..fd48bef05a78278497c2ee66c8d7a70904bfdc68 100644 (file)
@@ -59,8 +59,7 @@ DISTFILES = COPYING ChangeLog INSTALL Makefile.in NEWS README \
        config.guess config.sub configure configure.in \
        install.sh mkinstalldirs texinfo.tex \
        testsuite/Makefile.in testsuite/config/*.exp \
-       testsuite/lib/*.exp \
-       testsuite/autoconf.0/*.exp \
+       testsuite/lib/*.exp testsuite/autoconf.[gs]/*.exp \
        standards.texi make-stds.texi standards.info*
 
 editsh = sed -e 's,@''datadir''@,$(acdatadir),g' -e 's,@''M4''@,$(M4),g'
@@ -191,8 +190,9 @@ dist: $(DISTDEP)
        distname=`sed -e '/define(AC_ACVERSION,/!d' \
        -e 's/[^0-9.]*\([0-9.]*\).*/autoconf-\1/' -e q acgeneral.m4`; \
        rm -fr $$distname; \
-       mkdir $$distname $$distname/testsuite $$distname/testsuite/config; \
-       mkdir $$distname/testsuite/lib $$distname/testsuite/autoconf.0; \
+       mkdir $$distname $$distname/testsuite $$distname/testsuite/config \
+       $$distname/testsuite/lib $$distname/testsuite/autoconf.g \
+       $$distname/testsuite/autoconf.s; \
        for file in $(DISTFILES); do \
          ln $$file $$distname/$$file \
          || { echo copying $$file instead; cp -p $$file $$distname/$$file;}; \
index 429cef7b89c3d7143641a82b8c23cb74de4b30d4..2930cfa267ce99909be133c834599bdec0087f53 100644 (file)
@@ -124,6 +124,7 @@ verbose=
 x_includes=
 x_libraries=
 
+# Initialize some other variables.
 subdirs=
 
 ac_prev=
@@ -860,12 +861,11 @@ define(AC_DEFINE,[
 {
 dnl Uniformly use AC_DEFINE_[SED]QUOTE, so callers of AC_DEFINE_UNQUOTED
 dnl can use AC_QUOTE_* manually if they want to.
-test "$verbose" = yes && \
 ifelse($#, 2,
 [define([AC_VAL], $2)dnl
-echo " defining" $1 to be ifelse(AC_VAL,, empty, "AC_QUOTE_SQUOTE(AC_VAL)")],
+echo 1>&5 "    defining" $1 to be ifelse(AC_VAL,, empty, "AC_QUOTE_SQUOTE(AC_VAL)")],
 [define([AC_VAL], 1)dnl
-echo " defining $1"])
+echo 1>&5 "    defining $1"])
 dnl
 echo "[#][define]" $1 "AC_QUOTE_SQUOTE(AC_VAL)" >> confdefs.h
 dnl Define DEFS even if AC_LIST_HEADERS for use in user case statements.
@@ -1191,7 +1191,7 @@ dnl             [, ACTION-IF-CROSS-COMPILING]])
 define(AC_TEST_RUN,
 [AC_PROVIDE([$0])dnl
 AC_REQUIRE([AC_CROSS_CHECK])dnl
-if test -n "$cross_compiling"; then
+if test "$cross_compiling" = yes; then
   ifelse([$4], , AC_ERROR(can not run test program while cross compiling),
   [AC_VERBOSE(using default for cross-compiling)
 $4
index ac384226ea1438ac4ecd05cacd03b26f03d307bb..a9535cb88b02150bd94783d4efa41a88bdeca978 100644 (file)
@@ -96,7 +96,7 @@ else
 fi
 set dummy $CC; ac_cc=[$]2
 AC_CACHE_VAL(ac_cv_prog_cc_${ac_cc}_c_o,
-[ac_cv_prog_cc_${ac_cc}_c_o=no
+[eval ac_cv_prog_cc_${ac_cc}_c_o=no
 echo 'foo(){}' > conftest.c
 # Make sure it works both with $CC and with simple cc.
 # We do the test twice because some compilers refuse to overwrite an
@@ -111,7 +111,7 @@ then
       if cc -c conftest.c -o conftest2.o 1>&6 2>&6 &&
         test -f conftest2.o && cc -c conftest.c -o conftest2.o 1>&6 2>&6
       then
-        ac_cv_prog_cc_${ac_cc}_c_o=yes
+        eval ac_cv_prog_cc_${ac_cc}_c_o=yes
       fi
     fi
   fi
@@ -137,9 +137,9 @@ changequote(,)dnl
 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
 changequote([,])dnl
 if test -n "$ac_maketemp"; then
-  ac_cv_prog_make_${ac_make}_set=yes
+  eval ac_cv_prog_make_${ac_make}_set=yes
 else
-  ac_cv_prog_make_${ac_make}_set=no
+  eval ac_cv_prog_make_${ac_make}_set=no
 fi
 rm -f conftestmake])dnl
 if test $ac_cv_prog_make_${ac_make}_set = yes; then
@@ -218,7 +218,7 @@ define(AC_YYTEXT_POINTER,
 [AC_REQUIRE_CPP()dnl
 AC_REQUIRE([AC_PROG_LEX])dnl
 AC_CHECKING(for yytext declaration)
-AC_CACHE_VALUE(ac_cv_prog_lex_yytext_pointer,
+AC_CACHE_VAL(ac_cv_prog_lex_yytext_pointer,
 [# POSIX says lex can declare yytext either as a pointer or an array; the
 # default is implementation-dependent. Figure out which it is, since
 # not all implementations provide the %pointer and %array declarations.
@@ -409,7 +409,7 @@ dnl To avoid problems, don't check for gcc2 built-ins.
 define(AC_MEMORY_H,
 [AC_OBSOLETE([$0], [; instead use AC_HAVE_HEADERS(memory.h) and HAVE_MEMORY_H])AC_CHECKING(whether string.h declares mem functions)
 AC_HEADER_EGREP(memchr, string.h, ,
-  AC_HEADER_CHECK(memory.h, AC_DEFINE(NEED_MEMORY_H)))]
+  [AC_HEADER_CHECK(memory.h, AC_DEFINE(NEED_MEMORY_H))])]
 )dnl
 dnl
 define(AC_MAJOR_HEADER,
index 83241422b04064f77d11be3f15fad7728da20cd8..fd48bef05a78278497c2ee66c8d7a70904bfdc68 100644 (file)
@@ -59,8 +59,7 @@ DISTFILES = COPYING ChangeLog INSTALL Makefile.in NEWS README \
        config.guess config.sub configure configure.in \
        install.sh mkinstalldirs texinfo.tex \
        testsuite/Makefile.in testsuite/config/*.exp \
-       testsuite/lib/*.exp \
-       testsuite/autoconf.0/*.exp \
+       testsuite/lib/*.exp testsuite/autoconf.[gs]/*.exp \
        standards.texi make-stds.texi standards.info*
 
 editsh = sed -e 's,@''datadir''@,$(acdatadir),g' -e 's,@''M4''@,$(M4),g'
@@ -191,8 +190,9 @@ dist: $(DISTDEP)
        distname=`sed -e '/define(AC_ACVERSION,/!d' \
        -e 's/[^0-9.]*\([0-9.]*\).*/autoconf-\1/' -e q acgeneral.m4`; \
        rm -fr $$distname; \
-       mkdir $$distname $$distname/testsuite $$distname/testsuite/config; \
-       mkdir $$distname/testsuite/lib $$distname/testsuite/autoconf.0; \
+       mkdir $$distname $$distname/testsuite $$distname/testsuite/config \
+       $$distname/testsuite/lib $$distname/testsuite/autoconf.g \
+       $$distname/testsuite/autoconf.s; \
        for file in $(DISTFILES); do \
          ln $$file $$distname/$$file \
          || { echo copying $$file instead; cp -p $$file $$distname/$$file;}; \
index 429cef7b89c3d7143641a82b8c23cb74de4b30d4..2930cfa267ce99909be133c834599bdec0087f53 100644 (file)
@@ -124,6 +124,7 @@ verbose=
 x_includes=
 x_libraries=
 
+# Initialize some other variables.
 subdirs=
 
 ac_prev=
@@ -860,12 +861,11 @@ define(AC_DEFINE,[
 {
 dnl Uniformly use AC_DEFINE_[SED]QUOTE, so callers of AC_DEFINE_UNQUOTED
 dnl can use AC_QUOTE_* manually if they want to.
-test "$verbose" = yes && \
 ifelse($#, 2,
 [define([AC_VAL], $2)dnl
-echo " defining" $1 to be ifelse(AC_VAL,, empty, "AC_QUOTE_SQUOTE(AC_VAL)")],
+echo 1>&5 "    defining" $1 to be ifelse(AC_VAL,, empty, "AC_QUOTE_SQUOTE(AC_VAL)")],
 [define([AC_VAL], 1)dnl
-echo " defining $1"])
+echo 1>&5 "    defining $1"])
 dnl
 echo "[#][define]" $1 "AC_QUOTE_SQUOTE(AC_VAL)" >> confdefs.h
 dnl Define DEFS even if AC_LIST_HEADERS for use in user case statements.
@@ -1191,7 +1191,7 @@ dnl             [, ACTION-IF-CROSS-COMPILING]])
 define(AC_TEST_RUN,
 [AC_PROVIDE([$0])dnl
 AC_REQUIRE([AC_CROSS_CHECK])dnl
-if test -n "$cross_compiling"; then
+if test "$cross_compiling" = yes; then
   ifelse([$4], , AC_ERROR(can not run test program while cross compiling),
   [AC_VERBOSE(using default for cross-compiling)
 $4
index ac384226ea1438ac4ecd05cacd03b26f03d307bb..a9535cb88b02150bd94783d4efa41a88bdeca978 100644 (file)
@@ -96,7 +96,7 @@ else
 fi
 set dummy $CC; ac_cc=[$]2
 AC_CACHE_VAL(ac_cv_prog_cc_${ac_cc}_c_o,
-[ac_cv_prog_cc_${ac_cc}_c_o=no
+[eval ac_cv_prog_cc_${ac_cc}_c_o=no
 echo 'foo(){}' > conftest.c
 # Make sure it works both with $CC and with simple cc.
 # We do the test twice because some compilers refuse to overwrite an
@@ -111,7 +111,7 @@ then
       if cc -c conftest.c -o conftest2.o 1>&6 2>&6 &&
         test -f conftest2.o && cc -c conftest.c -o conftest2.o 1>&6 2>&6
       then
-        ac_cv_prog_cc_${ac_cc}_c_o=yes
+        eval ac_cv_prog_cc_${ac_cc}_c_o=yes
       fi
     fi
   fi
@@ -137,9 +137,9 @@ changequote(,)dnl
 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
 changequote([,])dnl
 if test -n "$ac_maketemp"; then
-  ac_cv_prog_make_${ac_make}_set=yes
+  eval ac_cv_prog_make_${ac_make}_set=yes
 else
-  ac_cv_prog_make_${ac_make}_set=no
+  eval ac_cv_prog_make_${ac_make}_set=no
 fi
 rm -f conftestmake])dnl
 if test $ac_cv_prog_make_${ac_make}_set = yes; then
@@ -218,7 +218,7 @@ define(AC_YYTEXT_POINTER,
 [AC_REQUIRE_CPP()dnl
 AC_REQUIRE([AC_PROG_LEX])dnl
 AC_CHECKING(for yytext declaration)
-AC_CACHE_VALUE(ac_cv_prog_lex_yytext_pointer,
+AC_CACHE_VAL(ac_cv_prog_lex_yytext_pointer,
 [# POSIX says lex can declare yytext either as a pointer or an array; the
 # default is implementation-dependent. Figure out which it is, since
 # not all implementations provide the %pointer and %array declarations.
@@ -409,7 +409,7 @@ dnl To avoid problems, don't check for gcc2 built-ins.
 define(AC_MEMORY_H,
 [AC_OBSOLETE([$0], [; instead use AC_HAVE_HEADERS(memory.h) and HAVE_MEMORY_H])AC_CHECKING(whether string.h declares mem functions)
 AC_HEADER_EGREP(memchr, string.h, ,
-  AC_HEADER_CHECK(memory.h, AC_DEFINE(NEED_MEMORY_H)))]
+  [AC_HEADER_CHECK(memory.h, AC_DEFINE(NEED_MEMORY_H))])]
 )dnl
 dnl
 define(AC_MAJOR_HEADER,
index 25e26f8c657f12918d9c363a7d464e19bd662386..2cf1e11d52559bcfce6dc23d3e4afe1276bfb042 100644 (file)
@@ -75,7 +75,7 @@ Makefile: Makefile.in ../config.status
        cd ..; ./config.status
 
 clean:
-       rm -f autoconf.log autoconf.sum site.exp site.bak
+       rm -f autoconf.log autoconf.sum site.exp site.bak AC* confdummy* 
 mostlyclean: clean
 distclean: clean
        rm -f Makefile config.status config.cache config.log
index e91e6e277f617067b8ebeaf7cd2941245cf4be7a..ef45d601f0207800b28ec5cf3489638d3fa9fe72 100644 (file)
@@ -1,4 +1,5 @@
 # -*- TCL -*-
+# Test-specific TCL procedures required by DejaGNU.
 # Copyright (C) 1994 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # 
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-# Modified by David MacKenzie (djm@cygnus.com) from the gcc files
-# written by Rob Savoye (rob@cygnus.com).
+# Modified by David MacKenzie <djm@gnu.ai.mit.edu> from the gcc files
+# written by Rob Savoye <rob@cygnus.com>.
 \f
 #
 # Called by runtest.
@@ -44,7 +45,7 @@ proc autoconf_version {} {
 # Runs autoconf and leaves the output in $comp_output.
 # Called by individual test scripts.
 # Return 1 if ok, 0 if not.
-proc autoconf_start { configin } {
+proc autoconf_start { configout } {
     global verbose
     global AUTOCONF
     global AUTOCONFFLAGS
@@ -55,9 +56,7 @@ proc autoconf_start { configin } {
        exit 1
     }
 
-    # Replace ".in" with ".conf".
-#    set configout "[file rootname $configin].conf"
-    set configout "[file rootname $configin]"
+    set configin "$configout.in"
 
     send_log "$AUTOCONF $AUTOCONFFLAGS $configin > $configout\n"
     if $verbose>1 then {
@@ -95,7 +94,7 @@ proc autoconf_load { args } {
        send_user "Executed $args\n"
     }
     if ![string match "" $exec_output] then {
-       fail "$args, problem while executing configure script"
+       fail "$args, problem with executing"
        send_log "$exec_output\n"
        return 0
     } else {
index df34fddb5d0c63ca14e5a730ac1754b13812d7c3..a71192f199ba21b4ce6cf0acce1e323e75fb0d23 100644 (file)
@@ -1,33 +1,65 @@
 # -*- TCL -*-
 # Auxiliary procedures for autoconf tests.
+# Copyright (C) 1994 Free Software Foundation, Inc.
 
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+# Written by David MacKenzie <djm@gnu.ai.mit.edu>.
+\f
+#
 # Create a configure.in from a string.
+# CONFIG.in is the file to create containing CONTENTS plus boilerplate.
 # Return 1 if successful, 0 if an error occurs.
-proc autoconf_create {configin contents} {
-    if [catch {set hand [open $configin "w"]}] {
-       error "$configin, cannot create"
+proc autoconf_create {config contents} {
+    if [catch {open "$config.in" "w"} hand] {
+       error "$config, cannot create $config.in"
        return 0
     }
-    puts $hand "AC_INIT(Makefile.in)
+    puts $hand "AC_INIT(confdummy.in)
 $contents
-AC_OUTPUT(Makefile)"
+AC_OUTPUT(confdummy)"
     close $hand
+
+    if [catch {open "confdummy.in" "w"} hand] {
+       error "$config, cannot create confdummy.in"
+       return 0
+    }
+    puts $hand "# This is a dummy file for testing.
+srcdir = @srcdir@
+# Please ignore this file."
+    close $hand
+
     return 1
 }
 
 # Compile a configure.in into a configure
 #  and call error if there's any output (undefined macros, can't
 #  find library files, etc.).
-proc autoconf_start_plus {configin} {
+proc autoconf_start_plus {configout} {
     global comp_output
 
-    set status [autoconf_start $configin]
+    set status [autoconf_start $configout]
     if {$status==0} {
        return 0
     }
     # Examine $comp_output.
+    if [string match "*is obsolete*" "$comp_output"] then {
+       return 1
+    }
     if ![string match "" "$comp_output"] then {
-       fail "$configin, running autoconf failed"
+       fail "$configout, problem with running autoconf"
        return 0
     }
     return 1
@@ -43,8 +75,10 @@ proc autoconf_load_plus {args} {
     if {$status==0} {
        return 0
     }
+    # Eventually we might want to run configure with --verbose.
+    # In that case, we'll need to examine $exec_output more creatively.
     if [string match "*:*" "$exec_output"] then {
-       fail "$args, did not execute correctly"
+       fail "$args, problem with executing"
        return 0
     }
     return 1
@@ -53,23 +87,25 @@ proc autoconf_load_plus {args} {
 # Remove generated configuration files for test CONFIG.
 # Return 1 if successful, 0 if not.
 proc autoconf_remove {config} {
-    if [catch "exec rm -f $config $config.in conftest* config.status config.cache config.log"] {
+    if [catch "exec rm -f $config $config.in [glob -nocomplain conftest* confdummy*] config.status config.cache config.log"] {
        warning "$config output files, cannot remove"
        return 0
     }
     return 1
 }
 
-# The standard autoconf test: compile, run, and remove
-# a simple configure script.
+# The standard autoconf test: create, compile, run, and remove
+# a simple configure script to test a single macro.
+# TESTNAME is the name of the macro being tested.
+# CONTENTS is the body of the configure script to create and test.
 proc autoconf_test {testname contents} {
     if ![autoconf_remove $testname] {
        return 0
     }
-    if ![autoconf_create $testname.in "$contents"] {
+    if ![autoconf_create $testname "$contents"] {
        return 0
     }
-    if ![autoconf_start_plus $testname.in] {
+    if ![autoconf_start_plus $testname] {
        autoconf_remove $testname
        return 0
     }