infra/pkg-perl: add possibility to pass extra env at configure time

Some perl packages may use environment variables as a hint to know 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: Francois Perrad <francois.perrad@gadz.org>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Tested-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
[yann.morin.1998@free.fr: enhance the commit log]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
This commit is contained in:
Francois Perrad 2014-07-13 15:03:21 +02:00 committed by Thomas Petazzoni
parent 6a67ad5a3d
commit 734b34f520
2 changed files with 8 additions and 0 deletions

View File

@ -100,6 +100,10 @@ A few additional variables, specific to the Perl/CPAN infrastructure,
can also be defined. Many of them are only useful in very specific can also be defined. Many of them are only useful in very specific
cases, typical packages will therefore only use a few of them. cases, typical packages will therefore only use a few of them.
* +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_CONF_OPT+/+HOST_PERL_FOO_CONF_OPT+, to specify additional * +PERL_FOO_CONF_OPT+/+HOST_PERL_FOO_CONF_OPT+, to specify additional
configure options to pass to the +perl Makefile.PL+ or +perl Build.PL+. configure options to pass to the +perl Makefile.PL+ or +perl Build.PL+.
By default, empty. By default, empty.

View File

@ -49,6 +49,7 @@ ifeq ($(4),target)
# Configure package for target # Configure package for target
define $(2)_CONFIGURE_CMDS define $(2)_CONFIGURE_CMDS
cd $$($$(PKG)_SRCDIR) && if [ -f Build.PL ] ; then \ cd $$($$(PKG)_SRCDIR) && if [ -f Build.PL ] ; then \
$$($(2)_CONF_ENV) \
PERL_MM_USE_DEFAULT=1 \ PERL_MM_USE_DEFAULT=1 \
perl Build.PL \ perl Build.PL \
--config ar="$$(TARGET_AR)" \ --config ar="$$(TARGET_AR)" \
@ -69,6 +70,7 @@ define $(2)_CONFIGURE_CMDS
--install_path libdoc=/usr/share/man/man3 \ --install_path libdoc=/usr/share/man/man3 \
$$($(2)_CONF_OPT); \ $$($(2)_CONF_OPT); \
else \ else \
$$($(2)_CONF_ENV) \
PERL_MM_USE_DEFAULT=1 \ PERL_MM_USE_DEFAULT=1 \
PERL_AUTOINSTALL=--skipdeps \ PERL_AUTOINSTALL=--skipdeps \
perl Makefile.PL \ perl Makefile.PL \
@ -95,12 +97,14 @@ else
# Configure package for host # Configure package for host
define $(2)_CONFIGURE_CMDS define $(2)_CONFIGURE_CMDS
cd $$($$(PKG)_SRCDIR) && if [ -f Build.PL ] ; then \ cd $$($$(PKG)_SRCDIR) && if [ -f Build.PL ] ; then \
$$($(2)_CONF_ENV) \
PERL_MM_USE_DEFAULT=1 \ PERL_MM_USE_DEFAULT=1 \
perl Build.PL \ perl Build.PL \
--install_base $$(HOST_DIR)/usr \ --install_base $$(HOST_DIR)/usr \
--installdirs vendor \ --installdirs vendor \
$$($(2)_CONF_OPT); \ $$($(2)_CONF_OPT); \
else \ else \
$$($(2)_CONF_ENV) \
PERL_MM_USE_DEFAULT=1 \ PERL_MM_USE_DEFAULT=1 \
PERL_AUTOINSTALL=--skipdeps \ PERL_AUTOINSTALL=--skipdeps \
perl Makefile.PL \ perl Makefile.PL \