pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/32174 )
Change subject: contrib/ber: Avoid regenerating codec_bit_class.h every build ......................................................................
contrib/ber: Avoid regenerating codec_bit_class.h every build
Automatic generation of a header file using a C program built during build of osmo-bts creates several problems when cross-compiling.
The generated header file is only 59 lines long, so let's have it generated in order to avoid having to call the helper program every time.
A Makefile target is added to easily regenerate the file manually in case it's needed: make -C contrib/ber/ update_codec_bit_class_h
Fixes: acf0f0f0bb715b795c5bc5de6ddf2aa62458af10 Change-Id: I97efdb4ee00537fcae191b4267d0211d582ef372 --- M .gitignore M contrib/ber/Makefile.am A contrib/ber/codec_bit_class.h 3 files changed, 83 insertions(+), 7 deletions(-)
Approvals: fixeria: Looks good to me, but someone else must approve pespin: Looks good to me, approved Jenkins Builder: Verified
diff --git a/.gitignore b/.gitignore index 72897c5..a18b040 100644 --- a/.gitignore +++ b/.gitignore @@ -105,6 +105,5 @@ doc/manuals/build
contrib/osmo-bts.spec -contrib/ber/codec_bit_class.h contrib/ber/rtp_ber contrib/ber/rtp_gen_map diff --git a/contrib/ber/Makefile.am b/contrib/ber/Makefile.am index e027378..9bd7f40 100644 --- a/contrib/ber/Makefile.am +++ b/contrib/ber/Makefile.am @@ -20,12 +20,9 @@
noinst_PROGRAMS = rtp_ber rtp_gen_map
-BUILT_SOURCES = codec_bit_class.h -DISTCLEANFILES = codec_bit_class.h - -codec_bit_class.h: rtp_gen_map - $(AM_V_GEN)./$< > $@ - rtp_ber_SOURCES = rtp_ber.c codec_bit_class.h
rtp_gen_map_SOURCES = rtp_gen_map.c + +update_codec_bit_class_h: rtp_gen_map + $(AM_V_GEN)./$< > $(top_srcdir)/contrib/ber/codec_bit_class.h diff --git a/contrib/ber/codec_bit_class.h b/contrib/ber/codec_bit_class.h new file mode 100644 index 0000000..2a712e7 --- /dev/null +++ b/contrib/ber/codec_bit_class.h @@ -0,0 +1,59 @@ +static const int gsm_fr_bitclass[] = { + -1, -1, -1, -1, 0, 0, 0, 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