I have no information about compiling with gcc on the mac platform. We
use Xerces and Xalan compiled in a static library, but that is on the
win32 platform.

I did an earlier post about compiling Xerces as a static library:

- First change the project type from dll to static lib.
- Remove the Win32MsgLoader from the project and add the InMemMsgLoader
instead.
- Change the project settings to define XML_USE_INMEM_MESSAGELOADER
instead of USE_WIN32_MESSAGELOADER.
- Change the defines for PLATFORM_EXPORT and PLATFORM_IMPORT by removing
the _declspec(dllexport) and _declspec(dllimport)
- Rebuild.

For Xalan the procedure is somewhat similar. But as I said: This is for
the win32 platform. You'll have to modify for your platform.

But usually it is very simple to compile a library. Just run the compile
phase on every source file in the project with the correct switches.
Then run the linker against all created object files with the option set
to create a library. All external references are resolved during the
final link-phase of your application. Just make sure you build all
objects with the same runtime libraries.

Hope you succeed
/ Erik

> -----Original Message-----
> From: Mark Goldstein [mailto:[EMAIL PROTECTED]
> Sent: den 26 februari 2004 18:47
> To: [EMAIL PROTECTED]
> Subject: Re: optimizing the xerces libraries
> 
> Thanks Erik.
> 
> Can you advise me how to make the xerces and xalan compile static? I
> assume I'll need to do this for both projects.
> Earlier, I tried to add a -l static option  to the xalan runConfigure
> command and it wouldn't accept the extra argument.
> 
> Also, there is a warning in man gcc for the static option on
> Macintoshes:
> "This option will not work on Mac OS X unless all of your libraries
> (including libgcc.a) have also been compiled with -static."
> If the xerces and xalan projects are not self-contained, this could be
> a static-killer.
> 
> -Mark
> 
> 
> 
> On Feb 26, 2004, at 2:29 AM, Erik Rydgren wrote:
> 
> > I recommend static linkage if you want a small footprint. Static
> > linkage
> > does only bring in what you actually use.
> >
> > / Erik
> >
> >> -----Original Message-----
> >> From: Mark Goldstein [mailto:[EMAIL PROTECTED]
> >> Sent: den 26 februari 2004 02:01
> >> To: [EMAIL PROTECTED]
> >> Subject: optimizing the xerces libraries
> >>
> >> Hello,
> >>
> >> I am including the xerces c libraries in a project and I'm
interested
> >> in getting them as small as possible. Looking at the makefiles that
> >> runConfigure generates, I can't find the value of CXXFLAGS, though
it
> >> appears in Makefile.incl. Can someone tell me where this is
defined,
> >> and what additional compiler flags (if any) might I add to make the
> >> libraries smaller.
> >>
> >> Thanks,
> >> -Mark
> >>
> >>
> >>
---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
> >
---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to