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
|
|
|
|
2017-01-26 21:07:56 +01:00
|
|
|
OPENSSL_VERSION = 1.0.2k
|
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)
|
2015-12-03 22:31:16 +01:00
|
|
|
OPENSSL_PATCH = \
|
|
|
|
https://gitweb.gentoo.org/repo/gentoo.git/plain/dev-libs/openssl/files/openssl-1.0.2d-parallel-build.patch?id=c8abcbe8de5d3b6cdd68c162f398c011ff6e2d9d \
|
|
|
|
https://gitweb.gentoo.org/repo/gentoo.git/plain/dev-libs/openssl/files/openssl-1.0.2a-parallel-obj-headers.patch?id=c8abcbe8de5d3b6cdd68c162f398c011ff6e2d9d \
|
|
|
|
https://gitweb.gentoo.org/repo/gentoo.git/plain/dev-libs/openssl/files/openssl-1.0.2a-parallel-install-dirs.patch?id=c8abcbe8de5d3b6cdd68c162f398c011ff6e2d9d \
|
|
|
|
https://gitweb.gentoo.org/repo/gentoo.git/plain/dev-libs/openssl/files/openssl-1.0.2a-parallel-symlinking.patch?id=c8abcbe8de5d3b6cdd68c162f398c011ff6e2d9d
|
2011-01-14 14:43:24 +01:00
|
|
|
|
2016-07-31 20:48:00 +02:00
|
|
|
# relocation truncated to fit: R_68K_GOT16O
|
|
|
|
ifeq ($(BR2_m68k_cf),y)
|
|
|
|
OPENSSL_CFLAGS += -mxgot
|
|
|
|
endif
|
|
|
|
|
2015-06-19 12:54:33 +02:00
|
|
|
ifeq ($(BR2_USE_MMU),)
|
|
|
|
OPENSSL_CFLAGS += -DHAVE_FORK=0
|
|
|
|
endif
|
|
|
|
|
2016-09-04 00:58:41 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_HAS_CRYPTODEV),y)
|
2015-03-31 09:21:57 +02:00
|
|
|
OPENSSL_CFLAGS += -DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS
|
2016-09-04 00:58:41 +02:00
|
|
|
OPENSSL_DEPENDENCIES += cryptodev
|
2011-01-14 14:43:24 +01:00
|
|
|
endif
|
2008-10-13 10:10:35 +02:00
|
|
|
|
|
|
|
# Some architectures are optimized in OpenSSL
|
2016-06-22 15:47:28 +02:00
|
|
|
# Doesn't work for thumb-only (Cortex-M?)
|
|
|
|
ifeq ($(BR2_ARM_CPU_HAS_ARM),y)
|
2015-03-31 09:21:57 +02:00
|
|
|
OPENSSL_TARGET_ARCH = armv4
|
2010-10-04 16:44:51 +02:00
|
|
|
endif
|
2016-04-19 12:26:46 +02:00
|
|
|
ifeq ($(ARCH),aarch64)
|
|
|
|
OPENSSL_TARGET_ARCH = aarch64
|
|
|
|
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),)
|
2015-03-31 09:21:57 +02:00
|
|
|
OPENSSL_TARGET_ARCH = ppc
|
2005-12-03 21:32:13 +01:00
|
|
|
endif
|
2012-12-07 03:06:20 +01:00
|
|
|
endif
|
2014-05-13 07:28:21 +02:00
|
|
|
ifeq ($(ARCH),powerpc64)
|
2015-03-31 09:21:57 +02:00
|
|
|
OPENSSL_TARGET_ARCH = ppc64
|
2014-05-13 07:28:21 +02:00
|
|
|
endif
|
|
|
|
ifeq ($(ARCH),powerpc64le)
|
2015-03-31 09:21:57 +02:00
|
|
|
OPENSSL_TARGET_ARCH = ppc64le
|
2014-05-13 07:28:21 +02:00
|
|
|
endif
|
2009-07-29 23:35:41 +02:00
|
|
|
ifeq ($(ARCH),x86_64)
|
2015-03-31 09:21:57 +02:00
|
|
|
OPENSSL_TARGET_ARCH = x86_64
|
2005-09-30 03:51:45 +02:00
|
|
|
endif
|
|
|
|
|
2013-04-10 12:29:24 +02:00
|
|
|
define HOST_OPENSSL_CONFIGURE_CMDS
|
|
|
|
(cd $(@D); \
|
|
|
|
$(HOST_CONFIGURE_OPTS) \
|
|
|
|
./config \
|
2014-11-03 10:59:06 +01:00
|
|
|
--prefix=$(HOST_DIR)/usr \
|
|
|
|
--openssldir=$(HOST_DIR)/etc/ssl \
|
2013-04-10 12:29:24 +02:00
|
|
|
--libdir=/lib \
|
|
|
|
shared \
|
2014-11-03 10:59:06 +01:00
|
|
|
zlib-dynamic \
|
2013-04-10 12:29:24 +02:00
|
|
|
)
|
2015-09-22 16:23:40 +02:00
|
|
|
$(SED) "s#-O[0-9]#$(HOST_CFLAGS)#" $(@D)/Makefile
|
2013-04-10 12:29:24 +02:00
|
|
|
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) \
|
2014-12-03 22:41:29 +01:00
|
|
|
$(if $(BR2_STATIC_LIBS),no-shared,shared) \
|
2008-09-24 11:10:06 +02:00
|
|
|
no-rc5 \
|
2010-06-03 22:10:10 +02:00
|
|
|
enable-camellia \
|
|
|
|
enable-mdc2 \
|
|
|
|
enable-tlsext \
|
2014-12-03 22:41:29 +01:00
|
|
|
$(if $(BR2_STATIC_LIBS),zlib,zlib-dynamic) \
|
|
|
|
$(if $(BR2_STATIC_LIBS),no-dso) \
|
2007-04-16 20:51:20 +02:00
|
|
|
)
|
2015-09-22 16:23:40 +02:00
|
|
|
$(SED) "s#-march=[-a-z0-9] ##" -e "s#-mcpu=[-a-z0-9] ##g" $(@D)/Makefile
|
|
|
|
$(SED) "s#-O[0-9]#$(OPENSSL_CFLAGS)#" $(@D)/Makefile
|
|
|
|
$(SED) "s# build_tests##" $(@D)/Makefile
|
2010-04-28 23:40:44 +02:00
|
|
|
endef
|
|
|
|
|
2015-07-07 12:37:58 +02:00
|
|
|
# libdl is not available in a static build, and this is not implied by no-dso
|
|
|
|
ifeq ($(BR2_STATIC_LIBS),y)
|
|
|
|
define OPENSSL_FIXUP_STATIC_MAKEFILE
|
2015-09-22 16:23:40 +02:00
|
|
|
$(SED) 's#-ldl##g' $(@D)/Makefile
|
2015-07-07 12:37:58 +02:00
|
|
|
endef
|
|
|
|
OPENSSL_POST_CONFIGURE_HOOKS += OPENSSL_FIXUP_STATIC_MAKEFILE
|
|
|
|
endif
|
|
|
|
|
2013-04-10 12:29:24 +02:00
|
|
|
define HOST_OPENSSL_BUILD_CMDS
|
2016-10-17 18:05:59 +02:00
|
|
|
$(HOST_MAKE_ENV) $(MAKE) -C $(@D)
|
2013-04-10 12:29:24 +02:00
|
|
|
endef
|
|
|
|
|
2010-04-28 23:40:44 +02:00
|
|
|
define OPENSSL_BUILD_CMDS
|
2016-10-14 00:13:22 +02:00
|
|
|
$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
|
2010-04-28 23:40:44 +02:00
|
|
|
endef
|
|
|
|
|
|
|
|
define OPENSSL_INSTALL_STAGING_CMDS
|
2016-10-14 00:13:22 +02:00
|
|
|
$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) INSTALL_PREFIX=$(STAGING_DIR) install
|
2010-04-28 23:40:44 +02:00
|
|
|
endef
|
|
|
|
|
2013-04-10 12:29:24 +02:00
|
|
|
define HOST_OPENSSL_INSTALL_CMDS
|
2016-10-17 18:05:59 +02:00
|
|
|
$(HOST_MAKE_ENV) $(MAKE) -C $(@D) install
|
2013-04-10 12:29:24 +02:00
|
|
|
endef
|
|
|
|
|
2010-04-28 23:40:44 +02:00
|
|
|
define OPENSSL_INSTALL_TARGET_CMDS
|
2016-10-14 00:13:22 +02:00
|
|
|
$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) INSTALL_PREFIX=$(TARGET_DIR) install
|
2010-04-28 23:40:44 +02:00
|
|
|
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
|
|
|
|
|
2014-07-19 17:16:11 +02:00
|
|
|
# libdl has no business in a static build
|
2014-12-03 22:41:29 +01:00
|
|
|
ifeq ($(BR2_STATIC_LIBS),y)
|
2014-07-19 17:16:11 +02:00
|
|
|
define OPENSSL_FIXUP_STATIC_PKGCONFIG
|
2015-09-22 16:23:40 +02:00
|
|
|
$(SED) 's#-ldl##' $(STAGING_DIR)/usr/lib/pkgconfig/libcrypto.pc
|
|
|
|
$(SED) 's#-ldl##' $(STAGING_DIR)/usr/lib/pkgconfig/libssl.pc
|
|
|
|
$(SED) 's#-ldl##' $(STAGING_DIR)/usr/lib/pkgconfig/openssl.pc
|
2014-07-19 17:16:11 +02:00
|
|
|
endef
|
|
|
|
OPENSSL_POST_INSTALL_STAGING_HOOKS += OPENSSL_FIXUP_STATIC_PKGCONFIG
|
|
|
|
endif
|
|
|
|
|
2014-12-03 22:41:29 +01:00
|
|
|
ifneq ($(BR2_STATIC_LIBS),y)
|
2012-07-01 23:59:29 +02:00
|
|
|
# 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
|
|
|
|
openssl: always build apps
Now that building the openssl binary without MMU is supported, the only
reason left for not building apps if the openssl binary is disabled is
to save build time. Moreover, the commit
720893b62510438237b9923d744dd079ddb4f67d "openssl: disable apps for
NOMMU", which added this behavior, had a side effect: the scripts from
apps (CA.pl, CA.sh and tsget) and the default configuration file
(openssl.cnf) were no longer installed, which is not advertized by the
BR2_PACKAGE_OPENSSL_BIN option. CA.pl and CA.sh use the openssl binary,
so not installing them without the latter makes sense. But tsget does
not use the openssl binary, and openssl.cnf can be used by libcrypto, so
it is preferable to handle BR2_PACKAGE_OPENSSL_BIN like before the
commit mentioned above, i.e. to always build and install apps and to
just remove the openssl binary afterwards if needed.
This is what the current commit does, but installing only the helper
scripts having their dependencies (perl or the openssl binary)
satisfied. The help text is updated accordingly.
Signed-off-by: Benoît Thébaudeau <benoit@wsystem.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-07-06 15:06:08 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_PERL),)
|
|
|
|
define OPENSSL_REMOVE_PERL_SCRIPTS
|
|
|
|
$(RM) -f $(TARGET_DIR)/etc/ssl/misc/{CA.pl,tsget}
|
|
|
|
endef
|
|
|
|
OPENSSL_POST_INSTALL_TARGET_HOOKS += OPENSSL_REMOVE_PERL_SCRIPTS
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(BR2_PACKAGE_OPENSSL_BIN),)
|
|
|
|
define OPENSSL_REMOVE_BIN
|
|
|
|
$(RM) -f $(TARGET_DIR)/usr/bin/openssl
|
|
|
|
$(RM) -f $(TARGET_DIR)/etc/ssl/misc/{CA.*,c_*}
|
|
|
|
endef
|
|
|
|
OPENSSL_POST_INSTALL_TARGET_HOOKS += OPENSSL_REMOVE_BIN
|
|
|
|
endif
|
|
|
|
|
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))
|