Makefile 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. #
  2. # Copyright (C) 2007-2016 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.50.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:=9e463ff8fdc1b5daa81c850c514980ec
  19. PKG_LICENSE:=MIT
  20. PKG_LICENSE_FILES:=COPYING
  21. PKG_FIXUP:=autoreconf
  22. PKG_BUILD_PARALLEL:=1
  23. PKG_CONFIG_DEPENDS:= \
  24. CONFIG_IPV6 \
  25. \
  26. CONFIG_LIBCURL_AXTLS \
  27. CONFIG_LIBCURL_CYASSL \
  28. CONFIG_LIBCURL_GNUTLS \
  29. CONFIG_LIBCURL_OPENSSL \
  30. CONFIG_LIBCURL_POLARSSL \
  31. CONFIG_LIBCURL_MBEDTLS \
  32. CONFIG_LIBCURL_NOSSL \
  33. \
  34. CONFIG_LIBCURL_LIBIDN \
  35. CONFIG_LIBCURL_SSH2 \
  36. CONFIG_LIBCURL_ZLIB \
  37. \
  38. CONFIG_LIBCURL_DICT \
  39. CONFIG_LIBCURL_FILE \
  40. CONFIG_LIBCURL_FTP \
  41. CONFIG_LIBCURL_GOPHER \
  42. CONFIG_LIBCURL_HTTP \
  43. CONFIG_LIBCURL_IMAP \
  44. CONFIG_LIBCURL_LDAP \
  45. CONFIG_LIBCURL_LDAPS \
  46. CONFIG_LIBCURL_POP3 \
  47. CONFIG_LIBCURL_RTSP \
  48. CONFIG_LIBCURL_NO_RTSP \
  49. CONFIG_LIBCURL_SMB \
  50. CONFIG_LIBCURL_NO_SMB \
  51. CONFIG_LIBCURL_SMTP \
  52. CONFIG_LIBCURL_TELNET \
  53. CONFIG_LIBCURL_TFTP \
  54. \
  55. CONFIG_LIBCURL_COOKIES \
  56. CONFIG_LIBCURL_CRYPTO_AUTH \
  57. CONFIG_LIBCURL_LIBCURL_OPTION \
  58. CONFIG_LIBCURL_PROXY \
  59. CONFIG_LIBCURL_THREADED_RESOLVER \
  60. CONFIG_LIBCURL_TLS_SRP \
  61. CONFIG_LIBCURL_UNIX_SOCKETS \
  62. CONFIG_LIBCURL_VERBOSE \
  63. CONFIG_LIBCURL_NTLM
  64. include $(INCLUDE_DIR)/package.mk
  65. define Package/curl/Default
  66. SECTION:=net
  67. CATEGORY:=Network
  68. URL:=http://curl.haxx.se/
  69. MAINTAINER:=Imre Kaloz <kaloz@openwrt.org>
  70. endef
  71. define Package/curl
  72. $(call Package/curl/Default)
  73. SUBMENU:=File Transfer
  74. DEPENDS:=+libcurl
  75. TITLE:=A client-side URL transfer utility
  76. endef
  77. define Package/libcurl
  78. $(call Package/curl/Default)
  79. SECTION:=libs
  80. CATEGORY:=Libraries
  81. DEPENDS:=+LIBCURL_POLARSSL:libpolarssl +LIBCURL_CYASSL:libcyassl +LIBCURL_AXTLS:libaxtls +LIBCURL_OPENSSL:libopenssl +LIBCURL_GNUTLS:libgnutls +LIBCURL_MBEDTLS:libmbedtls
  82. DEPENDS += +LIBCURL_ZLIB:zlib +LIBCURL_THREADED_RESOLVER:libpthread +LIBCURL_LDAP:libopenldap +LIBCURL_LIBIDN:libidn +LIBCURL_SSH2:libssh2
  83. TITLE:=A client-side URL transfer library
  84. MENU:=1
  85. endef
  86. define Package/libcurl/config
  87. source "$(SOURCE)/Config.in"
  88. endef
  89. TARGET_CFLAGS += $(FPIC) -ffunction-sections -fdata-sections
  90. TARGET_CPPFLAGS += $(if $(CONFIG_LIBCURL_NTLM),,-DCURL_DISABLE_NTLM)
  91. TARGET_LDFLAGS += -Wl,--gc-sections
  92. CONFIGURE_ARGS += \
  93. --disable-debug \
  94. --disable-ares \
  95. --enable-shared \
  96. --enable-static \
  97. --disable-manual \
  98. --without-nss \
  99. --without-libmetalink \
  100. --without-librtmp \
  101. \
  102. $(call autoconf_bool,CONFIG_IPV6,ipv6) \
  103. \
  104. $(if $(CONFIG_LIBCURL_AXTLS),--with-axtls="$(STAGING_DIR)/usr" --without-ca-path,--without-axtls) \
  105. $(if $(CONFIG_LIBCURL_CYASSL),--with-cyassl="$(STAGING_DIR)/usr" --without-ca-path --with-ca-bundle=/etc/ssl/certs/ca-certificates.crt,--without-cyassl) \
  106. $(if $(CONFIG_LIBCURL_GNUTLS),--with-gnutls="$(STAGING_DIR)/usr" --without-ca-bundle --with-ca-path=/etc/ssl/certs,--without-gnutls) \
  107. $(if $(CONFIG_LIBCURL_OPENSSL),--with-ssl="$(STAGING_DIR)/usr" --without-ca-bundle --with-ca-path=/etc/ssl/certs,--without-ssl) \
  108. $(if $(CONFIG_LIBCURL_POLARSSL),--with-polarssl="$(STAGING_DIR)/usr" --without-ca-bundle --with-ca-path=/etc/ssl/certs,--without-polarssl) \
  109. $(if $(CONFIG_LIBCURL_MBEDTLS),--with-mbedtls="$(STAGING_DIR)/usr" --without-ca-path --with-ca-bundle=/etc/ssl/certs/ca-certificates.crt,--without-mbedtls) \
  110. \
  111. $(if $(CONFIG_LIBCURL_LIBIDN),--with-libidn="$(STAGING_DIR)/usr",--without-libidn) \
  112. $(if $(CONFIG_LIBCURL_SSH2),--with-libssh2="$(STAGING_DIR)/usr",--without-libssh2) \
  113. $(if $(CONFIG_LIBCURL_ZLIB),--with-zlib="$(STAGING_DIR)/usr",--without-zlib) \
  114. \
  115. $(call autoconf_bool,CONFIG_LIBCURL_DICT,dict) \
  116. $(call autoconf_bool,CONFIG_LIBCURL_FILE,file) \
  117. $(call autoconf_bool,CONFIG_LIBCURL_FTP,ftp) \
  118. $(call autoconf_bool,CONFIG_LIBCURL_GOPHER,gopher) \
  119. $(call autoconf_bool,CONFIG_LIBCURL_HTTP,http) \
  120. $(call autoconf_bool,CONFIG_LIBCURL_IMAP,imap) \
  121. $(call autoconf_bool,CONFIG_LIBCURL_LDAP,ldap) \
  122. $(call autoconf_bool,CONFIG_LIBCURL_LDAPS,ldaps) \
  123. $(call autoconf_bool,CONFIG_LIBCURL_POP3,pop3) \
  124. $(call autoconf_bool,CONFIG_LIBCURL_RTSP,rtsp) \
  125. $(call autoconf_bool,CONFIG_LIBCURL_SMB,smb) \
  126. $(call autoconf_bool,CONFIG_LIBCURL_SMTP,smtp) \
  127. $(call autoconf_bool,CONFIG_LIBCURL_TELNET,telnet) \
  128. $(call autoconf_bool,CONFIG_LIBCURL_TFTP,tftp) \
  129. \
  130. $(call autoconf_bool,CONFIG_LIBCURL_COOKIES,cookies) \
  131. $(call autoconf_bool,CONFIG_LIBCURL_CRYPTO_AUTH,crypto-auth) \
  132. $(call autoconf_bool,CONFIG_LIBCURL_LIBCURL_OPTION,libcurl-option) \
  133. $(call autoconf_bool,CONFIG_LIBCURL_PROXY,proxy) \
  134. $(call autoconf_bool,CONFIG_LIBCURL_THREADED_RESOLVER,threaded-resolver) \
  135. $(call autoconf_bool,CONFIG_LIBCURL_TLS_SRP,tls-srp) \
  136. $(call autoconf_bool,CONFIG_LIBCURL_UNIX_SOCKETS,unix-sockets) \
  137. $(call autoconf_bool,CONFIG_LIBCURL_VERBOSE,verbose) \
  138. define Build/Compile
  139. +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
  140. DESTDIR="$(PKG_INSTALL_DIR)" \
  141. CC="$(TARGET_CC)" \
  142. install
  143. endef
  144. define Build/InstallDev
  145. $(INSTALL_DIR) $(2)/bin $(1)/usr/bin $(1)/usr/include $(1)/usr/lib $(1)/usr/lib/pkgconfig
  146. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/curl-config $(1)/usr/bin/
  147. $(CP) $(PKG_INSTALL_DIR)/usr/include/curl $(1)/usr/include/
  148. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcurl.{a,so*} $(1)/usr/lib/
  149. $(CP) $(PKG_BUILD_DIR)/libcurl.pc $(1)/usr/lib/pkgconfig/
  150. $(SED) 's,-L$$$${exec_prefix}/lib,,g' $(1)/usr/bin/curl-config
  151. [ -n "$(TARGET_LDFLAGS)" ] && $(SED) 's#$(TARGET_LDFLAGS)##g' $(1)/usr/lib/pkgconfig/libcurl.pc || true
  152. $(LN) $(STAGING_DIR)/usr/bin/curl-config $(2)/bin/
  153. endef
  154. define Package/curl/install
  155. $(INSTALL_DIR) $(1)/usr/bin
  156. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/curl $(1)/usr/bin/
  157. endef
  158. define Package/libcurl/install
  159. $(INSTALL_DIR) $(1)/usr/lib
  160. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcurl.so.* $(1)/usr/lib/
  161. endef
  162. $(eval $(call BuildPackage,curl))
  163. $(eval $(call BuildPackage,libcurl))