Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/2] infra/pkg-perl: add possibility to pass extra env at configure time
@ 2014-07-12 23:02 Yann E. MORIN
  2014-07-12 23:02 ` [Buildroot] [PATCH 2/2] package/perl-net-ssleay: fix buildsystem for cross-compilation Yann E. MORIN
  2014-07-13  7:05 ` [Buildroot] [PATCH 1/2] infra/pkg-perl: add possibility to pass extra env at configure time François Perrad
  0 siblings, 2 replies; 6+ messages in thread
From: Yann E. MORIN @ 2014-07-12 23:02 UTC (permalink / raw)
  To: buildroot

Some perl package may use environment variables as a hint to how to be
configured.

That's for example the case for perl-net-ssleay that uses
OPENSSL_PREFIX, if it is set in the environment, as the prefix to
openssl.

Add a new variable that packages can set if they need extra environment
variables. Update the manual accordingly.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Francois Perrad <fperrad@gmail.com>
---
 docs/manual/adding-packages-perl.txt | 4 ++++
 package/pkg-perl.mk                  | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/docs/manual/adding-packages-perl.txt b/docs/manual/adding-packages-perl.txt
index 4062646..52c18b9 100644
--- a/docs/manual/adding-packages-perl.txt
+++ b/docs/manual/adding-packages-perl.txt
@@ -104,6 +104,10 @@ cases, typical packages will therefore only use a few of them.
   configure options to pass to the +perl Makefile.PL+ or +perl Build.PL+.
   By default, empty.
 
+* +PERL_FOO_CONF_ENV+/+HOST_PERL_FOO_CONF_ENV+, to specify additional
+  environment variables to pass to the +perl Makefile.PL+ or
+  +perl Build.PL+. By default, empty.
+
 * +PERL_FOO_BUILD_OPT+/+HOST_PERL_FOO_BUILD_OPT+, to specify additional
   options to pass to +make pure_all+ or +perl Build build+ in the build step.
   By default, empty.
diff --git a/package/pkg-perl.mk b/package/pkg-perl.mk
index 5cfdc77..5867ccd 100644
--- a/package/pkg-perl.mk
+++ b/package/pkg-perl.mk
@@ -50,6 +50,7 @@ ifeq ($(4),target)
 define $(2)_CONFIGURE_CMDS
 	cd $$($$(PKG)_SRCDIR) && if [ -f Build.PL ] ; then \
 		PERL_MM_USE_DEFAULT=1 \
+		$$($(2)_CONF_ENV) \
 		perl Build.PL \
 			--config ar="$$(TARGET_AR)" \
 			--config full_ar="$$(TARGET_AR)" \
@@ -71,6 +72,7 @@ define $(2)_CONFIGURE_CMDS
 	else \
 		PERL_MM_USE_DEFAULT=1 \
 		PERL_AUTOINSTALL=--skipdeps \
+		$$($(2)_CONF_ENV) \
 		perl Makefile.PL \
 			AR="$$(TARGET_AR)" \
 			FULL_AR="$$(TARGET_AR)" \
@@ -96,6 +98,7 @@ else
 define $(2)_CONFIGURE_CMDS
 	cd $$($$(PKG)_SRCDIR) && if [ -f Build.PL ] ; then \
 		PERL_MM_USE_DEFAULT=1 \
+		$$($(2)_CONF_ENV) \
 		perl Build.PL \
 			--install_base $$(HOST_DIR)/usr \
 			--installdirs vendor \
@@ -103,6 +106,7 @@ define $(2)_CONFIGURE_CMDS
 	else \
 		PERL_MM_USE_DEFAULT=1 \
 		PERL_AUTOINSTALL=--skipdeps \
+		$$($(2)_CONF_ENV) \
 		perl Makefile.PL \
 			INSTALL_BASE=$$(HOST_DIR)/usr \
 			INSTALLDIRS=vendor \
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH 2/2] package/perl-net-ssleay: fix buildsystem for cross-compilation
  2014-07-12 23:02 [Buildroot] [PATCH 1/2] infra/pkg-perl: add possibility to pass extra env at configure time Yann E. MORIN
@ 2014-07-12 23:02 ` Yann E. MORIN
  2014-07-13  7:07   ` François Perrad
  2014-07-13  7:05 ` [Buildroot] [PATCH 1/2] infra/pkg-perl: add possibility to pass extra env at configure time François Perrad
  1 sibling, 1 reply; 6+ messages in thread
From: Yann E. MORIN @ 2014-07-12 23:02 UTC (permalink / raw)
  To: buildroot

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.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Francois Perrad <fperrad@gmail.com>
---
 .../perl-net-ssleay-001-fix-build-system.patch     | 25 ++++++++++++++++++++++
 package/perl-net-ssleay/perl-net-ssleay.mk         |  4 ++++
 2 files changed, 29 insertions(+)
 create mode 100644 package/perl-net-ssleay/perl-net-ssleay-001-fix-build-system.patch

diff --git a/package/perl-net-ssleay/perl-net-ssleay-001-fix-build-system.patch b/package/perl-net-ssleay/perl-net-ssleay-001-fix-build-system.patch
new file mode 100644
index 0000000..a5ee961
--- /dev/null
+++ b/package/perl-net-ssleay/perl-net-ssleay-001-fix-build-system.patch
@@ -0,0 +1,25 @@
+diff -durN perl-net-ssleay-1.64.orig/inc/Module/Install/PRIVATE/Net/SSLeay.pm perl-net-ssleay-1.64/inc/Module/Install/PRIVATE/Net/SSLeay.pm
+--- perl-net-ssleay-1.64.orig/inc/Module/Install/PRIVATE/Net/SSLeay.pm	2014-04-01 08:08:37.000000000 +0200
++++ perl-net-ssleay-1.64/inc/Module/Install/PRIVATE/Net/SSLeay.pm	2014-07-13 00:38:46.281380282 +0200
+@@ -37,14 +37,18 @@
+         exit 0; # according http://wiki.cpantesters.org/wiki/CPANAuthorNotes this is best-practice when "missing library"
+     }
+ 
+-    $self->check_openssl_version($prefix, $exec);
++# Does not work for cross-compilation.
++# In Buildroot, we do have a supported version.
++#    $self->check_openssl_version($prefix, $exec);
+     my $opts = $self->ssleay_get_build_opts($prefix, $exec);
+ 
+     $self->makemaker_args(
+         CCCDLFLAGS => $opts->{cccdlflags},
+         OPTIMIZE => $opts->{optimize},
+-        INC => join(' ', map {"-I$_"} @{$opts->{inc_paths}}),
+-        LIBS => join(' ', (map {"-L$_"} @{$opts->{lib_paths}}), (map {"-l$_"} @{$opts->{lib_links}})),
++# Buildroot already has the correct include and library search paths.
++#        INC => join(' ', map {"-I$_"} @{$opts->{inc_paths}}),
++#        LIBS => join(' ', (map {"-L$_"} @{$opts->{lib_paths}}), (map {"-l$_"} @{$opts->{lib_links}})),
++        LIBS => join(' ', (map {"-l$_"} @{$opts->{lib_links}})),
+     );
+ 
+     if ( $self->prompt(
diff --git a/package/perl-net-ssleay/perl-net-ssleay.mk b/package/perl-net-ssleay/perl-net-ssleay.mk
index 413fdf0..4a362fb 100644
--- a/package/perl-net-ssleay/perl-net-ssleay.mk
+++ b/package/perl-net-ssleay/perl-net-ssleay.mk
@@ -11,4 +11,8 @@ PERL_NET_SSLEAY_DEPENDENCIES = perl openssl
 PERL_NET_SSLEAY_LICENSE = OpenSSL
 PERL_NET_SSLEAY_LICENSE_FILES = LICENSE
 
+# 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
+
 $(eval $(perl-package))
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH 1/2] infra/pkg-perl: add possibility to pass extra env at configure time
  2014-07-12 23:02 [Buildroot] [PATCH 1/2] infra/pkg-perl: add possibility to pass extra env at configure time Yann E. MORIN
  2014-07-12 23:02 ` [Buildroot] [PATCH 2/2] package/perl-net-ssleay: fix buildsystem for cross-compilation Yann E. MORIN
@ 2014-07-13  7:05 ` François Perrad
  2014-07-13  8:52   ` Yann E. MORIN
  1 sibling, 1 reply; 6+ messages in thread
From: François Perrad @ 2014-07-13  7:05 UTC (permalink / raw)
  To: buildroot

I've already push the same patch in patchwork
see http://patchwork.ozlabs.org/patch/367111/

Fran?ois

2014-07-13 1:02 GMT+02:00 Yann E. MORIN <yann.morin.1998@free.fr>:
> Some perl package may use environment variables as a hint to how to be
> configured.
>
> That's for example the case for perl-net-ssleay that uses
> OPENSSL_PREFIX, if it is set in the environment, as the prefix to
> openssl.
>
> Add a new variable that packages can set if they need extra environment
> variables. Update the manual accordingly.
>
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Cc: Francois Perrad <fperrad@gmail.com>
> ---
>  docs/manual/adding-packages-perl.txt | 4 ++++
>  package/pkg-perl.mk                  | 4 ++++
>  2 files changed, 8 insertions(+)
>
> diff --git a/docs/manual/adding-packages-perl.txt b/docs/manual/adding-packages-perl.txt
> index 4062646..52c18b9 100644
> --- a/docs/manual/adding-packages-perl.txt
> +++ b/docs/manual/adding-packages-perl.txt
> @@ -104,6 +104,10 @@ cases, typical packages will therefore only use a few of them.
>    configure options to pass to the +perl Makefile.PL+ or +perl Build.PL+.
>    By default, empty.
>
> +* +PERL_FOO_CONF_ENV+/+HOST_PERL_FOO_CONF_ENV+, to specify additional
> +  environment variables to pass to the +perl Makefile.PL+ or
> +  +perl Build.PL+. By default, empty.
> +
>  * +PERL_FOO_BUILD_OPT+/+HOST_PERL_FOO_BUILD_OPT+, to specify additional
>    options to pass to +make pure_all+ or +perl Build build+ in the build step.
>    By default, empty.
> diff --git a/package/pkg-perl.mk b/package/pkg-perl.mk
> index 5cfdc77..5867ccd 100644
> --- a/package/pkg-perl.mk
> +++ b/package/pkg-perl.mk
> @@ -50,6 +50,7 @@ ifeq ($(4),target)
>  define $(2)_CONFIGURE_CMDS
>         cd $$($$(PKG)_SRCDIR) && if [ -f Build.PL ] ; then \
>                 PERL_MM_USE_DEFAULT=1 \
> +               $$($(2)_CONF_ENV) \
>                 perl Build.PL \
>                         --config ar="$$(TARGET_AR)" \
>                         --config full_ar="$$(TARGET_AR)" \
> @@ -71,6 +72,7 @@ define $(2)_CONFIGURE_CMDS
>         else \
>                 PERL_MM_USE_DEFAULT=1 \
>                 PERL_AUTOINSTALL=--skipdeps \
> +               $$($(2)_CONF_ENV) \
>                 perl Makefile.PL \
>                         AR="$$(TARGET_AR)" \
>                         FULL_AR="$$(TARGET_AR)" \
> @@ -96,6 +98,7 @@ else
>  define $(2)_CONFIGURE_CMDS
>         cd $$($$(PKG)_SRCDIR) && if [ -f Build.PL ] ; then \
>                 PERL_MM_USE_DEFAULT=1 \
> +               $$($(2)_CONF_ENV) \
>                 perl Build.PL \
>                         --install_base $$(HOST_DIR)/usr \
>                         --installdirs vendor \
> @@ -103,6 +106,7 @@ define $(2)_CONFIGURE_CMDS
>         else \
>                 PERL_MM_USE_DEFAULT=1 \
>                 PERL_AUTOINSTALL=--skipdeps \
> +               $$($(2)_CONF_ENV) \
>                 perl Makefile.PL \
>                         INSTALL_BASE=$$(HOST_DIR)/usr \
>                         INSTALLDIRS=vendor \
> --
> 1.9.1
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH 2/2] package/perl-net-ssleay: fix buildsystem for cross-compilation
  2014-07-12 23:02 ` [Buildroot] [PATCH 2/2] package/perl-net-ssleay: fix buildsystem for cross-compilation Yann E. MORIN
@ 2014-07-13  7:07   ` François Perrad
  2014-07-13  8:56     ` Yann E. MORIN
  0 siblings, 1 reply; 6+ messages in thread
From: François Perrad @ 2014-07-13  7:07 UTC (permalink / raw)
  To: buildroot

see http://patchwork.ozlabs.org/patch/367112/ (which is a part of your patch)
and http://patchwork.ozlabs.org/patch/366934/

Fran?ois

2014-07-13 1:02 GMT+02:00 Yann E. MORIN <yann.morin.1998@free.fr>:
> 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.
>
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Cc: Francois Perrad <fperrad@gmail.com>
> ---
>  .../perl-net-ssleay-001-fix-build-system.patch     | 25 ++++++++++++++++++++++
>  package/perl-net-ssleay/perl-net-ssleay.mk         |  4 ++++
>  2 files changed, 29 insertions(+)
>  create mode 100644 package/perl-net-ssleay/perl-net-ssleay-001-fix-build-system.patch
>
> diff --git a/package/perl-net-ssleay/perl-net-ssleay-001-fix-build-system.patch b/package/perl-net-ssleay/perl-net-ssleay-001-fix-build-system.patch
> new file mode 100644
> index 0000000..a5ee961
> --- /dev/null
> +++ b/package/perl-net-ssleay/perl-net-ssleay-001-fix-build-system.patch
> @@ -0,0 +1,25 @@
> +diff -durN perl-net-ssleay-1.64.orig/inc/Module/Install/PRIVATE/Net/SSLeay.pm perl-net-ssleay-1.64/inc/Module/Install/PRIVATE/Net/SSLeay.pm
> +--- perl-net-ssleay-1.64.orig/inc/Module/Install/PRIVATE/Net/SSLeay.pm 2014-04-01 08:08:37.000000000 +0200
> ++++ perl-net-ssleay-1.64/inc/Module/Install/PRIVATE/Net/SSLeay.pm      2014-07-13 00:38:46.281380282 +0200
> +@@ -37,14 +37,18 @@
> +         exit 0; # according http://wiki.cpantesters.org/wiki/CPANAuthorNotes this is best-practice when "missing library"
> +     }
> +
> +-    $self->check_openssl_version($prefix, $exec);
> ++# Does not work for cross-compilation.
> ++# In Buildroot, we do have a supported version.
> ++#    $self->check_openssl_version($prefix, $exec);
> +     my $opts = $self->ssleay_get_build_opts($prefix, $exec);
> +
> +     $self->makemaker_args(
> +         CCCDLFLAGS => $opts->{cccdlflags},
> +         OPTIMIZE => $opts->{optimize},
> +-        INC => join(' ', map {"-I$_"} @{$opts->{inc_paths}}),
> +-        LIBS => join(' ', (map {"-L$_"} @{$opts->{lib_paths}}), (map {"-l$_"} @{$opts->{lib_links}})),
> ++# Buildroot already has the correct include and library search paths.
> ++#        INC => join(' ', map {"-I$_"} @{$opts->{inc_paths}}),
> ++#        LIBS => join(' ', (map {"-L$_"} @{$opts->{lib_paths}}), (map {"-l$_"} @{$opts->{lib_links}})),
> ++        LIBS => join(' ', (map {"-l$_"} @{$opts->{lib_links}})),
> +     );
> +
> +     if ( $self->prompt(
> diff --git a/package/perl-net-ssleay/perl-net-ssleay.mk b/package/perl-net-ssleay/perl-net-ssleay.mk
> index 413fdf0..4a362fb 100644
> --- a/package/perl-net-ssleay/perl-net-ssleay.mk
> +++ b/package/perl-net-ssleay/perl-net-ssleay.mk
> @@ -11,4 +11,8 @@ PERL_NET_SSLEAY_DEPENDENCIES = perl openssl
>  PERL_NET_SSLEAY_LICENSE = OpenSSL
>  PERL_NET_SSLEAY_LICENSE_FILES = LICENSE
>
> +# 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
> +
>  $(eval $(perl-package))
> --
> 1.9.1
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH 1/2] infra/pkg-perl: add possibility to pass extra env at configure time
  2014-07-13  7:05 ` [Buildroot] [PATCH 1/2] infra/pkg-perl: add possibility to pass extra env at configure time François Perrad
@ 2014-07-13  8:52   ` Yann E. MORIN
  0 siblings, 0 replies; 6+ messages in thread
From: Yann E. MORIN @ 2014-07-13  8:52 UTC (permalink / raw)
  To: buildroot

Fran?ois, All,

On 2014-07-13 09:05 +0200, Fran?ois Perrad spake thusly:
> I've already push the same patch in patchwork
> see http://patchwork.ozlabs.org/patch/367111/

Ah, right, I missed it.

However, the commit log for your patch is very terse, when compared to
mine.

I don't care to withdraw my patch and use yours, but the commit log
should have more info. I'll get your patch (to keep you as author) and
will complement the commit log with mine, and then resend.

But at least, you and I coming with the same patch means I was not
completely off my shoes! ;-)

Regards,
Yann E. MORIN.

> 2014-07-13 1:02 GMT+02:00 Yann E. MORIN <yann.morin.1998@free.fr>:
> > Some perl package may use environment variables as a hint to how to be
> > configured.
> >
> > That's for example the case for perl-net-ssleay that uses
> > OPENSSL_PREFIX, if it is set in the environment, as the prefix to
> > openssl.
> >
> > Add a new variable that packages can set if they need extra environment
> > variables. Update the manual accordingly.
> >
> > Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> > Cc: Francois Perrad <fperrad@gmail.com>
> > ---
> >  docs/manual/adding-packages-perl.txt | 4 ++++
> >  package/pkg-perl.mk                  | 4 ++++
> >  2 files changed, 8 insertions(+)
> >
> > diff --git a/docs/manual/adding-packages-perl.txt b/docs/manual/adding-packages-perl.txt
> > index 4062646..52c18b9 100644
> > --- a/docs/manual/adding-packages-perl.txt
> > +++ b/docs/manual/adding-packages-perl.txt
> > @@ -104,6 +104,10 @@ cases, typical packages will therefore only use a few of them.
> >    configure options to pass to the +perl Makefile.PL+ or +perl Build.PL+.
> >    By default, empty.
> >
> > +* +PERL_FOO_CONF_ENV+/+HOST_PERL_FOO_CONF_ENV+, to specify additional
> > +  environment variables to pass to the +perl Makefile.PL+ or
> > +  +perl Build.PL+. By default, empty.
> > +
> >  * +PERL_FOO_BUILD_OPT+/+HOST_PERL_FOO_BUILD_OPT+, to specify additional
> >    options to pass to +make pure_all+ or +perl Build build+ in the build step.
> >    By default, empty.
> > diff --git a/package/pkg-perl.mk b/package/pkg-perl.mk
> > index 5cfdc77..5867ccd 100644
> > --- a/package/pkg-perl.mk
> > +++ b/package/pkg-perl.mk
> > @@ -50,6 +50,7 @@ ifeq ($(4),target)
> >  define $(2)_CONFIGURE_CMDS
> >         cd $$($$(PKG)_SRCDIR) && if [ -f Build.PL ] ; then \
> >                 PERL_MM_USE_DEFAULT=1 \
> > +               $$($(2)_CONF_ENV) \
> >                 perl Build.PL \
> >                         --config ar="$$(TARGET_AR)" \
> >                         --config full_ar="$$(TARGET_AR)" \
> > @@ -71,6 +72,7 @@ define $(2)_CONFIGURE_CMDS
> >         else \
> >                 PERL_MM_USE_DEFAULT=1 \
> >                 PERL_AUTOINSTALL=--skipdeps \
> > +               $$($(2)_CONF_ENV) \
> >                 perl Makefile.PL \
> >                         AR="$$(TARGET_AR)" \
> >                         FULL_AR="$$(TARGET_AR)" \
> > @@ -96,6 +98,7 @@ else
> >  define $(2)_CONFIGURE_CMDS
> >         cd $$($$(PKG)_SRCDIR) && if [ -f Build.PL ] ; then \
> >                 PERL_MM_USE_DEFAULT=1 \
> > +               $$($(2)_CONF_ENV) \
> >                 perl Build.PL \
> >                         --install_base $$(HOST_DIR)/usr \
> >                         --installdirs vendor \
> > @@ -103,6 +106,7 @@ define $(2)_CONFIGURE_CMDS
> >         else \
> >                 PERL_MM_USE_DEFAULT=1 \
> >                 PERL_AUTOINSTALL=--skipdeps \
> > +               $$($(2)_CONF_ENV) \
> >                 perl Makefile.PL \
> >                         INSTALL_BASE=$$(HOST_DIR)/usr \
> >                         INSTALLDIRS=vendor \
> > --
> > 1.9.1
> >
> > _______________________________________________
> > buildroot mailing list
> > buildroot at busybox.net
> > http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH 2/2] package/perl-net-ssleay: fix buildsystem for cross-compilation
  2014-07-13  7:07   ` François Perrad
@ 2014-07-13  8:56     ` Yann E. MORIN
  0 siblings, 0 replies; 6+ messages in thread
From: Yann E. MORIN @ 2014-07-13  8:56 UTC (permalink / raw)
  To: buildroot

Fran?ois, All,

On 2014-07-13 09:07 +0200, Fran?ois Perrad spake thusly:
> see http://patchwork.ozlabs.org/patch/367112/ (which is a part of your patch)

Hehe! Same patch, again! :-)

But it misses the fact that perl-net-ssleay will try to _run_ the
openssl binary it found, which can not work in cross-compilation.

I'll get your patch and complement with the missing changes.

> and http://patchwork.ozlabs.org/patch/366934/

But that one is not correct, as Peter and Thomas explained: it does not
account for static builds, whereas mine should work also for static.

I'll do a static build to check, and will respin a consolidated series
later.

Regards,
Yann E. MORIN.

> 2014-07-13 1:02 GMT+02:00 Yann E. MORIN <yann.morin.1998@free.fr>:
> > 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.
> >
> > Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> > Cc: Francois Perrad <fperrad@gmail.com>
> > ---
> >  .../perl-net-ssleay-001-fix-build-system.patch     | 25 ++++++++++++++++++++++
> >  package/perl-net-ssleay/perl-net-ssleay.mk         |  4 ++++
> >  2 files changed, 29 insertions(+)
> >  create mode 100644 package/perl-net-ssleay/perl-net-ssleay-001-fix-build-system.patch
> >
> > diff --git a/package/perl-net-ssleay/perl-net-ssleay-001-fix-build-system.patch b/package/perl-net-ssleay/perl-net-ssleay-001-fix-build-system.patch
> > new file mode 100644
> > index 0000000..a5ee961
> > --- /dev/null
> > +++ b/package/perl-net-ssleay/perl-net-ssleay-001-fix-build-system.patch
> > @@ -0,0 +1,25 @@
> > +diff -durN perl-net-ssleay-1.64.orig/inc/Module/Install/PRIVATE/Net/SSLeay.pm perl-net-ssleay-1.64/inc/Module/Install/PRIVATE/Net/SSLeay.pm
> > +--- perl-net-ssleay-1.64.orig/inc/Module/Install/PRIVATE/Net/SSLeay.pm 2014-04-01 08:08:37.000000000 +0200
> > ++++ perl-net-ssleay-1.64/inc/Module/Install/PRIVATE/Net/SSLeay.pm      2014-07-13 00:38:46.281380282 +0200
> > +@@ -37,14 +37,18 @@
> > +         exit 0; # according http://wiki.cpantesters.org/wiki/CPANAuthorNotes this is best-practice when "missing library"
> > +     }
> > +
> > +-    $self->check_openssl_version($prefix, $exec);
> > ++# Does not work for cross-compilation.
> > ++# In Buildroot, we do have a supported version.
> > ++#    $self->check_openssl_version($prefix, $exec);
> > +     my $opts = $self->ssleay_get_build_opts($prefix, $exec);
> > +
> > +     $self->makemaker_args(
> > +         CCCDLFLAGS => $opts->{cccdlflags},
> > +         OPTIMIZE => $opts->{optimize},
> > +-        INC => join(' ', map {"-I$_"} @{$opts->{inc_paths}}),
> > +-        LIBS => join(' ', (map {"-L$_"} @{$opts->{lib_paths}}), (map {"-l$_"} @{$opts->{lib_links}})),
> > ++# Buildroot already has the correct include and library search paths.
> > ++#        INC => join(' ', map {"-I$_"} @{$opts->{inc_paths}}),
> > ++#        LIBS => join(' ', (map {"-L$_"} @{$opts->{lib_paths}}), (map {"-l$_"} @{$opts->{lib_links}})),
> > ++        LIBS => join(' ', (map {"-l$_"} @{$opts->{lib_links}})),
> > +     );
> > +
> > +     if ( $self->prompt(
> > diff --git a/package/perl-net-ssleay/perl-net-ssleay.mk b/package/perl-net-ssleay/perl-net-ssleay.mk
> > index 413fdf0..4a362fb 100644
> > --- a/package/perl-net-ssleay/perl-net-ssleay.mk
> > +++ b/package/perl-net-ssleay/perl-net-ssleay.mk
> > @@ -11,4 +11,8 @@ PERL_NET_SSLEAY_DEPENDENCIES = perl openssl
> >  PERL_NET_SSLEAY_LICENSE = OpenSSL
> >  PERL_NET_SSLEAY_LICENSE_FILES = LICENSE
> >
> > +# 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
> > +
> >  $(eval $(perl-package))
> > --
> > 1.9.1
> >
> > _______________________________________________
> > buildroot mailing list
> > buildroot at busybox.net
> > http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-07-13  8:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-12 23:02 [Buildroot] [PATCH 1/2] infra/pkg-perl: add possibility to pass extra env at configure time Yann E. MORIN
2014-07-12 23:02 ` [Buildroot] [PATCH 2/2] package/perl-net-ssleay: fix buildsystem for cross-compilation Yann E. MORIN
2014-07-13  7:07   ` François Perrad
2014-07-13  8:56     ` Yann E. MORIN
2014-07-13  7:05 ` [Buildroot] [PATCH 1/2] infra/pkg-perl: add possibility to pass extra env at configure time François Perrad
2014-07-13  8:52   ` Yann E. MORIN

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox