STATIC_SIL-SA README

IMPORTANT info on Using Static SIL-SA Libraries

  1. Assume a SIL-SA library is setup

    > make_sil_sa_dir test2

This could also be a bundle (make_sil_sa_bundle)

  1. Build a static version of the SIL-SA library

    > cd test2 > make STATIC=1

  2. Copy the static library to a common directory if desired. This is not required but may make using the STATIC_SILSA variable easier.

    > cp lib/libtest2.a $HOME/silsa/libtest2_sa.a

  3. Use the macro STATIC_SILSA when building the sil-sa-app

  • Option 1: Change in Makefile:

    > STATIC_SILSA=-L /home/andy/silsa -ltest2_sa

  • Option 2: set from command line:

    > STATIC_SILSA='-L /home/andy/silsa -ltest2_sa' make

Note that the -L part must be first and it must specify where the static libraries are located. One or more -l parts can follow. The -l parameter does not use the full name. Instead libtest2_sa.a can be specified as -ltest2_sa.

  1. Register the static library in the sil-sa-app or combo-app program

Example from sil-sa-app/main.c:

/* extern definitions for the 3 expected callbacks */
AGT_SIL_LIB_EXTERN(test2)

static status_t static_silsa_init (void)
{
    /* example: module=test2;
     * need to use in Makefile (example)
     * STATIC_SILSA=-L /home/andy/silsa -ltest2_sa
     * The actual library names are not needed in this code
     */
    status_t res =
        agt_sil_lib_register_statlib((const xmlChar *)"test2",
                                     y_test2_init,
                                     y_test2_init2,
                                     y_test2_cleanup);

    return res;
}
  1. The SIL-SA library will not be used unless the module or bundle is loaded.

    > load test2 > netconfd-pro module=test2