attempt to fix parallel build, improve AM logic

The formerly existing make rule caused a race condition in parallel builds and
wrongly stated the .c files as targets, which caused make to execute the
rule twice (once for each target). This was actually only fallout of the
attempt to express the fact that those two files are generated by the rule.

The generated file ranap_ies_defs.h was moved by one make job, another
job then tried to access the file in the old location and failed.

parallel build verified with:
$ for i in $(seq 1 10)
do
	echo "XXXX iteration $i"
	git clean -xfd
	autoreconf -i
	./configure
	make -j${i} || break
done

Coauthored by Andreas Rottmann <mail@rotty.xx.vu>

Change-Id: I439edcb4b7742de861c99ed401114f51061f8088
Reviewed-on: https://gerrit.osmocom.org/65
Tested-by: Jenkins Builder
Reviewed-by: Harald Welte <laforge@gnumonks.org>
changes/65/65/3
Alexander Huemer 7 years ago committed by Holger Freyther
parent fd666890f7
commit 156fa393fc
  1. 2
      .gitignore
  2. 6
      contrib/jenkins.sh
  3. 2967
      include/osmocom/ranap/ranap_ies_defs.h
  4. 5
      src/Makefile.am

2
.gitignore vendored

@ -35,3 +35,5 @@ src/osmo-hnbgw
tags
libosmo-ranap.pc
m4
gen_ranap.stamp
include/osmocom/ranap/ranap_ies_defs.h

@ -55,10 +55,10 @@ PKG_CONFIG_PATH=$PWD/..//install/lib/pkgconfig:$PKG_CONFIG_PATH $MAKE $PARALLEL_
cd ../../
autoreconf --install --force
PKG_CONFIG_PATH=$PWD/deps/install/lib/pkgconfig:$PKG_CONFIG_PATH ./configure
PKG_CONFIG_PATH=$PWD/deps/install/lib/pkgconfig:$PKG_CONFIG_PATH $MAKE
PKG_CONFIG_PATH=$PWD/deps/install/lib/pkgconfig:$PKG_CONFIG_PATH $MAKE $PARALLEL_MAKE
PKG_CONFIG_PATH=$PWD/deps/install/lib/pkgconfig:$PKG_CONFIG_PATH LD_LIBRARY_PATH=$PWD/deps/install/lib $MAKE check
# distcheck is broken
#PKG_CONFIG_PATH=$PWD/deps/install/lib/pkgconfig:$PKG_CONFIG_PATH LD_LIBRARY_PATH=$PWD/deps/install/lib $MAKE distcheck
PATH=$PWD/deps/install/bin:$PATH PKG_CONFIG_PATH=$PWD/deps/install/lib/pkgconfig:$PKG_CONFIG_PATH $MAKE -C src regen
PKG_CONFIG_PATH=$PWD/deps/install/lib/pkgconfig:$PKG_CONFIG_PATH $MAKE
PATH=$PWD/deps/install/bin:$PATH PKG_CONFIG_PATH=$PWD/deps/install/lib/pkgconfig:$PKG_CONFIG_PATH $MAKE $PARALLEL_MAKE -C src regen
PKG_CONFIG_PATH=$PWD/deps/install/lib/pkgconfig:$PKG_CONFIG_PATH $MAKE $PARALLEL_MAKE
PKG_CONFIG_PATH=$PWD/deps/install/lib/pkgconfig:$PKG_CONFIG_PATH LD_LIBRARY_PATH=$PWD/deps/install/lib $MAKE check

File diff suppressed because it is too large Load Diff

@ -3,7 +3,7 @@ SUBDIRS = hnbap rua ranap tests
# Build {hnbap,rua,ranap}_{encoder,decoder}.c using asn1tostruct
ASN1_ROOT = $(top_builddir)/asn1/
ASN1TOSTRUCT = $(ASN1_ROOT)/utils/asn1tostruct.py
BUILT_SOURCES = hnbap_decoder.c hnbap_encoder.c rua_decoder.c rua_encoder.c ranap_decoder.c ranap_encoder.c
BUILT_SOURCES = hnbap_decoder.c hnbap_encoder.c rua_decoder.c rua_encoder.c gen_ranap.stamp
hnbap_encoder.c hnbap_decoder.c hnbap_ies_defs.h: $(ASN1_ROOT)/hnbap/HNBAP-PDU-Contents.asn $(ASN1TOSTRUCT)
$(ASN1TOSTRUCT) -f $<
@ -11,7 +11,7 @@ hnbap_encoder.c hnbap_decoder.c hnbap_ies_defs.h: $(ASN1_ROOT)/hnbap/HNBAP-PDU-C
rua_encoder.c rua_decoder.c rua_ies_defs.h: $(ASN1_ROOT)/rua/RUA-PDU-Contents.asn $(ASN1TOSTRUCT)
$(ASN1TOSTRUCT) -p RUA_ -f $<
ranap_encoder.c ranap_decoder.c: $(ASN1_ROOT)/ranap/RANAP-PDU-Contents.asn $(ASN1TOSTRUCT)
gen_ranap.stamp: $(ASN1_ROOT)/ranap/RANAP-PDU-Contents.asn $(ASN1TOSTRUCT)
$(ASN1TOSTRUCT) -p RANAP_ -f $<
# We also need to replace the include in the newly generated .c files:
sed -i 's,^#include "ranap_ies_defs.h",#include <osmocom/ranap/ranap_ies_defs.h>,' ranap_encoder.c ranap_decoder.c
@ -19,6 +19,7 @@ ranap_encoder.c ranap_decoder.c: $(ASN1_ROOT)/ranap/RANAP-PDU-Contents.asn $(ASN
mv ranap_ies_defs.h $(top_srcdir)/include/osmocom/ranap/
# this is ugly ^. ranap_ies_defs.h is generated from asn1tostruct.py here, but
# it should live in include/osmocom/ranap/.
touch $(top_builddir)/$@
AM_CFLAGS = -I$(top_srcdir)/include $(OSMOCORE_CFLAGS) $(OSMOVTY_CFLAGS) $(OSMOGSM_CFLAGS) $(OSMONETIF_CFLAGS) $(ASN1C_CFLAGS) $(OSMOSIGTRAN_CFLAGS)
COMMON_LDADD = -lsctp

Loading…
Cancel
Save