2013-06-06 01:53:30 +02:00
|
|
|
################################################################################
|
2002-10-17 10:55:05 +02:00
|
|
|
#
|
|
|
|
# openssl
|
|
|
|
#
|
2013-06-06 01:53:30 +02:00
|
|
|
################################################################################
|
2010-10-04 16:44:51 +02:00
|
|
|
|
2014-04-08 06:31:35 +02:00
|
|
|
OPENSSL_VERSION = 1.0.1g
|
2010-10-04 16:44:51 +02:00
|
|
|
OPENSSL_SITE = http://www.openssl.org/source
|
2012-08-11 22:13:02 +02:00
|
|
|
OPENSSL_LICENSE = OpenSSL or SSLeay
|
|
|
|
OPENSSL_LICENSE_FILES = LICENSE
|
2010-04-28 23:40:44 +02:00
|
|
|
OPENSSL_INSTALL_STAGING = YES
|
|
|
|
OPENSSL_DEPENDENCIES = zlib
|
2013-05-12 10:56:15 +02:00
|
|
|
HOST_OPENSSL_DEPENDENCIES = host-zlib
|
2010-10-04 16:44:51 +02:00
|
|
|
OPENSSL_TARGET_ARCH = generic32
|
2011-01-14 14:43:24 +01:00
|
|
|
OPENSSL_CFLAGS = $(TARGET_CFLAGS)
|
|
|
|
|
2012-10-22 07:42:08 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_OPENSSL_BIN),)
|
|
|
|
define OPENSSL_DISABLE_APPS
|
|
|
|
$(SED) '/^build_apps/! s/build_apps//' $(@D)/Makefile.org
|
|
|
|
$(SED) '/^DIRS=/ s/apps//' $(@D)/Makefile.org
|
|
|
|
endef
|
|
|
|
OPENSSL_PRE_CONFIGURE_HOOKS += OPENSSL_DISABLE_APPS
|
2013-12-05 22:46:49 +01:00
|
|
|
endif
|
2012-10-22 07:42:08 +02:00
|
|
|
|
2013-04-27 12:09:47 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_CRYPTODEV_LINUX),y)
|
|
|
|
OPENSSL_CFLAGS += -DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS
|
|
|
|
OPENSSL_DEPENDENCIES += cryptodev-linux
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(BR2_PACKAGE_OCF_LINUX),y)
|
2012-05-05 05:30:24 +02:00
|
|
|
OPENSSL_CFLAGS += -DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS
|
|
|
|
OPENSSL_DEPENDENCIES += ocf-linux
|
2011-01-14 14:43:24 +01:00
|
|
|
endif
|
2008-10-13 10:10:35 +02:00
|
|
|
|
|
|
|
# Some architectures are optimized in OpenSSL
|
2010-10-04 16:44:51 +02:00
|
|
|
ifeq ($(ARCH),arm)
|
|
|
|
OPENSSL_TARGET_ARCH = armv4
|
|
|
|
endif
|
2009-07-29 21:49:45 +02:00
|
|
|
ifeq ($(ARCH),powerpc)
|
2012-12-07 03:06:20 +01:00
|
|
|
# 4xx cores seem to have trouble with openssl's ASM optimizations
|
|
|
|
ifeq ($(BR2_powerpc_401)$(BR2_powerpc_403)$(BR2_powerpc_405)$(BR2_powerpc_405fp)$(BR2_powerpc_440)$(BR2_powerpc_440fp),)
|
2010-10-04 16:44:51 +02:00
|
|
|
OPENSSL_TARGET_ARCH = ppc
|
2005-12-03 21:32:13 +01:00
|
|
|
endif
|
2012-12-07 03:06:20 +01:00
|
|
|
endif
|
2009-07-29 23:35:41 +02:00
|
|
|
ifeq ($(ARCH),x86_64)
|
2010-10-04 16:44:51 +02:00
|
|
|
OPENSSL_TARGET_ARCH = x86_64
|
2005-09-30 03:51:45 +02:00
|
|
|
endif
|
|
|
|
|
2011-03-14 18:33:48 +01:00
|
|
|
# Workaround for bug #3445
|
|
|
|
ifeq ($(BR2_x86_i386),y)
|
|
|
|
OPENSSL_TARGET_ARCH = generic32 386
|
|
|
|
endif
|
|
|
|
|
2013-04-10 12:29:24 +02:00
|
|
|
define HOST_OPENSSL_CONFIGURE_CMDS
|
|
|
|
(cd $(@D); \
|
|
|
|
$(HOST_CONFIGURE_OPTS) \
|
|
|
|
./config \
|
|
|
|
--prefix=/usr \
|
|
|
|
--openssldir=/etc/ssl \
|
|
|
|
--libdir=/lib \
|
|
|
|
shared \
|
|
|
|
no-zlib \
|
|
|
|
)
|
|
|
|
endef
|
|
|
|
|
2010-04-28 23:40:44 +02:00
|
|
|
define OPENSSL_CONFIGURE_CMDS
|
|
|
|
(cd $(@D); \
|
2008-09-24 11:10:06 +02:00
|
|
|
$(TARGET_CONFIGURE_ARGS) \
|
|
|
|
$(TARGET_CONFIGURE_OPTS) \
|
|
|
|
./Configure \
|
|
|
|
linux-$(OPENSSL_TARGET_ARCH) \
|
|
|
|
--prefix=/usr \
|
2009-03-05 14:48:29 +01:00
|
|
|
--openssldir=/etc/ssl \
|
2011-02-03 13:55:48 +01:00
|
|
|
--libdir=/lib \
|
2013-11-22 22:38:58 +01:00
|
|
|
$(if $(BR2_TOOLCHAIN_HAS_THREADS),threads,no-threads) \
|
2012-07-01 23:59:29 +02:00
|
|
|
$(if $(BR2_PREFER_STATIC_LIB),no-shared,shared) \
|
2008-09-24 11:10:06 +02:00
|
|
|
no-idea \
|
|
|
|
no-rc5 \
|
2010-06-03 22:10:10 +02:00
|
|
|
enable-camellia \
|
|
|
|
enable-mdc2 \
|
|
|
|
enable-tlsext \
|
2012-07-01 23:59:29 +02:00
|
|
|
$(if $(BR2_PREFER_STATIC_LIB),zlib,zlib-dynamic) \
|
|
|
|
$(if $(BR2_PREFER_STATIC_LIB),no-dso) \
|
2007-04-16 20:51:20 +02:00
|
|
|
)
|
2010-04-28 23:40:44 +02:00
|
|
|
$(SED) "s:-march=[-a-z0-9] ::" -e "s:-mcpu=[-a-z0-9] ::g" $(@D)/Makefile
|
2011-01-14 14:43:24 +01:00
|
|
|
$(SED) "s:-O[0-9]:$(OPENSSL_CFLAGS):" $(@D)/Makefile
|
2013-08-23 16:02:24 +02:00
|
|
|
$(SED) "s: build_tests::" $(@D)/Makefile
|
2010-04-28 23:40:44 +02:00
|
|
|
endef
|
|
|
|
|
2013-04-10 12:29:24 +02:00
|
|
|
define HOST_OPENSSL_BUILD_CMDS
|
|
|
|
$(MAKE1) -C $(@D)
|
|
|
|
endef
|
|
|
|
|
2010-04-28 23:40:44 +02:00
|
|
|
define OPENSSL_BUILD_CMDS
|
2012-12-16 10:49:01 +01:00
|
|
|
$(MAKE1) -C $(@D)
|
2010-04-28 23:40:44 +02:00
|
|
|
endef
|
|
|
|
|
|
|
|
define OPENSSL_INSTALL_STAGING_CMDS
|
|
|
|
$(MAKE1) -C $(@D) INSTALL_PREFIX=$(STAGING_DIR) install
|
|
|
|
endef
|
|
|
|
|
2013-04-10 12:29:24 +02:00
|
|
|
define HOST_OPENSSL_INSTALL_CMDS
|
|
|
|
$(MAKE1) -C $(@D) INSTALL_PREFIX=$(HOST_DIR) install
|
|
|
|
endef
|
|
|
|
|
2010-04-28 23:40:44 +02:00
|
|
|
define OPENSSL_INSTALL_TARGET_CMDS
|
|
|
|
$(MAKE1) -C $(@D) INSTALL_PREFIX=$(TARGET_DIR) install
|
|
|
|
rm -rf $(TARGET_DIR)/usr/lib/ssl
|
2009-04-28 20:30:06 +02:00
|
|
|
rm -f $(TARGET_DIR)/usr/bin/c_rehash
|
2012-07-01 23:59:29 +02:00
|
|
|
endef
|
|
|
|
|
|
|
|
ifneq ($(BR2_PREFER_STATIC_LIB),y)
|
|
|
|
# libraries gets installed read only, so strip fails
|
|
|
|
define OPENSSL_INSTALL_FIXUPS_SHARED
|
2010-04-28 23:40:44 +02:00
|
|
|
chmod +w $(TARGET_DIR)/usr/lib/engines/lib*.so
|
2009-04-28 20:30:10 +02:00
|
|
|
for i in $(addprefix $(TARGET_DIR)/usr/lib/,libcrypto.so.* libssl.so.*); \
|
2010-04-28 23:40:44 +02:00
|
|
|
do chmod +w $$i; done
|
|
|
|
endef
|
2012-07-01 23:59:29 +02:00
|
|
|
OPENSSL_POST_INSTALL_TARGET_HOOKS += OPENSSL_INSTALL_FIXUPS_SHARED
|
|
|
|
endif
|
2010-04-28 23:40:44 +02:00
|
|
|
|
2013-12-05 22:46:49 +01:00
|
|
|
ifneq ($(BR2_PACKAGE_OPENSSL_ENGINES),y)
|
2010-04-28 23:40:44 +02:00
|
|
|
define OPENSSL_REMOVE_OPENSSL_ENGINES
|
2008-09-24 11:10:06 +02:00
|
|
|
rm -rf $(TARGET_DIR)/usr/lib/engines
|
2010-04-28 23:40:44 +02:00
|
|
|
endef
|
|
|
|
OPENSSL_POST_INSTALL_TARGET_HOOKS += OPENSSL_REMOVE_OPENSSL_ENGINES
|
2005-07-12 21:53:12 +02:00
|
|
|
endif
|
2009-04-28 20:30:20 +02:00
|
|
|
|
2012-07-03 00:07:32 +02:00
|
|
|
$(eval $(generic-package))
|
2013-04-10 12:29:24 +02:00
|
|
|
$(eval $(host-generic-package))
|