Makefile 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  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.38.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:=af6b3c299bd891f43cb5f76c4091b7b4
  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_HTTPS \
  35. LIBCURL_IMAP \
  36. LIBCURL_LDAP \
  37. LIBCURL_LDAPS \
  38. LIBCURL_LIBCURL_OPTION \
  39. LIBCURL_NOSSL \
  40. LIBCURL_OPENSSL \
  41. LIBCURL_POLARSSL \
  42. LIBCURL_POP3 \
  43. LIBCURL_PROXY \
  44. LIBCURL_RTSP \
  45. LIBCURL_SMTP \
  46. LIBCURL_SSPI \
  47. LIBCURL_TELNET \
  48. LIBCURL_TFTP \
  49. LIBCURL_THREADED_RESOLVER \
  50. LIBCURL_TLS-SRP \
  51. LIBCURL_ZLIB
  52. include $(INCLUDE_DIR)/package.mk
  53. define Package/curl/Default
  54. SECTION:=net
  55. CATEGORY:=Network
  56. URL:=http://curl.haxx.se/
  57. MAINTAINER:=Imre Kaloz <[email protected]>
  58. endef
  59. define Package/curl
  60. $(call Package/curl/Default)
  61. SUBMENU:=File Transfer
  62. DEPENDS:=+libcurl
  63. TITLE:=A client-side URL transfer utility
  64. endef
  65. define Package/libcurl
  66. $(call Package/curl/Default)
  67. SECTION:=libs
  68. CATEGORY:=Libraries
  69. DEPENDS:=+LIBCURL_POLARSSL:libpolarssl +LIBCURL_CYASSL:libcyassl +LIBCURL_AXTLS:libaxtls +LIBCURL_OPENSSL:libopenssl +LIBCURL_GNUTLS:libgnutls +LIBCURL_ZLIB:zlib +LIBCURL_THREADED_RESOLVER:libpthread
  70. 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)
  71. MENU:=1
  72. endef
  73. define Package/libcurl/config
  74. source "$(SOURCE)/Config.in"
  75. endef
  76. TARGET_CFLAGS += $(FPIC)
  77. CONFIGURE_ARGS += \
  78. --enable-shared \
  79. --enable-static \
  80. --disable-thread \
  81. --enable-nonblocking \
  82. --disable-ares \
  83. --disable-debug \
  84. --disable-manual \
  85. --disable-verbose \
  86. --without-ca-bundle \
  87. $(if $(CONFIG_LIBCURL_OPENSSL),--with-ca-path=/etc/ssl/certs/) \
  88. --without-krb4 \
  89. --without-libidn \
  90. --without-nss \
  91. --without-libssh2 \
  92. $(call autoconf_bool,CONFIG_IPV6,ipv6) \
  93. $(if $(CONFIG_LIBCURL_AXTLS),--with-axtls="$(STAGING_DIR)/usr",--without-axtls) \
  94. $(if $(CONFIG_LIBCURL_COOKIES),--enable,--disable)-cookies \
  95. $(if $(CONFIG_LIBCURL_CRYPTO-AUTH),--enable,--disable)-crypto-auth \
  96. $(if $(CONFIG_LIBCURL_CYASSL),--with-cyassl="$(STAGING_DIR)/usr",--without-cyassl) \
  97. $(if $(CONFIG_LIBCURL_DICT),--enable,--disable)-dict \
  98. $(if $(CONFIG_LIBCURL_FILE),--enable,--disable)-file \
  99. $(if $(CONFIG_LIBCURL_FTP),--enable,--disable)-ftp \
  100. $(if $(CONFIG_LIBCURL_GOPHER),--enable,--disable)-gopher \
  101. $(if $(CONFIG_LIBCURL_GNUTLS),--with-gnutls="$(STAGING_DIR)/usr",--without-gnutls) \
  102. $(if $(CONFIG_LIBCURL_HTTP),--enable,--disable)-http \
  103. $(if $(CONFIG_LIBCURL_HTTPS),--enable,--disable)-https \
  104. $(if $(CONFIG_LIBCURL_IMAP),--enable,--disable)-imap \
  105. $(if $(CONFIG_LIBCURL_LDAP),--enable,--disable)-ldap \
  106. $(if $(CONFIG_LIBCURL_LDAPS),--enable,--disable)-ldaps \
  107. $(if $(CONFIG_LIBCURL_LIBCURL-OPTION),--enable,--disable)-libcurl-option \
  108. $(if $(CONFIG_LIBCURL_OPENSSL),--with-ssl="$(STAGING_DIR)/usr",--without-ssl) \
  109. $(if $(CONFIG_LIBCURL_POLARSSL),--with-polarssl="$(STAGING_DIR)/usr",--without-polarssl) \
  110. $(if $(CONFIG_LIBCURL_POP3),--enable,--disable)-pop3 \
  111. $(if $(CONFIG_LIBCURL_PROXY),--enable,--disable)-proxy \
  112. $(if $(CONFIG_LIBCURL_RTSP),--enable,--disable)-rtsp \
  113. $(if $(CONFIG_LIBCURL_TELNET),--enable,--disable)-telnet \
  114. $(if $(CONFIG_LIBCURL_TFTP),--enable,--disable)-tftp \
  115. $(if $(CONFIG_LIBCURL_SMTP),--enable,--disable)-smtp \
  116. $(if $(CONFIG_LIBCURL_SSPI),--enable,--disable)-sspi \
  117. $(if $(CONFIG_LIBCURL_THREADED_RESOLVER),--enable,--disable)-threaded-resolver \
  118. $(if $(CONFIG_LIBCURL_TLS-SRP),--enable,--disable)-tls-srp \
  119. $(if $(CONFIG_LIBCURL_ZLIB),--with-zlib="$(STAGING_DIR)/usr",--without-zlib) \
  120. define Build/Compile
  121. +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
  122. DESTDIR="$(PKG_INSTALL_DIR)" \
  123. CC="$(TARGET_CC)" \
  124. install
  125. endef
  126. define Build/InstallDev
  127. $(INSTALL_DIR) $(2)/bin $(1)/usr/bin $(1)/usr/include $(1)/usr/lib $(1)/usr/lib/pkgconfig
  128. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/curl-config $(1)/usr/bin/
  129. $(CP) $(PKG_INSTALL_DIR)/usr/include/curl $(1)/usr/include/
  130. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcurl.{a,so*} $(1)/usr/lib/
  131. $(CP) $(PKG_BUILD_DIR)/libcurl.pc $(1)/usr/lib/pkgconfig/
  132. $(SED) 's,-L$$$${exec_prefix}/lib,,g' $(1)/usr/bin/curl-config
  133. [ -n "$(TARGET_LDFLAGS)" ] && $(SED) 's#$(TARGET_LDFLAGS)##g' $(1)/usr/lib/pkgconfig/libcurl.pc || true
  134. $(LN) $(STAGING_DIR)/usr/bin/curl-config $(2)/bin/
  135. endef
  136. define Package/curl/install
  137. $(INSTALL_DIR) $(1)/usr/bin
  138. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/curl $(1)/usr/bin/
  139. endef
  140. define Package/libcurl/install
  141. $(INSTALL_DIR) $(1)/usr/lib
  142. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcurl.so.* $(1)/usr/lib/
  143. endef
  144. $(eval $(call BuildPackage,curl))
  145. $(eval $(call BuildPackage,libcurl))