3

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

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

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

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

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

elite21
  • 757
  • 8
  • 9

2 Answers2

0

Have you tried something like this?

shared-lib main
  : /lib1//lib1
    /lib2//lib2
  : <link>shared
    <cxxflags>-fPIC
  ;
Steve Lorimer
  • 27,059
  • 17
  • 118
  • 213
0

I do 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
  ;
syvex
  • 7,518
  • 9
  • 43
  • 47