2002-10-17 10:55:05 +02:00
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# openssl
|
|
|
|
#
|
|
|
|
#############################################################
|
|
|
|
|
|
|
|
# TARGETS
|
2007-08-11 18:55:52 +02:00
|
|
|
OPENSSL_VERSION:=0.9.7m
|
2002-10-17 10:55:05 +02:00
|
|
|
OPENSSL_SITE:=http://www.openssl.org/source
|
2007-07-11 16:06:06 +02:00
|
|
|
OPENSSL_SOURCE:=openssl-$(OPENSSL_VERSION).tar.gz
|
2006-11-17 16:43:51 +01:00
|
|
|
OPENSSL_CAT:=$(ZCAT)
|
2007-07-11 16:06:06 +02:00
|
|
|
OPENSSL_DIR:=$(BUILD_DIR)/openssl-$(OPENSSL_VERSION)
|
2002-10-17 10:55:05 +02:00
|
|
|
|
2005-12-03 21:32:13 +01:00
|
|
|
OPENSSL_TARGET_ARCH:=
|
2005-09-30 03:51:45 +02:00
|
|
|
ifeq ($(BR2_i386),y)
|
2005-12-03 21:32:13 +01:00
|
|
|
ifneq ($(ARCH),i386)
|
2005-09-30 03:51:45 +02:00
|
|
|
OPENSSL_TARGET_ARCH:=i386-$(ARCH)
|
2005-10-06 05:00:54 +02:00
|
|
|
endif
|
2005-12-29 12:19:18 +01:00
|
|
|
ifeq ($(ARCH),i686)
|
|
|
|
OPENSSL_TARGET_ARCH:=i386-i686/cmov
|
|
|
|
endif
|
2005-12-03 21:32:13 +01:00
|
|
|
endif
|
|
|
|
ifeq ($(OPENSSL_TARGET_ARCH),)
|
2005-09-30 03:51:45 +02:00
|
|
|
OPENSSL_TARGET_ARCH:=$(ARCH)
|
|
|
|
endif
|
|
|
|
|
2002-10-17 10:55:05 +02:00
|
|
|
$(DL_DIR)/$(OPENSSL_SOURCE):
|
2002-11-21 00:16:10 +01:00
|
|
|
$(WGET) -P $(DL_DIR) $(OPENSSL_SITE)/$(OPENSSL_SOURCE)
|
2002-10-17 10:55:05 +02:00
|
|
|
|
2005-12-03 21:32:13 +01:00
|
|
|
openssl-unpack: $(OPENSSL_DIR)/.unpacked
|
2004-10-09 04:49:33 +02:00
|
|
|
$(OPENSSL_DIR)/.unpacked: $(DL_DIR)/$(OPENSSL_SOURCE)
|
2006-11-17 16:43:51 +01:00
|
|
|
$(OPENSSL_CAT) $(DL_DIR)/$(OPENSSL_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
|
2004-10-09 04:49:33 +02:00
|
|
|
toolchain/patch-kernel.sh $(OPENSSL_DIR) package/openssl/ openssl\*.patch
|
2003-11-01 06:34:41 +01:00
|
|
|
# sigh... we have to resort to this just to set a gcc flag.
|
2007-04-06 17:01:32 +02:00
|
|
|
# grumble.. and of course make sure to escape any '/' in CFLAGS
|
2003-11-19 18:17:56 +01:00
|
|
|
$(SED) 's,/CFLAG=,/CFLAG= $(TARGET_SOFT_FLOAT) ,g' \
|
2003-11-01 06:34:41 +01:00
|
|
|
$(OPENSSL_DIR)/Configure
|
2007-04-06 17:01:32 +02:00
|
|
|
$(SED) '/CFLAG=/s,/;, $(shell echo '$(TARGET_CFLAGS)' | sed -e 's/\//\\\\\//g')/;,' \
|
2004-10-21 17:08:17 +02:00
|
|
|
$(OPENSSL_DIR)/Configure
|
2007-04-16 20:51:20 +02:00
|
|
|
touch $@
|
2002-10-17 10:55:05 +02:00
|
|
|
|
|
|
|
$(OPENSSL_DIR)/Makefile: $(OPENSSL_DIR)/.unpacked
|
|
|
|
(cd $(OPENSSL_DIR); \
|
2005-07-12 21:53:12 +02:00
|
|
|
CFLAGS="-DOPENSSL_NO_KRB5 -DOPENSSL_NO_IDEA -DOPENSSL_NO_MDC2 -DOPENSSL_NO_RC5 $(TARGET_CFLAGS)" \
|
2007-04-16 20:51:20 +02:00
|
|
|
PATH=$(TARGET_PATH) \
|
|
|
|
./Configure linux-$(OPENSSL_TARGET_ARCH) --prefix=/ \
|
2007-08-13 21:35:08 +02:00
|
|
|
--openssldir=/lib/ssl -L$(STAGING_DIR)/lib -ldl \
|
2007-08-11 18:55:52 +02:00
|
|
|
-I$(STAGING_DIR)/usr/include $(OPENSSL_OPTS) threads \
|
2002-12-30 10:47:45 +01:00
|
|
|
shared no-idea no-mdc2 no-rc5)
|
2002-10-17 10:55:05 +02:00
|
|
|
|
2007-08-13 21:35:08 +02:00
|
|
|
# --openssldir=/usr/lib/ssl results in files in /usr/usr/lib...
|
|
|
|
|
2002-10-17 10:55:05 +02:00
|
|
|
$(OPENSSL_DIR)/apps/openssl: $(OPENSSL_DIR)/Makefile
|
2004-12-11 14:03:52 +01:00
|
|
|
$(MAKE1) CC=$(TARGET_CC) -C $(OPENSSL_DIR) all build-shared
|
2003-11-01 06:34:41 +01:00
|
|
|
# Work around openssl build bug to link libssl.so with libcrypto.so.
|
|
|
|
-rm $(OPENSSL_DIR)/libssl.so.*.*.*
|
2004-12-11 14:03:52 +01:00
|
|
|
$(MAKE1) CC=$(TARGET_CC) -C $(OPENSSL_DIR) do_linux-shared
|
2002-10-17 10:55:05 +02:00
|
|
|
|
2007-04-16 20:51:20 +02:00
|
|
|
$(STAGING_DIR)/usr/lib/libcrypto.a: $(OPENSSL_DIR)/apps/openssl
|
|
|
|
$(MAKE) CC=$(TARGET_CC) INSTALL_PREFIX=$(STAGING_DIR)/usr -C $(OPENSSL_DIR) install
|
|
|
|
cp -fa $(OPENSSL_DIR)/libcrypto.so* $(STAGING_DIR)/usr/lib/
|
|
|
|
chmod a-x $(STAGING_DIR)/usr/lib/libcrypto.so.0.9.7
|
|
|
|
(cd $(STAGING_DIR)/usr/lib ; \
|
|
|
|
ln -fs libcrypto.so.0.9.7 libcrypto.so ; \
|
|
|
|
ln -fs libcrypto.so.0.9.7 libcrypto.so.0 ; \
|
|
|
|
)
|
|
|
|
cp -fa $(OPENSSL_DIR)/libssl.so* $(STAGING_DIR)/usr/lib/
|
|
|
|
chmod a-x $(STAGING_DIR)/usr/lib/libssl.so.0.9.7
|
|
|
|
(cd $(STAGING_DIR)/usr/lib ; \
|
|
|
|
ln -fs libssl.so.0.9.7 libssl.so ; \
|
|
|
|
ln -fs libssl.so.0.9.7 libssl.so.0 ; \
|
|
|
|
)
|
|
|
|
touch -c $@
|
2002-12-30 10:47:45 +01:00
|
|
|
|
2007-04-16 20:51:20 +02:00
|
|
|
$(TARGET_DIR)/usr/lib/libcrypto.so.0.9.7: $(STAGING_DIR)/usr/lib/libcrypto.a
|
2003-11-02 03:05:46 +01:00
|
|
|
mkdir -p $(TARGET_DIR)/usr/lib
|
2007-04-16 20:51:20 +02:00
|
|
|
cp -fa $(STAGING_DIR)/usr/lib/libcrypto.so* $(TARGET_DIR)/usr/lib/
|
|
|
|
cp -fa $(STAGING_DIR)/usr/lib/libssl.so* $(TARGET_DIR)/usr/lib/
|
2002-12-06 05:30:19 +01:00
|
|
|
#cp -fa $(STAGING_DIR)/bin/openssl $(TARGET_DIR)/bin/
|
2003-11-01 06:34:41 +01:00
|
|
|
-$(STRIP) --strip-unneeded $(TARGET_DIR)/usr/lib/libssl.so.0.9.7
|
|
|
|
-$(STRIP) --strip-unneeded $(TARGET_DIR)/usr/lib/libcrypto.so.0.9.7
|
2002-10-17 10:55:05 +02:00
|
|
|
|
2007-04-16 20:51:20 +02:00
|
|
|
$(TARGET_DIR)/usr/lib/libssl.a: $(STAGING_DIR)/usr/lib/libcrypto.a
|
2003-01-17 05:50:35 +01:00
|
|
|
mkdir -p $(TARGET_DIR)/usr/include
|
2007-04-16 20:51:20 +02:00
|
|
|
cp -a $(STAGING_DIR)/usr/include/openssl $(TARGET_DIR)/usr/include/
|
|
|
|
cp -dpf $(STAGING_DIR)/usr/lib/libssl.a $(TARGET_DIR)/usr/lib/
|
|
|
|
cp -dpf $(STAGING_DIR)/usr/lib/libcrypto.a $(TARGET_DIR)/usr/lib/
|
|
|
|
touch -c $@
|
2003-01-08 19:17:28 +01:00
|
|
|
|
2003-01-21 08:34:29 +01:00
|
|
|
openssl-headers: $(TARGET_DIR)/usr/lib/libssl.a
|
2003-01-08 19:17:28 +01:00
|
|
|
|
2003-11-12 10:31:12 +01:00
|
|
|
openssl: uclibc $(TARGET_DIR)/usr/lib/libcrypto.so.0.9.7
|
|
|
|
|
|
|
|
openssl-source: $(DL_DIR)/$(OPENSSL_SOURCE)
|
|
|
|
|
2002-10-17 10:55:05 +02:00
|
|
|
openssl-clean:
|
|
|
|
$(MAKE) -C $(OPENSSL_DIR) clean
|
2007-04-16 20:51:20 +02:00
|
|
|
rm -f $(STAGING_DIR)/usr/bin/openssl $(TARGET_DIR)/usr/bin/openssl
|
|
|
|
rm -f $(STAGING_DIR)/usr/lib/libcrypto.so* $(TARGET_DIR)/usr/lib/libcrypto.so*
|
|
|
|
rm -f $(STAGING_DIR)/usr/lib/libssl.so* $(TARGET_DIR)/usr/lib/libssl.so*
|
|
|
|
rm -rf $(STAGING_DIR)/usr/include/openssl $(TARGET_DIR)/usr/include/openssl
|
2002-10-17 10:55:05 +02:00
|
|
|
|
|
|
|
openssl-dirclean:
|
2004-10-21 17:08:17 +02:00
|
|
|
rm -rf $(OPENSSL_DIR)
|
2005-02-10 04:06:39 +01:00
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# Toplevel Makefile options
|
|
|
|
#
|
|
|
|
#############################################################
|
|
|
|
ifeq ($(strip $(BR2_PACKAGE_OPENSSL)),y)
|
|
|
|
TARGETS+=openssl
|
|
|
|
endif
|
2005-07-12 21:53:12 +02:00
|
|
|
ifeq ($(strip $(BR2_PACKAGE_OPENSSL_TARGET_HEADERS)),y)
|
|
|
|
TARGETS+=openssl-headers
|
|
|
|
endif
|