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 "PRABHU, ANANTHA (STSD)" <an...@hp.com> on 2004/09/09 11:47:21 UTC

How to create a statically linked xerces library(libxerces.a)...?

Hello,

I have an application which needs a statically linked Xerces library(libxerces.a).  I downloaded the Xerces sources and tried to build it. But the existing build procedure only creates a dynamic library. 

Could some one give me instructions about building the static xerces library?
What are the changes needs to be done for building a static xerces library?

Thanks in advance
Regards
Ananth


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


Re: How to create a statically linked xerces library(libxerces.a)...?

Posted by Gareth Reakes <ga...@parthenoncomputing.com>.
Hi,
	take a look in the archives, this has been discussed recently.

Gareth

PRABHU, ANANTHA (STSD) wrote:

> Hello,
> 
> I have an application which needs a statically linked Xerces library(libxerces.a).  I downloaded the Xerces sources and tried to build it. But the existing build procedure only creates a dynamic library. 
> 
> Could some one give me instructions about building the static xerces library?
> What are the changes needs to be done for building a static xerces library?
> 
> Thanks in advance
> Regards
> Ananth
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
> 
> 

-- 
Gareth Reakes, Managing Director      Parthenon Computing
+44-1865-811184                  http://www.parthcomp.com

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


Re: How to create a statically linked xerces library(libxerces.a)...?

Posted by Pete Forman <pe...@westerngeco.com>.
"PRABHU, ANANTHA (STSD)" <an...@hp.com> writes:
> Could some one give me instructions about building the static xerces
> library?

Here is an ugly one-liner that assumes that g++ is being used to build
dynamic libs with .so suffixes.

make -n XML_LIB_DIR=$XERCESCROOT/lib/dummy | grep 'g++ .*\.so' | tr \  \\n | grep '\.o$' | ( cd ../../obj ; xargs ar rcs $XERCESCROOT/lib/libxerces-c.a )

Here it is again with extra newlines in case this message gets mangled.

make -n XML_LIB_DIR=$XERCESCROOT/lib/dummy |
  grep 'g++ .*\.so' |
  tr \  \\n |
  grep '\.o$' |
  ( cd ../../obj ; xargs ar rcs $XERCESCROOT/lib/libxerces-c.a )

The logic is

make prints out what to do to make the dynamic libs
grep singles out the link lines
tr translates space into newlines so that each object is on one line
grep finds the object files
xargs passes the list of object files to ar

-- 
Pete Forman                -./\.-  Disclaimer: This post is originated
WesternGeco                  -./\.-   by myself and does not represent
pete.forman@westerngeco.com    -./\.-   opinion of Schlumberger, Baker
http://petef.port5.com           -./\.-   Hughes or their divisions.


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org