]> rtime.felk.cvut.cz Git - coffee/buildroot.git/commitdiff
perl-net-ssleay: fix configure
authorFrancois Perrad <fperrad@gmail.com>
Mon, 14 Jul 2014 23:48:04 +0000 (01:48 +0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tue, 15 Jul 2014 17:12:03 +0000 (19:12 +0200)
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>
package/perl-net-ssleay/perl-net-ssleay.mk

index 4a362fb9759921bdec8f0cc10154c05edea7fca2..6b21eb2fadac8f8c7a3406ee6ae0a7b6194a91c2 100644 (file)
@@ -15,4 +15,9 @@ PERL_NET_SSLEAY_LICENSE_FILES = LICENSE
 # suffers from: don't search for openssl, they pick the host-system one.
 PERL_NET_SSLEAY_CONF_ENV = OPENSSL_PREFIX=$(STAGING_DIR)/usr
 
+define PERL_NET_SSLEAY_FIX_MAKEFILE
+       $(SED) "s/^LDDLFLAGS = '\(.*\)'/LDDLFLAGS = \1/" $(@D)/Makefile
+endef
+PERL_NET_SSLEAY_POST_CONFIGURE_HOOKS += PERL_NET_SSLEAY_FIX_MAKEFILE
+
 $(eval $(perl-package))