How to use Berkeley DB on blackfin

1. Download Berkeley DB 4.4.20 from http://dev.sleepycat.com/downloads/releasehistorybdb.html,
untar it into DBDIR/.

2. In DBDIR/build_unix/

$../dist/configure –host=bfin-uclinux –disable-tcl

(modify db_config.h here if you want to do customize features)

$make

We’ll get all the necessary header files and libdb.a in this same folder after make.
3. Test example
In DBDIR/examples_c/getting_started/, run

$ bfin-uclinux-gcc gettingstarted_common.c\
example_database_read.c \
-o example_database_read -L../../build_unix\
-ldb -I../../build_unix -lpthread \
-Wl,-elf2flt

$ bfin-uclinux-gcc gettingstarted_common.c\
example_database_load.c \
-o example_database_load -L../../build_unix\
-ldb -I../../build_unix -lpthread \
-Wl,-elf2flt

Note that DB needs a set of atomic mutex control functions, but Blackfin doesn’t have a simple atomic asm instruction, now we use the mutex functions in uclibc/libpthread. That is the reason for “-lpthread”.

Copy the generated “example_database_read”, “example_database_load” and “inventory.txt”, “vendors.txt” to Blackfin target. Run following to see the result.
$./example_database_load; ./example_database_read

1 Comment »

  1. FOR BEING AN ATHEIST ONE MUST BE WELL VERSED IN ENGLISH COS PAKISTANI indigenous GIVE U A SHIT OF KNOWLEDGEhttps://ameo.link/mercercasey1480908180

RSS feed for comments on this post · TrackBack URI

Leave a comment