Cross-compiling sqlite, using configure

  • Version: sqlite-3.3.5 - sqlite-3.3.12
  • SDK version: 2.10 RC2
  • Compiler: gcc 3.2.1 Axis release R63/1.63-v32
  • See notes at base of this document that provide alternate scripts for sqlite-3.4.0

Cross-Compiling SQLite

  1. download sources from SQLite webpage
  2. unpack it to some directory using tar tar -xzf sqlite-3.x.x.tar.gz
  3. copy and create hints.txt, configure_axis and config.sub.patch files inside unpacked source dir
  4. if using crisv32 architecture apply patch below patch -p0 <config.sub.patch
  5. Modify files to match your SDK & compiler dirs (-isystem flag might be unnessessary if compiler properly configured)
  6. run . configure_axis
  7. if problems read configure.ac file and modify hints.txt
  8. run make & make install

Patch

--- config.sub-old      2007-02-13 11:20:10.000000000 +0200
+++ config.sub  2007-02-13 11:30:26.000000000 +0200
@@ -448,6 +448,9 @@
        cris | cris-* | etrax*)
                basic_machine=cris-axis
                ;;
+       crisv32-*)
+               basic_machine=crisv32-axis
+               ;;
        da30 | da30-*)
                basic_machine=m68k-da30
                ;;

hints.txt

config_BUILD_CC="gcc -g -o2"
config_TARGET_READLINE_INC="-L/$AXIS_TOP_DIR/libs/readline-IR5_1-2"
config_TARGET_CC="gcc-cris -Wall -march=v32 -mlinux -isystem /usr/local/crisv32/crisv32-axis-linux-gnu/sys-include"

configure_axis

env \
  CC="gcc-cris -Wall -march=v32 -mlinux -isystem /usr/local/crisv32/crisv32-axis-linux-gnu/sys-include" \
  CPP="gcc-cris -Wall -march=v32 -mlinux -E -isystem /usr/local/crisv32/crisv32-axis-linux-gnu/sys-include" \
  CXX="g++-cris -Wall -march=v32 -mlinux -xc++ -isystem /usr/local/crisv32/crisv32-axis-linux-gnu/sys-include" \
  LDFLAGS="-L/**YOUR**EXTRA**LIBS**/lib" \
  CPPFLAGS="-I/**YOUR**EXTRA**INCLUDES/include" \
  OBJCOPY="cris-objcopy" \
  LD="ld-cris -mcrislinux" \
  AR="ar-cris" \
  RANLIB="ranlib-cris" \
  NM="nm-cris" \
  STRIP="strip-cris" \
  \
 ./configure \
 --host=i686-pc-linux-gnu --build=crisv32-axis-linux-gnu --without-x --prefix=`pwd`/../target \
 --cache-file=cache.txt --with-hints=`pwd`/hints.txt

Cross-Compiling SQLite for version 3.4.0 under cris

The instructions provided in “Cross-Compiling SQLite” are an excellent solution to the previous difficulties encountered with the lemon parser and other issues cross-compiling sqlite. Here are some suggested modifications to the above which may be used with sqlite 3.3.7 and 3.4.0 (not tested on other versions). These assume you are building in a cris-axis-linux-gnu environment and are not using a v32 architecture.

  1. download sources from SQLite webpage
  2. unpack it to some directory using tar tar -xzf sqlite-3.4.0.tar.gz
  3. copy and create hints.txt, and configure_axis inside unpacked source dir. Make sure as with all unix files the file format is correct (linefeed line endings only). Note in hints.txt the reference to readline. Make sure this matches the directory name in your tree.
  4. run . configure_axis
  5. if problems read configure.ac file and modify hints.txt
  6. run make & make install

hints.txt

config_BUILD_CC="gcc -g -o2"
config_TARGET_READLINE_INC="-L/$AXIS_TOP_DIR/libs/readline-R1_0_6"
config_TARGET_CC="gcc-cris -Wall -mlinux -isystem /usr/local/cris/cris-axis-linux-gnu/sys-include"

configure_axis

env \
  CC="gcc-cris -Wall -mlinux -isystem /usr/local/cris/cris-axis-linux-gnu" \
  CPP="gcc-cris -Wall -mlinux -E -isystem /usr/local/cris/cris-axis-linux-gnu" \
  CXX="g++-cris -Wall -mlinux -xc++ -isystem /usr/local/cris/cris-axis-linux-gnu" \
  LDFLAGS="-L/**YOUR**EXTRA**LIBS**/lib" \
  CPPFLAGS="-I/**YOUR**EXTRA**INCLUDES/include" \
  OBJCOPY="cris-objcopy" \
  LD="ld-cris -mcrislinux" \
  AR="ar-cris" \
  RANLIB="ranlib-cris" \
  NM="nm-cris" \
  STRIP="strip-cris" \
  \
 ./configure \
 --host=cris-axis-linux-gnu --build=cris-axis-linux-gnu --without-x --prefix=`pwd`/../target \
 --cache-file=cache.txt --with-hints=`pwd`/hints.txt
 
cros-compiling-sqlite.txt · Last modified: 2007/06/20 16:16 by k1mgy
 
All text is available under the terms of the GNU Free Documentation License (see Copyrights for details).