To update or change this libasn1c.so library, please follow those steps:

Preparation:

Make sure asn1c is working in your system.

A 64-bit build system is strongly recommended for asn1c operation. The following operations is performed on a 64-bit machine.

For the complete list of dependencies, check https://github.com/vlm/asn1c/blob/master/REQUIREMENTS.md

For configurations and build steps, check https://github.com/vlm/asn1c/blob/master/INSTALL.md

To use asn1c, check https://github.com/vlm/asn1c/blob/master/doc/asn1c-usage.pdf

A stable version ticket is: 59b1bc8, which is on Sep 19th 2017.

To generate libasn1c_x86.so and libasn1c_x64 libraries, your workspace should have this structure:

Note: Workspace in this context is a temporary folder ouside the Carma code tree for creating the third party shared library.

Workspace
  |
  ------include
  |
  ------src

All generated header files from asn1c and the JNI header files shoube be in the include folder.

All generated source files from asn1c(except for converter-sample.c) and the wrapper.c shoube be in src folder.

Build:

To generate code for the usage of our platform, run:

asn1c -pdu=MessageFrame -fcompound-names -gen-PER ***.asn

Note: ***.asn here is the message spec file. We used J2735_201603.asn1 in Carma.

In Workspace, make changes on wrapper.c.

To generate the x64 shared library, run:

gcc -DPDU=MessageFrame -shared -o libasn1c_x64.so -I./include/ -I/usr/lib/jvm/default-java/include -I/usr/lib/jvm/default-java/include/linux/ ./src/*.c -fPIC

To generate the x86 shared library, run:

gcc -m32 -DPDU=MessageFrame -shared -o libasn1c_x86.so -I./include/ -I/usr/lib/jvm/default-java/include -I/usr/lib/jvm/default-java/include/linux/ ./src/*.c -fPIC

Note: In order to use m32 flag, you should have the package libc6-dev-i386 ready.

Copy the new generated shared libraries in your Workspace.

Paste and replace the old libraries in this folder.

Post Build:

Make sure to update the wrapper.c file in ../src as well.
