Makefile 3.0 KB

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