readd some hashes and algorithms, needed for ipsec, fixes build of ipsec-tools
[openwrt.git] / package / openssl / Makefile
1 # $Id$
2
3 include $(TOPDIR)/rules.mk
4
5 PKG_NAME:=openssl
6 PKG_VERSION:=0.9.8a
7 PKG_RELEASE:=3
8 PKG_MD5SUM:=1d16c727c10185e4d694f87f5e424ee1
9
10 PKG_SOURCE_URL:=http://www.openssl.org/source/ \
11 ftp://ftp.funet.fi/pub/crypt/cryptography/libs/openssl/source/ \
12 ftp://ftp.webmonster.de/pub/openssl/source/ \
13 ftp://ftp.sunet.se/pub/security/tools/net/openssl/source/
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_CAT:=zcat
16
17 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
18 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
19
20 OPENSSL_NO_CIPHERS:= no-idea no-md2 no-mdc2 no-rc5 no-sha0 no-rmd160 no-aes192
21 OPENSSL_OPTIONS:= shared no-ec no-err no-fips no-hw no-krb5 no-threads zlib-dynamic no-engines
22
23 include $(TOPDIR)/package/rules.mk
24
25 $(eval $(call PKG_template,LIBOPENSSL,libopenssl,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
26 $(eval $(call PKG_template,OPENSSL_UTIL,openssl-util,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
27
28 $(PKG_BUILD_DIR)/.configured:
29 $(SED) 's,/CFLAG=,/CFLAG= $(TARGET_SOFT_FLOAT) ,g' $(PKG_BUILD_DIR)/Configure
30 $(SED) s/OPENWRT_OPTIMIZATION_FLAGS/$(BR2_TARGET_OPTIMIZATION)/g $(PKG_BUILD_DIR)/Configure
31 (cd $(PKG_BUILD_DIR); \
32 PATH=$(TARGET_PATH) \
33 ./Configure linux-openwrt \
34 --prefix=/usr \
35 --openssldir=/etc/ssl \
36 -I$(STAGING_DIR)/usr/include \
37 -L$(STAGING_DIR)/usr/lib -ldl \
38 -DOPENSSL_SMALL_FOOTPRINT \
39 $(OPENSSL_NO_CIPHERS) \
40 $(OPENSSL_OPTIONS) \
41 )
42 touch $@
43
44 $(PKG_BUILD_DIR)/.built:
45 rm -rf $(PKG_INSTALL_DIR)
46 mkdir -p $(PKG_INSTALL_DIR)
47 $(MAKE) -C $(PKG_BUILD_DIR) -j1 \
48 MAKEDEPPROG="$(TARGET_CC)" \
49 depend
50 $(MAKE) -C $(PKG_BUILD_DIR) -j1 \
51 CC="$(TARGET_CC)" \
52 AR="$(TARGET_CROSS)ar r" \
53 RANLIB="$(TARGET_CROSS)ranlib" \
54 all build-shared
55 # Work around openssl build bug to link libssl.so with libcrypto.so.
56 -rm $(PKG_BUILD_DIR)/libssl.so.*.*.*
57 $(MAKE) -C $(PKG_BUILD_DIR) -j1 \
58 CC=$(TARGET_CC) \
59 CCOPTS="$(TARGET_CFLAGS) -fomit-frame-pointer" \
60 do_linux-shared
61 $(MAKE) -C $(PKG_BUILD_DIR) -j1 \
62 INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \
63 install
64 touch $@
65
66 $(IPKG_LIBOPENSSL):
67 install -d -m0755 $(IDIR_LIBOPENSSL)/usr/lib
68 $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{crypto,ssl}.so.* $(IDIR_LIBOPENSSL)/usr/lib/
69 chmod 0644 $(IDIR_LIBOPENSSL)/usr/lib/*
70 $(RSTRIP) $(IDIR_LIBOPENSSL)
71 $(IPKG_BUILD) $(IDIR_LIBOPENSSL) $(PACKAGE_DIR)
72
73 $(IPKG_OPENSSL_UTIL):
74 install -d -m0755 $(IDIR_OPENSSL_UTIL)/etc/ssl
75 $(CP) $(PKG_INSTALL_DIR)/etc/ssl/openssl.cnf $(IDIR_OPENSSL_UTIL)/etc/ssl/
76 install -d -m0755 $(IDIR_OPENSSL_UTIL)/etc/ssl/certs
77 install -d -m0755 $(IDIR_OPENSSL_UTIL)/etc/ssl/private
78 chmod 0700 $(IDIR_OPENSSL_UTIL)/etc/ssl/private
79 install -d -m0755 $(IDIR_OPENSSL_UTIL)/usr/bin
80 $(CP) $(PKG_INSTALL_DIR)/usr/bin/openssl $(IDIR_OPENSSL_UTIL)/usr/bin/
81 $(RSTRIP) $(IDIR_OPENSSL_UTIL)
82 $(IPKG_BUILD) $(IDIR_OPENSSL_UTIL) $(PACKAGE_DIR)
83
84 $(STAGING_DIR)/usr/lib/libssl.so: $(PKG_BUILD_DIR)/.built
85 mkdir -p $(STAGING_DIR)/usr/include
86 $(CP) $(PKG_INSTALL_DIR)/usr/include/openssl $(STAGING_DIR)/usr/include/
87 mkdir -p $(STAGING_DIR)/usr/lib/
88 $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{crypto,ssl}.{a,so*} $(STAGING_DIR)/usr/lib/
89 touch $@
90
91 install-dev: $(STAGING_DIR)/usr/lib/libssl.so
92
93 uninstall-dev:
94 rm -rf \
95 $(STAGING_DIR)/usr/include/openssl \
96 $(STAGING_DIR)/usr/lib/lib{crypto,ssl}.{a,so*} \
97
98 compile-targets: install-dev
99 clean-targets: uninstall-dev
This page took 0.048943 seconds and 5 git commands to generate.