2013-06-06 01:53:30 +02:00
|
|
|
################################################################################
|
2012-10-19 05:13:47 +02:00
|
|
|
#
|
|
|
|
# perl
|
|
|
|
#
|
2013-06-06 01:53:30 +02:00
|
|
|
################################################################################
|
2012-10-19 05:13:47 +02:00
|
|
|
|
2016-06-16 18:26:24 +02:00
|
|
|
# When updating the version here, also update support/scripts/scancpan
|
2017-01-03 17:01:17 +01:00
|
|
|
PERL_VERSION_MAJOR = 24
|
2017-01-23 09:41:49 +01:00
|
|
|
PERL_VERSION = 5.$(PERL_VERSION_MAJOR).1
|
2012-10-19 05:13:47 +02:00
|
|
|
PERL_SITE = http://www.cpan.org/src/5.0
|
2017-01-06 11:05:23 +01:00
|
|
|
PERL_SOURCE = perl-$(PERL_VERSION).tar.xz
|
2017-03-30 15:43:31 +02:00
|
|
|
PERL_LICENSE = Artistic or GPL-1.0+
|
2013-10-08 21:02:32 +02:00
|
|
|
PERL_LICENSE_FILES = Artistic Copying README
|
2012-10-19 05:13:47 +02:00
|
|
|
PERL_INSTALL_STAGING = YES
|
2012-10-19 05:13:48 +02:00
|
|
|
|
2017-02-17 12:20:01 +01:00
|
|
|
PERL_CROSS_VERSION = 1.1.4
|
2014-04-24 18:26:02 +02:00
|
|
|
# DO NOT refactor with the github helper (the result is not the same)
|
2016-01-10 15:50:01 +01:00
|
|
|
PERL_CROSS_SITE = https://github.com/arsv/perl-cross/releases/download/$(PERL_CROSS_VERSION)
|
2017-01-03 17:01:18 +01:00
|
|
|
PERL_CROSS_SOURCE = perl-cross-$(PERL_CROSS_VERSION).tar.gz
|
2015-03-29 19:33:21 +02:00
|
|
|
PERL_EXTRA_DOWNLOADS = $(PERL_CROSS_SITE)/$(PERL_CROSS_SOURCE)
|
|
|
|
|
2012-11-08 16:47:05 +01:00
|
|
|
# We use the perlcross hack to cross-compile perl. It should
|
|
|
|
# be extracted over the perl sources, so we don't define that
|
|
|
|
# as a separate package. Instead, it is downloaded and extracted
|
|
|
|
# together with perl
|
|
|
|
define PERL_CROSS_EXTRACT
|
2013-08-02 11:05:14 +02:00
|
|
|
$(call suitable-extractor,$(PERL_CROSS_SOURCE)) $(DL_DIR)/$(PERL_CROSS_SOURCE) | \
|
2015-07-12 13:51:59 +02:00
|
|
|
$(TAR) --strip-components=1 -C $(@D) $(TAR_OPTIONS) -
|
2012-11-08 16:47:05 +01:00
|
|
|
endef
|
|
|
|
PERL_POST_EXTRACT_HOOKS += PERL_CROSS_EXTRACT
|
|
|
|
|
2016-10-25 23:21:09 +02:00
|
|
|
# Even though perl is not an autotools-package, it uses config.sub and
|
|
|
|
# config.guess. Up-to-date versions of these files may be needed to build perl
|
|
|
|
# on newer host architectures, so we borrow the hook which updates them from the
|
|
|
|
# autotools infrastructure.
|
|
|
|
PERL_POST_PATCH_HOOKS += UPDATE_CONFIG_HOOK
|
|
|
|
|
2012-10-19 05:13:48 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_BERKELEYDB),y)
|
2014-10-25 08:20:44 +02:00
|
|
|
PERL_DEPENDENCIES += berkeleydb
|
2012-10-19 05:13:48 +02:00
|
|
|
endif
|
2012-10-19 05:13:50 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_GDBM),y)
|
2014-10-25 08:20:44 +02:00
|
|
|
PERL_DEPENDENCIES += gdbm
|
2012-10-19 05:13:50 +02:00
|
|
|
endif
|
2012-10-19 05:13:47 +02:00
|
|
|
|
2012-11-08 16:47:05 +01:00
|
|
|
# We have to override LD, because an external multilib toolchain ld is not
|
2015-10-04 14:28:45 +02:00
|
|
|
# wrapped to provide the required sysroot options.
|
2014-09-27 21:32:44 +02:00
|
|
|
PERL_CONF_OPTS = \
|
2012-11-08 16:47:05 +01:00
|
|
|
--target=$(GNU_TARGET_NAME) \
|
|
|
|
--target-tools-prefix=$(TARGET_CROSS) \
|
|
|
|
--prefix=/usr \
|
2015-10-04 14:28:45 +02:00
|
|
|
-Dld="$(TARGET_CC)" \
|
2012-11-28 07:09:20 +01:00
|
|
|
-Dccflags="$(TARGET_CFLAGS)" \
|
|
|
|
-Dldflags="$(TARGET_LDFLAGS) -lm" \
|
2012-12-06 22:38:07 +01:00
|
|
|
-Dmydomain="" \
|
2016-06-22 21:07:32 +02:00
|
|
|
-Dmyhostname="noname" \
|
2012-12-06 22:38:07 +01:00
|
|
|
-Dmyuname="Buildroot $(BR2_VERSION_FULL)" \
|
|
|
|
-Dosname=linux \
|
|
|
|
-Dosvers=$(LINUX_VERSION) \
|
|
|
|
-Dperladmin=root
|
2012-10-19 05:13:47 +02:00
|
|
|
|
|
|
|
ifeq ($(shell expr $(PERL_VERSION_MAJOR) % 2), 1)
|
2014-10-25 08:20:44 +02:00
|
|
|
PERL_CONF_OPTS += -Dusedevel
|
2012-10-19 05:13:47 +02:00
|
|
|
endif
|
|
|
|
|
2014-12-03 22:41:29 +01:00
|
|
|
ifeq ($(BR2_STATIC_LIBS),y)
|
2014-10-25 08:20:44 +02:00
|
|
|
PERL_CONF_OPTS += --all-static --no-dynaloader
|
2014-07-27 18:34:37 +02:00
|
|
|
endif
|
|
|
|
|
2012-11-08 16:47:05 +01:00
|
|
|
PERL_MODULES = $(call qstrip,$(BR2_PACKAGE_PERL_MODULES))
|
|
|
|
ifneq ($(PERL_MODULES),)
|
2014-09-27 21:32:44 +02:00
|
|
|
PERL_CONF_OPTS += --only-mod=$(subst $(space),$(comma),$(PERL_MODULES))
|
2012-11-08 16:47:05 +01:00
|
|
|
endif
|
|
|
|
|
2012-10-19 05:13:47 +02:00
|
|
|
define PERL_CONFIGURE_CMDS
|
2016-10-28 15:18:24 +02:00
|
|
|
(cd $(@D); $(TARGET_MAKE_ENV) HOSTCC='$(HOSTCC_NOCCACHE)' \
|
|
|
|
./configure $(PERL_CONF_OPTS))
|
2012-10-19 05:13:47 +02:00
|
|
|
$(SED) 's/UNKNOWN-/Buildroot $(BR2_VERSION_FULL) /' $(@D)/patchlevel.h
|
|
|
|
endef
|
|
|
|
|
|
|
|
define PERL_BUILD_CMDS
|
2016-10-28 15:18:24 +02:00
|
|
|
$(TARGET_MAKE_ENV) $(MAKE1) -C $(@D) all
|
2012-10-19 05:13:47 +02:00
|
|
|
endef
|
|
|
|
|
|
|
|
define PERL_INSTALL_STAGING_CMDS
|
2017-01-03 17:01:18 +01:00
|
|
|
$(TARGET_MAKE_ENV) $(MAKE1) -C $(@D) DESTDIR="$(STAGING_DIR)" install.perl install.sym
|
2012-10-19 05:13:47 +02:00
|
|
|
endef
|
|
|
|
|
|
|
|
define PERL_INSTALL_TARGET_CMDS
|
2017-01-03 17:01:18 +01:00
|
|
|
$(TARGET_MAKE_ENV) $(MAKE1) -C $(@D) DESTDIR="$(TARGET_DIR)" install.perl install.sym
|
2012-10-19 05:13:47 +02:00
|
|
|
endef
|
|
|
|
|
2014-10-11 08:36:43 +02:00
|
|
|
HOST_PERL_CONF_OPTS = \
|
|
|
|
-des \
|
|
|
|
-Dprefix="$(HOST_DIR)/usr" \
|
|
|
|
-Dcc="$(HOSTCC)"
|
|
|
|
|
|
|
|
define HOST_PERL_CONFIGURE_CMDS
|
2016-10-28 15:18:25 +02:00
|
|
|
(cd $(@D); $(HOST_MAKE_ENV) HOSTCC='$(HOSTCC_NOCCACHE)' \
|
|
|
|
./Configure $(HOST_PERL_CONF_OPTS))
|
2014-10-11 08:36:43 +02:00
|
|
|
endef
|
|
|
|
|
|
|
|
define HOST_PERL_BUILD_CMDS
|
2016-10-28 15:18:25 +02:00
|
|
|
$(HOST_MAKE_ENV) $(MAKE) -C $(@D)
|
2014-10-11 08:36:43 +02:00
|
|
|
endef
|
|
|
|
|
|
|
|
define HOST_PERL_INSTALL_CMDS
|
2016-10-28 15:18:25 +02:00
|
|
|
$(HOST_MAKE_ENV) $(MAKE) -C $(@D) INSTALL_DEPENDENCE='' install
|
2014-10-11 08:36:43 +02:00
|
|
|
endef
|
|
|
|
|
2012-10-19 05:13:47 +02:00
|
|
|
$(eval $(generic-package))
|
2014-10-11 08:36:43 +02:00
|
|
|
$(eval $(host-generic-package))
|
2014-07-29 20:18:14 +02:00
|
|
|
|
|
|
|
define PERL_FINALIZE_TARGET
|
|
|
|
rm -rf $(TARGET_DIR)/usr/lib/perl5/$(PERL_VERSION)/pod
|
|
|
|
rm -rf $(TARGET_DIR)/usr/lib/perl5/$(PERL_VERSION)/$(PERL_ARCHNAME)/CORE
|
|
|
|
find $(TARGET_DIR)/usr/lib/perl5/ -name 'extralibs.ld' -print0 | xargs -0 rm -f
|
|
|
|
find $(TARGET_DIR)/usr/lib/perl5/ -name '*.bs' -print0 | xargs -0 rm -f
|
|
|
|
find $(TARGET_DIR)/usr/lib/perl5/ -name '.packlist' -print0 | xargs -0 rm -f
|
|
|
|
endef
|
2016-06-22 21:07:37 +02:00
|
|
|
PERL_TARGET_FINALIZE_HOOKS += PERL_FINALIZE_TARGET
|