ifup is now a standalone script
[openwrt.git] / obsolete-buildroot / make / openssl.mk
1 #############################################################
2 #
3 # openssl
4 #
5 #############################################################
6
7 # TARGETS
8 OPENSSL_SITE:=http://www.openssl.org/source
9 OPENSSL_SOURCE:=openssl-0.9.7d.tar.gz
10 OPENSSL_DIR:=$(BUILD_DIR)/openssl-0.9.7d
11 OPENSSL_PATCH=$(SOURCE_DIR)/openssl.patch
12
13 $(DL_DIR)/$(OPENSSL_SOURCE):
14 $(WGET) -P $(DL_DIR) $(OPENSSL_SITE)/$(OPENSSL_SOURCE)
15
16 $(OPENSSL_DIR)/.unpacked: $(DL_DIR)/$(OPENSSL_SOURCE) $(OPENSSL_PATCH)
17 gunzip -c $(DL_DIR)/$(OPENSSL_SOURCE) | tar -C $(BUILD_DIR) -xvf -
18 cat $(OPENSSL_PATCH) | patch -p1 -d $(OPENSSL_DIR)
19 # sigh... we have to resort to this just to set a gcc flag.
20 $(SED) 's,/CFLAG=,/CFLAG= $(TARGET_SOFT_FLOAT) ,g' \
21 $(OPENSSL_DIR)/Configure
22 touch $(OPENSSL_DIR)/.unpacked
23
24 $(OPENSSL_DIR)/Makefile: $(OPENSSL_DIR)/.unpacked
25 (cd $(OPENSSL_DIR); \
26 CFLAGS="-DOPENSSL_NO_KRB5 -DOPENSSL_NO_IDEA -DOPENSSL_NO_MDC2 -DOPENSSL_NO_RC5" \
27 PATH=$(TARGET_PATH) ./Configure linux-$(ARCH) --prefix=/ \
28 --openssldir=/usr/lib/ssl -L$(STAGING_DIR)/lib -ldl \
29 -I$(STAGING_DIR)/include $(OPENSSL_OPTS) no-threads \
30 shared no-idea no-mdc2 no-rc5)
31
32 $(OPENSSL_DIR)/apps/openssl: $(OPENSSL_DIR)/Makefile
33 $(MAKE) CC=$(TARGET_CC) -C $(OPENSSL_DIR) all build-shared
34 # Work around openssl build bug to link libssl.so with libcrypto.so.
35 -rm $(OPENSSL_DIR)/libssl.so.*.*.*
36 $(MAKE) CC=$(TARGET_CC) -C $(OPENSSL_DIR) do_linux-shared
37
38 $(STAGING_DIR)/lib/libcrypto.a: $(OPENSSL_DIR)/apps/openssl
39 $(MAKE) CC=$(TARGET_CC) INSTALL_PREFIX=$(STAGING_DIR) -C $(OPENSSL_DIR) install
40 cp -fa $(OPENSSL_DIR)/libcrypto.so* $(STAGING_DIR)/lib/
41 chmod a-x $(STAGING_DIR)/lib/libcrypto.so.0.9.7
42 (cd $(STAGING_DIR)/lib; ln -fs libcrypto.so.0.9.7 libcrypto.so)
43 (cd $(STAGING_DIR)/lib; ln -fs libcrypto.so.0.9.7 libcrypto.so.0)
44 cp -fa $(OPENSSL_DIR)/libssl.so* $(STAGING_DIR)/lib/
45 chmod a-x $(STAGING_DIR)/lib/libssl.so.0.9.7
46 (cd $(STAGING_DIR)/lib; ln -fs libssl.so.0.9.7 libssl.so)
47 (cd $(STAGING_DIR)/lib; ln -fs libssl.so.0.9.7 libssl.so.0)
48
49 $(TARGET_DIR)/usr/lib/libcrypto.so.0.9.7: $(STAGING_DIR)/lib/libcrypto.a
50 mkdir -p $(TARGET_DIR)/usr/lib
51 cp -fa $(STAGING_DIR)/lib/libcrypto.so* $(TARGET_DIR)/usr/lib/
52 cp -fa $(STAGING_DIR)/lib/libssl.so* $(TARGET_DIR)/usr/lib/
53 #cp -fa $(STAGING_DIR)/bin/openssl $(TARGET_DIR)/bin/
54 -$(STRIP) --strip-unneeded $(TARGET_DIR)/usr/lib/libssl.so.0.9.7
55 -$(STRIP) --strip-unneeded $(TARGET_DIR)/usr/lib/libcrypto.so.0.9.7
56
57 $(TARGET_DIR)/usr/lib/libssl.a: $(STAGING_DIR)/lib/libcrypto.a
58 mkdir -p $(TARGET_DIR)/usr/include
59 cp -a $(STAGING_DIR)/include/openssl $(TARGET_DIR)/usr/include/
60 cp -dpf $(STAGING_DIR)/lib/libssl.a $(TARGET_DIR)/usr/lib/
61 cp -dpf $(STAGING_DIR)/lib/libcrypto.a $(TARGET_DIR)/usr/lib/
62 touch -c $(TARGET_DIR)/usr/lib/libssl.a
63
64 openssl-headers: $(TARGET_DIR)/usr/lib/libssl.a
65
66 openssl: uclibc $(TARGET_DIR)/usr/lib/libcrypto.so.0.9.7
67
68 openssl-source: $(DL_DIR)/$(OPENSSL_SOURCE)
69
70 openssl-clean:
71 rm -f $(STAGING_DIR)/bin/openssl $(TARGET_DIR)/bin/openssl
72 rm -f $(STAGING_DIR)/lib/libcrypto.so* $(TARGET_DIR)/lib/libcrypto.so*
73 rm -f $(STAGING_DIR)/lib/libssl.so* $(TARGET_DIR)/lib/libssl.so*
74 $(MAKE) -C $(OPENSSL_DIR) clean
75
76 openssl-dirclean:
77 rm -rf $(OPENSSL_DIR)
78
This page took 0.043848 seconds and 5 git commands to generate.