diff options
author | Daniel Willmann <dwillmann@sysmocom.de> | 2019-02-13 17:58:25 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2019-02-15 07:49:54 +0000 |
commit | f6c5da90f00b38aed885c840fe72827f3060a684 (patch) | |
tree | a76a43e690dbc4816a794c60535b06d96f8468a4 | |
parent | 8e07a4a8d6b85e1bd211a74adb04fadd1011cd03 (diff) |
Fix compilation on eclipse-titan 6.5.1
Newer eclipse-titan makefilegen already sets CPPFLAGS like this:
CPPFLAGS = -D$(PLATFORM) -I$(TTCN3_DIR)/include$(TTCN3_SUBDIR)
where TTCN3_SUBDIR expands to '/titan' and TTCN3_DIR to '/usr'
If we add /titan after include we end up with
-I/usr/include/titan/titan/ which will cause the compile to fail due to
a missing TTCN3.hh include.
Check the titan version so we retain backwards compatibility.
Change-Id: If9fef29ce243be112d3735f0236335197f8f140f
Related: OS#3179
Sponsored-by: On-Waves ehf.
-rwxr-xr-x | regen-makefile.sh | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/regen-makefile.sh b/regen-makefile.sh index 5a4dd4c1..77fcb6c4 100755 --- a/regen-makefile.sh +++ b/regen-makefile.sh @@ -25,13 +25,20 @@ if [ -z "$USE_CCACHE" ] && which ccache 2>/dev/null; then fi ttcn3_makefilegen -p -l -f $* + +TITAN_VERSION=$(ttcn3_makefilegen -v 2>&1 |grep "Product number" |cut --delimiter="/" -f 2-| sed -e "s/[A-Z ]//g") + 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 # The -DMAKEDEPEND_RUN is a workaround for Debian packaging issue, # see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=879816 for details -sed -i -e 's/CPPFLAGS = -D$(PLATFORM) -I$(TTCN3_DIR)\/include/CPPFLAGS = -D$(PLATFORM) -DMAKEDEPEND_RUN -DUSE_SCTP -I$(TTCN3_DIR)\/include -I\/usr\/include\/titan/' Makefile +if [ $(($TITAN_VERSION >= 65)) = 1 ]; then + sed -i -e 's/CPPFLAGS = -D$(PLATFORM)/CPPFLAGS = -D$(PLATFORM) -DMAKEDEPEND_RUN -DUSE_SCTP/' Makefile +else + sed -i -e 's/CPPFLAGS = -D$(PLATFORM) -I$(TTCN3_DIR)\/include/CPPFLAGS = -D$(PLATFORM) -DMAKEDEPEND_RUN -DUSE_SCTP -I$(TTCN3_DIR)\/include -I\/usr\/include\/titan/' Makefile +fi #remove -Wall from CXXFLAGS: we're not interested in generic warnings for autogenerated code cluttering the logs sed -i -e 's/-Wall//' Makefile |