pkg-perl: refactor with host-perl
Signed-off-by: Francois Perrad <francois.perrad@gadz.org> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
This commit is contained in:
parent
43f69458ae
commit
fad24172f1
@ -232,9 +232,6 @@ HOST_LDFLAGS += -L$(HOST_DIR)/lib -L$(HOST_DIR)/usr/lib -Wl,-rpath,$(HOST_DIR)/
|
|||||||
HOSTCC_VERSION := $(shell $(HOSTCC_NOCCACHE) --version | \
|
HOSTCC_VERSION := $(shell $(HOSTCC_NOCCACHE) --version | \
|
||||||
sed -n 's/^.* \([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)[ ]*.*$$/\1\2\3/p')
|
sed -n 's/^.* \([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)[ ]*.*$$/\1\2\3/p')
|
||||||
|
|
||||||
HOST_PERL_ARCHNAME := $(shell perl -MConfig -e "print Config->{archname}")
|
|
||||||
export PERL5LIB := $(HOST_DIR)/usr/lib/perl5/$(HOST_PERL_ARCHNAME):$(HOST_DIR)/usr/lib/perl5
|
|
||||||
|
|
||||||
TARGET_CONFIGURE_OPTS = PATH=$(BR_PATH) \
|
TARGET_CONFIGURE_OPTS = PATH=$(BR_PATH) \
|
||||||
AR="$(TARGET_AR)" \
|
AR="$(TARGET_AR)" \
|
||||||
AS="$(TARGET_AS)" \
|
AS="$(TARGET_AS)" \
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
PERL_ARCHNAME = $(ARCH)-linux
|
PERL_ARCHNAME = $(ARCH)-linux
|
||||||
|
PERL_RUN = $(HOST_DIR)/usr/bin/perl
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# inner-perl-package -- defines how the configuration, compilation and
|
# inner-perl-package -- defines how the configuration, compilation and
|
||||||
@ -38,6 +39,8 @@ PERL_ARCHNAME = $(ARCH)-linux
|
|||||||
|
|
||||||
define inner-perl-package
|
define inner-perl-package
|
||||||
|
|
||||||
|
$(2)_DEPENDENCIES += host-perl
|
||||||
|
|
||||||
#
|
#
|
||||||
# Configure step. Only define it if not already defined by the package
|
# Configure step. Only define it if not already defined by the package
|
||||||
# .mk file. And take care of the differences between host and target
|
# .mk file. And take care of the differences between host and target
|
||||||
@ -51,7 +54,7 @@ define $(2)_CONFIGURE_CMDS
|
|||||||
cd $$($$(PKG)_SRCDIR) && if [ -f Build.PL ] ; then \
|
cd $$($$(PKG)_SRCDIR) && if [ -f Build.PL ] ; then \
|
||||||
$$($(2)_CONF_ENV) \
|
$$($(2)_CONF_ENV) \
|
||||||
PERL_MM_USE_DEFAULT=1 \
|
PERL_MM_USE_DEFAULT=1 \
|
||||||
perl Build.PL \
|
$$(PERL_RUN) Build.PL \
|
||||||
--config ar="$$(TARGET_AR)" \
|
--config ar="$$(TARGET_AR)" \
|
||||||
--config full_ar="$$(TARGET_AR)" \
|
--config full_ar="$$(TARGET_AR)" \
|
||||||
--config cc="$$(TARGET_CC)" \
|
--config cc="$$(TARGET_CC)" \
|
||||||
@ -74,7 +77,7 @@ define $(2)_CONFIGURE_CMDS
|
|||||||
$$($(2)_CONF_ENV) \
|
$$($(2)_CONF_ENV) \
|
||||||
PERL_MM_USE_DEFAULT=1 \
|
PERL_MM_USE_DEFAULT=1 \
|
||||||
PERL_AUTOINSTALL=--skipdeps \
|
PERL_AUTOINSTALL=--skipdeps \
|
||||||
perl Makefile.PL \
|
$$(PERL_RUN) Makefile.PL \
|
||||||
AR="$$(TARGET_AR)" \
|
AR="$$(TARGET_AR)" \
|
||||||
FULL_AR="$$(TARGET_AR)" \
|
FULL_AR="$$(TARGET_AR)" \
|
||||||
CC="$$(TARGET_CC)" \
|
CC="$$(TARGET_CC)" \
|
||||||
@ -101,17 +104,13 @@ define $(2)_CONFIGURE_CMDS
|
|||||||
cd $$($$(PKG)_SRCDIR) && if [ -f Build.PL ] ; then \
|
cd $$($$(PKG)_SRCDIR) && if [ -f Build.PL ] ; then \
|
||||||
$$($(2)_CONF_ENV) \
|
$$($(2)_CONF_ENV) \
|
||||||
PERL_MM_USE_DEFAULT=1 \
|
PERL_MM_USE_DEFAULT=1 \
|
||||||
perl Build.PL \
|
$$(PERL_RUN) Build.PL \
|
||||||
--install_base $$(HOST_DIR)/usr \
|
|
||||||
--installdirs vendor \
|
|
||||||
$$($(2)_CONF_OPTS); \
|
$$($(2)_CONF_OPTS); \
|
||||||
else \
|
else \
|
||||||
$$($(2)_CONF_ENV) \
|
$$($(2)_CONF_ENV) \
|
||||||
PERL_MM_USE_DEFAULT=1 \
|
PERL_MM_USE_DEFAULT=1 \
|
||||||
PERL_AUTOINSTALL=--skipdeps \
|
PERL_AUTOINSTALL=--skipdeps \
|
||||||
perl Makefile.PL \
|
$$(PERL_RUN) Makefile.PL \
|
||||||
INSTALL_BASE=$$(HOST_DIR)/usr \
|
|
||||||
INSTALLDIRS=vendor \
|
|
||||||
$$($(2)_CONF_OPTS); \
|
$$($(2)_CONF_OPTS); \
|
||||||
fi
|
fi
|
||||||
endef
|
endef
|
||||||
@ -129,7 +128,7 @@ ifeq ($(4),target)
|
|||||||
# Build package for target
|
# Build package for target
|
||||||
define $(2)_BUILD_CMDS
|
define $(2)_BUILD_CMDS
|
||||||
cd $$($$(PKG)_SRCDIR) && if [ -f Build.PL ] ; then \
|
cd $$($$(PKG)_SRCDIR) && if [ -f Build.PL ] ; then \
|
||||||
perl Build $$($(2)_BUILD_OPTS) build; \
|
$$(PERL_RUN) Build $$($(2)_BUILD_OPTS) build; \
|
||||||
else \
|
else \
|
||||||
$$(MAKE1) \
|
$$(MAKE1) \
|
||||||
PERL_INC=$$(STAGING_DIR)/usr/lib/perl5/$$(PERL_VERSION)/$$(PERL_ARCHNAME)/CORE \
|
PERL_INC=$$(STAGING_DIR)/usr/lib/perl5/$$(PERL_VERSION)/$$(PERL_ARCHNAME)/CORE \
|
||||||
@ -141,7 +140,7 @@ else
|
|||||||
# Build package for host
|
# Build package for host
|
||||||
define $(2)_BUILD_CMDS
|
define $(2)_BUILD_CMDS
|
||||||
cd $$($$(PKG)_SRCDIR) && if [ -f Build.PL ] ; then \
|
cd $$($$(PKG)_SRCDIR) && if [ -f Build.PL ] ; then \
|
||||||
perl Build $$($(2)_BUILD_OPTS) build; \
|
$$(PERL_RUN) Build $$($(2)_BUILD_OPTS) build; \
|
||||||
else \
|
else \
|
||||||
$$(MAKE1) $$($(2)_BUILD_OPTS) pure_all; \
|
$$(MAKE1) $$($(2)_BUILD_OPTS) pure_all; \
|
||||||
fi
|
fi
|
||||||
@ -156,7 +155,7 @@ endif
|
|||||||
ifndef $(2)_INSTALL_CMDS
|
ifndef $(2)_INSTALL_CMDS
|
||||||
define $(2)_INSTALL_CMDS
|
define $(2)_INSTALL_CMDS
|
||||||
cd $$($$(PKG)_SRCDIR) && if [ -f Build.PL ] ; then \
|
cd $$($$(PKG)_SRCDIR) && if [ -f Build.PL ] ; then \
|
||||||
perl Build $$($(2)_INSTALL_TARGET_OPTS) install; \
|
$$(PERL_RUN) Build $$($(2)_INSTALL_TARGET_OPTS) install; \
|
||||||
else \
|
else \
|
||||||
$$(MAKE1) $$($(2)_INSTALL_TARGET_OPTS) pure_install; \
|
$$(MAKE1) $$($(2)_INSTALL_TARGET_OPTS) pure_install; \
|
||||||
fi
|
fi
|
||||||
@ -170,7 +169,7 @@ endif
|
|||||||
ifndef $(2)_INSTALL_TARGET_CMDS
|
ifndef $(2)_INSTALL_TARGET_CMDS
|
||||||
define $(2)_INSTALL_TARGET_CMDS
|
define $(2)_INSTALL_TARGET_CMDS
|
||||||
cd $$($$(PKG)_SRCDIR) && if [ -f Build.PL ] ; then \
|
cd $$($$(PKG)_SRCDIR) && if [ -f Build.PL ] ; then \
|
||||||
perl Build $$($(2)_INSTALL_TARGET_OPTS) install; \
|
$$(PERL_RUN) Build $$($(2)_INSTALL_TARGET_OPTS) install; \
|
||||||
else \
|
else \
|
||||||
$$(MAKE1) $$($(2)_INSTALL_TARGET_OPTS) pure_install; \
|
$$(MAKE1) $$($(2)_INSTALL_TARGET_OPTS) pure_install; \
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user