2014-06-23 20:14:45 +02:00
|
|
|
################################################################################
|
|
|
|
#
|
|
|
|
# perl-net-ssleay
|
|
|
|
#
|
|
|
|
################################################################################
|
|
|
|
|
2015-10-24 18:26:56 +02:00
|
|
|
PERL_NET_SSLEAY_VERSION = 1.72
|
2014-06-23 20:14:45 +02:00
|
|
|
PERL_NET_SSLEAY_SOURCE = Net-SSLeay-$(PERL_NET_SSLEAY_VERSION).tar.gz
|
2014-07-31 10:46:58 +02:00
|
|
|
PERL_NET_SSLEAY_SITE = $(BR2_CPAN_MIRROR)/authors/id/M/MI/MIKEM
|
2015-09-04 10:31:14 +02:00
|
|
|
PERL_NET_SSLEAY_DEPENDENCIES = openssl
|
2014-06-23 20:14:45 +02:00
|
|
|
PERL_NET_SSLEAY_LICENSE = OpenSSL
|
|
|
|
PERL_NET_SSLEAY_LICENSE_FILES = LICENSE
|
|
|
|
|
package/perl-net-ssleay: fix buildsystem for cross-compilation
The buildsystem for perl-net-ssleay is totally brain-damaged: it tries
to execute the openssl program. It uses that to check the openssl
version, detect the prefix to openssl, and set the include and library
search paths.
Of course, it does not handle the destdir idiom, so it ends up finding
the host system's openssl (not even ours!), so it sets search paths to
/usr/inlcude and /usr/lib and /lib.
Well, guess what? It does not work.
Fix that by:
- passing the prefix to openssl in the environment, so it does not go
hunting for the host-system openssl;
- not checking the version string, since we can't run, and Buildroot
has the correct version anyway;
- not setting any -I or -L paths since our compiler/linker already
know where to look for for includes and libs.
Fixes:
http://autobuild.buildroot.net/results/135/135867ef85535863e3647cc5fb82accb6f77612c/
Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
[me: enhance commit log, add patch to avoid running openssl and setting
wrong include and library search paths]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-07-13 15:03:22 +02:00
|
|
|
# Try as hard as possible to remedy to the brain-damage their build-system
|
|
|
|
# suffers from: don't search for openssl, they pick the host-system one.
|
|
|
|
PERL_NET_SSLEAY_CONF_ENV = OPENSSL_PREFIX=$(STAGING_DIR)/usr
|
|
|
|
|
2014-08-16 09:11:10 +02:00
|
|
|
# Remove problematic single quotes in LDDLFLAGS, CCFLAGS & OPTIMIZE definition
|
perl-net-ssleay: fix configure
When TARGET_LDFLAGS contains more than one option, the generated
Makefile contains this definition of LDDLFLAGS:
LDDLFLAGS = '--option-1 --option-2'
Which when passed to gcc is interpreted as a single option, and gcc
(rightfully) barfs on it, like with:
arm-linux-gnueabihf-gcc: error: unrecognized command line
option ‘-shared -g’
This is because perl-net-ssleay's buildsystem is really completely
brain-damaged. Other perl extensions do not behave like that, and
instead are doing the only sane thing to do: not add single quotes
around the definition, and just use what they were provided for
LDDLFLAGS.
So, just do the same for perl-net-ssleay. Since tweaking (yet once
more) their buildsystem is too complex, we just use a post-configure
hook to fix up the mess, by removing single quotes around the definition
of LDDLFLAGS.
Note: if only one option is specified, no single quotes are added,
but our hook is a no-op in this case.
See also:
http://lists.busybox.net/pipermail/buildroot/2014-July/101782.html
and the previous message for even more entertainment. ;-)
Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
[me: find the real cause of the issue, tweak the sed expression to not
force -shared and instead just trim the single quotes, enhance commit
log]
[Thomas: fix minor typos in the commit log, add comment above hook
definition]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-07-15 01:48:04 +02:00
|
|
|
define PERL_NET_SSLEAY_FIX_MAKEFILE
|
|
|
|
$(SED) "s/^LDDLFLAGS = '\(.*\)'/LDDLFLAGS = \1/" $(@D)/Makefile
|
2014-07-24 20:15:56 +02:00
|
|
|
$(SED) "s/^CCFLAGS = '\(.*\)'/CCFLAGS = \1/" $(@D)/Makefile
|
2014-08-16 09:11:10 +02:00
|
|
|
$(SED) "s/^OPTIMIZE = '\(.*\)'/OPTIMIZE = \1/" $(@D)/Makefile
|
perl-net-ssleay: fix configure
When TARGET_LDFLAGS contains more than one option, the generated
Makefile contains this definition of LDDLFLAGS:
LDDLFLAGS = '--option-1 --option-2'
Which when passed to gcc is interpreted as a single option, and gcc
(rightfully) barfs on it, like with:
arm-linux-gnueabihf-gcc: error: unrecognized command line
option ‘-shared -g’
This is because perl-net-ssleay's buildsystem is really completely
brain-damaged. Other perl extensions do not behave like that, and
instead are doing the only sane thing to do: not add single quotes
around the definition, and just use what they were provided for
LDDLFLAGS.
So, just do the same for perl-net-ssleay. Since tweaking (yet once
more) their buildsystem is too complex, we just use a post-configure
hook to fix up the mess, by removing single quotes around the definition
of LDDLFLAGS.
Note: if only one option is specified, no single quotes are added,
but our hook is a no-op in this case.
See also:
http://lists.busybox.net/pipermail/buildroot/2014-July/101782.html
and the previous message for even more entertainment. ;-)
Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
[me: find the real cause of the issue, tweak the sed expression to not
force -shared and instead just trim the single quotes, enhance commit
log]
[Thomas: fix minor typos in the commit log, add comment above hook
definition]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-07-15 01:48:04 +02:00
|
|
|
endef
|
|
|
|
PERL_NET_SSLEAY_POST_CONFIGURE_HOOKS += PERL_NET_SSLEAY_FIX_MAKEFILE
|
|
|
|
|
2014-06-23 20:14:45 +02:00
|
|
|
$(eval $(perl-package))
|