You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

108 lines
2.8 KiB

  1. #
  2. # Copyright (C) 2006-2014 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=sqlite
  9. PKG_VERSION:=3210000
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-autoconf-$(PKG_VERSION).tar.gz
  12. PKG_HASH:=d7dd516775005ad87a57f428b6f86afd206cb341722927f104d3f0cf65fbbbe3
  13. PKG_SOURCE_URL:=http://www.sqlite.org/2017/
  14. PKG_LICENSE:=PUBLICDOMAIN
  15. PKG_LICENSE_FILES:=
  16. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-autoconf-$(PKG_VERSION)
  17. PKG_FIXUP:=autoreconf
  18. PKG_INSTALL:=1
  19. include $(INCLUDE_DIR)/package.mk
  20. define Package/sqlite3/Default
  21. SUBMENU:=database
  22. TITLE:=SQLite (v3.x) database engine
  23. URL:=http://www.sqlite.org/
  24. MAINTAINER:=Etienne CHAMPETIER <champetier.etienne@gmail.com>
  25. endef
  26. define Package/sqlite3/Default/description
  27. SQLite is a small C library that implements a self-contained, embeddable,
  28. zero-configuration SQL database engine.
  29. endef
  30. define Package/libsqlite3
  31. $(call Package/sqlite3/Default)
  32. SECTION:=libs
  33. CATEGORY:=Libraries
  34. DEPENDS:=+libpthread
  35. TITLE+= (library)
  36. endef
  37. define Package/libsqlite3/description
  38. $(call Package/sqlite3/Default/description)
  39. This package contains the SQLite (v3.x) shared library, used by other
  40. programs.
  41. endef
  42. define Package/sqlite3-cli
  43. $(call Package/sqlite3/Default)
  44. SECTION:=utils
  45. CATEGORY:=Utilities
  46. DEPENDS:=+libsqlite3 +libncurses +libreadline
  47. TITLE+= (cli)
  48. endef
  49. define Package/sqlite3-cli/description
  50. $(call Package/sqlite3/Default/description)
  51. This package contains a terminal-based front-end to the SQLite (v3.x) library
  52. that can evaluate queries interactively and display the results in multiple
  53. formats.
  54. endef
  55. TARGET_CFLAGS += $(FPIC) \
  56. -DSQLITE_ENABLE_UNLOCK_NOTIFY=1 \
  57. -DHAVE_ISNAN=1 \
  58. -DHAVE_MALLOC_USABLE_SIZE=1
  59. CONFIGURE_ARGS += \
  60. --enable-shared \
  61. --enable-static \
  62. --disable-editline
  63. CONFIGURE_VARS += \
  64. config_BUILD_CC="$(HOSTCC)" \
  65. config_BUILD_CFLAGS="-O2" \
  66. config_TARGET_CC="$(TARGET_CC)" \
  67. config_TARGET_CFLAGS="$(TARGET_CFLAGS)" \
  68. config_TARGET_READLINE_INC="$(TARGET_CPPFLAGS)" \
  69. config_TARGET_READLINE_LIBS="$(TARGET_LDFLAGS) -lreadline -lncurses" \
  70. define Build/InstallDev
  71. $(INSTALL_DIR) $(1)/usr/include
  72. $(CP) $(PKG_INSTALL_DIR)/usr/include/sqlite3{,ext}.h $(1)/usr/include/
  73. $(INSTALL_DIR) $(1)/usr/lib
  74. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsqlite3.{a,so*} $(1)/usr/lib/
  75. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  76. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/sqlite3.pc $(1)/usr/lib/pkgconfig/
  77. endef
  78. define Package/libsqlite3/install
  79. $(INSTALL_DIR) $(1)/usr/lib
  80. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsqlite3.so.* $(1)/usr/lib/
  81. endef
  82. define Package/sqlite3-cli/install
  83. $(INSTALL_DIR) $(1)/usr/bin
  84. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/sqlite3 $(1)/usr/bin/
  85. endef
  86. $(eval $(call BuildPackage,libsqlite3))
  87. $(eval $(call BuildPackage,sqlite3-cli))