Login
Changes To AmalgamationBuild
Login

Changes to "AmalgamationBuild" between 2021-08-29 13:31:45 and 2021-12-21 16:08:27

1
2
3
4
5
6
7
8
9
10

11
12
13
14
15



16
17
18
19
20
21
22
23
24
25
26
27

28
29
30
31
32
33
34
1
2
3
4
5
6
7
8
9

10
11
12



13
14
15
16
17
18
19
20
21
22
23
24
25
26

27
28
29
30
31
32
33
34









-
+


-
-
-
+
+
+











-
+







# The libfossil Amalgamation Build

See also: [](building), [download pre-built copies of the amalgamation](/uv/amalgamation.html)

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:~/libfossil/src]$ make amal
[stephan@host:~/libfossil]$ make amal
...
Amalgamation files:
-rw-rw-r-- 1 stephan stephan 1328712 Aug 29 14:22 ../libfossil.c
-rw-rw-r-- 1 stephan stephan    4040 Aug 29 14:22 ../libfossil-config.h
-rw-rw-r-- 1 stephan stephan  695123 Aug 29 14:22 ../libfossil.h
-rw-rw-r-- 1 stephan stephan 1502299 Dec 21 17:06 ./libfossil.c
-rw-rw-r-- 1 stephan stephan    4273 Dec 21 15:16 ./libfossil-config.h
-rw-rw-r-- 1 stephan stephan  824290 Dec 21 17:06 ./libfossil.h
ccache cc -I. ... -o "../libfossil.o"
Reminder: it will need these sqlite3 files to build:
sqlite3.h, sqlite3ext.h, and optionally a local copy of sqlite3.c
```

The output is these three files in the top-most directory of the tree:

   *  `libfossil-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.h` contains header files. It `#include`s `libfossil-config.h`.
   *  `libfossil.c` contains all of the sources. It `#include`s `libfossil.h`.

The C++ build also has an amalgamation build which requires this amalgamation. To build it, run make amal from the `bindings/cpp` directory.
The C++ build also has an amalgamation build which requires this amalgamation. To build it, run `make amalpp`.

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 <em>might</em> be required (which version is unknown - development typically happens against the sqlite3 trunk). Optionally, you can link in a self-compiled <tt>sqlite3.o</tt>.
- `#include "libfossil.h"`
- Optionally tweak `libfossil-config.h`
- Compile `libfossil.c`