add missing dependency (#4654)
[openwrt/svn-archive/archive.git] / libs / sqlite3 / Makefile
1 #
2 # Copyright (C) 2006-2009 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=sqlite
12 PKG_VERSION:=3.5.9
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=http://www.sqlite.org/
17 PKG_MD5SUM:=b58412904b42fe49e5a281e99da0fd72
18
19 PKG_BUILD_DEPENDS:=libncurses libreadline
20
21 include $(INCLUDE_DIR)/package.mk
22
23 define Package/sqlite3/Default
24 SUBMENU:=database
25 TITLE:=SQLite (v3.x) database engine
26 URL:=http://www.sqlite.org/
27 endef
28
29 define Package/sqlite3/Default/description
30 SQLite is a small C library that implements a self-contained, embeddable,
31 zero-configuration SQL database engine.
32 endef
33
34 define Package/libsqlite3
35 $(call Package/sqlite3/Default)
36 SECTION:=libs
37 CATEGORY:=Libraries
38 DEPENDS:=+libpthread
39 TITLE+= (library)
40 endef
41
42 define Package/libsqlite3/description
43 $(call Package/sqlite3/Default/description)
44 This package contains the SQLite (v3.x) shared library, used by other
45 programs.
46 endef
47
48 define Package/sqlite3-cli
49 $(call Package/sqlite3/Default)
50 SECTION:=utils
51 CATEGORY:=Utilities
52 DEPENDS:=+libsqlite3 +libncurses +libreadline
53 TITLE+= (cli)
54 endef
55
56 define Package/sqlite3-cli/description
57 $(call Package/sqlite3/Default/description)
58 This package contains a terminal-based front-end to the SQLite (v3.x) library
59 that can evaluate queries interactively and display the results in multiple
60 formats.
61 endef
62
63 TARGET_CFLAGS += $(FPIC)
64
65 CONFIGURE_ARGS += \
66 --enable-shared \
67 --enable-static \
68 --disable-tcl \
69 --disable-amalgamation \
70
71 CONFIGURE_VARS += \
72 config_BUILD_CC="$(HOSTCC)" \
73 config_BUILD_CFLAGS="-O2" \
74 config_TARGET_CC="$(TARGET_CC)" \
75 config_TARGET_CFLAGS="$(TARGET_CFLAGS)" \
76 config_TARGET_READLINE_INC="-I$(STAGING_DIR)/usr/include" \
77 config_TARGET_READLINE_LIBS="-L$(STAGING_DIR)/usr/lib -lreadline -lncurses" \
78
79 define Build/Compile
80 $(MAKE) -C $(PKG_BUILD_DIR) \
81 DESTDIR="$(PKG_INSTALL_DIR)" \
82 all install
83 endef
84
85 define Build/InstallDev
86 $(INSTALL_DIR) $(1)/usr/include
87 $(CP) $(PKG_INSTALL_DIR)/usr/include/sqlite3.h $(1)/usr/include/
88 $(INSTALL_DIR) $(1)/usr/lib
89 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsqlite3.{a,so*} $(1)/usr/lib/
90 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
91 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/sqlite3.pc $(1)/usr/lib/pkgconfig/
92 endef
93
94 define Package/libsqlite3/install
95 $(INSTALL_DIR) $(1)/usr/lib
96 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsqlite3.so.* $(1)/usr/lib/
97 endef
98
99 define Package/sqlite3-cli/install
100 $(INSTALL_DIR) $(1)/usr/bin
101 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/sqlite3 $(1)/usr/bin/
102 endef
103
104 $(eval $(call BuildPackage,libsqlite3))
105 $(eval $(call BuildPackage,sqlite3-cli))