Cross compiling Berkeley DB for ARM and MIPS

Following my blog entry about Databases for Linux Embedded Systems, here are the instructions to cross-compile Oracle Berkeley DB. First download the source code of the latest version of Berkeley DB (version 11gR2 – 11.2.5.1.25). You’ll need to register on Oracle website first on the download page http://www.oracle.com/technetwork/database/berkeleydb/downloads/index.html to download http://download.oracle.com/otn/berkeley-db/db-5.1.25.tar.gz (with AES encryption) or  http://download.oracle.com/otn/berkeley-db/db-5.1.25.NC.tar.gz (if you don’t need encryption). Extract the source code: tar xzvf ../Downloads/db-5.1.25.tar.gz Configure and build the source code. I’ll use mipsel-linux-gcc, but any other cross-compiler could be used. cd db-5.1.25/build_unix ../dist/configure –host=mipsel-linux CC=mipsel-linux-gcc RANLIB=mipsel-linux-ranlib STRIP=mipsel-linux-strip AR=mipsel-linux-ar –prefix=/home/jaufranc/edev/lib/db-11g make make install The full berkeley DB package is 79MB: jaufranc@CNX-TOWER:~/edev/lib/db-11g$ du –max-depth=1 -h 6.6M    ./lib 308K    ./bin 72M    ./docs 176K    ./include 79M    . However, you won’t need the include and docs directory in your embedded target. So you do not need to copy those. You may or may need the utilities in the bin file. The […]

Databases for Linux Embedded Systems: Berkeley DB and SQLite

Embedded systems often need to use database to store contact information, EPG data and more. Many Linux systems use MySQL, however such a large database management system may not always be appropriate for embedded systems. Hence, there are lightweight database management systems  implementation that are especially suited to embedded systems by their binary footprint, memory footprint and CPU requirements. If you want to develop in C in Linux and your requirement is to have no (or little) license to pay in your application, you could consider Oracle Berkeley DB or SQLite among others. Oracle Berkeley DB (previously Sleepycat Berkeley DB)  is described as follows: Berkeley DB enables the development of custom data management solutions, without the overhead traditionally associated with such custom projects. Berkeley DB provides a collection of well-proven building-block technologies that can be configured to address any application need from the hand-held device to the datacenter, from a […]