2 # Copyright (C) 2007-2016 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
14 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.xz
15 PKG_SOURCE_URL
:=https
://dl.uxnr.de
/mirror
/curl
/ \
16 https
://curl.mirror.anstey.ca
/ \
17 https
://curl.askapache.com
/download
/ \
18 https
://curl.haxx.se
/download
/
19 PKG_HASH
:=0ded0808c4d85f2ee0db86980ae610cc9d165e9ca9da466196cc73c346513713
22 PKG_LICENSE_FILES
:=COPYING
23 PKG_CPE_ID
:=cpe
:/a
:haxx
:libcurl
28 PKG_CONFIG_DEPENDS
:= \
31 CONFIG_LIBCURL_WOLFSSL \
32 CONFIG_LIBCURL_GNUTLS \
33 CONFIG_LIBCURL_OPENSSL \
34 CONFIG_LIBCURL_MBEDTLS \
35 CONFIG_LIBCURL_NOSSL \
37 CONFIG_LIBCURL_LIBIDN2 \
44 CONFIG_LIBCURL_GOPHER \
48 CONFIG_LIBCURL_LDAPS \
51 CONFIG_LIBCURL_NO_RTSP \
53 CONFIG_LIBCURL_NO_SMB \
55 CONFIG_LIBCURL_TELNET \
57 CONFIG_LIBCURL_NGHTTP2 \
59 CONFIG_LIBCURL_COOKIES \
60 CONFIG_LIBCURL_CRYPTO_AUTH \
61 CONFIG_LIBCURL_LIBCURL_OPTION \
62 CONFIG_LIBCURL_PROXY \
63 CONFIG_LIBCURL_THREADED_RESOLVER \
64 CONFIG_LIBCURL_TLS_SRP \
65 CONFIG_LIBCURL_UNIX_SOCKETS \
66 CONFIG_LIBCURL_VERBOSE \
68 $(if
$(CONFIG_LIBCURL_OPENSSL
), \
69 CONFIG_OPENSSL_ENGINE \
70 CONFIG_OPENSSL_WITH_COMPRESSION \
71 CONFIG_OPENSSL_WITH_NPN
)
73 include $(INCLUDE_DIR
)/package.mk
75 define Package
/curl
/Default
78 URL
:=http
://curl.haxx.se
/
79 MAINTAINER
:=Imre Kaloz
<kaloz@openwrt.org
>
83 $(call Package
/curl
/Default
)
84 SUBMENU
:=File Transfer
86 TITLE
:=A client-side URL transfer utility
89 define Package
/libcurl
90 $(call Package
/curl
/Default
)
93 DEPENDS
:= +LIBCURL_WOLFSSL
:libwolfssl
+LIBCURL_OPENSSL
:libopenssl
+LIBCURL_GNUTLS
:libgnutls
+LIBCURL_MBEDTLS
:libmbedtls
94 DEPENDS
+= +LIBCURL_ZLIB
:zlib
+LIBCURL_THREADED_RESOLVER
:libpthread
+LIBCURL_LDAP
:libopenldap
+LIBCURL_LIBIDN2
:libidn2
95 DEPENDS
+= +LIBCURL_SSH2
:libssh2
+LIBCURL_NGHTTP2
:libnghttp2
+ca-bundle
96 TITLE
:=A client-side URL transfer library
101 define Package
/libcurl
/config
102 source
"$(SOURCE)/Config.in"
105 TARGET_CFLAGS
+= $(FPIC
) -ffunction-sections
-fdata-sections
106 TARGET_CPPFLAGS
+= $(if
$(CONFIG_LIBCURL_NTLM
),,-DCURL_DISABLE_NTLM
)
107 TARGET_LDFLAGS
+= -Wl
,--gc-sections
116 --without-libmetalink \
122 --with-ca-bundle
=/etc
/ssl
/certs
/ca-certificates.crt \
124 $(call autoconf_bool
,CONFIG_IPV6
,ipv6
) \
126 $(if
$(CONFIG_LIBCURL_WOLFSSL
),--with-wolfssl
="$(STAGING_DIR)/usr",--without-wolfssl
) \
127 $(if
$(CONFIG_LIBCURL_GNUTLS
),--with-gnutls
="$(STAGING_DIR)/usr",--without-gnutls
) \
128 $(if
$(CONFIG_LIBCURL_OPENSSL
),--with-ssl
="$(STAGING_DIR)/usr",--without-ssl
) \
129 $(if
$(CONFIG_LIBCURL_MBEDTLS
),--with-mbedtls
="$(STAGING_DIR)/usr",--without-mbedtls
) \
131 $(if
$(CONFIG_LIBCURL_LIBIDN2
),--with-libidn2
="$(STAGING_DIR)/usr",--without-libidn2
) \
132 $(if
$(CONFIG_LIBCURL_SSH2
),--with-libssh2
="$(STAGING_DIR)/usr",--without-libssh2
) \
133 $(if
$(CONFIG_LIBCURL_ZLIB
),--with-zlib
="$(STAGING_DIR)/usr",--without-zlib
) \
134 $(if
$(CONFIG_LIBCURL_NGHTTP2
),--with-nghttp2
="$(STAGING_DIR)/usr",--without-nghttp2
) \
136 $(call autoconf_bool
,CONFIG_LIBCURL_DICT
,dict
) \
137 $(call autoconf_bool
,CONFIG_LIBCURL_FILE
,file
) \
138 $(call autoconf_bool
,CONFIG_LIBCURL_FTP
,ftp
) \
139 $(call autoconf_bool
,CONFIG_LIBCURL_GOPHER
,gopher
) \
140 $(call autoconf_bool
,CONFIG_LIBCURL_HTTP
,http
) \
141 $(call autoconf_bool
,CONFIG_LIBCURL_IMAP
,imap
) \
142 $(call autoconf_bool
,CONFIG_LIBCURL_LDAP
,ldap
) \
143 $(call autoconf_bool
,CONFIG_LIBCURL_LDAPS
,ldaps
) \
144 $(call autoconf_bool
,CONFIG_LIBCURL_POP3
,pop3
) \
145 $(call autoconf_bool
,CONFIG_LIBCURL_RTSP
,rtsp
) \
146 $(call autoconf_bool
,CONFIG_LIBCURL_SMB
,smb
) \
147 $(call autoconf_bool
,CONFIG_LIBCURL_SMTP
,smtp
) \
148 $(call autoconf_bool
,CONFIG_LIBCURL_TELNET
,telnet
) \
149 $(call autoconf_bool
,CONFIG_LIBCURL_TFTP
,tftp
) \
151 $(call autoconf_bool
,CONFIG_LIBCURL_COOKIES
,cookies
) \
152 $(call autoconf_bool
,CONFIG_LIBCURL_CRYPTO_AUTH
,crypto-auth
) \
153 $(call autoconf_bool
,CONFIG_LIBCURL_LIBCURL_OPTION
,libcurl-option
) \
154 $(call autoconf_bool
,CONFIG_LIBCURL_PROXY
,proxy
) \
155 $(call autoconf_bool
,CONFIG_LIBCURL_THREADED_RESOLVER
,threaded-resolver
) \
156 $(call autoconf_bool
,CONFIG_LIBCURL_TLS_SRP
,tls-srp
) \
157 $(call autoconf_bool
,CONFIG_LIBCURL_UNIX_SOCKETS
,unix-sockets
) \
158 $(call autoconf_bool
,CONFIG_LIBCURL_VERBOSE
,verbose
) \
161 +$(MAKE
) $(PKG_JOBS
) -C
$(PKG_BUILD_DIR
) \
162 DESTDIR
="$(PKG_INSTALL_DIR)" \
167 define Build
/InstallDev
168 $(INSTALL_DIR
) $(2)/bin
$(1)/usr
/bin
$(1)/usr
/include $(1)/usr
/lib
$(1)/usr
/lib
/pkgconfig
169 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/curl-config
$(1)/usr
/bin
/
170 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/curl
$(1)/usr
/include/
171 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libcurl.
{a
,so
*} $(1)/usr
/lib
/
172 $(CP
) $(PKG_BUILD_DIR
)/libcurl.
pc $(1)/usr
/lib
/pkgconfig
/
173 $(SED
) 's,-L$$$${exec_prefix}/lib,,g' $(1)/usr
/bin
/curl-config
174 [ -n
"$(TARGET_LDFLAGS)" ] && $(SED
) 's#$(TARGET_LDFLAGS)##g' $(1)/usr
/lib
/pkgconfig
/libcurl.
pc || true
175 $(LN
) $(STAGING_DIR
)/usr
/bin
/curl-config
$(2)/bin
/
178 define Package
/curl
/install
179 $(INSTALL_DIR
) $(1)/usr
/bin
180 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/curl
$(1)/usr
/bin
/
183 define Package
/libcurl
/install
184 $(INSTALL_DIR
) $(1)/usr
/lib
185 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libcurl.so.
* $(1)/usr
/lib
/
188 $(eval
$(call BuildPackage
,curl
))
189 $(eval
$(call BuildPackage
,libcurl
))