[glibmm/glibmm-2-66] Update tools/test_scripts/testheaders.sh
- From: Kjell Ahlstedt <kjellahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glibmm/glibmm-2-66] Update tools/test_scripts/testheaders.sh
- Date: Wed, 1 Jun 2022 13:56:20 +0000 (UTC)
commit a84b807b88b55c633ddccd1ebe48357abc49d728
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date: Wed Jun 1 15:54:22 2022 +0200
Update tools/test_scripts/testheaders.sh
tools/test_scripts/testheaders.sh | 19 ++++++++++++++++---
1 file changed, 16 insertions(+), 3 deletions(-)
---
diff --git a/tools/test_scripts/testheaders.sh b/tools/test_scripts/testheaders.sh
index fe01c927..abafc158 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.4 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,6 +18,18 @@ function usage() {
exit 1
}
+# Compiler, default: CXX=g++
+if test "x$CXX" = x
+then
+ CXX=g++
+fi
+
+# Extra compiler flags, default: CXXFLAGS=-std=c++11
+if test "x$CXXFLAGS" = x
+then
+ CXXFLAGS=-std=c++11
+fi
+
# Search for directories to include in CFLAGS.
idirs=""
while [ $# -gt 0 ]
@@ -65,6 +77,7 @@ then
echo "pkg-config failed"
usage
fi
+echo CXX=$CXX, CXXFLAGS=$CXXFLAGS
echo CFLAGS=$CFLAGS
# Compile the specified files
@@ -75,11 +88,11 @@ do
for headerfile in $i/${i}mm/*.h
do
echo "=== $headerfile"
- g++ -c -x c++ -std=c++11 -o /dev/null $headerfile $CFLAGS
+ $CXX -c -x c++ $CXXFLAGS -o /dev/null $headerfile $CFLAGS
done
else
echo "=== $i"
- g++ -c -x c++ -std=c++11 -o /dev/null $i $CFLAGS
+ $CXX -c -x c++ $CXXFLAGS -o /dev/null $i $CFLAGS
fi
done
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]