X-Git-Url: http://git.openwrt.org/?p=openwrt%2Fsvn-archive%2Farchive.git;a=blobdiff_plain;f=lang%2Fperl%2FMakefile;h=1dd1490f841d94c9f43caaa1309c8f6898017de2;hp=936b1497ec13fdd7909dc3ce0833b7a429253db8;hb=6e531f1344f761b78bc9508fe1b410216ef98b81;hpb=ce65d947730a75c56d6960359c08f79f157cc9cf diff --git a/lang/perl/Makefile b/lang/perl/Makefile index 936b1497ec..1dd1490f84 100644 --- a/lang/perl/Makefile +++ b/lang/perl/Makefile @@ -1,5 +1,5 @@ -# -# Copyright (C) 2006 OpenWrt.org +# +# Copyright (C) 2006-2008 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -9,40 +9,187 @@ include $(TOPDIR)/rules.mk PKG_NAME:=perl -PKG_VERSION:=5.8.6 +PKG_VERSION:=5.10.0 PKG_RELEASE:=1 +PKG_MD5SUM:=d2c39b002ebfd2c3c5dba589365c5a71 -PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=ftp://ftp.cpan.org/pub/CPAN/src/5.0 \ - ftp://ftp.mpi-sb.mpg.de/pub/perl/CPAN/src/5.0 \ - ftp://ftp.gmd.de/mirrors/CPAN/src/5.0 \ + ftp://ftp.mpi-sb.mpg.de/pub/perl/CPAN/src/5.0 \ + ftp://ftp.gmd.de/mirrors/CPAN/src/5.0 \ ftp://ftp.funet.fi/pub/languages/perl/CPAN/src/5.0 -PKG_MD5SUM:=8d4aa4e061fd5bc0c39e4f0a63267880 +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_CAT:=zcat +PKG_BUILD_DIR:=$(BUILD_DIR)/perl/$(PKG_NAME)-$(PKG_VERSION) + include $(INCLUDE_DIR)/package.mk -define Package/microperl - SECTION:=utils - CATEGORY:=Utilities - TITLE:=A really minimal perl - DESCRIPTION:=A really minimal perl.\\\ - A perl package without operating-specific functions such as readdir. +define Package/perl/Default + SUBMENU:=Perl + SECTION:=lang + CATEGORY:=Languages + TITLE:=The Perl intepreter URL:=http://www.perl.com/ endef -define Build/Configure +define Package/microperl +$(call Package/perl/Default) + TITLE+=(minimal version) endef -define Build/Compile +define Package/microperl/description + A perl package without operating-specific functions such as readdir. +endef + +define Build/Template + +$(STAMP_CONFIGURED)-$(1): $(STAMP_PREPARED) + -$(MAKE) -C $(PKG_BUILD_DIR) clean + $(call Build/$(1)/Configure) + touch $$@ + +$(STAMP_BUILT)-$(1): $(STAMP_CONFIGURED)-$(1) + $(call Build/$(1)/Compile) + touch $$@ + +$(STAMP_BUILT): $(STAMP_BUILT)-$(1) + +endef + +define Build/microperl/Configure +endef + +define Build/microperl/Compile $(MAKE) -C $(PKG_BUILD_DIR) -f Makefile.micro \ CC="$(TARGET_CC)" OPTIMIZE="$(TARGET_CFLAGS)" + mkdir -p $(PKG_INSTALL_DIR)/usr/bin/ + $(CP) $(PKG_BUILD_DIR)/microperl $(PKG_INSTALL_DIR)/usr/bin/ endef define Package/microperl/install - install -d -m0755 $(1)/usr/bin - install -m0755 $(PKG_BUILD_DIR)/microperl $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/microperl $(1)/usr/bin/ +endef + +include perlmod.mk + +define Package/perl +$(call Package/perl/Default) + MAINTAINER:=Peter Colberg +endef + +define Package/perl/description + Perl is a stable, cross platform programming language. + It is used for mission critical projects in the public and private sectors + and is widely used to program web applications of all needs. +endef + +define Build/perl/Configure + @echo + @echo "===> Stage 1: Configure host perl" + @echo + mkdir -p $(PKG_BUILD_DIR)/host-perl + (cd $(PKG_BUILD_DIR)/host-perl && sh ../Configure -der -Dmksymlinks -Uusedl) + + @echo + @echo "===> Stage 2: Build host perl binary with static extensions" + @echo + $(MAKE) -C $(PKG_BUILD_DIR)/host-perl + + @echo + @echo "===> Stage 3: Configure target perl" + @echo + -$(MAKE) -C $(PKG_BUILD_DIR) clean + sed \ + -e 's!%%CC%%!$(TARGET_CC)!g' \ + -e 's!%%CFLAGS%%!$(TARGET_CFLAGS) -DUSE_CROSS_COMPILE -I$(STAGING_DIR)/include -I$(STAGING_DIR)/usr/include!g' \ + -e 's!%%CPP%%!$(TARGET_CROSS)gcc -E!g' \ + -e 's!%%AR%%!$(TARGET_CROSS)ar!g' \ + -e 's!%%LD%%!$(TARGET_CROSS)gcc!g' \ + -e 's!%%LDFLAGS%%!-rdynamic -L$(STAGING_DIR)/lib -L$(STAGING_DIR)/usr/lib!g' \ + -e 's!%%LIBDIRS%%!$(STAGING_DIR)/lib $(STAGING_DIR)/usr/lib!g' \ + -e 's!%%INCDIRS%%!$(STAGING_DIR)/include $(STAGING_DIR)/usr/include!g' \ + files/config.sh-$(patsubst i386,i486,$(ARCH)).in \ + > $(PKG_BUILD_DIR)/config.sh + (cd $(PKG_BUILD_DIR) && ./Configure -S) +endef + +define Build/perl/Compile + @echo + @echo "===> Stage 4: Build target miniperl binary" + @echo + install -m 0644 $(PKG_BUILD_DIR)/config.h $(PKG_BUILD_DIR)/xconfig.h + -rm -f $(PKG_BUILD_DIR)/miniperl + $(MAKE) -C $(PKG_BUILD_DIR) miniperl + mkdir -p $(PKG_BUILD_DIR)/target-bin + install -m 0755 $(PKG_BUILD_DIR)/miniperl $(PKG_BUILD_DIR)/target-bin/ + + @echo + @echo "===> Stage 5: Build target perl binary" + @echo + -rm -f $(PKG_BUILD_DIR)/miniperl $(PKG_BUILD_DIR)/perl + install -m 0755 $(PKG_BUILD_DIR)/host-perl/miniperl $(PKG_BUILD_DIR)/ + touch $(PKG_BUILD_DIR)/miniperl + $(MAKE) -C $(PKG_BUILD_DIR) perl + install -m 0755 $(PKG_BUILD_DIR)/perl $(PKG_BUILD_DIR)/target-bin/ + + @echo + @echo "===> Stage 6: Build target extensions and utils" + @echo + -rm -f $(PKG_BUILD_DIR)/miniperl $(PKG_BUILD_DIR)/perl + install -m 0755 $(PKG_BUILD_DIR)/host-perl/miniperl $(PKG_BUILD_DIR)/ + ln -sf miniperl $(PKG_BUILD_DIR)/perl + touch $(PKG_BUILD_DIR)/miniperl $(PKG_BUILD_DIR)/perl + $(MAKE) -C $(PKG_BUILD_DIR) + + @echo + @echo "===> Stage 7: Install Perl into staging dir" + @echo + -rm -f $(PKG_BUILD_DIR)/perl + $(INSTALL_BIN) $(PKG_BUILD_DIR)/host-perl/perl $(PKG_BUILD_DIR)/ + (cd $(PKG_BUILD_DIR) && ./perl installperl --destdir=$(STAGING_DIR)) + + @echo + @echo "===> Stage 8: Install Perl into a temporary root" + @echo + -rm -f $(PKG_BUILD_DIR)/perl + $(INSTALL_BIN) $(PKG_BUILD_DIR)/target-bin/perl $(PKG_BUILD_DIR) + -rm -rf $(PKG_INSTALL_DIR) + mkdir -p $(PKG_INSTALL_DIR) + (cd $(PKG_BUILD_DIR) && host-perl/miniperl installperl --destdir=$(PKG_INSTALL_DIR)) +endef + +define Package/perl/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/perl$(PKG_VERSION) $(1)/usr/bin + ln -f $(1)/usr/bin/perl$(PKG_VERSION) $(1)/usr/bin/perl +endef + +ifneq ($(CONFIG_PACKAGE_microperl),) +define Build/microperl + $(call Build/Template,microperl) +endef +endif +$(eval $(Build/microperl)) + +ifneq ($(CONFIG_PACKAGE_perl),) +define Build/perl + $(call Build/Template,perl) +endef +endif +$(eval $(Build/perl)) + +define Build/Configure +endef + +define Build/Compile endef $(eval $(call BuildPackage,microperl)) +$(eval $(call BuildPackage,perl)) + +$(eval $(call RequireCommand,rsync, \ + $(PKG_NAME) requires rsync installed on the host-system. \ +)) + +-include perlbase.mk