Combining multiple static libraries into one shared library in a Boost Jam file

Hi I have the following hirarcy project:
-Top
------ lib1
---------- Jamfile
------ lib2
---------- Jamfile
--- --- Jamroot

Both libs: lib1 and lib2 are static libs (.a) and their Jamfile consists of the following command:

lib $ (library): [glob * .cpp]: <link> static;

Now at the Jamroot level I need to create a single shared library (.so) by combining all of the above two static libs: lib1.a and lib2.a should be combined to form libmain.so.

Can you tell me how I can write the required bjam statement to achieve the goal in my Jamroot.jam file?

+3


source to share


2 answers


Have you tried something like this?



shared-lib main
  : /lib1//lib1
    /lib2//lib2
  : <link>shared
    <cxxflags>-fPIC
  ;

      

0


source


I am doing this for android libraries. The trick is to just add /<link>static

after each library.



lib shared-library
  :
    /lib1//lib1/<link>static
    /lib2//lib2/<link>static
  :
    <link>shared
  ;

      

0


source







All Articles