Andre Noll [Tue, 22 May 2012 15:55:10 +0000 (17:55 +0200)]
Allow to build a static version of libosl.
This adds the new target libosl.a which creates an archive that can
be statically linked into applications. Currently this works only on
ELF-based systems including Linux, FreeBSD and NetBSD, but fails on
MacOS. So it is not built automatically.
Unfortunately, creating libosl.a turned out to be trickier than
expected, because -fvisibility=hidden works only for dynamic libraries.
So we need a different method to hide non-static internal symbols
like make_message() which must not be global (external) because they
might clash with symbols used in the application.
objcopy(1) does the trick but we must provide a list of exceptional
symbols that should not be made local. This list is generated from
the osl.h header file.
Andre Noll [Wed, 25 Nov 2009 09:40:08 +0000 (10:40 +0100)]
Split install target.
As proposed by Sebastian Stark, this introduces the install-lib,
install-bin and install-man targets. The simple "make install" still
installs everything, but splitting the target allows people to install
for example only the library if they do not have all tools available
which are necessary to build the oslfsck binary or its man page.
Andre Noll [Fri, 20 Nov 2009 08:38:56 +0000 (09:38 +0100)]
Drop dependency on openssl.
This patch adds git's implementation of the sha1 hash algorithm. This
makes osl more self-contained as it allows to build osl without
openssl being installed.
It should also reduce the startup time of applications that link
against libosl.
Andre Noll [Mon, 2 Nov 2009 13:39:16 +0000 (14:39 +0100)]
Set CC to gcc by default.
On systems where cc != gcc, compilation likely fails because we are
using quite some gccisms in osl. So default to gcc but let the user
override the default by setting CC manually.
The straight-forward CC ?= gcc does not work with gnu make as make
assigns CC the default value "cc".
Thanks to Steffen Schmidt for pointing out this shortcoming.
Andre Noll [Mon, 3 Aug 2009 09:31:49 +0000 (11:31 +0200)]
README: Clarify red-black tree statements.
As noted by Sebastian Stark, the old text was a bit misleading. So
make it clear that no special linux files are necessary to compile
the library.
Also, the sentence on table locking was not quite true: There's the
dirty bit in each osl table which is some kind of locking. Correct that
statement as well.
Andre Noll [Sun, 2 Aug 2009 10:31:07 +0000 (12:31 +0200)]
Improve table versioning.
This patch changes the way table version numbers are stored on disk.
Two version numbers instead of only one are stored in the table header:
The version of the lib that created the table, and the lowest version
number of the lib that can read the table.
As the latter is currently 0, it has no effect so far, i.e. tables
created with previous versions of the library still work fine. However,
with this change future versions of the library can detect from the
on-disk versions and the library version numbers if table and library
are compatible.
Andre Noll [Sat, 11 Jul 2009 21:24:02 +0000 (23:24 +0200)]
fsck: Fix a serious bug in prune_mapped_column().
This function still contained a relict from the old database format that was changed in commit 6d7dce7f277fc8606fb8d5ed6360660c13a218af. This caused prune_mapped_column()
to write one byte too much to the data file of a mapped column for each removed row.
Running the buggy oslfsck on a table with mapped columns where rows have been deleted
likely results in data corruption to objects adjacent to the deleted objects.
Worst of all, since only the data files but not the index is affected, the corruption will not
immediately be noticed, which is probably why it took one year to find this bug. Kill it with
pleasure.
Andre Noll [Sun, 10 May 2009 19:36:18 +0000 (21:36 +0200)]
rbtree: Add const qualifier to some functions.
The 'rb_first()', 'rb_last()', 'rb_next()' and 'rb_prev()' calls take a pointer
to an RB node or RB root. They do not change the pointed objects, so add a
'const' qualifier.
Andre Noll [Fri, 6 Jun 2008 08:53:33 +0000 (10:53 +0200)]
init loglevel.
Global variables that are defined in different object files need to be initialised
on the Mac. Fixes
ld: common symbols not allowed with MH_DYLIB output format with the -multi_module option
osl.o private external definition of common _loglevel (size 4)
/usr/bin/libtool: internal link edit command failed