/
Makefile
188 lines (156 loc) · 4.28 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2012-2013, Joyent, Inc. All rights reserved.
#
VER = openssl-1.0.1d
LIBVER = 1.0.0
include ../Makefile.defs
SHELL = /bin/bash
BUILD64 = yes
UNPACK_SENTINEL = Configure
AUTOCONF_OUT = crypto/opensslconf.h
MT_CPPFLAGS = -D_REENTRANT
SHARED_CFLAGS = -fPIC -DPIC
SHARED_LDFLAGS = -fPIC -shared
PKCS11_SRCS = \
hw_pk11_err.c \
hw_pk11_err.h \
hw_pk11_pub.c \
hw_pk11_uri.c \
hw_pk11_uri.h \
hw_pk11.c \
hw_pk11.h
PKCS11_DST.32 = $(VER.32)/crypto/engine
PKCS11_DST.64 = $(VER.64)/crypto/engine
PKCS11.32 = $(PKCS11_SRCS:%=$(PKCS11_DST.32)/%)
PKCS11.64 = $(PKCS11_SRCS:%=$(PKCS11_DST.64)/%)
CHECK_LIBS = \
$(VER.32)/libsunw_crypto.so.$(LIBVER) \
$(VER.32)/libsunw_ssl.so.$(LIBVER) \
$(VER.64)/libsunw_crypto.so.$(LIBVER) \
$(VER.64)/libsunw_ssl.so.$(LIBVER)
#
# There are races between the building of assembly language sources and
# the assembly of those files. Disable parallel build.
#
PARALLEL =
CPPFLAGS += \
-DSOLARIS_OPENSSL \
-DNO_WINDOWS_BRAINDEATH \
-include openssl/sunw_prefix.h
CFLAGS += \
-O3 \
-march=pentium \
-Wall \
-Werror \
-DPK11_LIB_LOCATION=\\"/usr/lib/libpkcs11.so.1\\"
CFLAGS.64 += \
-O3 \
-Wall \
-Werror \
-DPK11_LIB_LOCATION=\\"/usr/lib/64/libpkcs11.so.1\\"
LIBS += -lsocket -lnsl
ifeq ($(STRAP),strap)
LDFLAGS += $(SYSLIBDIRS:%=-R$(DESTDIR)/%)
LDFLAGS.64 += $(SYSLIBDIRS:%=-R$(DESTDIR)/%/64)
endif
PATCHES = Patches/*
AUTOCONF_ENV =
AUTOCONF_OPTS += \
--openssldir=/etc/openssl \
--install_prefix=$(DESTDIR) \
no-ec \
no-ecdh \
no-ecdsa \
no-rc3 \
no-rc5 \
no-mdc2 \
no-idea \
no-hw_4758_cca \
no-hw_aep \
no-hw_atalla \
no-hw_chil \
no-hw_gmp \
no-hw_ncipher \
no-hw_nuron \
no-hw_padlock \
no-hw_sureware \
no-hw_ubsec \
no-hw_cswift \
enable-md2 \
threads \
shared
AUTOCONF_OPTS.32 += \
smartos-x86-gcc
AUTOCONF_OPTS.64 += \
smartos64-x86_64-gcc
$(PKCS11_DST.32)/%: engine_pkcs11/%
cp $< $@
$(PKCS11_DST.64)/%: engine_pkcs11/%
cp $< $@
$(VER.32)/%: %
cp $< $@
$(VER.64)/%: %
cp $< $@
$(VER.32)/configure: $(VER.32)/Configure Makefile $(PKCS11.32) \
$(VER.32)/sunw_prefix.h
sed -e 's#@@CC@@#$(GCC)#g' \
-e 's#@@CPPFLAGS@@#$(CPPFLAGS)#g' \
-e 's#@@CFLAGS@@#$(CFLAGS)#g' \
-e 's#@@MT_CPPFLAGS@@#$(MT_CPPFLAGS)#g' \
-e 's#@@LDFLAGS@@#$(LDFLAGS)#g' \
-e 's#@@LIBS@@#$(LIBS)#g' \
-e 's#@@SHARED_CFLAGS@@#$(SHARED_CFLAGS)#g' \
-e 's#@@SHARED_LDFLAGS@@#$(SHARED_LDFLAGS)#g' < $< > $@
chmod +x $@
$(VER.64)/configure: $(VER.64)/Configure Makefile $(PKCS11.64) \
$(VER.64)/sunw_prefix.h
sed -e 's#@@CC@@#$(GCC.64)#g' \
-e 's#@@CPPFLAGS@@#$(CPPFLAGS)#g' \
-e 's#@@CFLAGS@@#$(CFLAGS.64)#g' \
-e 's#@@MT_CPPFLAGS@@#$(MT_CPPFLAGS)#g' \
-e 's#@@LDFLAGS@@#$(LDFLAGS.64)#g' \
-e 's#@@LIBS@@#$(LIBS)#g' \
-e 's#@@SHARED_CFLAGS@@#$(SHARED_CFLAGS)#g' \
-e 's#@@SHARED_LDFLAGS@@#$(SHARED_LDFLAGS)#g' < $< > $@
chmod +x $@
all: all_autoconf
check: $(CHECK_LIBS:%=%.check)
%.check: %
syms="$$(/usr/bin/nm -ph $< | \
awk '$$2 == T && $$3 != _init && $$3 != _fini { print $$3 }' | \
grep -v ^sunw_)"; \
if [[ -n "$$syms" ]]; then \
echo "Unprefixed symbols found in $<: $$syms"; \
exit 1; \
else \
touch $@; \
fi
$(CHECK_LIBS): all
install_32: all check
DESTDIR=$(DESTDIR) VERDIR=$(VER.32) LIBVER=$(LIBVER) \
ksh93 ./install-sfw
install_64: all check
DESTDIR=$(DESTDIR) VERDIR=$(VER.64) LIBVER=$(LIBVER) \
ksh93 ./install-sfw-64
install: install_32 install_64
include ../Makefile.targ