* tests/defs (required): Handle `gcc' and `g++'; automatically
authorAlexandre Duret-Lutz <adl@gnu.org>
Tue, 18 Jun 2002 19:44:48 +0000 (19:44 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Tue, 18 Jun 2002 19:44:48 +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 d6fd296..5a7f7e7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,18 @@
 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'.
        (needs_gnu_make): Don't define anymore.
        * tests/cond4.test, tests/cond18.test, tests/cond19.test,
index 0f62ff9..c716e77 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 9659b4a..fdc7126 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 319f6ba..90b7251 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 43e4a68..f7248b4 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 8cac306..1e55e02 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 8108d29..4bcd220 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 15e89f8..3c64abf 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 684126e..0946d12 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 04c53e7..b4a784d 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 41d547d..0393279 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 be6c31d..82bc3b5 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 1c8178b..2626186 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 80499e9..798ad52 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 e39ff55..2b9c301 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 db9c377..56db813 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 8dc7bca..7aa3322 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 14b1d6c..59850da 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 95daef1..a2f6c56 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 923cc07..60e9caf 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'