This is an old revision of
UnixBuild from 2007-01-25 03:38:29.
Linux / BSD / *nix / Cygwin Build Documentation
Simple Instructions
- Make sure you have downloaded and build the Xerces-C library. It can be downloaded here∞.
- Untar the downloaded archive
tar -xzvf XQilla-1.0.tar.gz
- Change directory to the build directory -
- Run the configure script -
./configure --with-xerces=/path/to/xerces
- Build XQilla -
- *Optional* Install XQilla (as a super-user) -
Developer Instructions
The build system uses autoconf, automake and libtool. It is set to build (mostly) from a single Makefile in the "xqilla" directory. There
is a sub-directory Makefile in the "include" directory, but I only did that because I couldn't get the headers to install to the correct path otherwise.
Adding / Removing Files
If you need to add/remove files from the build, it needs to be done in the Makefile.am in the "xqilla" directory, unless the files are inside the "include" directory - when they need to be put in include/Makefile.am. The Makefile has rules to automatically rebuilds itself and it's dependants if they need to be rebuilt.
- I intend to add some scripting to generate windows project files and the Makefile.am listings from the same common list of source and headers. Until that is done, be aware that the windows project files will also need updating for added or removed source and headers.
Configure Options
Specifying "--help" to the configure script will give you a list of options. When developing I usually use "--enable-debug --disable-static --disable-fast-install".
Useful Make Targets
- "clean" - Removes all the executable, library and object files, and lets you build from scratch.
- "docs" - Builds the doxygen documentation - you'll need Doxygen∞ installed for this.
- "dist" - Rolls the distributions.
- "tags" - Makes an emacs "TAGS" file from the source code.
Building from another directory
This can be useful if you want to have two builds at the same time. Often I will have a debug build and a release build. This can also be useful if you want to cross-compile for a number of platforms, or if you just want to keep the "xqilla" directory free from object files. This will only work if you're version of "make" has VPATH support - which I think means GNU make. To do this:
- Create a directory for the build to go in. I usually make it inside the "xqilla" directory, but that is not mandatory.
- Run the configure script from inside the new directory.
- Make the project as usual form inside the new directory.
Building on Cygwin
Building XQilla under Cygwin follows the same steps as for other Unixes, however the default behavior is to generate only a static library. To get the shared library (and the Cygwin DLL) you need to make some changes to the generated Makefile. Open the Makefile and find the line that looks like:
libxqilla.la: $(libxqilla_la_OBJECTS) $(libxqilla_la_DEPENDENCIES)
$(CXXLINK) -no-undefined -rpath $(libdir) $(libxqilla_la_LDFLAGS) $(libxqilla_la_OBJECTS) $(libxqilla_la_LIBADD) $(LIBS) -lxerces-c
Change it to (adding the options: -no-undefined and -lxerces-c to it):
libxqilla.la: $(libxqilla_la_OBJECTS) $(libxqilla_la_DEPENDENCIES)
$(CXXLINK) -no-undefined -rpath $(libdir) $(libxqilla_la_LDFLAGS) $(libxqilla_la_OBJECTS) $(libxqilla_la_LIBADD) $(LIBS) -lxerces-c
This generates the cygxqilla-0.dll, and libxqilla.dll.a file, which is what is needed to link your code to the dynamic library. If you want to link your code to the dynamic libraries, you need to use libtool under Cygwin. Here is an example of a Makefile line that will link you objects to XQilla and Xerces under Cygwin:
$(TGT): $(OBJS)
libtool --tag=CXX --mode=link g++ -v -lstdc++ -lxerces-c -lxqilla $(OBJS) -o $(TGT)
To run the application you either have to do a make install on XQilla (to get the cygxqilla-0.dll on the correct directory) or copy the cygxqilla-0.dll to the same directory of the executable.
CategoryDocumentation
There are 3 comments on this page. [Display comments]