2 # Copyright (C) 2006-2012 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.gz
15 PKG_SOURCE_URL
:=http
://www.openssl.org
/source
/ \
16 ftp
://ftp.funet.fi
/pub
/crypt
/cryptography
/libs
/openssl
/source
/ \
17 ftp
://ftp.webmonster.de
/pub
/openssl
/source
/ \
18 ftp
://ftp.sunet.se
/pub
/security
/tools
/net
/openssl
/source
/
19 PKG_MD5SUM
:=ae412727c8c15b67880aef7bd2999b2e
21 PKG_BUILD_DEPENDS
:=ocf-crypto-headers
22 PKG_CONFIG_DEPENDS
:=CONFIG_OPENSSL_ENGINE_CRYPTO CONFIG_OPENSSL_ENGINE_DIGEST
24 include $(INCLUDE_DIR
)/package.mk
26 define Package
/openssl
/Default
27 TITLE
:=Open source SSL toolkit
28 URL
:=http
://www.openssl.org
/
31 define Package
/libopenssl
/config
32 source
"$(SOURCE)/Config.in"
35 define Package
/openssl
/Default
/description
36 The OpenSSL Project is a collaborative effort to develop a robust
,
37 commercial-grade
, full-featured
, and Open Source toolkit implementing the Secure
38 Sockets Layer
(SSL v2
/v3
) and Transport Layer Security
(TLS v1
) protocols
as well
39 as a full-strength general purpose cryptography library.
42 define Package
/libopenssl
43 $(call Package
/openssl
/Default
)
52 define Package
/libopenssl
/description
53 $(call Package
/openssl
/Default
/description
)
54 This package contains the OpenSSL shared libraries
, needed by other programs.
57 define Package
/openssl-util
58 $(call Package
/openssl
/Default
)
65 define Package
/openssl-util
/conffiles
69 define Package
/openssl-util
/description
70 $(call Package
/openssl
/Default
/description
)
71 This package contains the OpenSSL command-line utility.
75 OPENSSL_NO_CIPHERS
:= no-idea no-md2 no-mdc2 no-rc5 no-sha0 no-smime \
76 no-rmd160 no-aes192 no-ripemd no-camellia no-ans1 no-krb5
77 OPENSSL_OPTIONS
:= shared no-ec no-err no-hw no-threads zlib-dynamic no-sse2
79 ifdef CONFIG_OPENSSL_ENGINE_CRYPTO
80 OPENSSL_OPTIONS
+= -DHAVE_CRYPTODEV
81 ifdef CONFIG_OPENSSL_ENGINE_DIGEST
82 OPENSSL_OPTIONS
+= -DUSE_CRYPTODEV_DIGESTS
85 OPENSSL_OPTIONS
+= no-engines
88 ifeq ($(CONFIG_x86_64
),y
)
89 OPENSSL_TARGET
:=linux-x86_64
91 OPENSSL_OPTIONS
+=no-sse2
92 ifeq ($(CONFIG_mips
)$(CONFIG_mipsel
),y
)
93 OPENSSL_TARGET
:=linux-mips-openwrt
95 OPENSSL_TARGET
:=linux-generic-openwrt
96 OPENSSL_OPTIONS
+=no-perlasm
100 define Build
/Configure
101 (cd
$(PKG_BUILD_DIR
); \
102 .
/Configure
$(OPENSSL_TARGET
) \
104 --openssldir
=/etc
/ssl \
106 $(TARGET_LDFLAGS
) -ldl \
107 -DOPENSSL_SMALL_FOOTPRINT \
108 $(OPENSSL_NO_CIPHERS
) \
113 TARGET_CFLAGS
+= $(FPIC
)
116 # XXX: OpenSSL "make depend" will look for installed headers before its own,
117 # so remove installed stuff first
118 -$(SUBMAKE
) -j1 clean-staging
119 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
120 MAKEDEPPROG
="$(TARGET_CROSS)gcc" \
121 OPENWRT_OPTIMIZATION_FLAGS
="$(TARGET_CFLAGS)" \
122 $(OPENSSL_MAKEFLAGS
) \
124 $(_SINGLE
)$(MAKE
) -C
$(PKG_BUILD_DIR
) \
126 AR
="$(TARGET_CROSS)ar r" \
127 RANLIB
="$(TARGET_CROSS)ranlib" \
128 OPENWRT_OPTIMIZATION_FLAGS
="$(TARGET_CFLAGS)" \
129 $(OPENSSL_MAKEFLAGS
) \
131 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
133 AR
="$(TARGET_CROSS)ar r" \
134 RANLIB
="$(TARGET_CROSS)ranlib" \
135 OPENWRT_OPTIMIZATION_FLAGS
="$(TARGET_CFLAGS)" \
136 $(OPENSSL_MAKEFLAGS
) \
138 # Work around openssl build bug to link libssl.so with libcrypto.so.
139 -rm $(PKG_BUILD_DIR
)/libssl.so.
*.
*.
*
140 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
142 OPENWRT_OPTIMIZATION_FLAGS
="$(TARGET_CFLAGS)" \
143 $(OPENSSL_MAKEFLAGS
) \
145 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
147 INSTALL_PREFIX
="$(PKG_INSTALL_DIR)" \
148 $(OPENSSL_MAKEFLAGS
) \
152 define Build
/InstallDev
153 $(INSTALL_DIR
) $(1)/usr
/include
154 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/openssl
$(1)/usr
/include/
155 $(INSTALL_DIR
) $(1)/usr
/lib
/
156 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/lib
{crypto
,ssl
}.
{a
,so
*} $(1)/usr
/lib
/
157 $(INSTALL_DIR
) $(1)/usr
/lib
/pkgconfig
158 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/pkgconfig
/{openssl
,libcrypto
,libssl
}.
pc $(1)/usr
/lib
/pkgconfig
/
159 [ -n
"$(TARGET_LDFLAGS)" ] && $(SED
) 's#$(TARGET_LDFLAGS)##g' $(1)/usr
/lib
/pkgconfig
/{openssl
,libcrypto
,libssl
}.
pc || true
162 define Package
/libopenssl
/install
163 $(INSTALL_DIR
) $(1)/usr
/lib
164 $(INSTALL_DATA
) $(PKG_INSTALL_DIR
)/usr
/lib
/libcrypto.so.
* $(1)/usr
/lib
/
165 $(INSTALL_DATA
) $(PKG_INSTALL_DIR
)/usr
/lib
/libssl.so.
* $(1)/usr
/lib
/
168 define Package
/openssl-util
/install
169 $(INSTALL_DIR
) $(1)/etc
/ssl
170 $(CP
) $(PKG_INSTALL_DIR
)/etc
/ssl
/openssl.cnf
$(1)/etc
/ssl
/
171 $(INSTALL_DIR
) $(1)/etc
/ssl
/certs
172 $(INSTALL_DIR
) $(1)/etc
/ssl
/private
173 chmod
0700 $(1)/etc
/ssl
/private
174 $(INSTALL_DIR
) $(1)/usr
/bin
175 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/openssl
$(1)/usr
/bin
/
178 $(eval
$(call BuildPackage
,libopenssl
))
179 $(eval
$(call BuildPackage
,openssl-util
))