4

I am new to compiling and want to create a binary file of sqlcipher for use in hybrid android apps.

I am stuck here

Building SQLCipher is almost the same as compiling a regular version of SQLite with two small exceptions:

You must define SQLITE_HAS_CODEC and SQLITE_TEMP_STORE=2 when building sqlcipher. You need to link against a OpenSSL's libcrypto Example Static linking (replace /opt/local/lib with the path to libcrypto.a). Note in this example, --enable-tempstore=yes is setting SQLITE_TEMP_STORE=2 for the build.

$ ./configure --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC" \ LDFLAGS="/opt/local/lib/libcrypto.a" $ make Example Dynamic linking

$ ./configure --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC" \ LDFLAGS="-lcrypto" $ make

This instruction seems to be for compiling on Linux. Can anyone tell me how can I do it in windows? Also 2nd difficulty is I have to include OpenSSL's libcrypto library. I don't know what it is, why is it required, from where to download it and how to include it while compiling.

Amron
  • 197
  • 1
  • 9
  • 1
    Is there a particular reason you are compiling it yourself on Windows, rather than using the existing SQLCipher for Android binaries? – CommonsWare Apr 17 '15 at 16:03
  • I want to learn how compilation works and also need to compile some other programs too. – Amron Apr 18 '15 at 09:16

1 Answers1

0

Compiling SQLCipher for Android is a much more involved process than just building basic binaries of SQLCipher. That should certainly not stop you however, and if you are interested in learning more about how the project is structured, and built, we provide the source to SQLCipher for Android here.

In terms of build instructions, it is generally performed on either OS X, or Linux, along with the Android NDK, I have never built SQLCipher for Android on a Windows machine. The entire build process is orchestrated using this Makefile.

Nick Parker
  • 1,378
  • 1
  • 7
  • 10