-e 's|@PERL[@]|$(PERL)|g' \
-e 's|@EGREP[@]|$(EGREP)|g' \
-e 's|@FGREP[@]|$(FGREP)|g' \
+ -e 's|@CPPFLAGS[@]|$(CPPFLAGS)|g' \
+ -e 's|@CC[@]|$(CC)|g' \
+ -e 's|@CFLAGS[@]|$(CFLAGS)|g' \
+ -e 's|@CXX[@]|$(CXX)|g' \
+ -e 's|@CXXFLAGS[@]|$(CXXFLAGS)|g' \
+ -e 's|@F77[@]|$(F77)|g' \
+ -e 's|@FFLAGS[@]|$(FFLAGS)|g' \
+ -e 's|@FC[@]|$(FC)|g' \
+ -e 's|@FCFLAGS[@]|$(FCFLAGS)|g' \
-e 's|@GNU_CFLAGS[@]|$(GNU_CFLAGS)|g' \
-e 's|@GNU_CXXFLAGS[@]|$(GNU_CXXFLAGS)|g' \
-e 's|@GNU_FFLAGS[@]|$(GNU_FFLAGS)|g' \
case $tool in
:) ;;
cc)
- test "$CC" = false && skip_all_ "no C compiler available";;
+ test "$CC" = false && skip_all_ "no C compiler available"
+ export CC CFLAGS CPPFLAGS
+ ;;
c++)
- test "$CXX" = false && skip_all_ "no C++ compiler available";;
+ test "$CXX" = false && skip_all_ "no C++ compiler available"
+ export CXX CXXFLAGS CPPFLAGS
+ ;;
fortran)
- test "$FC" = false && skip_all_ "no Fortran compiler available";;
+ test "$FC" = false && skip_all_ "no Fortran compiler available"
+ export FC FCFLAGS
+ ;;
fortran77)
- test "$F77" = false && skip_all_ "no Fortran 77 compiler available";;
+ test "$F77" = false && skip_all_ "no Fortran 77 compiler available"
+ export F77 FFLAGS
+ ;;
xsi-shell)
require_xsi "$SHELL";;
xsi-bin-sh)
;;
cl)
CC=cl
- export CC
+ # Don't export CFLAGS, as that could have been initialized to only
+ # work with the C compiler detected at configure time. If the user
+ # wants CFLAGS to also influence `cl', he can still export CFLAGS
+ # in the environment "by hand" before calling the testsuite.
+ export CC CPPFLAGS
echo "$me: running $CC -?"
$CC -? || skip_all_ "Microsoft C compiler \`$CC' not available"
;;
# prefer gcc to other compilers.
CC=${am__tool_prefix}gcc
CFLAGS=$GNU_CFLAGS
- export CC CFLAGS
+ export CC CFLAGS CPPFLAGS
echo "$me: running $CC --version"
$CC --version || skip_all_ "GNU C compiler not available"
echo "$me: running $CC -v"
g++)
CXX=${am__tool_prefix}g++
CXXFLAGS=$GNU_CXXFLAGS
- export CXX CXXFLAGS
+ export CXX CXXFLAGS CPPFLAGS
echo "$me: running $CXX --version"
$CXX --version || skip_all_ "GNU C++ compiler not available"
echo "$me: running $CXX -v"
;;
icc)
CC=icc
- export CC
+ export CC CPPFLAGS # But not CFLAGS (see comments for `cl' above).
# There is no way to ask *only* the compiler's version.
# This tool always wants to do something (by default
# it will try link *nothing* and complain it cannot find
EGREP=${AM_TESTSUITE_EGREP-'@EGREP@'}
FGREP=${AM_TESTSUITE_FGREP-'@FGREP@'}
+# Compilers and their flags. These can point to non-GNU compilers (and
+# on non-Linux and non-BSD systems, they probably will).
+CC=${AM_TESTSUITE_CC-${CC-'@CC@'}}
+CXX=${AM_TESTSUITE_CXX-${CXX-'@CXX@'}}
+F77=${AM_TESTSUITE_F77-${F77-'@F77@'}}
+FC=${AM_TESTSUITE_FC-${FC-'@FC@'}}
+CFLAGS=${AM_TESTSUITE_CFLAGS-${CFLAGS-'@CFLAGS@'}}
+CXXFLAGS=${AM_TESTSUITE_CXXFLAGS-${CXXFLAGS-'@CXXFLAGS@'}}
+FCFLAGS=${AM_TESTSUITE_FCFLAGS-${FCFLAGS-'@FCFLAGS@'}}
+FFLAGS=${AM_TESTSUITE_FFLAGS-${FFLAGS-'@FFLAGS@'}}
+CPPFLAGS=${AM_TESTSUITE_CPPFLAGS-${CPPFLAGS-'@CPPFLAGS@'}}
+
# Flags for the GNU compilers.
GNU_FFLAGS=${AM_TESTSUITE_GNU_FFLAGS-${GNU_FFLAGS-'@GNU_FFLAGS@'}}
GNU_FCFLAGS=${AM_TESTSUITE_GNU_FCFLAGS-${GNU_FCFLAGS-'@GNU_FCFLAGS@'}}