[MERGED] osmo-ttcn3-hacks[master]: generalize shared code from regen_makefile.sh into shared he...

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Wed Dec 13 00:07:02 UTC 2017


Harald Welte has submitted this change and it was merged.

Change subject: generalize shared code from regen_makefile.sh into shared helper script
......................................................................


generalize shared code from regen_makefile.sh into shared helper script

Change-Id: I86a738420851a7d9e3bdb2671f6862c3d505a4ba
---
M bsc-nat/regen_makefile.sh
M bsc/regen_makefile.sh
M ggsn_tests/regen_makefile.sh
M gprs_gb/regen_makefile.sh
M lapdm/regen_makefile.sh
M mgw/regen_makefile.sh
M msc_tests/regen_makefile.sh
A regen-makefile.sh
M selftest/regen_makefile.sh
M sysinfo/regen_makefile.sh
10 files changed, 29 insertions(+), 81 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/bsc-nat/regen_makefile.sh b/bsc-nat/regen_makefile.sh
index 6d0ac12..a3c6243 100755
--- a/bsc-nat/regen_makefile.sh
+++ b/bsc-nat/regen_makefile.sh
@@ -4,12 +4,4 @@
 
 FILES="*.ttcn SCCP_EncDec.cc IPA_CodecPort_CtrlFunctDef.cc IPL4asp_PT.cc IPL4asp_discovery.cc TCCConversion.cc TCCInterface.cc RTP_EncDec.cc SDP_EncDec.cc *.c MGCP_CodecPort_CtrlFunctDef.cc"
 
-ttcn3_makefilegen -l -f $MAIN $FILES
-sed -i -e 's/# TTCN3_DIR = /TTCN3_DIR = \/usr/' Makefile
-sed -i -e 's/LDFLAGS = /LDFLAGS = -L \/usr\/lib\/titan /' Makefile
-#sed -i -e 's/TTCN3_LIB = ttcn3-parallel/TTCN3_LIB = ttcn3/' Makefile
-sed -i -e 's/CPPFLAGS = -D$(PLATFORM) -I$(TTCN3_DIR)\/include/CPPFLAGS = -D$(PLATFORM) -I$(TTCN3_DIR)\/include -I\/usr\/include\/titan/' Makefile
-
-# for TITAN 6.3.0
-sed -i -e 's/TTCN3_DIR = $/TTCN3_DIR = \/usr/' Makefile
-sed -i -e 's/\/bin\/compiler/\/bin\/ttcn3_compiler/' Makefile
+../regen-makefile.sh $MAIN $FILES
diff --git a/bsc/regen_makefile.sh b/bsc/regen_makefile.sh
index 4e334d5..8b8fa43 100755
--- a/bsc/regen_makefile.sh
+++ b/bsc/regen_makefile.sh
@@ -4,12 +4,4 @@
 
 FILES="*.ttcn IPA_CodecPort_CtrlFunctDef.cc IPL4asp_PT.cc IPL4asp_discovery.cc TCCConversion.cc TCCInterface.cc SCTPasp_PT.cc RTP_EncDec.cc SDP_EncDec.cc *.c"
 
-ttcn3_makefilegen -l -f $MAIN $FILES
-sed -i -e 's/# TTCN3_DIR = /TTCN3_DIR = \/usr/' Makefile
-sed -i -e 's/LDFLAGS = /LDFLAGS = -L \/usr\/lib\/titan /' Makefile
-#sed -i -e 's/TTCN3_LIB = ttcn3-parallel/TTCN3_LIB = ttcn3/' Makefile
-sed -i -e 's/CPPFLAGS = -D$(PLATFORM) -I$(TTCN3_DIR)\/include/CPPFLAGS = -D$(PLATFORM) -I$(TTCN3_DIR)\/include -I\/usr\/include\/titan/' Makefile
-
-# for TITAN 6.3.0
-sed -i -e 's/TTCN3_DIR = $/TTCN3_DIR = \/usr/' Makefile
-sed -i -e 's/\/bin\/compiler/\/bin\/ttcn3_compiler/' Makefile
+../regen-makefile.sh $MAIN $FILES
diff --git a/ggsn_tests/regen_makefile.sh b/ggsn_tests/regen_makefile.sh
index cd2d95a..3970187 100755
--- a/ggsn_tests/regen_makefile.sh
+++ b/ggsn_tests/regen_makefile.sh
@@ -2,12 +2,4 @@
 
 FILES="*.ttcn IPL4asp_PT.cc  IPL4asp_discovery.cc  TCCConversion.cc  TCCInterface.cc GTPC_EncDec.cc GTPU_EncDec.cc GTP_CodecPort_CtrlFunctDef.cc ICMPv6_EncDec.cc IP_EncDec.cc Native_FunctionDefs.cc UDP_EncDec.cc"
 
-ttcn3_makefilegen -l -f GGSN_Tests.ttcn $FILES
-sed -i -e 's/# TTCN3_DIR = /TTCN3_DIR = \/usr/' Makefile
-sed -i -e 's/LDFLAGS = /LDFLAGS = -L \/usr\/lib\/titan /' Makefile
-#sed -i -e 's/TTCN3_LIB = ttcn3-parallel/TTCN3_LIB = ttcn3/' Makefile
-sed -i -e 's/CPPFLAGS = -D$(PLATFORM) -I$(TTCN3_DIR)\/include/CPPFLAGS = -D$(PLATFORM) -I$(TTCN3_DIR)\/include -I\/usr\/include\/titan/' Makefile
-
-# for TITAN 6.3.0
-sed -i -e 's/TTCN3_DIR = $/TTCN3_DIR = \/usr/' Makefile
-sed -i -e 's/\/bin\/compiler/\/bin\/ttcn3_compiler/' Makefile
+../regen-makefile.sh GGSN_Tests.ttcn $FILES
diff --git a/gprs_gb/regen_makefile.sh b/gprs_gb/regen_makefile.sh
index 72fc632..b883d1e 100755
--- a/gprs_gb/regen_makefile.sh
+++ b/gprs_gb/regen_makefile.sh
@@ -2,12 +2,4 @@
 
 FILES="*.ttcn BSSGP_Helper.cc IPL4asp_PT.cc IPL4asp_discovery.cc TCCConversion.cc TCCInterface.cc NS_CodecPort_CtrlFunctDef.cc UD_PT.cc RLCMAC_EncDec.cc"
 
-ttcn3_makefilegen -f Test.ttcn $FILES
-sed -i -e 's/# TTCN3_DIR = /TTCN3_DIR = \/usr/' Makefile
-sed -i -e 's/LDFLAGS = /LDFLAGS = -L \/usr\/lib\/titan/' Makefile
-#sed -i -e 's/TTCN3_LIB = ttcn3-parallel/TTCN3_LIB = ttcn3/' Makefile
-sed -i -e 's/CPPFLAGS = -D$(PLATFORM) -I$(TTCN3_DIR)\/include/CPPFLAGS = -D$(PLATFORM) -I$(TTCN3_DIR)\/include -I\/usr\/include\/titan/' Makefile
-
-# for TITAN 6.3.0
-sed -i -e 's/TTCN3_DIR = $/TTCN3_DIR = \/usr/' Makefile
-sed -i -e 's/\/bin\/compiler/\/bin\/ttcn3_compiler/' Makefile
+../regen-makefile.sh Test.ttcn $FILES
diff --git a/lapdm/regen_makefile.sh b/lapdm/regen_makefile.sh
index c80b094..c3601c8 100755
--- a/lapdm/regen_makefile.sh
+++ b/lapdm/regen_makefile.sh
@@ -2,12 +2,4 @@
 
 FILES="*.ttcn UD_PT.cc UD_PT.hh RLCMAC_EncDec.cc"
 
-ttcn3_makefilegen -f L1CTL_Test.ttcn $FILES
-sed -i -e 's/# TTCN3_DIR = /TTCN3_DIR = \/usr/' Makefile
-sed -i -e 's/LDFLAGS = /LDFLAGS = -L \/usr\/lib\/titan `pkg-config --libs libnetfilter_conntrack`/' Makefile
-#sed -i -e 's/TTCN3_LIB = ttcn3-parallel/TTCN3_LIB = ttcn3/' Makefile
-sed -i -e 's/CPPFLAGS = -D$(PLATFORM) -I$(TTCN3_DIR)\/include/CPPFLAGS = -D$(PLATFORM) -I$(TTCN3_DIR)\/include -I\/usr\/include\/titan/' Makefile
-
-# for TITAN 6.3.0
-sed -i -e 's/TTCN3_DIR = $/TTCN3_DIR = \/usr/' Makefile
-sed -i -e 's/\/bin\/compiler/\/bin\/ttcn3_compiler/' Makefile
+../regen-makefile.sh L1CTL_Test.ttcn $FILES
diff --git a/mgw/regen_makefile.sh b/mgw/regen_makefile.sh
index 30f8c33..9b94d69 100755
--- a/mgw/regen_makefile.sh
+++ b/mgw/regen_makefile.sh
@@ -2,12 +2,4 @@
 
 FILES="*.ttcn SDP_EncDec.cc *.c MGCP_CodecPort_CtrlFunctDef.cc IPL4asp_PT.cc IPL4asp_discovery.cc TCCConversion.cc TCCInterface.cc RTP_EncDec.cc RTP_CodecPort_CtrlFunctDef.cc"
 
-ttcn3_makefilegen -l -f MGCP_Test.ttcn $FILES
-sed -i -e 's/# TTCN3_DIR = /TTCN3_DIR = \/usr/' Makefile
-sed -i -e 's/LDFLAGS = /LDFLAGS = -L \/usr\/lib\/titan /' Makefile
-#sed -i -e 's/TTCN3_LIB = ttcn3-parallel/TTCN3_LIB = ttcn3/' Makefile
-sed -i -e 's/CPPFLAGS = -D$(PLATFORM) -I$(TTCN3_DIR)\/include/CPPFLAGS = -D$(PLATFORM) -I$(TTCN3_DIR)\/include -I\/usr\/include\/titan/' Makefile
-
-# for TITAN 6.3.0
-sed -i -e 's/TTCN3_DIR = $/TTCN3_DIR = \/usr/' Makefile
-sed -i -e 's/\/bin\/compiler/\/bin\/ttcn3_compiler/' Makefile
+../regen-makefile.sh MGCP_Test.ttcn $FILES
diff --git a/msc_tests/regen_makefile.sh b/msc_tests/regen_makefile.sh
index 7db539d..132da3b 100755
--- a/msc_tests/regen_makefile.sh
+++ b/msc_tests/regen_makefile.sh
@@ -2,12 +2,4 @@
 
 FILES="*.ttcn SCCP_EncDec.cc  SCTPasp_PT.cc  TCCConversion.cc TCCInterface.cc"
 
-ttcn3_makefilegen -l -f MSC_Tests.ttcn $FILES
-sed -i -e 's/# TTCN3_DIR = /TTCN3_DIR = \/usr/' Makefile
-sed -i -e 's/LDFLAGS = /LDFLAGS = -L \/usr\/lib\/titan /' Makefile
-#sed -i -e 's/TTCN3_LIB = ttcn3-parallel/TTCN3_LIB = ttcn3/' Makefile
-sed -i -e 's/CPPFLAGS = -D$(PLATFORM) -I$(TTCN3_DIR)\/include/CPPFLAGS = -D$(PLATFORM) -I$(TTCN3_DIR)\/include -I\/usr\/include\/titan/' Makefile
-
-# for TITAN 6.3.0
-sed -i -e 's/TTCN3_DIR = $/TTCN3_DIR = \/usr/' Makefile
-sed -i -e 's/\/bin\/compiler/\/bin\/ttcn3_compiler/' Makefile
+../regen-makefile.sh MSC_Tests.ttcn $FILES
diff --git a/regen-makefile.sh b/regen-makefile.sh
new file mode 100755
index 0000000..1814699
--- /dev/null
+++ b/regen-makefile.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+# Wrapper around the TITAN make file generator to work in Debian.
+#
+# TITAN has a makefile generator, but somehow Debian seems to install
+# the binaries to different paths without patching the make file
+# generator, leading in inconsistent non-working Makefiles.
+#
+# The regexes below patch the generated Makefile to work on Debian 9 and
+# unstable, so far tested with TITAN 6.1.0, 6.2.0 and 6.3.0
+
+ttcn3_makefilegen -l -f $*
+sed -i -e 's/# TTCN3_DIR = /TTCN3_DIR = \/usr/' Makefile
+sed -i -e 's/LDFLAGS = /LDFLAGS = -L \/usr\/lib\/titan /' Makefile
+#sed -i -e 's/TTCN3_LIB = ttcn3-parallel/TTCN3_LIB = ttcn3/' Makefile
+sed -i -e 's/CPPFLAGS = -D$(PLATFORM) -I$(TTCN3_DIR)\/include/CPPFLAGS = -D$(PLATFORM) -I$(TTCN3_DIR)\/include -I\/usr\/include\/titan/' Makefile
+
+# for TITAN 6.3.0
+sed -i -e 's/TTCN3_DIR = $/TTCN3_DIR = \/usr/' Makefile
+sed -i -e 's/\/bin\/compiler/\/bin\/ttcn3_compiler/' Makefile
diff --git a/selftest/regen_makefile.sh b/selftest/regen_makefile.sh
index 086441b..eefda49 100755
--- a/selftest/regen_makefile.sh
+++ b/selftest/regen_makefile.sh
@@ -4,12 +4,4 @@
 
 FILES="*.ttcn IPA_CodecPort_CtrlFunctDef.cc IPL4asp_PT.cc IPL4asp_discovery.cc TCCConversion.cc TCCInterface.cc SDP_EncDec.cc *.c"
 
-ttcn3_makefilegen -l -f $MAIN $FILES
-sed -i -e 's/# TTCN3_DIR = /TTCN3_DIR = \/usr/' Makefile
-sed -i -e 's/LDFLAGS = /LDFLAGS = -L \/usr\/lib\/titan /' Makefile
-#sed -i -e 's/TTCN3_LIB = ttcn3-parallel/TTCN3_LIB = ttcn3/' Makefile
-sed -i -e 's/CPPFLAGS = -D$(PLATFORM) -I$(TTCN3_DIR)\/include/CPPFLAGS = -D$(PLATFORM) -I$(TTCN3_DIR)\/include -I\/usr\/include\/titan/' Makefile
-
-# for TITAN 6.3.0
-sed -i -e 's/TTCN3_DIR = $/TTCN3_DIR = \/usr/' Makefile
-sed -i -e 's/\/bin\/compiler/\/bin\/ttcn3_compiler/' Makefile
+../regen-makefile.sh $MAIN $FILES
diff --git a/sysinfo/regen_makefile.sh b/sysinfo/regen_makefile.sh
index e06b8f5..9dd3b7f 100755
--- a/sysinfo/regen_makefile.sh
+++ b/sysinfo/regen_makefile.sh
@@ -2,12 +2,4 @@
 
 FILES="*.ttcn IPL4asp_PT.cc IPL4asp_discovery.cc TCCConversion.cc TCCInterface.cc IPL4_GSMTAP_CtrlFunctDef.cc TELNETasp_PT.cc"
 
-ttcn3_makefilegen -l -f Test.ttcn $FILES
-sed -i -e 's/# TTCN3_DIR = /TTCN3_DIR = \/usr/' Makefile
-sed -i -e 's/LDFLAGS = /LDFLAGS = -L \/usr\/lib\/titan /' Makefile
-#sed -i -e 's/TTCN3_LIB = ttcn3-parallel/TTCN3_LIB = ttcn3/' Makefile
-sed -i -e 's/CPPFLAGS = -D$(PLATFORM) -I$(TTCN3_DIR)\/include/CPPFLAGS = -D$(PLATFORM) -I$(TTCN3_DIR)\/include -I\/usr\/include\/titan/' Makefile
-
-# for TITAN 6.3.0
-sed -i -e 's/TTCN3_DIR = $/TTCN3_DIR = \/usr/' Makefile
-sed -i -e 's/\/bin\/compiler/\/bin\/ttcn3_compiler/' Makefile
+../regen-makefile.sh Test.ttcn $FILES

-- 
To view, visit https://gerrit.osmocom.org/5307
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I86a738420851a7d9e3bdb2671f6862c3d505a4ba
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list