2 # Copyright (C) 2006-2010 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR)/rules.mk
14 PKG_SOURCE:=sqlite-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=http://www.sqlite.org/
16 PKG_MD5SUM:=838dbac20b56d2c4292e98848505a05b
18 PKG_BUILD_DIR:=$(BUILD_DIR)/sqlite-$(PKG_VERSION)
20 PKG_BUILD_DEPENDS:=libncurses libreadline
26 include $(INCLUDE_DIR)/package.mk
28 TARGET_CFLAGS += $(FPIC)
30 define Package/sqlite2/Default
32 TITLE:=SQLite (v2.x) database engine
33 URL:=http://www.sqlite.org/
36 define Package/libsqlite2
37 $(call Package/sqlite2/Default)
43 define Package/libsqlite2/description
44 SQLite is a small C library that implements a self-contained, embeddable,
45 zero-configuration SQL database engine.
46 This package contains the SQLite (v2.x) shared library, used by other programs.
49 define Package/sqlite2-cli
50 $(call Package/sqlite2/Default)
53 DEPENDS:=+libsqlite2 +libncurses +libreadline
58 define Package/sqlite2-cli/description
59 SQLite is a small C library that implements a self-contained, embeddable,
60 zero-configuration SQL database engine.
61 This package contains a terminal-based front-end to the SQLite (v2.x) library
62 that can evaluate queries interactively and display the results in
66 define Build/Configure
67 $(call Build/Configure/Default, \
71 config_BUILD_CC="$(HOSTCC)" \
72 config_BUILD_CFLAGS="-O2" \
73 config_TARGET_CC="$(TARGET_CC)" \
74 config_TARGET_CFLAGS="$(TARGET_CFLAGS)" \
75 config_TARGET_READLINE_INC="$(TARGET_CPPFLAGS)" \
76 config_TARGET_READLINE_LIBS="$(TARGET_LDFLAGS) -lreadline -lncurses" \
77 config_TARGET_TCL_INC="-DNO_TCL=1" \
81 define Build/InstallDev
82 $(INSTALL_DIR) $(1)/usr/include
83 $(CP) $(PKG_INSTALL_DIR)/usr/include/sqlite.h $(1)/usr/include/
84 $(INSTALL_DIR) $(1)/usr/lib
85 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsqlite.{a,so*} $(1)/usr/lib/
86 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
87 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/sqlite.pc $(1)/usr/lib/pkgconfig/
90 define Package/libsqlite2/install
91 $(INSTALL_DIR) $(1)/usr/lib
92 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsqlite.so.* $(1)/usr/lib/
95 define Package/sqlite2-cli/install
96 $(INSTALL_DIR) $(1)/usr/bin
97 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/sqlite $(1)/usr/bin/
100 $(eval $(call BuildPackage,libsqlite2))
101 $(eval $(call BuildPackage,sqlite2-cli))