summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKjell Ahlstedt <kjellahlstedt@gmail.com>2022-06-01 15:57:41 +0200
committerKjell Ahlstedt <kjellahlstedt@gmail.com>2022-06-01 15:57:41 +0200
commitc0833df6e471053e721764b22c40dd95b324c543 (patch)
treee5266be080632c35032f681b1012580040f0cecc
parentb43b1aee2857ce16b68b1860acf0bd7631639f14 (diff)
downloadglibmm-c0833df6e471053e721764b22c40dd95b324c543.tar.gz
Update tools/test_scripts/testheaders.sh
-rwxr-xr-xtools/test_scripts/testheaders.sh20
1 files changed, 15 insertions, 5 deletions
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<dir>]... <pkg> [<dir> | <file>]...
-# -I<dir> is added to the g++ command.
+# -I<dir> is added to the compiler flags.
# <pkg> 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
-