blob: f33528fb4d4e0a07ee9d1bf6bc672f6391633671 [file] [log] [blame]
Arnout Vandecappelle (Essensium/Mind)1541d642012-01-23 21:23:25 +01001#############################################################
2#
3# Sqlcipher extension of sqlite
4# http://sqlcipher.net
5#
6#############################################################
Alexandre Belloni70270402013-06-05 23:53:25 +00007
Arnout Vandecappelle (Essensium/Mind)1541d642012-01-23 21:23:25 +01008SQLCIPHER_VERSION = 1.1.9
9SQLCIPHER_SITE = http://github.com/sjlombardo/sqlcipher/tarball/v$(SQLCIPHER_VERSION)
10SQLCIPHER_DEPENDENCIES = openssl host-tcl
11SQLCIPHER_INSTALL_STAGING = YES
12
13SQLCIPHER_CONF_ENV = \
14 CFLAGS+=" $(SQLCIPHER_CFLAGS)" \
15 LDFLAGS+=" $(SQLCIPHER_LDFLAGS)" \
Peter Korsgaard16b17c92012-01-24 14:59:26 +010016 TCLSH_CMD=$(HOST_DIR)/usr/bin/tclsh$(TCL_VERSION_MAJOR)
Arnout Vandecappelle (Essensium/Mind)1541d642012-01-23 21:23:25 +010017
18SQLCIPHER_CONF_OPT = \
19 --enable-threadsafe \
20 --localstatedir=/var
21
22SQLCIPHER_CFLAGS += -DSQLITE_HAS_CODEC # Required according to the README
23SQLCIPHER_LDFLAGS += -lcrypto
24
25ifneq ($(BR2_LARGEFILE),y)
26# the sqlite configure script fails to define SQLITE_DISABLE_LFS when
27# --disable-largefile is passed, breaking the build. Work around it by
28# simply adding it to CFLAGS for configure instead
29SQLCIPHER_CFLAGS += -DSQLITE_DISABLE_LFS
30endif
31
32ifeq ($(BR2_PACKAGE_SQLCIPHER_STAT3),y)
33SQLCIPHER_CFLAGS += -DSQLITE_ENABLE_STAT3
34endif
35
36ifeq ($(BR2_PACKAGE_SQLCIPHER_READLINE),y)
37SQLCIPHER_DEPENDENCIES += ncurses readline
38SQLCIPHER_CONF_OPT += --with-readline-inc="-I$(STAGING_DIR)/usr/include"
39else
40SQLCIPHER_CONF_OPT += --disable-readline
41endif
42
43define SQLCIPHER_UNINSTALL_TARGET_CMDS
44 rm -f $(TARGET_DIR)/usr/bin/sqlite3
45 rm -f $(TARGET_DIR)/usr/lib/libsqlite3*
46 rm -f $(TARGET_DIR)/usr/lib/pkgconfig/sqlite3.pc
47 rm -f $(TARGET_DIR)/usr/include/sqlite3*.h
48endef
49
50define SQLCIPHER_UNINSTALL_STAGING_CMDS
51 rm -f $(STAGING_DIR)/usr/bin/sqlite3
52 rm -f $(STAGING_DIR)/usr/lib/libsqlite3*
53 rm -f $(STAGING_DIR)/usr/lib/pkgconfig/sqlite3.pc
54 rm -f $(STAGING_DIR)/usr/include/sqlite3*.h
55endef
56
Arnout Vandecappelle (Essensium/Mind)e1502eb2012-07-03 00:07:32 +020057$(eval $(autotools-package))