[xsd-users] Mac OS X need to link against static Boost / xerces_c

Boris Kolpackov boris at codesynthesis.com
Thu Dec 5 02:21:30 EST 2013


Hi Chris,

Chris Green <greenc at fnal.gov> writes:

> We've been building on linux for a while now linked against static
> Boost and xerces_c libraries by starting with the rollup source
> (e.g. xsd-3.3.0-2+dep.tar.bz2) and applying patches of the form:

You should be able to do this without patching using the LDFLAGS
and LIBS make variables (described in the README file). Something
along these lines:

make LDFLAGS="-L$(BOOST_LIB) -L$(XERCESCROOT)/lib" LIBS=-lpthread

If you are using GNU make 3.81 (which you most likely are on OS X),
then you will also need to add .LIBPATTERNS=lib%.a as described in
this post:

http://codesynthesis.com/pipermail/xsd-users/2013-May/003937.html


> I'm by no means an expert compiling on OS X, although it seems that
> the static xerces_c library introduces a need to link against (at
> least) the CoreFoundations framework.

Yes, adding "-framework CoreFoundation" to the LIBS variable as shown
above should do the trick.


> I should note that we need to do this because all of our own code is
> built for C++2011 (-std=c++11), and therefore C++2011-compiled
> versions of Boost and xerces_c are what are available in
> LD_LIBRARY_PATH at the time we are invoking xsd -- either xsd has to
> be compiled statically against these libraries or it must be
> compiled C++2011. We have been unable to do the latter thus far

Will try to make sure XSD compiles in the C++11 mode for the upcoming
release.

Boris



More information about the xsd-users mailing list