0
|
1 |
#
|
|
2 |
# CDDL HEADER START
|
|
3 |
#
|
|
4 |
# The contents of this file are subject to the terms of the
|
|
5 |
# Common Development and Distribution License (the "License").
|
|
6 |
# You may not use this file except in compliance with the License.
|
|
7 |
#
|
|
8 |
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
|
9 |
# or http://www.opensolaris.org/os/licensing.
|
|
10 |
# See the License for the specific language governing permissions
|
|
11 |
# and limitations under the License.
|
|
12 |
#
|
|
13 |
# When distributing Covered Code, include this CDDL HEADER in each
|
|
14 |
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
|
15 |
# If applicable, add the following below this CDDL HEADER, with the
|
|
16 |
# fields enclosed by brackets "[]" replaced with your own identifying
|
|
17 |
# information: Portions Copyright [yyyy] [name of copyright owner]
|
|
18 |
#
|
|
19 |
# CDDL HEADER END
|
|
20 |
#
|
|
21 |
#
|
|
22 |
# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
|
|
23 |
# Use is subject to license terms.
|
|
24 |
#
|
|
25 |
#ident "@(#)Makefile.sfw 1.9 09/08/24 SMI"
|
|
26 |
#
|
|
27 |
# This makefile builds both 32 and 64 bit versions of the library.
|
|
28 |
# Builds occur in separate directories.
|
|
29 |
#
|
|
30 |
|
|
31 |
VER=curl-7.19.5
|
|
32 |
VER64=$(VER)-64
|
|
33 |
|
|
34 |
LARGEFILES= -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
|
|
35 |
PREFIX = /usr
|
|
36 |
|
|
37 |
# We need to do this because libtool adds wrong paths to RPATH.
|
|
38 |
LDFLAGS += -L$(PREFIX)/lib -R$(PREFIX)/lib
|
|
39 |
LDFLAGS += -L$(ROOT)/usr/lib
|
|
40 |
LDFLAGS += -lgss
|
|
41 |
|
|
42 |
EXTRA_LDFLAGS64 += -L$(PREFIX)/lib/$(MACH64)
|
|
43 |
EXTRA_LDFLAGS64 += -L$(ROOT)/lib/$(MACH64)
|
|
44 |
EXTRA_LDFLAGS64 += -R$(PREFIX)/lib/$(MACH64)
|
|
45 |
EXTRA_LDFLAGS64 += -lgss
|
|
46 |
|
|
47 |
LD_OPTIONS = -M $(SRC)/cmd/mapfile_noexstk -z ignore
|
|
48 |
LD_OPTIONS += -lsocket -lresolv -lnsl -lgen
|
|
49 |
|
|
50 |
include ../Makefile.lib
|
|
51 |
|
|
52 |
CONFIGURE_OPTIONS = --localstatedir=/var --enable-shared
|
|
53 |
CONFIGURE_OPTIONS += --disable-static --enable-http --enable-ftp
|
|
54 |
CONFIGURE_OPTIONS += --enable-file --enable-dict
|
|
55 |
CONFIGURE_OPTIONS += --enable-telnet --enable-tftp
|
|
56 |
CONFIGURE_OPTIONS += --enable-manual --disable-libgcc
|
|
57 |
CONFIGURE_OPTIONS += --enable-ipv6 --enable-nonblocking
|
|
58 |
CONFIGURE_OPTIONS += --enable-thread --enable-verbose
|
|
59 |
CONFIGURE_OPTIONS += --disable-sspi --enable-crypto-auth
|
|
60 |
CONFIGURE_OPTIONS += --enable-cookies --disable-hidden-symbols
|
|
61 |
CONFIGURE_OPTIONS += --disable-soname-bump
|
|
62 |
CONFIGURE_OPTIONS += --enable-ldap --with-random=/dev/urandom
|
|
63 |
CONFIGURE_OPTIONS += --with-ssl --with-ldap-lib=ldap
|
|
64 |
CONFIGURE_OPTIONS += --with-lber-lib=sldap
|
|
65 |
CONFIGURE_OPTIONS += --with-gssapi-includes=/usr/include/gssapi
|
|
66 |
CONFIGURE_OPTIONS += --with-gssapi-libs=/usr/lib
|
|
67 |
CONFIGURE_OPTIONS += --with-gssapi=/usr --with-ca-bundle=/etc/curl/curlCA
|
|
68 |
CONFIGURE_OPTIONS += --with-zlib=/usr --with-libidn=/usr
|
|
69 |
CONFIGURE_OPTIONS += --with-pic
|
|
70 |
|
|
71 |
all: real-all
|
|
72 |
|
|
73 |
all32: $(VER)/config.status
|
|
74 |
(cd $(VER); env - "CFLAGS=$(CFLAGS) $(XREGSFLAG) $(LARGEFILES)" \
|
|
75 |
"LD_OPTIONS=$(LD_OPTIONS)" \
|
|
76 |
"LDFLAGS=$(LDFLAGS)" \
|
|
77 |
PATH=$(SFW_PATH) \
|
|
78 |
"MAKE=$(CCSMAKE)" $(CCSMAKE) -e)
|
|
79 |
|
|
80 |
# if we do not add $($(MACH64)_XARCH), CXX will assume that it's linking
|
|
81 |
# 32-bit, and linking will fail.
|
|
82 |
all64: $(VER64)/config.status
|
|
83 |
(cd $(VER64); env - "CFLAGS=$(CFLAGS64) $(XREGSFLAG64) $(LARGEFILES)" \
|
|
84 |
"LD_OPTIONS=$(LD_OPTIONS)" \
|
|
85 |
"LDFLAGS=$(EXTRA_LDFLAGS64) $($(MACH64)_XARCH)" \
|
|
86 |
PATH=$(SFW_PATH) \
|
|
87 |
"MAKE=$(CCSMAKE)" $(CCSMAKE) -e)
|
|
88 |
|
|
89 |
COMPAT_VERSION= 5
|
|
90 |
|
|
91 |
# We need to add this because idn's includes and libraries should be
|
|
92 |
# picked up from the shadow build area (for now)
|
|
93 |
CPPFLAGS += -I$(ROOT)/usr/include/idn
|
|
94 |
|
|
95 |
# We want a thread-safe curl
|
|
96 |
CFLAGS += -mt -D_REENTRANT -D__EXTENSIONS__
|
|
97 |
CFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
|
|
98 |
CFLAGS += -D_XPG6 -D_XOPEN_SOURCE=600 -D_POSIX_PTHREAD_SEMANTICS
|
|
99 |
CFLAGS += -D_POSIX_C_SOURCE=200112L -D__XOPEN_OR_POSIX
|
|
100 |
CPPFLAGS += -D_THREAD_SAFE -D_REENTRANT -D__EXTENSIONS__
|
|
101 |
CPPFLAGS += -D_LARGEFILE_SOURCE
|
|
102 |
CPPFLAGS += -D_FILE_OFFSET_BITS=64 -D_XPG6 -D_XOPEN_SOURCE=600
|
|
103 |
CPPFLAGS += -D_POSIX_PTHREAD_SEMANTICS -D_POSIX_C_SOURCE=200112L
|
|
104 |
CPPFLAGS += -D__XOPEN_OR_POSIX
|
|
105 |
|
|
106 |
# lint stuff
|
|
107 |
LIBRARY=libcurl.a
|
|
108 |
LINTOUT= lint.out
|
|
109 |
LINTFLAGS= -I./include -I. -Xc99=%all $(CCBITS32) $(LARGEFILES)
|
|
110 |
LINTFLAGS64= -I./include -I. -Xc99=%all $(CCBITS64) $(LARGEFILES)
|
|
111 |
|
|
112 |
install: all
|
|
113 |
$(SH) ./install-sfw
|
|
114 |
MACH64=$(MACH64) $(SH) ./install-sfw-64
|
|
115 |
|
|
116 |
real-all: all32 all64 lint32 lint64
|
|
117 |
|
|
118 |
test: test32 test64
|
|
119 |
|
|
120 |
# We need to use a different method for correcting the pkgconfig *.pc
|
|
121 |
# files generated by libtool for curl. The contents of these files is,
|
|
122 |
# by default, wrong. It includes the entire LDFLAGS, and it does not
|
|
123 |
# include the correct -L directive for 64-bit builds. This is done
|
|
124 |
# by maintaining a correct set of libcurl.pc and libcurl-64.pc files,
|
|
125 |
# and determining at make time the appropriate 64-bit ISA on which
|
|
126 |
# the build is run.
|
|
127 |
|
|
128 |
$(VER)/config.status: $(VER)/configure
|
|
129 |
( cd $(VER); \
|
|
130 |
env - "CC=$(CC)" \
|
|
131 |
"CPPFLAGS=$(CPPFLAGS)" \
|
|
132 |
"CFLAGS=$(CPPFLAGS) $(CFLAGS)" \
|
|
133 |
"CPP=$(CC) $(CFLAGS) $(CPPFLAGS) -E" \
|
|
134 |
"CXX=$(CCC)" "CXXFLAGS=$(CPPFLAGS) $(CCFLAGS)" \
|
|
135 |
"CXXCPP=$(CCC) $(CPPFLAGS) $(CCFLAGS) -E" \
|
|
136 |
"LDFLAGS=$(LDFLAGS)" \
|
|
137 |
"LD_OPTIONS=$(LD_OPTIONS)" \
|
|
138 |
"CXXLDFLAGS=$(LDFLAGS)" \
|
|
139 |
"CXXLD=$(CCC) $(LDFLAGS)" \
|
|
140 |
PATH=$(SFW_PATH) \
|
|
141 |
"INSTALL=$(GINSTALL)" \
|
|
142 |
"MAKE=$(CCSMAKE)" \
|
|
143 |
./configure --prefix=$(PREFIX) \
|
|
144 |
--bindir=$(PREFIX)/bin \
|
|
145 |
--sbindir=$(PREFIX)/sbin \
|
|
146 |
--libdir=$(PREFIX)/lib \
|
|
147 |
--libexecdir=$(PREFIX)/libexec \
|
|
148 |
$(CONFIGURE_OPTIONS) ; \
|
|
149 |
rm -f curl-config; \
|
|
150 |
cp -p ../Solaris/curl-config .; \
|
|
151 |
touch -acm curl-config; \
|
|
152 |
rm -f libcurl.pc; \
|
|
153 |
cp -p ../Solaris/libcurl.pc .; \
|
|
154 |
touch -acm libcurl.pc)
|
|
155 |
|
|
156 |
$(VER64)/config.status: $(VER64)/configure
|
|
157 |
( cd $(VER64); \
|
|
158 |
env - "CC=$(CC64)" \
|
|
159 |
"CPPFLAGS=$(CPPFLAGS)" \
|
|
160 |
"CFLAGS=$(CPPFLAGS) $(CFLAGS64)" \
|
|
161 |
"CPP=$(CC64) $(CFLAGS64) $(CPPFLAGS) -E" \
|
|
162 |
"CXX=$(CCC64)" "CXXFLAGS=$(CPPFLAGS) $(CCFLAGS64)" \
|
|
163 |
"CXXCPP=$(CCC64) $(CPPFLAGS) $(CCFLAGS64) -E" \
|
|
164 |
"LDFLAGS=$(EXTRA_LDFLAGS64) $($(MACH64)_XARCH)" \
|
|
165 |
"LD_OPTIONS=$(LD_OPTIONS)" \
|
|
166 |
"CXXLDFLAGS=$(EXTRA_LDFLAGS64) $($(MACH64)_XARCH)" \
|
|
167 |
"CXXLD=$(CCC64) $(EXTRA_LDFLAGS64) $($(MACH64)_XARCH)" \
|
|
168 |
"CXXLINKLIB=$(CCC64) $(EXTRA_LDFLAGS64) $($(MACH64)_XARCH)" \
|
|
169 |
"MACH64=$(MACH64)" \
|
|
170 |
PATH=$(SFW_PATH) \
|
|
171 |
"INSTALL=$(GINSTALL)" \
|
|
172 |
"MAKE=$(CCSMAKE)" \
|
|
173 |
./configure --prefix=$(PREFIX) \
|
|
174 |
--bindir=$(PREFIX)/bin/$(MACH64) \
|
|
175 |
--sbindir=$(PREFIX)/sbin/$(MACH64) \
|
|
176 |
--libdir=$(PREFIX)/lib/$(MACH64) \
|
|
177 |
--libexecdir=$(PREFIX)/libexec/$(MACH64) \
|
|
178 |
$(CONFIGURE_OPTIONS) ; \
|
|
179 |
rm -f curl-config; \
|
|
180 |
cp -p ../Solaris/curl-config-64 curl-config; \
|
|
181 |
touch -acm curl-config; \
|
|
182 |
rm -f libcurl.pc; \
|
|
183 |
cp -p ../Solaris/libcurl.pc .; \
|
|
184 |
/bin/ksh ../postprocess-pkgconfig-64 libcurl.pc )
|
|
185 |
|
|
186 |
$(VER)/configure: $(VER).tar.gz
|
|
187 |
mkdir -p tmp; gzip -dc $(VER).tar.gz | (cd tmp; tar xopf -)
|
|
188 |
mv tmp/$(VER) $(VER); rmdir tmp
|
|
189 |
( cd $(VER) ; \
|
|
190 |
gpatch -p1 <../Solaris/diffs/configure.0.diff ; \
|
|
191 |
gpatch -p1 <../Solaris/diffs/Makefile.in.1.diff ; \
|
|
192 |
gpatch -p1 <../Solaris/diffs/curlbuild.h.2.diff ; \
|
|
193 |
gpatch -p1 <../Solaris/diffs/Makefile.in.3.diff ; \
|
|
194 |
gpatch -p1 < ../Solaris/diffs/curl-7.19.5-CVE-2009-2417.patch ; \
|
|
195 |
gpatch -p1 < ../Solaris/diffs/curl-multi-crash-2.patch ; \
|
|
196 |
touch -acm configure ; \
|
|
197 |
touch -acm include/curl/curlbuild.h ; \
|
|
198 |
chmod 0755 configure )
|
|
199 |
|
|
200 |
$(VER64)/configure: $(VER).tar.gz
|
|
201 |
mkdir -p tmp; gzip -dc $(VER).tar.gz | (cd tmp; tar xopf -)
|
|
202 |
mv tmp/$(VER) $(VER64); rmdir tmp
|
|
203 |
( cd $(VER64) ; \
|
|
204 |
gpatch -p1 <../Solaris/diffs/configure.0.diff ; \
|
|
205 |
gpatch -p1 <../Solaris/diffs/Makefile.in.1.diff ; \
|
|
206 |
gpatch -p1 <../Solaris/diffs/curlbuild.h.2.diff ; \
|
|
207 |
gpatch -p1 <../Solaris/diffs/Makefile.in.3.diff ; \
|
|
208 |
gpatch -p1 < ../Solaris/diffs/curl-7.19.5-CVE-2009-2417.patch ; \
|
|
209 |
gpatch -p1 < ../Solaris/diffs/curl-multi-crash-2.patch ; \
|
|
210 |
touch -acm configure ; \
|
|
211 |
touch -acm include/curl/curlbuild.h ; \
|
|
212 |
chmod 0755 configure )
|
|
213 |
clean:
|
|
214 |
-rm -rf $(VER)
|
|
215 |
-rm -rf $(VER64)
|
|
216 |
|
|
217 |
lint32: $(VER)/config.status
|
|
218 |
(cd $(VER); \
|
|
219 |
$(LINT.c) -o $(LIBNAME) ../llib-lcurl > $(LINTOUT) 2>&1)
|
|
220 |
|
|
221 |
lint64: $(VER64)/config.status
|
|
222 |
(cd $(VER64); \
|
|
223 |
$(LINT64.c) -o $(LIBNAME) ../llib-lcurl > $(LINTOUT) 2>&1)
|
|
224 |
|
|
225 |
test32: $(VER)/config.status
|
|
226 |
( cd $(VER) ; \
|
|
227 |
$(GMAKE) check > $(SRC)/lib/curl/test-results-$(MACH).out 2>&1 )
|
|
228 |
|
|
229 |
test64: $(VER64)/config.status
|
|
230 |
( cd $(VER64) ; \
|
|
231 |
$(GMAKE) check > $(SRC)/lib/curl/test-results-$(MACH64).out 2>&1 )
|
|
232 |
|
|
233 |
install_h:
|
|
234 |
|
|
235 |
include ../Makefile.targ
|