packages: fix parallel build by adding + for every make command that passes the jobserver
[packages.git] / libs / curl / Makefile
1
2 # Copyright (C) 2007-2011 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=curl
11 PKG_VERSION:=7.23.1
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15 PKG_SOURCE_URL:=http://curl.haxx.se/download/ \
16         http://www.mirrorspace.org/curl/ \
17         http://curl.mirror.internet.tp/download/ \
18         ftp://ftp.sunet.se/pub/www/utilities/curl/ \
19         ftp://ftp.planetmirror.com/pub/curl/ \
20         http://www.mirrormonster.com/curl/download/ \
21         http://curl.mirrors.cyberservers.net/download/
22 PKG_MD5SUM:=0296d3196b4bf82c896a869b38dbc5f2
23
24 PKG_FIXUP:=autoreconf
25 PKG_BUILD_PARALLEL:=1
26
27 include $(INCLUDE_DIR)/package.mk
28
29 define Package/curl/Default
30   SECTION:=net
31   CATEGORY:=Network
32   URL:=http://curl.haxx.se/
33 endef
34
35 define Package/curl
36   $(call Package/curl/Default)
37   SUBMENU:=File Transfer
38   DEPENDS:=+libcurl
39   TITLE:=A client-side URL transfer utility
40 endef
41
42 define Package/libcurl
43   $(call Package/curl/Default)
44   SECTION:=libs
45   CATEGORY:=Libraries
46   DEPENDS:=+libopenssl +zlib
47   TITLE:=A client-side URL transfer library
48 endef
49
50 TARGET_CFLAGS += $(FPIC)
51
52 CONFIGURE_ARGS += \
53         --enable-shared \
54         --enable-static \
55         --disable-thread \
56         --enable-cookies \
57         --enable-crypto-auth \
58         --enable-nonblocking \
59         --enable-file \
60         --enable-ftp \
61         --enable-http \
62         --disable-ares \
63         --disable-debug \
64         --disable-dict \
65         --disable-gopher \
66         --disable-ldap \
67         --disable-manual \
68         --disable-sspi \
69         --disable-telnet \
70         --enable-tftp \
71         --disable-verbose \
72         --with-random="/dev/urandom" \
73         --with-ssl="$(STAGING_DIR)/usr" \
74         --without-ca-bundle \
75         --without-gnutls \
76         --without-krb4 \
77         --without-libidn \
78         --without-nss \
79         --without-libssh2 \
80         --with-zlib="$(STAGING_DIR)/usr" \
81         $(call autoconf_bool,CONFIG_IPV6,ipv6) \
82
83 CONFIGURE_VARS += \
84         LDFLAGS="$$$$LDFLAGS -lcrypto -lssl -lz" \
85         CC="$(filter-out ccache,$(TARGET_CC))"
86
87 define Build/Compile
88         +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
89                 DESTDIR="$(PKG_INSTALL_DIR)" \
90                 CC="$(TARGET_CC)" \
91                 install
92 endef
93
94 define Build/InstallDev
95         $(INSTALL_DIR) $(2)/bin $(1)/usr/bin $(1)/usr/include $(1)/usr/lib $(1)/usr/lib/pkgconfig
96         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/curl-config $(1)/usr/bin/
97         $(CP) $(PKG_INSTALL_DIR)/usr/include/curl $(1)/usr/include/
98         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcurl.{a,so*} $(1)/usr/lib/
99         $(CP) $(PKG_BUILD_DIR)/libcurl.pc $(1)/usr/lib/pkgconfig/
100         $(SED) 's,-L$$$${exec_prefix}/lib,,g' $(1)/usr/bin/curl-config
101         [ -n "$(TARGET_LDFLAGS)" ] && $(SED) 's#$(TARGET_LDFLAGS)##g' $(1)/usr/lib/pkgconfig/libcurl.pc || true
102         ln -sf $(STAGING_DIR)/usr/bin/curl-config $(2)/bin/
103 endef
104
105 define Package/curl/install
106         $(INSTALL_DIR) $(1)/usr/bin
107         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/curl $(1)/usr/bin/
108 endef
109
110 define Package/libcurl/install
111         $(INSTALL_DIR) $(1)/usr/lib
112         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcurl.so.* $(1)/usr/lib/
113 endef
114
115 $(eval $(call BuildPackage,curl))
116 $(eval $(call BuildPackage,libcurl))