osmith has uploaded this change for review.
s1gw: titan 11.2.1: use --legacy-template-subrefs
Add the flag if running with a ttcn3_compiler version that supports it
and omit it otherwise.
Related: https://gitlab.eclipse.org/eclipse/titan/titan.core/-/work_items/798
Change-Id: I918b814f33a9db8614961ebddb3a7ad1adfebf99
---
M _buildsystem/regen_makefile.inc.sh
M s1gw/regen_makefile.sh
2 files changed, 35 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/26/43926/1
diff --git a/_buildsystem/regen_makefile.inc.sh b/_buildsystem/regen_makefile.inc.sh
index f9dcfe6..b68e244 100644
--- a/_buildsystem/regen_makefile.inc.sh
+++ b/_buildsystem/regen_makefile.inc.sh
@@ -65,6 +65,36 @@
fi
#
+# Add options to ttcn3_compiler if they are supported
+#
+add_ttcn3_compiler_opts_if_supported() {
+ local i
+ local add_flags=""
+
+ if [ -z "$REGEN_MAKEFILE_ADD_TTCN3_COMPILER_FLAGS_IF_SUPPORTED" ]; then
+ return
+ fi
+
+ for i in $REGEN_MAKEFILE_ADD_TTCN3_COMPILER_FLAGS_IF_SUPPORTED; do
+ if ttcn3_compiler --help 2>&1 | grep -q -- "$i"; then
+ echo "Using ttcn3_compiler flag: $i"
+ add_flags="$add_flags $i"
+ else
+ echo "Unsupported ttcn3_compiler flag: $i"
+ fi
+ done
+
+ sed -i "s/COMPILER_FLAGS = /COMPILER_FLAGS = $add_flags /" Makefile
+
+ if ! grep -q "COMPILER_FLAGS = $add_flags " Makefile; then
+ echo "ERROR: failed to add compiler flags: $add_flags"
+ exit 1
+ fi
+}
+
+add_ttcn3_compiler_opts_if_supported
+
+#
# Make output more readable (skip with make V=1)
#
diff --git a/s1gw/regen_makefile.sh b/s1gw/regen_makefile.sh
index 01f5cd4..fbcfa43 100755
--- a/s1gw/regen_makefile.sh
+++ b/s1gw/regen_makefile.sh
@@ -22,4 +22,9 @@
TCCInterface.cc
"
+# https://gitlab.eclipse.org/eclipse/titan/titan.core/-/work_items/798
+REGEN_MAKEFILE_ADD_TTCN3_COMPILER_FLAGS_IF_SUPPORTED="
+ --legacy-template-subrefs
+"
+
. ../_buildsystem/regen_makefile.inc.sh
To view, visit change 43926. To unsubscribe, or for help writing mail filters, visit settings.