From: Alexandre Duret-Lutz Date: Tue, 18 Jun 2002 19:44:43 +0000 (+0000) Subject: * tests/defs (required): Handle `gcc' and `g++'; automatically X-Git-Tag: Release-1-6b~56 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=dd129fba72d84912c3575317fc348d3a68cf6b53;p=automake.git * tests/defs (required): Handle `gcc' and `g++'; automatically export CC and CXX when they are required. * tests/ansi3.test, tests/ansi5.test, tests/ccnoco.test, tests/cond4.test, tests/cond16.test, tests/cond18.test, tests/cond19.test, tests/depcomp2.test, tests/depend2.test, tests/lex3.test, tests/pr87.test, tests/pr220.test, tests/substref.test, tests/target-cflags.test, tests/yacc4.test, tests/yaccvpath.test: Require gcc. Don't pass CC=gcc to configure. * tests/subobj9.test: Require g++. --- diff --git a/ChangeLog b/ChangeLog index d6fd296e..5a7f7e74 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2002-06-18 Alexandre Duret-Lutz + + * tests/defs (required): Handle `gcc' and `g++'; automatically + export CC and CXX when they are required. + * tests/ansi3.test, tests/ansi5.test, tests/ccnoco.test, + tests/cond4.test, tests/cond16.test, tests/cond18.test, + tests/cond19.test, tests/depcomp2.test, tests/depend2.test, + tests/lex3.test, tests/pr87.test, tests/pr220.test, + tests/substref.test, tests/target-cflags.test, tests/yacc4.test, + tests/yaccvpath.test: Require gcc. Don't pass CC=gcc to + configure. + * tests/subobj9.test: Require g++. + 2002-06-18 Alexandre Duret-Lutz * tests/defs (required): Handle `GNUmake'. diff --git a/tests/ansi3.test b/tests/ansi3.test index 0f62ff91..c716e772 100755 --- a/tests/ansi3.test +++ b/tests/ansi3.test @@ -3,6 +3,7 @@ # Actual test of ansi2knr functionality. Relies on existence # of working gcc. +required=gcc . $srcdir/defs || exit 1 cat > configure.in << 'END' @@ -28,9 +29,6 @@ main (int argc, char *argv[]) } END -# Likewise for gcc. -(gcc -v) > /dev/null 2>&1 || exit 77 - # Ignore user CFLAGS. CFLAGS= export CFLAGS diff --git a/tests/ansi5.test b/tests/ansi5.test index 9659b4af..fdc71260 100755 --- a/tests/ansi5.test +++ b/tests/ansi5.test @@ -2,6 +2,7 @@ # Test for ansi2knr in another directory. +required=gcc . $srcdir/defs || exit 1 cat > configure.in << 'END' @@ -48,8 +49,6 @@ main (int argc, char *argv[]) } END -(gcc -v) > /dev/null 2>&1 || exit 77 - set -e $ACLOCAL diff --git a/tests/ccnoco.test b/tests/ccnoco.test index 319f6ba9..90b72515 100755 --- a/tests/ccnoco.test +++ b/tests/ccnoco.test @@ -3,6 +3,7 @@ # Test to make sure we can compile when the compiler doesn't # understand `-c -o'. +required=gcc . $srcdir/defs || exit 1 cat > configure.1 << 'END' @@ -39,8 +40,6 @@ int main () } END -gcc -v || exit 77 - cat > Mycomp << 'END' #!/bin/sh diff --git a/tests/cond16.test b/tests/cond16.test index 43e4a68d..f7248b46 100755 --- a/tests/cond16.test +++ b/tests/cond16.test @@ -3,6 +3,7 @@ # Test for bug in conditionals in SOURCES with variable substitution references. # Report from Richard Boulton +required=gcc . $srcdir/defs || exit 1 cat > configure.in << 'END' @@ -32,8 +33,6 @@ echorule: END -(gcc -v) > /dev/null 2>&1 || exit 77 - # Ignore user CFLAGS. CFLAGS= export CFLAGS @@ -44,7 +43,7 @@ $ACLOCAL $AUTOCONF $AUTOMAKE -a -CC='gcc' ./configure +./configure val=`$MAKE -s echorule`; echo $val diff --git a/tests/cond18.test b/tests/cond18.test index 8cac3065..1e55e023 100755 --- a/tests/cond18.test +++ b/tests/cond18.test @@ -3,7 +3,7 @@ # Regression test for substitution references to conditional variables. # Report from Richard Boulton -required=GNUmake +required='GNUmake gcc' . $srcdir/defs || exit 1 cat > configure.in << 'END' @@ -39,8 +39,6 @@ echorule: bin_PROGRAMS = helldl END -(gcc -v) > /dev/null 2>&1 || exit 77 - # Ignore user CFLAGS. CFLAGS= export CFLAGS @@ -51,7 +49,7 @@ $ACLOCAL $AUTOCONF $AUTOMAKE -a -CC='gcc' ./configure +./configure val=`$MAKE --no-print-directory echorule`; echo $val diff --git a/tests/cond19.test b/tests/cond19.test index 8108d29a..4bcd2201 100755 --- a/tests/cond19.test +++ b/tests/cond19.test @@ -3,7 +3,7 @@ # Regression test for substitution references to conditional variables. # Report from Richard Boulton -required=GNUmake +required='GNUmake gcc' . $srcdir/defs || exit 1 cat > configure.in << 'END' @@ -41,8 +41,6 @@ echorule: bin_PROGRAMS = helldl END -(gcc -v) > /dev/null 2>&1 || exit 77 - # Ignore user CFLAGS. CFLAGS= export CFLAGS @@ -53,13 +51,13 @@ $ACLOCAL $AUTOCONF $AUTOMAKE -a -CONDITION1=true CONDITION2=true CC='gcc' ./configure +CONDITION1=true CONDITION2=true ./configure vala=`$MAKE --no-print-directory echorule`; -CONDITION1=true CONDITION2=false CC='gcc' ./configure +CONDITION1=true CONDITION2=false ./configure valb=`$MAKE --no-print-directory echorule`; -CONDITION1=false CONDITION2=true CC='gcc' ./configure +CONDITION1=false CONDITION2=true ./configure valc=`$MAKE --no-print-directory echorule`; -CONDITION1=false CONDITION2=false CC='gcc' ./configure +CONDITION1=false CONDITION2=false ./configure vald=`$MAKE --no-print-directory echorule`; echo $vala diff --git a/tests/cond4.test b/tests/cond4.test index 15e89f86..3c64abff 100755 --- a/tests/cond4.test +++ b/tests/cond4.test @@ -2,7 +2,7 @@ # Another sources-in-conditional test. Report from Tim Goodwin. -required=GNUmake +required='GNUmake gcc' . $srcdir/defs || exit 1 cat > configure.in << 'END' @@ -38,19 +38,18 @@ $AUTOMAKE || exit 1 test "`grep '^@TWO_FALSE@' Makefile.in | wc -l`" -eq 0 || exit 1 $AUTOCONF || exit 1 -(gcc -v) > /dev/null 2>&1 || exit 77 # Ignore user CFLAGS. CFLAGS= export CFLAGS -CC='gcc' CONDITION1=true CONDITION2=true ./configure || exit 1 +CONDITION1=true CONDITION2=true ./configure || exit 1 msgtt=`$MAKE --no-print-directory echo-objects` -CC='gcc' CONDITION1=true CONDITION2=false ./configure || exit 1 +CONDITION1=true CONDITION2=false ./configure || exit 1 msgtf=`$MAKE --no-print-directory echo-objects` -CC='gcc' CONDITION1=false CONDITION2=true ./configure || exit 1 +CONDITION1=false CONDITION2=true ./configure || exit 1 msgft=`$MAKE --no-print-directory echo-objects` -CC='gcc' CONDITION1=false CONDITION2=false ./configure || exit 1 +CONDITION1=false CONDITION2=false ./configure || exit 1 msgff=`$MAKE --no-print-directory echo-objects` echo $msgtt diff --git a/tests/defs b/tests/defs index 684126ea..0946d124 100644 --- a/tests/defs +++ b/tests/defs @@ -32,12 +32,33 @@ then echo "$me: running $MAKE --version" ( $MAKE --version ) || exit 77 ;; + gcc) + # When gcc is required, export `CC=gcc' so that ./configure + # always use it. This is important only when the user + # has defined CC in his environment, otherwise ./configure will + # prefer gcc to other compilers. + CC=gcc + export CC + echo "$me: running $CC --version" + ( $CC --version ) || exit 77 + ;; + g++) + CXX=g++ + export CXX + echo "$me: running $CXX --version" + ( $CXX --version ) || exit 77 + ;; # Generic case: the tool must support --version. *) echo "$me: running $tool --version" ( $tool --version ) || exit 77 ;; esac + # Additional variables to define if some $tool is required. + case $tool in + gcc) + ;; + esac done fi diff --git a/tests/depcomp2.test b/tests/depcomp2.test index 04c53e79..b4a784d1 100755 --- a/tests/depcomp2.test +++ b/tests/depcomp2.test @@ -3,6 +3,7 @@ # Test to make sure that depcomp is not used when it's not installed # From Pavel Roskin. +required=gcc . $srcdir/defs || exit 1 cat > configure.in << 'END' @@ -26,9 +27,6 @@ END : > subdir/foo.c -# Likewise for gcc. -(gcc -v) > /dev/null 2>&1 || exit 77 - # Ignore user CFLAGS. CFLAGS= export CFLAGS diff --git a/tests/depend2.test b/tests/depend2.test index 41d547d1..0393279f 100755 --- a/tests/depend2.test +++ b/tests/depend2.test @@ -4,6 +4,7 @@ # --disable-dependency-tracking. # Report from Robert Boehne +required=gcc . $srcdir/defs || exit 1 cat > configure.in << 'END' @@ -31,9 +32,6 @@ main (int argc, char *argv[]) } END -# Likewise for gcc. -(gcc -v) > /dev/null 2>&1 || exit 77 - set -e $ACLOCAL @@ -44,6 +42,6 @@ $AUTOMAKE -a CFLAGS= export CFLAGS -CC='gcc' ./configure --disable-dependency-tracking +./configure --disable-dependency-tracking $MAKE diff --git a/tests/lex3.test b/tests/lex3.test index be6c31d6..82bc3b5c 100755 --- a/tests/lex3.test +++ b/tests/lex3.test @@ -3,19 +3,13 @@ # Test associated with PR 19. # From Matthew D. Langston. -required=GNUmake +required='GNUmake gcc gzip' . $srcdir/defs || exit 1 -# Likewise for gcc. -(gcc -v) > /dev/null 2>&1 || exit 77 - # Ignore user CFLAGS. CFLAGS= export CFLAGS -# Likewise for gzip. -(gzip --version) > /dev/null 2>&1 || exit 77 - cat > configure.in << 'END' AC_INIT dnl Prevent automake from looking in .. and ../.. diff --git a/tests/pr220.test b/tests/pr220.test index 1c8178b9..2626186f 100755 --- a/tests/pr220.test +++ b/tests/pr220.test @@ -1,7 +1,7 @@ #! /bin/sh # Test for PR automake/220. - + required=gcc . $srcdir/defs || exit 1 @@ -43,5 +43,5 @@ $ACLOCAL \ cd build # configure should fail since we've done something invalid. -CC='gcc' ../configure && exit 1 +../configure && exit 1 exit 0 diff --git a/tests/pr87.test b/tests/pr87.test index 80499e93..798ad52e 100755 --- a/tests/pr87.test +++ b/tests/pr87.test @@ -3,7 +3,7 @@ # Test for PR automake/87. # Require GNU make for `make distcheck' -required=GNUmake +required='GNUmake gcc' . $srcdir/defs || exit 1 subdirs="foo bar" @@ -28,9 +28,6 @@ AC_PROG_CC AC_OUTPUT(Makefile `echo $subdirs | sed 's|\([a-z][a-z]*\)|\1/Makefile|g'`) EOF -# Likewise for gcc. -(gcc -v) > /dev/null 2>&1 || exit 77 - # Ignore user CFLAGS. CFLAGS= export CFLAGS @@ -57,5 +54,5 @@ $ACLOCAL \ done) < foo/Makefile.in || exit 1 cd build \ - && CC='gcc' ../configure \ + && ../configure \ && $MAKE distcheck || exit 1 diff --git a/tests/subobj3.test b/tests/subobj3.test index e39ff558..2b9c3015 100755 --- a/tests/subobj3.test +++ b/tests/subobj3.test @@ -2,6 +2,7 @@ # Test of subdir objects with C++. +required=gcc . $srcdir/defs || exit 1 cat > configure.in << 'END' @@ -32,9 +33,6 @@ main (int argc, char *argv[]) } END -# Likewise for gcc. -(gcc -v) > /dev/null 2>&1 || exit 77 - # Ignore user CFLAGS. CFLAGS= export CFLAGS @@ -44,6 +42,6 @@ export CFLAGS $ACLOCAL \ && $AUTOCONF \ && $AUTOMAKE -a \ - && CC='gcc' ./configure \ + && ./configure \ && ANSI2KNR=./ansi2knr U=_ $MAKE -e SHELL=/bin/sh \ && ./hello diff --git a/tests/subobj9.test b/tests/subobj9.test index db9c3773..56db8132 100755 --- a/tests/subobj9.test +++ b/tests/subobj9.test @@ -2,7 +2,7 @@ # Test for PR 312. -required='libtoolize gcc' +required='libtoolize g++' . $srcdir/defs || exit 1 cat > configure.in << 'END' @@ -36,6 +36,6 @@ $ACLOCAL $AUTOCONF $AUTOMAKE -a -./configure CXX=gcc +./configure $MAKE $MAKE distcheck diff --git a/tests/substref.test b/tests/substref.test index 8dc7bca7..7aa33228 100755 --- a/tests/substref.test +++ b/tests/substref.test @@ -4,6 +4,7 @@ # null. # Report from Richard Boulton +required=gcc . $srcdir/defs || exit 1 cat > configure.in << 'END' @@ -30,8 +31,6 @@ echorule: bin_PROGRAMS = helldl END -(gcc -v) > /dev/null 2>&1 || exit 77 - # Ignore user CFLAGS. CFLAGS= export CFLAGS diff --git a/tests/target-cflags.test b/tests/target-cflags.test index 14b1d6ce..59850da1 100755 --- a/tests/target-cflags.test +++ b/tests/target-cflags.test @@ -3,7 +3,7 @@ # Test to make sure target specific CFLAGS work # Assar Westerlund -required=GNUmake +required='GNUmake gcc' . $srcdir/defs || exit 1 cat > configure.in << 'END' @@ -38,9 +38,6 @@ int main(void) #endif END -# Likewise for gcc. -(gcc -v) > /dev/null 2>&1 || exit 77 - set -e $ACLOCAL diff --git a/tests/yacc4.test b/tests/yacc4.test index 95daef1a..a2f6c560 100755 --- a/tests/yacc4.test +++ b/tests/yacc4.test @@ -2,10 +2,9 @@ # Some simple tests of ylwrap functionality. +required=gcc . $srcdir/defs || exit 1 -# Likewise for some other tools. -(gcc -v) > /dev/null 2>&1 || exit 77 (bison -V) > /dev/null 2>&1 || exit 77 cat > configure.in << 'END' diff --git a/tests/yaccvpath.test b/tests/yaccvpath.test index 923cc078..60e9caf7 100755 --- a/tests/yaccvpath.test +++ b/tests/yaccvpath.test @@ -7,11 +7,9 @@ # to be distributed is up to date. # Require GNU make for `make distdir' -required=GNUmake +required='GNUmake gcc' . $srcdir/defs || exit 1 -# Likewise for some other tools. -(gcc -v) > /dev/null 2>&1 || exit 77 (bison -V) > /dev/null 2>&1 || exit 77 cat > configure.in << 'END'