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