> I have downloaded sqlite-3.2.7.tar.gz from Internet, but I do not know how
> to compile it on s3c2410(linux 2.6, arm9, samsung)?
There's some info in the wiki on it, but basically the steps are:
1. change the configure script (see attached patch for 3.2.6)
2. configure with something like this (in my case an arm sa1110):
cd $PATH/sqlite-3.2.6
CC=arm-sa1100-linux-gnu-gcc CXX=arm-sa1100-linux-gnu-g++ \
CFLAGS=-I$TOOLCHAIN_BASE/include BUILD_CC=gcc \
./configure --host=i686-pc-linux --target=arm-sa1100-linux \
--disable-shared --disable-tcl --prefix=$PATH_INSTALL
3. change the Makefile a bit, setting 'BCC' to your regular compiler and (if
you want) add the static build flag, for example doing something like this:
mv Makefile Makefile.sed
cat Makefile.sed | sed 's/^BCC.*/BCC = gcc/' | sed 's/^LTLINK.*/&
-all-static/' > Makefile
rm Makefile.sed
4. make && make install
Mind you, depending on which core you have and whether you want floating
point, you might find the other patch attached usefull as well. It is from an
earlier posting of myself:
"In order to wrap this up: apparently there's a feature / bug (choose one) in
any ARM core earlier than v5 due to which a float will be stored in big
endian quad order. The processor in this particular case is an SA1110, which
is default little endian while having a v4 core. (and thus is 'swapping'
the quads)."
--
Best,
Frank.
--- configure_orig 2005-09-19 10:46:30.0 +0200
+++ configure 2005-09-19 10:46:34.0 +0200
@@ -19209,11 +19209,11 @@
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
- if test "$cross_compiling" = "yes"; then
-{ { echo "$as_me:$LINENO: error: unable to find a compiler for building build tools" >&5
-echo "$as_me: error: unable to find a compiler for building build tools" >&2;}
- { (exit 1); exit 1; }; }
- fi
+# if test "$cross_compiling" = "yes"; then
+#{ { echo "$as_me:$LINENO: error: unable to find a compiler for building build tools" >&5
+#echo "$as_me: error: unable to find a compiler for building build tools" >&2;}
+# { (exit 1); exit 1; }; }
+# fi
BUILD_CC=$CC
default_build_cflags=$CFLAGS
else
@@ -20165,11 +20165,11 @@
echo $ECHO_N "checking for $dir/include/readline.h... $ECHO_C" >&6
if eval "test \"\${$as_ac_File+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- test "$cross_compiling" = yes &&
- { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5
-echo "$as_me: error: cannot check for file existence when cross compiling" >&2;}
- { (exit 1); exit 1; }; }
+#else
+# test "$cross_compiling" = yes &&
+# { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5
+#echo "$as_me: error: cannot check for file existence when cross compiling" >&2;}
+# { (exit 1); exit 1; }; }
if test -r "$dir/include/readline.h"; then
eval "$as_ac_File=yes"
else
@@ -20191,11 +20191,11 @@
echo $ECHO_N "checking for $dir/include/readline/readline.h... $ECHO_C" >&6
if eval "test \"\${$as_ac_File+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- test "$cross_compiling" = yes &&
- { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5
-echo "$as_me: error: cannot check for file existence when cross compiling" >&2;}
- { (exit 1); exit 1; }; }
+#else
+# test "$cross_compiling" = yes &&
+# { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5
+#echo "$as_me: error: cannot check for file existence when cross compiling" >&2;}
+# { (exit 1); exit 1; }; }
if test -r "$dir/include/readline/readline.h"; then
eval "$as_ac_File=yes"
else
--- vdbeaux.c_orig 2005-09-17 19:48:56.0 +0200
+++ vdbeaux.c 2005-09-19 10:55:50.0 +0200
@@ -1509,7 +1509,11 @@
}
len = i = sqlite3VdbeSerialTypeLen(serial_type);
while( i-- ){
- buf[i] = (v&0xFF);
+ if( serial_type==7 ){
+buf[(i+4)%8] = (v&0xFF);
+ }else{
+buf[i] = (v&0xFF);
+ }
v >>= 8;
}
return len;
@@ -1568,28 +1572,20 @@
pMem->flags = MEM_Int;
return 6;
}
-case 6: /* 8-byte signed integer */
+case 6: { /* 8-byte signed integer */
+ u64 x = (buf[0]<<24) | (buf[1]<<16) | (buf[2]<<8) | buf[3];
+ u32 y = (buf[4]<<24) | (buf[5]<<16) | (buf[6]<<8) | buf[7];
+ x = (x<<32) | y;
+ pMem->i = *(i64*)
+ pMem->flags = MEM_Int;
+ return 8;
+}
case 7: { /* IEEE floating point */
- u64 x;
- u32 y;
-#ifndef NDEBUG
- /* Verify that integers and floating point values use the same
- ** byte order. The byte order differs on some (broken) architectures.
- */
- static const u64 t1 = ((u64)0x3ff0)<<32;
- assert( 1.0==*(double*) );
-#endif
-
- x = (buf[0]<<24) |