building SQLCipher for Android

366 views
Skip to first unread message

liche...@gmail.com

unread,
Mar 23, 2012, 2:20:56 PM3/23/12
to SQLCipher Users
Hi, I am having issues trying to build SQLCipher for Android. I was
following the instructions on
http://sqlcipher.net/sqlcipher-for-android/#build-tutorial

and upon reaching the step in Building, at the "make" after the "make
init", the make would fail when doing ./configure for sqlcipher. I
was building on Ubuntu x86-64 cross-compiling for ARM (as typical of
Android development)

The instruction on the page does not mention any special setup steps
for cross compiling. Any special steps required?

Thanks for any info on this.

Nick Parker

unread,
Mar 23, 2012, 2:26:00 PM3/23/12
to sqlc...@googlegroups.com
Hello,

Could you share what error message you received during the ./configure
step of the build process?

--
Nick Parker

Andy Tai

unread,
Mar 23, 2012, 2:30:38 PM3/23/12
to sqlc...@googlegroups.com
atai@atai-ubuntu:~/workspace/sqlcipher_android/android-database-sqlcipher$ make
cd external/ && \
    make -f Android.mk build-local-hack && \
    ndk-build && \
    make -f Android.mk copy-libs-hack
make[1]: Entering directory `/home/atai/workspace/sqlcipher_android/android-database-sqlcipher/external'
cd sqlcipher && ./configure --enable-tempstore=yes CFLAGS="-DSQL_HAS_CODEC" LDFLAGS="-lcrypto"
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for gcc... arm-none-linux-gnueabi-gcc --sysroot=/home/atai/arm-2010q1/arm-none-linux-gnueabi/libc
checking for C compiler default output file name...
configure: error: C compiler cannot create executables
See `config.log' for more details.
make[1]: *** [sqlcipher/sqlite3.c] Error 77
make[1]: Leaving directory `/home/atai/workspace/sqlcipher_android/android-database-sqlcipher/external'
make: *** [build-external] Error 2

As you can see I tried to set the environment var CC to the ARM cross compiler... but that was not enough
--
Andy Tai, at...@atai.org, Skype: licheng.tai
Year 2012 民國101年
自動的精神力是信仰與覺悟
自動的行為力是勞動與技能

Nick Parker

unread,
Mar 23, 2012, 2:38:09 PM3/23/12
to sqlc...@googlegroups.com
Hi Andy,

If you are building on Ubuntu you will want to make sure you've got the GNU compiler chain.  From a terminal prompt you'll want to execute:

sudo apt-get install build-essential

It also statically links in the OpenSSL libcyrypto.so library, you will need this on your machine as well.  Can you try this and verify if you are able to successfully build?  Thanks!
-- 
Nick Parker
Reply all
Reply to author
Forward
0 new messages