From c0833df6e471053e721764b22c40dd95b324c543 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Wed, 1 Jun 2022 15:57:41 +0200 Subject: Update tools/test_scripts/testheaders.sh --- tools/test_scripts/testheaders.sh | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'tools') diff --git a/tools/test_scripts/testheaders.sh b/tools/test_scripts/testheaders.sh index b5f54411..927356e8 100755 --- a/tools/test_scripts/testheaders.sh +++ b/tools/test_scripts/testheaders.sh @@ -10,7 +10,7 @@ # tools/test_scripts/testheaders.sh -I glib glibmm-2.68 glib/glibmm/ustring.h # compile glibmm/glib/glibmm/ustring.h # Usage: testheaders.sh [-I]... [ | ]... -# -I is added to the g++ command. +# -I is added to the compiler flags. # is the name of the package, given to pkg-config. function usage() { @@ -18,7 +18,17 @@ function usage() { exit 1 } -extra_gcc_args=-std=c++17 +# Compiler, default: CXX=g++ +if test "x$CXX" = x +then + CXX=g++ +fi + +# Extra compiler flags, default: CXXFLAGS=-std=c++17 +if test "x$CXXFLAGS" = x +then + CXXFLAGS=-std=c++17 +fi # Search for directories to include in CFLAGS. idirs="" @@ -67,6 +77,7 @@ then echo "pkg-config failed" usage fi +echo CXX=$CXX, CXXFLAGS=$CXXFLAGS echo CFLAGS=$CFLAGS # Compile the specified files @@ -77,11 +88,10 @@ do for headerfile in $i/${i}mm/*.h do echo "=== $headerfile" - g++ -c -x c++ $extra_gcc_args -o /dev/null $headerfile $CFLAGS + $CXX -c -x c++ $CXXFLAGS -o /dev/null $headerfile $CFLAGS done else echo "=== $i" - g++ -c -x c++ $extra_gcc_args -o /dev/null $i $CFLAGS + $CXX -c -x c++ $CXXFLAGS -o /dev/null $i $CFLAGS fi done - -- cgit v1.2.1