add some ioctl stuff from wrt54gs.2.06 source
[openwrt.git] / package / openssl / Makefile
1 # $Id$
2
3 include $(TOPDIR)/rules.mk
4
5 PKG_NAME := openssl
6 PKG_VERSION := 0.9.7f
7 PKG_RELEASE := 1
8 PKG_MD5SUM := b2d37d7eb8a5a5040d834105d5ae1a50
9
10 PKG_SOURCE_SITE := http://www.openssl.org/source
11 PKG_SOURCE_FILE := $(PKG_NAME)-$(PKG_VERSION).tar.gz
12 PKG_SOURCE_CAT := zcat
13 PKG_SOURCE_DIR := $(PKG_NAME)-$(PKG_VERSION)
14 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_SOURCE_DIR)
15 PKG_IPK := $(PACKAGE_DIR)/$(PKG_NAME)_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
16
17 OPENSSL_NO_CIPHERS:=no-idea no-mdc2 no-rc5 no-rc2 no-md2 no-md4
18
19 .NOTPARALLEL:
20
21 $(DL_DIR)/$(PKG_SOURCE_FILE):
22 mkdir -p $(DL_DIR)
23 $(SCRIPT_DIR)/download.pl $(DL_DIR) $(PKG_SOURCE_FILE) $(PKG_MD5SUM) $(PKG_SOURCE_SITE)
24
25 $(PKG_BUILD_DIR)/.patched: $(DL_DIR)/$(PKG_SOURCE_FILE)
26 mkdir -p $(TOOL_BUILD_DIR)
27 $(PKG_SOURCE_CAT) $(DL_DIR)/$(PKG_SOURCE_FILE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
28 $(PATCH) $(PKG_BUILD_DIR) ./patches
29 $(SED) 's,/CFLAG=,/CFLAG= $(TARGET_SOFT_FLOAT) ,g' \
30 $(PKG_BUILD_DIR)/Configure
31 touch $(PKG_BUILD_DIR)/.patched
32
33 $(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.patched
34 (cd $(PKG_BUILD_DIR); \
35 CFLAGS="-DOPENSSL_NO_KRB5 -DOPENSSL_NO_IDEA -DOPENSSL_NO_MDC2 -DOPENSSL_NO_RC5" \
36 PATH=$(TARGET_PATH) ./Configure linux-$(ARCH) --prefix=/ \
37 --openssldir=/usr/lib/ssl -L$(STAGING_DIR)/lib -ldl \
38 -I$(STAGING_DIR)/include $(OPENSSL_NO_CIPHERS) \
39 shared no-krb5 no-ec no-engine zlib-dynamic no-hw no-threads )
40 touch $(PKG_BUILD_DIR)/.configured
41
42 $(PKG_BUILD_DIR)/apps/openssl: $(PKG_BUILD_DIR)/.configured
43 $(MAKE) -j1 CC=$(TARGET_CC) -C $(PKG_BUILD_DIR) all build-shared
44 # Work around openssl build bug to link libssl.so with libcrypto.so.
45 -rm $(PKG_BUILD_DIR)/libssl.so.*.*.*
46 $(MAKE) -j1 CC=$(TARGET_CC) -C $(PKG_BUILD_DIR) do_linux-shared
47
48 $(STAGING_DIR)/lib/libssl.so: $(PKG_BUILD_DIR)/apps/openssl
49 $(MAKE) -j1 CC=$(TARGET_CC) INSTALL_PREFIX=$(STAGING_DIR) -C $(PKG_BUILD_DIR) install_sw
50 cp -fa $(PKG_BUILD_DIR)/libcrypto.so* $(STAGING_DIR)/lib/
51 chmod a-x $(STAGING_DIR)/lib/libcrypto.so.0.9.7
52 (cd $(STAGING_DIR)/lib; ln -fs libcrypto.so.0.9.7 libcrypto.so)
53 (cd $(STAGING_DIR)/lib; ln -fs libcrypto.so.0.9.7 libcrypto.so.0)
54 cp -fa $(PKG_BUILD_DIR)/libssl.so* $(STAGING_DIR)/lib/
55 chmod a-x $(STAGING_DIR)/lib/libssl.so.0.9.7
56 (cd $(STAGING_DIR)/lib; ln -fs libssl.so.0.9.7 libssl.so)
57 (cd $(STAGING_DIR)/lib; ln -fs libssl.so.0.9.7 libssl.so.0)
58
59 $(PKG_IPK): $(STAGING_DIR)/lib/libssl.so
60 mkdir -p $(PACKAGE_DIR)
61 $(SCRIPT_DIR)/make-ipkg-dir.sh $(PKG_BUILD_DIR)/ipkg/$(PKG_NAME) $(PKG_NAME).control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH)
62 mkdir -p $(PKG_BUILD_DIR)/ipkg/$(PKG_NAME)/usr/lib
63 cp -a $(STAGING_DIR)/lib/libssl.so* $(PKG_BUILD_DIR)/ipkg/$(PKG_NAME)/usr/lib
64 cp -a $(STAGING_DIR)/lib/libcrypto.so* $(PKG_BUILD_DIR)/ipkg/$(PKG_NAME)/usr/lib
65 $(STRIP) $(PKG_BUILD_DIR)/ipkg/$(PKG_NAME)/usr/lib/*
66 $(IPKG_BUILD) $(PKG_BUILD_DIR)/ipkg/$(PKG_NAME) $(PACKAGE_DIR)
67
68 $(IPKG_STATE_DIR)/info/openssl.list: $(PKG_IPK)
69 $(IPKG) install $(PKG_IPK)
70
71 source: $(DL_DIR)/$(PKG_SOURCE_FILE)
72 prepare: $(PKG_BUILD_DIR)/.patched
73 compile: $(STAGING_DIR)/lib/libssl.so $(PKG_IPK)
74 install: $(PKG_ZLIB) $(IPKG_STATE_DIR)/info/openssl.list
75
76 clean:
77 rm -rf $(PKG_BUILD_DIR)
78 rm -f $(STAGING_DIR)/lib/libssl*
79 rm -f $(STAGING_DIR)/lib/libcrypto*
80 rm -f $(PKG_IPK)
81
This page took 0.045286 seconds and 5 git commands to generate.