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.bz2
15 PKG_SOURCE_URL
:=https
://dl.uxnr.de
/mirror
/curl
/ \
16 http
://curl.mirror.anstey.ca
/ \
17 http
://curl.askapache.com
/download
/ \
18 https
://curl.haxx.se
/download
/
19 PKG_HASH
:=2594670367875e7d87b0f129b5e4690150780884d90244ba0fe3e74a778b5f90
22 PKG_LICENSE_FILES
:=COPYING
27 PKG_CONFIG_DEPENDS
:= \
30 CONFIG_LIBCURL_WOLFSSL \
31 CONFIG_LIBCURL_GNUTLS \
32 CONFIG_LIBCURL_OPENSSL \
33 CONFIG_LIBCURL_MBEDTLS \
34 CONFIG_LIBCURL_NOSSL \
36 CONFIG_LIBCURL_LIBIDN \
43 CONFIG_LIBCURL_GOPHER \
47 CONFIG_LIBCURL_LDAPS \
50 CONFIG_LIBCURL_NO_RTSP \
52 CONFIG_LIBCURL_NO_SMB \
54 CONFIG_LIBCURL_TELNET \
56 CONFIG_LIBCURL_NGHTTP2 \
58 CONFIG_LIBCURL_COOKIES \
59 CONFIG_LIBCURL_CRYPTO_AUTH \
60 CONFIG_LIBCURL_LIBCURL_OPTION \
61 CONFIG_LIBCURL_PROXY \
62 CONFIG_LIBCURL_THREADED_RESOLVER \
63 CONFIG_LIBCURL_TLS_SRP \
64 CONFIG_LIBCURL_UNIX_SOCKETS \
65 CONFIG_LIBCURL_VERBOSE \
68 include $(INCLUDE_DIR
)/package.mk
70 define Package
/curl
/Default
73 URL
:=http
://curl.haxx.se
/
74 MAINTAINER
:=Imre Kaloz
<kaloz@openwrt.org
>
78 $(call Package
/curl
/Default
)
79 SUBMENU
:=File Transfer
81 TITLE
:=A client-side URL transfer utility
84 define Package
/libcurl
85 $(call Package
/curl
/Default
)
88 DEPENDS
:= +LIBCURL_WOLFSSL
:libwolfssl
+LIBCURL_OPENSSL
:libopenssl
+LIBCURL_GNUTLS
:libgnutls
+LIBCURL_MBEDTLS
:libmbedtls
89 DEPENDS
+= +LIBCURL_ZLIB
:zlib
+LIBCURL_THREADED_RESOLVER
:libpthread
+LIBCURL_LDAP
:libopenldap
+LIBCURL_LIBIDN
:libidn
90 DEPENDS
+= +LIBCURL_SSH2
:libssh2
+LIBCURL_NGHTTP2
:libnghttp2
91 TITLE
:=A client-side URL transfer library
96 define Package
/libcurl
/config
97 source
"$(SOURCE)/Config.in"
100 TARGET_CFLAGS
+= $(FPIC
) -ffunction-sections
-fdata-sections
101 TARGET_CPPFLAGS
+= $(if
$(CONFIG_LIBCURL_NTLM
),,-DCURL_DISABLE_NTLM
)
102 TARGET_LDFLAGS
+= -Wl
,--gc-sections
111 --without-libmetalink \
114 $(call autoconf_bool
,CONFIG_IPV6
,ipv6
) \
116 $(if
$(CONFIG_LIBCURL_WOLFSSL
),--with-cyassl
="$(STAGING_DIR)/usr" --without-ca-path
--with-ca-bundle
=/etc
/ssl
/certs
/ca-certificates.crt
,--without-cyassl
) \
117 $(if
$(CONFIG_LIBCURL_GNUTLS
),--with-gnutls
="$(STAGING_DIR)/usr" --without-ca-bundle
--with-ca-path
=/etc
/ssl
/certs
,--without-gnutls
) \
118 $(if
$(CONFIG_LIBCURL_OPENSSL
),--with-ssl
="$(STAGING_DIR)/usr" --without-ca-bundle
--with-ca-path
=/etc
/ssl
/certs
,--without-ssl
) \
119 $(if
$(CONFIG_LIBCURL_MBEDTLS
),--with-mbedtls
="$(STAGING_DIR)/usr" --without-ca-path
--with-ca-bundle
=/etc
/ssl
/certs
/ca-certificates.crt
,--without-mbedtls
) \
121 $(if
$(CONFIG_LIBCURL_LIBIDN
),--with-libidn
="$(STAGING_DIR)/usr",--without-libidn
) \
122 $(if
$(CONFIG_LIBCURL_SSH2
),--with-libssh2
="$(STAGING_DIR)/usr",--without-libssh2
) \
123 $(if
$(CONFIG_LIBCURL_ZLIB
),--with-zlib
="$(STAGING_DIR)/usr",--without-zlib
) \
124 $(if
$(CONFIG_LIBCURL_NGHTTP2
),--with-nghttp2
="$(STAGING_DIR)/usr",--without-nghttp2
) \
126 $(call autoconf_bool
,CONFIG_LIBCURL_DICT
,dict
) \
127 $(call autoconf_bool
,CONFIG_LIBCURL_FILE
,file
) \
128 $(call autoconf_bool
,CONFIG_LIBCURL_FTP
,ftp
) \
129 $(call autoconf_bool
,CONFIG_LIBCURL_GOPHER
,gopher
) \
130 $(call autoconf_bool
,CONFIG_LIBCURL_HTTP
,http
) \
131 $(call autoconf_bool
,CONFIG_LIBCURL_IMAP
,imap
) \
132 $(call autoconf_bool
,CONFIG_LIBCURL_LDAP
,ldap
) \
133 $(call autoconf_bool
,CONFIG_LIBCURL_LDAPS
,ldaps
) \
134 $(call autoconf_bool
,CONFIG_LIBCURL_POP3
,pop3
) \
135 $(call autoconf_bool
,CONFIG_LIBCURL_RTSP
,rtsp
) \
136 $(call autoconf_bool
,CONFIG_LIBCURL_SMB
,smb
) \
137 $(call autoconf_bool
,CONFIG_LIBCURL_SMTP
,smtp
) \
138 $(call autoconf_bool
,CONFIG_LIBCURL_TELNET
,telnet
) \
139 $(call autoconf_bool
,CONFIG_LIBCURL_TFTP
,tftp
) \
141 $(call autoconf_bool
,CONFIG_LIBCURL_COOKIES
,cookies
) \
142 $(call autoconf_bool
,CONFIG_LIBCURL_CRYPTO_AUTH
,crypto-auth
) \
143 $(call autoconf_bool
,CONFIG_LIBCURL_LIBCURL_OPTION
,libcurl-option
) \
144 $(call autoconf_bool
,CONFIG_LIBCURL_PROXY
,proxy
) \
145 $(call autoconf_bool
,CONFIG_LIBCURL_THREADED_RESOLVER
,threaded-resolver
) \
146 $(call autoconf_bool
,CONFIG_LIBCURL_TLS_SRP
,tls-srp
) \
147 $(call autoconf_bool
,CONFIG_LIBCURL_UNIX_SOCKETS
,unix-sockets
) \
148 $(call autoconf_bool
,CONFIG_LIBCURL_VERBOSE
,verbose
) \
151 +$(MAKE
) $(PKG_JOBS
) -C
$(PKG_BUILD_DIR
) \
152 DESTDIR
="$(PKG_INSTALL_DIR)" \
157 define Build
/InstallDev
158 $(INSTALL_DIR
) $(2)/bin
$(1)/usr
/bin
$(1)/usr
/include $(1)/usr
/lib
$(1)/usr
/lib
/pkgconfig
159 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/curl-config
$(1)/usr
/bin
/
160 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/curl
$(1)/usr
/include/
161 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libcurl.
{a
,so
*} $(1)/usr
/lib
/
162 $(CP
) $(PKG_BUILD_DIR
)/libcurl.
pc $(1)/usr
/lib
/pkgconfig
/
163 $(SED
) 's,-L$$$${exec_prefix}/lib,,g' $(1)/usr
/bin
/curl-config
164 [ -n
"$(TARGET_LDFLAGS)" ] && $(SED
) 's#$(TARGET_LDFLAGS)##g' $(1)/usr
/lib
/pkgconfig
/libcurl.
pc || true
165 $(LN
) $(STAGING_DIR
)/usr
/bin
/curl-config
$(2)/bin
/
168 define Package
/curl
/install
169 $(INSTALL_DIR
) $(1)/usr
/bin
170 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/curl
$(1)/usr
/bin
/
173 define Package
/libcurl
/install
174 $(INSTALL_DIR
) $(1)/usr
/lib
175 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libcurl.so.
* $(1)/usr
/lib
/
178 $(eval
$(call BuildPackage
,curl
))
179 $(eval
$(call BuildPackage
,libcurl
))