source: trunk/package/openssl/Makefile @ 19939

Last change on this file since 19939 was 19939, checked in by nbd, 7 years ago

openssl: upgrade to 0.9.8m (patch by Peter Wagner)

  • Property svn:copyright set to Copyright (C) 2006 OpenWrt.org
  • Property svn:eol-style set to native
File size: 4.5 KB
Line 
1#
2# Copyright (C) 2006-2009 OpenWrt.org
3#
4# This is free software, licensed under the GNU General Public License v2.
5# See /LICENSE for more information.
6#
7
8include $(TOPDIR)/rules.mk
9
10PKG_NAME:=openssl
11PKG_VERSION:=0.9.8m
12PKG_RELEASE:=1
13
14PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15PKG_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/
19PKG_MD5SUM:=898bf125370926d5f692a2201124f8ec
20
21PKG_BUILD_DEPENDS := ocf-crypto-headers
22PKG_CONFIG_DEPENDS := CONFIG_OPENSSL_ENGINE
23
24include $(INCLUDE_DIR)/package.mk
25
26define Package/openssl/Default
27  TITLE:=Open source SSL toolkit
28  URL:=http://www.openssl.org/
29endef
30
31define Package/libopenssl/config
32source "$(SOURCE)/Config.in"
33endef
34
35define 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
38 Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1)
39 protocols as well as a full-strength general purpose cryptography library.
40endef
41
42define Package/libopenssl
43$(call Package/openssl/Default)
44  SECTION:=libs
45  SUBMENU:=SSL
46  CATEGORY:=Libraries
47  DEPENDS:=+zlib
48  TITLE+= (libraries)
49endef
50
51define Package/libopenssl/description
52$(call Package/openssl/Default/description)
53 This package contains the OpenSSL shared libraries, needed by other
54 programs.
55endef
56
57define Package/openssl-util
58  $(call Package/openssl/Default)
59  SECTION:=utils
60  CATEGORY:=Utilities
61  DEPENDS:=+libopenssl
62  TITLE+= (utility)
63endef
64
65define Package/openssl-util/conffiles
66/etc/ssl/openssl.cnf
67endef
68
69define Package/openssl-util/description
70$(call Package/openssl/Default/description)
71 This package contains the OpenSSL command-line utility.
72endef
73
74
75OPENSSL_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
77OPENSSL_OPTIONS:= shared no-ec no-err no-hw no-threads zlib-dynamic no-sse2
78
79ifdef CONFIG_OPENSSL_ENGINE
80  OPENSSL_OPTIONS += --with-cryptodev
81else
82  OPENSSL_OPTIONS += no-engines
83endif
84
85ifdef CONFIG_arm
86OPENSSL_MAKEFLAGS := AES_ASM_OBJ="aes-armv4.o aes_cbc.o"
87else
88OPENSSL_OPTIONS += no-perlasm
89endif
90
91define Build/Configure
92        (cd $(PKG_BUILD_DIR); \
93                ./Configure linux-openwrt \
94                        --prefix=/usr \
95                        --openssldir=/etc/ssl \
96                        $(TARGET_CPPFLAGS) \
97                        $(TARGET_LDFLAGS) -ldl \
98                        -DOPENSSL_SMALL_FOOTPRINT \
99                        $(OPENSSL_NO_CIPHERS) \
100                        $(OPENSSL_OPTIONS) \
101        )
102endef
103
104TARGET_CFLAGS += $(FPIC)
105
106define Build/Compile
107        # XXX: OpenSSL "make depend" will look for installed headers before its own,
108        # so remove installed stuff first
109        -$(SUBMAKE) -j1 clean-staging
110        $(MAKE) -C $(PKG_BUILD_DIR) \
111                MAKEDEPPROG="$(TARGET_CROSS)gcc" \
112                OPENWRT_OPTIMIZATION_FLAGS="$(TARGET_CFLAGS)" \
113                $(OPENSSL_MAKEFLAGS) \
114                depend
115        $(MAKE) -C $(PKG_BUILD_DIR) \
116                CC="$(TARGET_CC)" \
117                AR="$(TARGET_CROSS)ar r" \
118                RANLIB="$(TARGET_CROSS)ranlib" \
119                OPENWRT_OPTIMIZATION_FLAGS="$(TARGET_CFLAGS)" \
120                $(OPENSSL_MAKEFLAGS) \
121                all build-shared
122        # Work around openssl build bug to link libssl.so with libcrypto.so.
123        -rm $(PKG_BUILD_DIR)/libssl.so.*.*.*
124        $(MAKE) -C $(PKG_BUILD_DIR) \
125                CC="$(TARGET_CC)" \
126                OPENWRT_OPTIMIZATION_FLAGS="$(TARGET_CFLAGS)" \
127                $(OPENSSL_MAKEFLAGS) \
128                do_linux-shared
129        $(MAKE) -C $(PKG_BUILD_DIR) \
130                INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \
131                $(OPENSSL_MAKEFLAGS) \
132                install
133endef
134
135define Build/InstallDev
136        mkdir -p $(1)/usr/include
137        $(CP) $(PKG_INSTALL_DIR)/usr/include/openssl $(1)/usr/include/
138        mkdir -p $(1)/usr/lib/
139        $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{crypto,ssl}.{a,so*} $(1)/usr/lib/
140        mkdir -p $(1)/usr/lib/pkgconfig
141        $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/{openssl,libcrypto,libssl}.pc $(1)/usr/lib/pkgconfig/
142        $(SED) 's#$(TARGET_LDFLAGS)##g' $(1)/usr/lib/pkgconfig/{openssl,libcrypto,libssl}.pc
143endef
144
145define Package/libopenssl/install
146        $(INSTALL_DIR) $(1)/usr/lib
147        $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libcrypto.so.* $(1)/usr/lib/
148        $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libssl.so.* $(1)/usr/lib/
149endef
150
151define Package/openssl-util/install
152        $(INSTALL_DIR) $(1)/etc/ssl
153        $(CP) $(PKG_INSTALL_DIR)/etc/ssl/openssl.cnf $(1)/etc/ssl/
154        $(INSTALL_DIR) $(1)/etc/ssl/certs
155        $(INSTALL_DIR) $(1)/etc/ssl/private
156        chmod 0700 $(1)/etc/ssl/private
157        $(INSTALL_DIR) $(1)/usr/bin
158        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/openssl $(1)/usr/bin/
159endef
160
161$(eval $(call BuildPackage,libopenssl))
162$(eval $(call BuildPackage,openssl-util))
Note: See TracBrowser for help on using the repository browser.