OpenBSD build broken

On OpenBSD 5.5 AMD64, I compile SQLightning as follows:

git clone https://github.com/LMDB/lmdb.git

cd lmdb

git checkout mdb.RE/0.9

cd libraries/liblmdb

make

sudo make install

(On Linux: sudo ldconfig)

cd ../../..

git clone https://github.com/LMDB/sqlightning.git

cd sqlightning

git checkout mdb

./configure

(trying "make" here complained that "mdb.c" doesn't exist on Linux and that "mdb.h" doesn't exist on OpenBSD, so I fixed this by "cp ../lmdb/libraries/liblmdb/* src/" and then):

make -j2

sudo make install

(On Linux: sudo ldconfig)

I then try the newly built sqlite3 binary:

./sqlite3 /tmp/zz

SQLite version 3.7.17 2013-05-20 00:56:22

Enter ".help" for instructions

Enter SQL statements terminated with a ";"

sqlite> create table a(b);

Error: unable to open database "/tmp/zz": UNKNOWN ERROR

Equally so, sqlite3_open() fails with 2 = SQLITE_INTERNAL , http://www.sqlite.org/rescode.html#internal [1] .

I also found that SQLightning does not specify MDB_WRITEMAP by default, and therefore added to src/btree.c as a line right before the mdb_env_open call, I added a line "eflags |= MDB_WRITEMAP | MDB_MAPASYNC;", and also this did not resolve anything but the error is the same.

Both SQLightning, LMDB and SQLite are built specifically to work on OpenBSD, so it should work.

How fix?

Thanks!!