You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by "Masaoud T. Moonim" <ma...@mailandnews.com> on 2000/12/28 15:26:12 UTC

Creating a static lib for Xerces C under Linux

Hi,

I would like to create a static library for Xerces-C on Linux.
I tried modifying the "runConfigure" script and changed the CXXFLAGS 
and CFLAGS variables to contain '-static' instead of '-shared'.
Then I did a 'gmake', but I got some errors, hence unsuccessful.
I realized that the object files had been created though. So I ran 
the 'ar' command to create a static library and then created an index 
using 'ranlib'. 
This worked and I was successfully able to create a static library.
I tested some of the sample apps ( after linking with xerces and 
lpthread ) this worked fine to.

What I wanted to know is what all changes does one need to make in 
the MakeFile and runConfigure script in order to create a statically 
linked library for Xerces ?

Also the runConfigure script allows us to provide extra compile time
( -z ) and extra linker ( -l ) options. But how do I give more than 
one compile time option ( say -pg and -g ) ?

The reason I want to create a static linked library is so that I
can use gprof to profile the Xerces code. Some how I was unable to 
get profiling information when it was a ".so" even though I had done 
a 'make' wit the '-g' and '-pg' compile/link flags ( I manually edited 
the MakeFiles as the getOpt( ) method used in the 'runConfigure' script
cribbed about 2 parameters.

Thanks and Regards
Masaoud