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.
This commit is contained in:
Daniel Willmann 2019-02-13 17:58:25 +01:00 committed by Harald Welte
parent 8e07a4a8d6
commit f6c5da90f0
1 changed files with 8 additions and 1 deletions

View File

@ -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