]> sourceware.org Git - automake.git/commitdiff
* tests/defs (required): Handle `gcc' and `g++'; automatically
authorAlexandre Duret-Lutz <adl@gnu.org>
Tue, 18 Jun 2002 19:44:43 +0000 (19:44 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Tue, 18 Jun 2002 19:44:43 +0000 (19:44 +0000)
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++.

20 files changed:
ChangeLog
tests/ansi3.test
tests/ansi5.test
tests/ccnoco.test
tests/cond16.test
tests/cond18.test
tests/cond19.test
tests/cond4.test
tests/defs
tests/depcomp2.test
tests/depend2.test
tests/lex3.test
tests/pr220.test
tests/pr87.test
tests/subobj3.test
tests/subobj9.test
tests/substref.test
tests/target-cflags.test
tests/yacc4.test
tests/yaccvpath.test

index d6fd296e244363fd389634a9c105cc1093b4081d..5a7f7e7403da5014032223125d7502a751e2b8f1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2002-06-18  Alexandre Duret-Lutz  <duret_g@epita.fr>
+
+       * 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  <duret_g@epita.fr>
 
        * tests/defs (required): Handle `GNUmake'.
index 0f62ff91822d3b74c3774ecff7fa4b3733e98bfd..c716e772587c1295358f9584f4ba09519e140451 100755 (executable)
@@ -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
index 9659b4af712d0dccc33b643950177931a57a5b0f..fdc71260bc31b4208c4ab7a7e3a1883b034d539c 100755 (executable)
@@ -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
index 319f6ba98b8a4b8a2dc8cb4ffba5398e98d116c8..90b72515d49f1e8bdd2b45cbe9e5167ad19e91ae 100755 (executable)
@@ -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
 
index 43e4a68dd6ef1d12266be46838ea1f23ec6c9523..f7248b4673211c3c63801437988cac98eb0c6574 100755 (executable)
@@ -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
index 8cac3065215d5519b9c43e92dcff2bd0258ae14c..1e55e023a8ee3f6959ad95cfeb16f0264e00a04d 100755 (executable)
@@ -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
index 8108d29a7512b7c1f3e65eb05fbe24314fe6575b..4bcd22010a245ef9b56a455d8954d14676424ae8 100755 (executable)
@@ -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
index 15e89f86cb9d18e03646ac03b409cbd46d3f6791..3c64abffe9590db3e5c84eb029b7b947a0fbd304 100755 (executable)
@@ -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
index 684126ea6883b6c206bae0a50997b5bd9500d6ba..0946d124d643b319329604e1d51c5af396d3dcdc 100644 (file)
@@ -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
 
index 04c53e79f4a885ff903e9a20c9ea92b17bf6fe94..b4a784d1ae92780b4084820d43d05b6fc900b11c 100755 (executable)
@@ -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
index 41d547d1ffd7a37f28e94952e1ff0b697bde495d..0393279f819c9e37a0badb929f3d8b5f05d3d987 100755 (executable)
@@ -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
index be6c31d64d51a88a0ead193342ec061df3feeab9..82bc3b5cfcf59392f5c69b689fa193191f48fd41 100755 (executable)
@@ -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 ../..
index 1c8178b9ae02cf02a3d850bb292c010114b665bd..2626186f4f68fc4825a6465de4662ef0a8363c2f 100755 (executable)
@@ -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
index 80499e9398ff75f1a87aa42ad0068a2d9cea42d6..798ad52e0de5988c1db0f0999156920454b2409c 100755 (executable)
@@ -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
index e39ff558ec03f1cd3068cf2cee837c8a97d4a318..2b9c3015381498a96fd352fefa22bdb18d81dc2f 100755 (executable)
@@ -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
index db9c3773f61d5ae98df02781debd089d0f515777..56db81328ef1b55aed38311dc6c393526fdf6673 100755 (executable)
@@ -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
index 8dc7bca7291f94fa997100ba73315821ff188155..7aa3322812a2db5e537159e3b5bd3d40e1ca3bbd 100755 (executable)
@@ -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
index 14b1d6ce30c21fc00f6e1966af909b251cdd5b29..59850da18e84d8391db93a5da01d0f7f59db901a 100755 (executable)
@@ -3,7 +3,7 @@
 # Test to make sure target specific CFLAGS work
 # Assar Westerlund <assar@sics.se>
 
-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
index 95daef1a769c5528fb0b6ff2c498b9d4963f596a..a2f6c560494777b7da58621987b4db17e6386c6c 100755 (executable)
@@ -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'
index 923cc07845ed375bd160147d0db0d0fcdc550214..60e9caf73e89c3b94c03f4ff5fd5c11cd8204387 100755 (executable)
@@ -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'
This page took 0.054864 seconds and 5 git commands to generate.