The Amalgamation Build
See also: building
This library supports the creation of a so-called "amalgamation build", a practice adopted from the sqlite project which compounds the sources and headers into a form which can easily be dropped into client-side projects.
To create the amalgamation you need a working build environment (GNU Make and friends):
[stephan@host:~/cvs/fossil/f2]$ make amal Generating dependencies... Generating libfossil_amalgamation-config.h ... sh configure --amal Host System...x86_64-unknown-linux-gnu Build System...x86_64-unknown-linux-gnu C compiler... cc -g -O2 C++ compiler... c++ -g -O2 Build C compiler...cc Checking for stdlib.h...ok Found fossil binary: fossil Using hard-coded aux-schema: 2011-04-25 19:50 Generating conservative config for the amalgamation build... Generated libfossil_amalgamation-config.h. Creating libfossil_amalgamation.h... Creating libfossil_amalgamation.c... gcc -c -pedantic -Wall -Werror -std=c89 -Wno-long-long libfossil_amalgamation.c
The output is these three files:
- libfossil_amalgamation-config.h holds a basic set of configuration options. This file can/should be tweaked for the target platform. The default options set there are, by design, conservative. That said, the conservative options "should" work just fine for all modern platforms.
- libfossil_amalgamation.h contains header files. It #includes libfossil_amalgamation-config.h.
- libfossil_amalgamation.h contains all of the sources. It #includes libfossil_amalgamation.h.
To use the amalgamation, simply:
- Make sure you have zlib and sqlite3 libraries and headers installed. They are preinstalled on any modern Unix system, though a newer sqlite3 might be required (which version is unknown - development typically happens against the sqlite3 trunk).
- #include "libfossil_amalgamation.h"
- Compile libfossil_amalgamation.c
- Link your app with libfossil_amalgamation.o, zlib, and sqlite3. Unix: -lz -lsqlite3.
Regarding the sqlite3 dependency: currently this library tries to work with whatever sqlite3 version is installed, but if it at some point requires features of relatively new versions then clients may need to use the sqlite3 amalgamation when building this code.