Makefile 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. #
  2. # Copyright (C) 2007-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:=curl
  9. PKG_VERSION:=7.36.0
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
  12. PKG_SOURCE_URL:=http://curl.haxx.se/download/ \
  13. http://www.mirrorspace.org/curl/ \
  14. ftp://ftp.sunet.se/pub/www/utilities/curl/ \
  15. ftp://ftp.planetmirror.com/pub/curl/ \
  16. http://www.mirrormonster.com/curl/download/ \
  17. http://curl.mirrors.cyberservers.net/download/
  18. PKG_MD5SUM:=e6d1f9d1b59da5062109ffe14e0569a4
  19. PKG_LICENSE:=MIT
  20. PKG_LICENSE_FILES:=COPYING
  21. PKG_FIXUP:=autoreconf
  22. PKG_BUILD_PARALLEL:=1
  23. PKG_CONFIG_DEPENDS := \
  24. LIBCURL_AXTLS \
  25. LIBCURL_COOKIES \
  26. LIBCURL_CRYPTO_AUTH \
  27. LIBCURL_CYASSL \
  28. LIBCURL_DICT \
  29. LIBCURL_FILE \
  30. LIBCURL_FTP \
  31. LIBCURL_GNUTLS \
  32. LIBCURL_GOPHER \
  33. LIBCURL_HTTP \
  34. LIBCURL_IMAP \
  35. LIBCURL_LDAP \
  36. LIBCURL_LDAPS \
  37. LIBCURL_LIBCURL_OPTION \
  38. LIBCURL_NOSSL \
  39. LIBCURL_OPENSSL \
  40. LIBCURL_POLARSSL \
  41. LIBCURL_POP3 \
  42. LIBCURL_PROXY \
  43. LIBCURL_RTSP \
  44. LIBCURL_SMTP \
  45. LIBCURL_SSPI \
  46. LIBCURL_TELNET \
  47. LIBCURL_TFTP \
  48. LIBCURL_THREADED_RESOLVER \
  49. LIBCURL_TLS-SRP \
  50. LIBCURL_ZLIB
  51. include $(INCLUDE_DIR)/package.mk
  52. define Package/curl/Default
  53. SECTION:=net
  54. CATEGORY:=Network
  55. URL:=http://curl.haxx.se/
  56. MAINTAINER:=Imre Kaloz <[email protected]>
  57. endef
  58. define Package/curl
  59. $(call Package/curl/Default)
  60. SUBMENU:=File Transfer
  61. DEPENDS:=+libcurl
  62. TITLE:=A client-side URL transfer utility
  63. endef
  64. define Package/libcurl
  65. $(call Package/curl/Default)
  66. SECTION:=libs
  67. CATEGORY:=Libraries
  68. DEPENDS:=+LIBCURL_POLARSSL:libpolarssl +LIBCURL_CYASSL:libcyassl +LIBCURL_AXTLS:libaxtls +LIBCURL_OPENSSL:libopenssl +LIBCURL_GNUTLS:libgnutls +LIBCURL_ZLIB:zlib +LIBCURL_THREADED_RESOLVER:libpthread
  69. TITLE:=A client-side URL transfer library using $(if $(CONFIG_LIBCURL_POLARSSL),PolarSSL)$(if $(CONFIG_LIBCURL_OPENSSL),OpenSSL)$(if $(CONFIG_LIBCURL_GNUTLS),GNUTLS)$(if $(CONFIG_LIBCURL_NOSSL),no SSL)
  70. MENU:=1
  71. endef
  72. define Package/libcurl/config
  73. source "$(SOURCE)/Config.in"
  74. endef
  75. TARGET_CFLAGS += $(FPIC)
  76. CONFIGURE_ARGS += \
  77. --enable-shared \
  78. --enable-static \
  79. --disable-thread \
  80. --enable-nonblocking \
  81. --disable-ares \
  82. --disable-debug \
  83. --disable-manual \
  84. --disable-verbose \
  85. --without-ca-bundle \
  86. --without-krb4 \
  87. --without-libidn \
  88. --without-nss \
  89. --without-libssh2 \
  90. $(call autoconf_bool,CONFIG_IPV6,ipv6) \
  91. $(if $(CONFIG_LIBCURL_AXTLS),--with-axtls="$(STAGING_DIR)/usr",--without-axtls) \
  92. $(if $(CONFIG_LIBCURL_COOKIES),--enable,--disable)-cookies \
  93. $(if $(CONFIG_LIBCURL_CRYPTO-AUTH),--enable,--disable)-crypto-auth \
  94. $(if $(CONFIG_LIBCURL_CYASSL),--with-cyassl="$(STAGING_DIR)/usr",--without-cyassl) \
  95. $(if $(CONFIG_LIBCURL_DICT),--enable,--disable)-dict \
  96. $(if $(CONFIG_LIBCURL_FILE),--enable,--disable)-file \
  97. $(if $(CONFIG_LIBCURL_FTP),--enable,--disable)-ftp \
  98. $(if $(CONFIG_LIBCURL_GOPHER),--enable,--disable)-gopher \
  99. $(if $(CONFIG_LIBCURL_GNUTLS),--with-gnutls="$(STAGING_DIR)/usr",--without-gnutls) \
  100. $(if $(CONFIG_LIBCURL_HTTP),--enable,--disable)-http \
  101. $(if $(CONFIG_LIBCURL_IMAP),--enable,--disable)-imap \
  102. $(if $(CONFIG_LIBCURL_LDAP),--enable,--disable)-ldap \
  103. $(if $(CONFIG_LIBCURL_LDAPS),--enable,--disable)-ldaps \
  104. $(if $(CONFIG_LIBCURL_LIBCURL-OPTION),--enable,--disable)-libcurl-option \
  105. $(if $(CONFIG_LIBCURL_OPENSSL),--with-ssl="$(STAGING_DIR)/usr",--without-ssl) \
  106. $(if $(CONFIG_LIBCURL_POLARSSL),--with-polarssl="$(STAGING_DIR)/usr",--without-polarssl) \
  107. $(if $(CONFIG_LIBCURL_POP3),--enable,--disable)-pop3 \
  108. $(if $(CONFIG_LIBCURL_PROXY),--enable,--disable)-proxy \
  109. $(if $(CONFIG_LIBCURL_RTSP),--enable,--disable)-rtsp \
  110. $(if $(CONFIG_LIBCURL_TELNET),--enable,--disable)-telnet \
  111. $(if $(CONFIG_LIBCURL_TFTP),--enable,--disable)-tftp \
  112. $(if $(CONFIG_LIBCURL_SMTP),--enable,--disable)-smtp \
  113. $(if $(CONFIG_LIBCURL_SSPI),--enable,--disable)-sspi \
  114. $(if $(CONFIG_LIBCURL_THREADED_RESOLVER),--enable,--disable)-threaded-resolver \
  115. $(if $(CONFIG_LIBCURL_TLS-SRP),--enable,--disable)-tls-srp \
  116. $(if $(CONFIG_LIBCURL_ZLIB),--with-zlib="$(STAGING_DIR)/usr",--without-zlib) \
  117. define Build/Compile
  118. +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
  119. DESTDIR="$(PKG_INSTALL_DIR)" \
  120. CC="$(TARGET_CC)" \
  121. install
  122. endef
  123. define Build/InstallDev
  124. $(INSTALL_DIR) $(2)/bin $(1)/usr/bin $(1)/usr/include $(1)/usr/lib $(1)/usr/lib/pkgconfig
  125. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/curl-config $(1)/usr/bin/
  126. $(CP) $(PKG_INSTALL_DIR)/usr/include/curl $(1)/usr/include/
  127. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcurl.{a,so*} $(1)/usr/lib/
  128. $(CP) $(PKG_BUILD_DIR)/libcurl.pc $(1)/usr/lib/pkgconfig/
  129. $(SED) 's,-L$$$${exec_prefix}/lib,,g' $(1)/usr/bin/curl-config
  130. [ -n "$(TARGET_LDFLAGS)" ] && $(SED) 's#$(TARGET_LDFLAGS)##g' $(1)/usr/lib/pkgconfig/libcurl.pc || true
  131. ln -sf $(STAGING_DIR)/usr/bin/curl-config $(2)/bin/
  132. endef
  133. define Package/curl/install
  134. $(INSTALL_DIR) $(1)/usr/bin
  135. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/curl $(1)/usr/bin/
  136. endef
  137. define Package/libcurl/install
  138. $(INSTALL_DIR) $(1)/usr/lib
  139. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcurl.so.* $(1)/usr/lib/
  140. endef
  141. $(eval $(call BuildPackage,curl))
  142. $(eval $(call BuildPackage,libcurl))