2013-06-06 07:53:30 +08:00
|
|
|
################################################################################
|
2012-10-19 11:13:47 +08:00
|
|
|
#
|
|
|
|
# perl
|
|
|
|
#
|
2013-06-06 07:53:30 +08:00
|
|
|
################################################################################
|
2012-10-19 11:13:47 +08:00
|
|
|
|
2013-09-02 16:18:49 +08:00
|
|
|
PERL_VERSION_MAJOR = 18
|
2014-01-08 20:27:26 +08:00
|
|
|
PERL_VERSION = 5.$(PERL_VERSION_MAJOR).2
|
2012-10-19 11:13:47 +08:00
|
|
|
PERL_SITE = http://www.cpan.org/src/5.0
|
|
|
|
PERL_SOURCE = perl-$(PERL_VERSION).tar.bz2
|
2013-10-09 03:02:32 +08:00
|
|
|
PERL_LICENSE = Artistic or GPLv1+
|
|
|
|
PERL_LICENSE_FILES = Artistic Copying README
|
2012-10-19 11:13:47 +08:00
|
|
|
PERL_INSTALL_STAGING = YES
|
2012-10-19 11:13:48 +08:00
|
|
|
|
2013-10-21 14:05:11 +08:00
|
|
|
PERL_CROSS_VERSION = 0.8.3
|
|
|
|
PERL_CROSS_BASE_VERSION = 5.$(PERL_VERSION_MAJOR).1
|
2012-11-08 23:47:05 +08:00
|
|
|
PERL_CROSS_SITE = http://download.berlios.de/perlcross
|
2012-11-28 14:09:18 +08:00
|
|
|
PERL_CROSS_SOURCE = perl-$(PERL_CROSS_BASE_VERSION)-cross-$(PERL_CROSS_VERSION).tar.gz
|
|
|
|
PERL_CROSS_OLD_POD = perl$(subst .,,$(PERL_CROSS_BASE_VERSION))delta.pod
|
|
|
|
PERL_CROSS_NEW_POD = perl$(subst .,,$(PERL_VERSION))delta.pod
|
2012-11-08 23:47:05 +08: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_DOWNLOAD
|
2013-04-12 17:40:30 +08:00
|
|
|
$(call DOWNLOAD,$(PERL_CROSS_SITE:/=)/$(PERL_CROSS_SOURCE))
|
2012-11-08 23:47:05 +08:00
|
|
|
endef
|
|
|
|
PERL_POST_DOWNLOAD_HOOKS += PERL_CROSS_DOWNLOAD
|
|
|
|
|
|
|
|
define PERL_CROSS_EXTRACT
|
2013-08-02 17:05:14 +08:00
|
|
|
$(call suitable-extractor,$(PERL_CROSS_SOURCE)) $(DL_DIR)/$(PERL_CROSS_SOURCE) | \
|
2012-11-08 23:47:05 +08:00
|
|
|
$(TAR) $(TAR_STRIP_COMPONENTS)=1 -C $(@D) $(TAR_OPTIONS) -
|
|
|
|
endef
|
|
|
|
PERL_POST_EXTRACT_HOOKS += PERL_CROSS_EXTRACT
|
|
|
|
|
2012-11-28 14:09:18 +08:00
|
|
|
define PERL_CROSS_SET_POD
|
|
|
|
$(SED) s/$(PERL_CROSS_OLD_POD)/$(PERL_CROSS_NEW_POD)/g $(@D)/Makefile
|
|
|
|
endef
|
|
|
|
PERL_POST_PATCH_HOOKS += PERL_CROSS_SET_POD
|
|
|
|
|
2012-10-19 11:13:48 +08:00
|
|
|
ifeq ($(BR2_PACKAGE_BERKELEYDB),y)
|
|
|
|
PERL_DEPENDENCIES += berkeleydb
|
|
|
|
endif
|
2012-10-19 11:13:50 +08:00
|
|
|
ifeq ($(BR2_PACKAGE_GDBM),y)
|
|
|
|
PERL_DEPENDENCIES += gdbm
|
|
|
|
endif
|
2012-10-19 11:13:47 +08:00
|
|
|
|
2012-11-08 23:47:05 +08:00
|
|
|
# We have to override LD, because an external multilib toolchain ld is not
|
|
|
|
# wrapped to provide the required sysroot options. We also can't use ccache
|
|
|
|
# because the configure script doesn't support it.
|
|
|
|
PERL_CONF_OPT = \
|
|
|
|
--target=$(GNU_TARGET_NAME) \
|
|
|
|
--target-tools-prefix=$(TARGET_CROSS) \
|
|
|
|
--prefix=/usr \
|
|
|
|
-Dld="$(TARGET_CC_NOCCACHE)" \
|
2012-11-28 14:09:20 +08:00
|
|
|
-Dccflags="$(TARGET_CFLAGS)" \
|
|
|
|
-Dldflags="$(TARGET_LDFLAGS) -lm" \
|
2012-12-07 05:38:07 +08:00
|
|
|
-Dmydomain="" \
|
|
|
|
-Dmyhostname="$(BR2_TARGET_GENERIC_HOSTNAME)" \
|
|
|
|
-Dmyuname="Buildroot $(BR2_VERSION_FULL)" \
|
|
|
|
-Dosname=linux \
|
|
|
|
-Dosvers=$(LINUX_VERSION) \
|
|
|
|
-Dperladmin=root
|
2012-10-19 11:13:47 +08:00
|
|
|
|
|
|
|
ifeq ($(shell expr $(PERL_VERSION_MAJOR) % 2), 1)
|
|
|
|
PERL_CONF_OPT += -Dusedevel
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(BR2_LARGEFILE),y)
|
|
|
|
PERL_CONF_OPT += -Uuselargefiles
|
|
|
|
endif
|
|
|
|
|
2012-11-08 23:47:05 +08:00
|
|
|
PERL_MODULES = $(call qstrip,$(BR2_PACKAGE_PERL_MODULES))
|
|
|
|
ifneq ($(PERL_MODULES),)
|
|
|
|
PERL_CONF_OPT += --only-mod=$(subst $(space),$(comma),$(PERL_MODULES))
|
|
|
|
endif
|
|
|
|
|
2012-10-19 11:13:47 +08:00
|
|
|
define PERL_CONFIGURE_CMDS
|
2012-11-28 14:09:19 +08:00
|
|
|
(cd $(@D); HOSTCC='$(HOSTCC_NOCACHE)' ./configure $(PERL_CONF_OPT))
|
2012-10-19 11:13:47 +08:00
|
|
|
$(SED) 's/UNKNOWN-/Buildroot $(BR2_VERSION_FULL) /' $(@D)/patchlevel.h
|
|
|
|
endef
|
|
|
|
|
|
|
|
define PERL_BUILD_CMDS
|
2014-01-08 20:27:27 +08:00
|
|
|
$(MAKE1) -C $(@D) all
|
2012-10-19 11:13:47 +08:00
|
|
|
endef
|
|
|
|
|
|
|
|
define PERL_INSTALL_STAGING_CMDS
|
2014-01-08 20:27:27 +08:00
|
|
|
$(MAKE1) -C $(@D) DESTDIR="$(STAGING_DIR)" install.perl
|
2012-10-19 11:13:47 +08:00
|
|
|
endef
|
|
|
|
|
2012-11-08 23:47:05 +08:00
|
|
|
PERL_INSTALL_TARGET_GOALS = install.perl
|
2012-10-19 11:13:51 +08:00
|
|
|
|
2012-10-19 11:13:47 +08:00
|
|
|
define PERL_INSTALL_TARGET_CMDS
|
2014-01-08 20:27:27 +08:00
|
|
|
$(MAKE1) -C $(@D) DESTDIR="$(TARGET_DIR)" $(PERL_INSTALL_TARGET_GOALS)
|
2012-10-19 11:13:47 +08:00
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(generic-package))
|