Commit Graph

24 Commits

Author SHA1 Message Date
Oliver Smith 48c038d399 asn1: fix visibility warnings from generated code
Fix warnings from generated asn1 code in order to build osmo-iuh with
werror in a future patch:

../../include/osmocom/hnbap/HNBAP_CriticalityDiagnostics-IE-List.h:29:23: error: ‘struct HNBAP_CriticalityDiagnostics_IE_List__Member’ declared inside parameter list will not be visible outside of this definition or declaration [-Werror]

These visibility warnings come from "SEQUENCE … OF SEQUENCE" definitions
in the asn1 source files, as described in detail here:
https://github.com/vlm/asn1c/issues/430

It is not possible to tell gcc to just ignore these warnings since they
don't have their own type (unlike e.g. -Wuninitialized). Also it seems
like a huge effort to patch this in asn1c.

So work around the problem the same way the author of the issue worked
around it by rewriting the lines to "SEQUENCE … OF …-Value" and adding
a "…-Value ::= SEQUENCE" line below. Add a script in
asn1/utils/asn1_restructure_sequence_of_sequence.py for the
transformation and apply it.

Related: OS#4462
Change-Id: If84445ed2e0df604b581684dcf83f8520b7da84c
2022-11-14 09:52:14 +01:00
Oliver Smith f8ed10a323 Cosmetic: put asn1c parameters in separate lines
Change-Id: Id1425753f9b4cbce172a1b875a680aa189bb5737
2021-11-12 13:44:34 +01:00
Pau Espin 41fefdb12d hnbap: Use asn1c flag -fcompound-names to avoid name collisions with other libs
Change-Id: I1bcbe047d233684647d6ffe9febb14a12c579696
2021-10-27 16:51:18 +02:00
Pau Espin 02de780ceb hnbap: Drop no longer existing asn1c param -fnative-types
This is an option enabled by default and not existent as cmdline param
since asn1c 0.9.26.

For some reason, when dropping it, asn1c generates different description
comment section on related files. In any case, this makes hnbap look
like other libraries which already got this param removed and hence also
generateds code looks the same.

Change-Id: Iccf81539a5045416185e619d24c3d542204437e6
2021-10-27 16:32:58 +02:00
Pau Espin bc7c69d170 hnbap: Use specific prefix for HNBAP generated code
Other libraries already use ASN1C_PREFIX except the HNBAP one. Let's use
it here to avoid collisions.

All new include/osmocom/hnbap/HNBAP_*.h and src/hnbap/HNBAP_*.c are
generated using the updated src/hnbap/Makefile.am.
Files such as src/*.c, test/* and include/osmocom/hnbap/hnbap_common.h
are modified manually to update structs/enums to new prefix.

Related: SYS#5516
Change-Id: I6c062f631527ae42811bfec134933671c05ecba6
2021-10-26 16:42:07 +02:00
Pau Espin 651ff175d5 Update generated .c/.h after using asn1c -R param
Change-Id: Ib7a03973d43828f47ff59b561d9ddce43186f8af
2021-10-26 16:42:07 +02:00
Pau Espin b292db8923 src/*/Makefile.am: Use asn1c -R to avoid generating runtime code
Change-Id: I5666a6dc1ec9e56fe133642fb0054e913265c081
2021-10-26 16:42:07 +02:00
Pau Espin 861d9d2ebf src/*/Makefile.am: Copy back to srcdir the generated .c files from ASN
Change-Id: I203a25a8059218bb9fd6d10cbc028a296d347382
2021-10-26 16:41:31 +02:00
Pau Espin 35f2bd60ae Provide libosmo-hnbap as a public shared library
It is needed by the new osmo-hnodeb project.

Related: SYS#5516
Change-Id: I0d0862e9d59d3b206f3f7dfae4b39ae4032bb762
2021-10-22 15:42:27 +02:00
Neels Hofmeyr 30e08f5b8e build: cosmetic: hnbap: undup asn1 src path
Change-Id: I0507277995302261c87db1b0c48105065cf13ae4
2016-09-09 06:43:32 +00:00
Neels Hofmeyr f67803684f build: use $top_srcdir instead of ../ 2016-02-29 14:28:00 +01:00
Neels Hofmeyr 92b13bc875 fix build: move local include dir before sys installed one 2016-02-29 14:22:21 +01:00
Neels Hofmeyr f1f2d7ca19 Remove osmo-iuh subdir level from include/ (2/2)
Make all changes to #include statements and build files.
2016-01-05 12:00:06 +01:00
Neels Hofmeyr c04a96c476 move asn1 headers to include/ dir (5/5)
Do all remaining changes necessary for a working build.

Add Makefile.am files in include/... subdirs.

Remove noinst_HEADERS directives from src/*/Makefile.am, but keep the headers
list to feed to move-asn1-header-files.sh.

Adjust all #includes in src/*_common.h and elsewhere. In hnbap_common.h,
separate the ASN.1 "primitive" headers from the others, and include them
without a subdir path, as before.
2016-01-04 18:11:19 +01:00
Neels Hofmeyr 16c97669bd move asn1 headers to include/ dir (4/5)
Move headers.
2016-01-04 18:11:19 +01:00
Neels Hofmeyr b0429374e2 move asn1 headers to include/ dir (2/5)
Show effects of the new sed step on asn1-generated files, without moving the
files.
2016-01-04 18:11:18 +01:00
Neels Hofmeyr 5aabad1380 move asn1 headers to include/ dir (1/5)
Add move-asn1-header-files.sh to do header file moving and sed'ding the include
statements. The file moving part is disabled until a later commit, to make
reading the diffs easier.

Call shell script from src/{hnbap,ranap,rua}/Makefile.am regen targets.

Add convenience regen target to src/Makefile.am, calling regen in the three subdirs.

This change is split over several commits to ease diff reading. Subsequent
commits show, in steps:
- the "unmoved" effect of sed,
- header moves,
- adjust build system and include statements.
2016-01-04 18:09:37 +01:00
Harald Welte 06bc548cee steps towards making 'make distcheck' work
'make distcheck' checks for out-of-source-tree builds and whether
the distribution tarball includes all source files.  This commit
fixes many problems, except some remaining with src/test still
to-be-fixd.
2016-01-03 17:54:24 +01:00
Alexander Huemer ef8934612c fix build if depenedencies are in distinct directories 2015-12-24 16:15:17 +01:00
Harald Welte fd5db064cb Re-add the 'regen' targets lost in the automake transition
This might need a lot of cleanup for out-of-source-tree builds and the
like, but let's not spend time on this now.  The old Makefile also
didn't support that.  But loosing the ability to regenerate the C source
is not an option either.
2015-12-16 13:14:10 +01:00
Harald Welte 3297dbaaa7 rename ASN_MODULE_FILES to ASN_MODULE_SOURCES
... brings us closer to the Makefile.am.sampl generated by asn1c,
facilitating copy+paste.
2015-12-16 13:13:30 +01:00
Daniel Willmann 29b9e00355 Autotoolize the build
Use Autoconf/make for building and autotest for tests
2015-12-15 15:10:31 +01:00
Harald Welte 3bc7ff0bb5 hnbap Makefile: add asn1c include directory 2015-09-10 16:43:44 +02:00
Harald Welte 0ec7f13667 Cleanups (rename 'asn1c' to 'hnbap', Makefile sanitizing) 2015-09-10 10:53:37 +02:00