|
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 # Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. |
|
22 # |
|
23 include $(WS_TOP)/make-rules/shared-macros.mk |
|
24 |
|
25 COMPONENT_NAME = openssl |
|
26 # When new version of OpenSSL comes in, you must update both COMPONENT_VERSION |
|
27 # and IPS_COMPONENT_VERSION. |
|
28 COMPONENT_VERSION = 1.0.0d |
|
29 # Version for IPS. It is easier to do it manually than convert the letter to a |
|
30 # number while taking into account that there might be no letter at all. |
|
31 IPS_COMPONENT_VERSION = 1.0.0.4 |
|
32 COMPONENT_SRC = $(COMPONENT_NAME)-$(COMPONENT_VERSION) |
|
33 COMPONENT_ARCHIVE = $(COMPONENT_SRC).tar.gz |
|
34 COMPONENT_ARCHIVE_HASH= sha1:32ca934f380a547061ddab7221b1a34e4e07e8d5 |
|
35 COMPONENT_ARCHIVE_URL = http://www.openssl.org/source/$(COMPONENT_ARCHIVE) |
|
36 |
|
37 include $(WS_TOP)/make-rules/prep.mk |
|
38 include $(WS_TOP)/make-rules/configure.mk |
|
39 include $(WS_TOP)/make-rules/ips.mk |
|
40 include $(WS_TOP)/make-rules/lint-libraries.mk |
|
41 |
|
42 # OpenSSL does not use autoconf but its own configure system. |
|
43 CONFIGURE_SCRIPT = $(SOURCE_DIR)/Configure |
|
44 |
|
45 # Used in the configure options below. |
|
46 PKCS11_LIB32 = /usr/lib/libpkcs11.so.1 |
|
47 PKCS11_LIB64 = /usr/lib/64/libpkcs11.so.1 |
|
48 ENGINESDIR_32 = /lib/openssl/engines |
|
49 ENGINESDIR_64 = /lib/openssl/engines/64 |
|
50 |
|
51 CONFIGURE_OPTIONS = -DSOLARIS_OPENSSL -DNO_WINDOWS_BRAINDEATH |
|
52 CONFIGURE_OPTIONS += --openssldir=/etc/openssl |
|
53 CONFIGURE_OPTIONS += --prefix=/usr |
|
54 # We use OpenSSL install code for installing only manual pages and we do that |
|
55 # for 32-bit version only. |
|
56 CONFIGURE_OPTIONS += --install_prefix=$(PROTO_DIR) |
|
57 CONFIGURE_OPTIONS += no-ec |
|
58 CONFIGURE_OPTIONS += no-ecdh |
|
59 CONFIGURE_OPTIONS += no-ecdsa |
|
60 CONFIGURE_OPTIONS += no-rc3 |
|
61 CONFIGURE_OPTIONS += no-rc5 |
|
62 CONFIGURE_OPTIONS += no-mdc2 |
|
63 CONFIGURE_OPTIONS += no-idea |
|
64 CONFIGURE_OPTIONS += no-hw_4758_cca |
|
65 CONFIGURE_OPTIONS += no-hw_aep |
|
66 CONFIGURE_OPTIONS += no-hw_atalla |
|
67 CONFIGURE_OPTIONS += no-hw_chil |
|
68 CONFIGURE_OPTIONS += no-hw_gmp |
|
69 CONFIGURE_OPTIONS += no-hw_ncipher |
|
70 CONFIGURE_OPTIONS += no-hw_nuron |
|
71 CONFIGURE_OPTIONS += no-hw_padlock |
|
72 CONFIGURE_OPTIONS += no-hw_sureware |
|
73 CONFIGURE_OPTIONS += no-hw_ubsec |
|
74 CONFIGURE_OPTIONS += no-hw_cswift |
|
75 CONFIGURE_OPTIONS += threads |
|
76 CONFIGURE_OPTIONS += shared |
|
77 # MD2 is not enabled by default in OpensSSL but some software we have in |
|
78 # Userland needs it. One example is nmap. |
|
79 CONFIGURE_OPTIONS += enable-md2 |
|
80 CONFIGURE_OPTIONS += no-seed |
|
81 # We use both no-whirlpool and no-whrlpool since there is an inconsistency in |
|
82 # the OpenSSL code and one needs both to build OpenSSL successfully with |
|
83 # Whirlpool implementation removed. |
|
84 CONFIGURE_OPTIONS += no-whirlpool |
|
85 CONFIGURE_OPTIONS += no-whrlpool |
|
86 |
|
87 # We define our own compiler and linker option sets for Solaris. See Configure |
|
88 # for more information. |
|
89 CONFIGURE_OPTIONS32_i386 = solaris-x86-cc-sunw |
|
90 CONFIGURE_OPTIONS32_sparc = solaris-sparcv9-cc-sunw |
|
91 CONFIGURE_OPTIONS64_i386 = solaris64-x86_64-cc-sunw |
|
92 CONFIGURE_OPTIONS64_sparc = solaris64-sparcv9-cc-sunw |
|
93 |
|
94 # Some additional options needed for our engines. |
|
95 CONFIGURE_OPTIONS += --pk11-libname=$(PKCS11_LIB$(BITS)) |
|
96 CONFIGURE_OPTIONS += --enginesdir=$(ENGINESDIR_$(BITS)) |
|
97 CONFIGURE_OPTIONS += $(CONFIGURE_OPTIONS$(BITS)_$(MACH)) |
|
98 |
|
99 # OpenSSL has its own configure system which must be run from the fully |
|
100 # populated source code directory. However, the Userland configuration phase is |
|
101 # run from the build directory. So, we must get the full source code into the |
|
102 # build directory. |
|
103 COMPONENT_PRE_CONFIGURE_ACTION = \ |
|
104 ( $(CLONEY) $(SOURCE_DIR) $(BUILD_DIR)/$(MACH$(BITS)); ) |
|
105 |
|
106 # We deliver only one opensslconf.h file which must be suitable for both 32 and |
|
107 # 64 bits. Depending on the configuration option, OpenSSL's Configure script |
|
108 # creates opensslconf.h for either 32 or 64 bits. A patch makes the resulting |
|
109 # header file usable on both architectures. The patch was generated against the |
|
110 # opensslconf.h version from the 32 bit build. |
|
111 COMPONENT_POST_CONFIGURE_ACTION = \ |
|
112 ( [ $(BITS) -eq 32 ] && $(GPATCH) -p1 $(@D)/crypto/opensslconf.h \ |
|
113 patches-post-config/opensslconf.patch; cd $(@D); $(MAKE) depend; ) |
|
114 |
|
115 # We do not ship our engines as patches since it would be more difficult to |
|
116 # update the files which have been under continuous development. We rather copy |
|
117 # the files to the right directories. |
|
118 COMPONENT_PRE_BUILD_ACTION = \ |
|
119 ( $(CP) -fp engines/devcrypto/* $(@D)/engines; \ |
|
120 $(CP) -fp engines/pkcs11/* $(@D)/crypto/engine; ) |
|
121 |
|
122 build: $(BUILD_32_and_64) |
|
123 |
|
124 # OpenSSL uses sections man[1357] by default so we must create the man |
|
125 # directories we use for OpenSSL man pages in Solaris. Note that we patch the |
|
126 # OpenSSL man page install script to use the correct directories. |
|
127 MANDIR_SECTIONS = $(PROTO_DIR)/usr/share/man/man1openssl |
|
128 MANDIR_SECTIONS += $(PROTO_DIR)/usr/share/man/man3openssl |
|
129 MANDIR_SECTIONS += $(PROTO_DIR)/usr/share/man/man5openssl |
|
130 MANDIR_SECTIONS += $(PROTO_DIR)/usr/share/man/man7openssl |
|
131 |
|
132 # We must create man page directories manually since we patched OpenSSL install |
|
133 # code to install into manXopenssl instead of manX. Also, OpenSSL does not |
|
134 # install into <dir>/$(MACH64) for 64-bit install so no such directory is |
|
135 # created and Userland install code would fail when installing lint libraries. |
|
136 COMPONENT_PRE_INSTALL_ACTION = ( $(MKDIR) $(MANDIR_SECTIONS); \ |
|
137 $(MKDIR) $(PROTO_DIR)/usr/lib/$(MACH64); ) |
|
138 |
|
139 # The install_docs target will install man pages into $(PROTO_DIR)/$(MANDIR). We |
|
140 # also add /usr/perl5/bin to PATH so that OpenSSL install code can locate the |
|
141 # system pod2man. If not set, OpenSSL make would use an internal implementation |
|
142 # from the tarball which would corrupt some man pages. |
|
143 COMPONENT_INSTALL_ENV += PATH=$(PATH):/usr/perl5/bin MANDIR=/usr/share/man |
|
144 |
|
145 # We could run OpenSSL install code for 32 bits only to process header files and |
|
146 # manual pages. However, link libraries depend on install stamps so we run |
|
147 # install for 64 bit as well. Note that we must take built binary files from |
|
148 # build directories, not from the proto area which contains whatever was |
|
149 # installed first. |
|
150 install: $(INSTALL_32_and_64) |
|
151 |
|
152 # We need to modify the default lint flags to include patched opensslconf.h from |
|
153 # the build directory. If we do not do that, lint will complain about md2.h |
|
154 # which is not enabled by default but it is in our opensslconf.h. |
|
155 LFLAGS_32 := -I$(BUILD_DIR_32)/include $(LINT_FLAGS) |
|
156 LFLAGS_64 := -I$(BUILD_DIR_64)/include $(LINT_FLAGS) |
|
157 |
|
158 # Set modified lint flags for our lint library targets. |
|
159 $(BUILD_DIR_32)/llib-lcrypto.ln: LINT_FLAGS="$(LFLAGS_32)" |
|
160 $(BUILD_DIR_32)/llib-lssl.ln: LINT_FLAGS="$(LFLAGS_32)" |
|
161 $(BUILD_DIR_64)/llib-lcrypto.ln: LINT_FLAGS="$(LFLAGS_64)" |
|
162 $(BUILD_DIR_64)/llib-lssl.ln: LINT_FLAGS="$(LFLAGS_64)" |
|
163 |
|
164 test: $(NO_TESTS) |
|
165 |
|
166 BUILD_PKG_DEPENDENCIES = $(BUILD_TOOLS) |
|
167 |
|
168 include $(WS_TOP)/make-rules/depend.mk |