title: static link openssl to sqlcipher
body: <p>I have build sqlcipher for Linux but it depends on openssl. I want to configure sqlcipher to work without external openssl library by linking it statically.
  I configure sqlcipher with this command</p>
  
  <pre><code>./configure --prefix=/home/admin/Downloads/qt-everywhere-opensource-src-4.8.0/src/plugins/sqldrivers/sqlcipher/ --disable-shared --enable-static --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC" LDFLAGS="/usr/lib64/libcrypto.a"
  make
  </code></pre>
  
  <p>after that I got next strings:</p>
  
  <pre><code>    /libtool --mode=link gcc   -DSQLITE_HAS_CODEC -DSQLITE_OS_UNIX=1 -I. -I./src -I./ext/rtree -D_HAVE_SQLITE_CONFIG_H -DNDEBUG  -I/usr/include -DSQLITE_THREADSAFE=1 -DSQLITE_OMIT_LOAD_EXTENSION=1   /usr/lib64/libcrypto.a  -DHAVE_READLINE=0  \
                  -o sqlite3 ./src/shell.c libsqlite3.la \
                   -lpthread  -rpath "/home/admin/Downloads/qt-everywhere-opensource-src-4.8.0/src/plugins/sqldrivers/sqlcipher/lib"  
  libtool: link: gcc -DSQLITE_HAS_CODEC -DSQLITE_OS_UNIX=1 -I. -I./src -I./ext/rtree -D_HAVE_SQLITE_CONFIG_H -DNDEBUG -I/usr/include -DSQLITE_THREADSAFE=1 -DSQLITE_OMIT_LOAD_EXTENSION=1 -DHAVE_READLINE=0 -o sqlite3 ./src/shell.c  /usr/lib64/libcrypto.a ./.libs/libsqlite3.a -lpthread -Wl,-rpath -Wl,/home/admin/Downloads/qt-everywhere-opensource-src-4.8.0/src/plugins/sqldrivers/sqlcipher/lib
  ./.libs/libsqlite3.a(sqlite3.o): In function `sqlcipher_activate':
  sqlite3.c:(.text+0xb66): undefined reference to `EVP_get_cipherbyname'
  sqlite3.c:(.text+0xb70): undefined reference to `OPENSSL_add_all_algorithms_noconf'
  ./.libs/libsqlite3.a(sqlite3.o): In function `sqlcipher_random':
  sqlite3.c:(.text+0xc0c): undefined reference to `RAND_bytes'
  ./.libs/libsqlite3.a(sqlite3.o): In function `sqlcipher_codec_ctx_set_cipher':
  sqlite3.c:(.text+0x11a2): undefined reference to `EVP_get_cipherbyname'
  sqlite3.c:(.text+0x11ba): undefined reference to `EVP_CIPHER_key_length'
  sqlite3.c:(.text+0x11d4): undefined reference to `EVP_CIPHER_iv_length'
  sqlite3.c:(.text+0x11ee): undefined reference to `EVP_CIPHER_block_size'
  sqlite3.c:(.text+0x11fd): undefined reference to `EVP_sha1'
  sqlite3.c:(.text+0x1205): undefined reference to `EVP_MD_size'
  ./.libs/libsqlite3.a(sqlite3.o): In function `sqlcipher_page_hmac':
  sqlite3.c:(.text+0x1880): undefined reference to `HMAC_CTX_init'
  sqlite3.c:(.text+0x1885): undefined reference to `EVP_sha1'
  sqlite3.c:(.text+0x18b9): undefined reference to `HMAC_Init_ex'
  sqlite3.c:(.text+0x18d9): undefined reference to `HMAC_Update'
  sqlite3.c:(.text+0x18f8): undefined reference to `HMAC_Update'
  sqlite3.c:(.text+0x1917): undefined reference to `HMAC_Final'
  sqlite3.c:(.text+0x1929): undefined reference to `HMAC_CTX_cleanup'
  ./.libs/libsqlite3.a(sqlite3.o): In function `sqlcipher_page_cipher':
  sqlite3.c:(.text+0x1b35): undefined reference to `EVP_CipherInit'
  sqlite3.c:(.text+0x1b4a): undefined reference to `EVP_CIPHER_CTX_set_padding'
  sqlite3.c:(.text+0x1b7a): undefined reference to `EVP_CipherInit'
  sqlite3.c:(.text+0x1ba2): undefined reference to `EVP_CipherUpdate'
  sqlite3.c:(.text+0x1bcc): undefined reference to `EVP_CipherFinal'
  sqlite3.c:(.text+0x1be2): undefined reference to `EVP_CIPHER_CTX_cleanup'
  ./.libs/libsqlite3.a(sqlite3.o): In function `sqlcipher_cipher_ctx_key_derive':
  sqlite3.c:(.text+0x1d3a): undefined reference to `PKCS5_PBKDF2_HMAC_SHA1'
  sqlite3.c:(.text+0x1e08): undefined reference to `PKCS5_PBKDF2_HMAC_SHA1'
  collect2: ld returned 1 exit status
  make: *** [sqlite3] Error 1
  </code></pre>
  
  <p>I have installed openssl and openssl-dev packages and /usr/lib64/libcrypto.a exists.
  What I do wrong?</p>