2005-02-25 03:27:54 +01:00
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# microperl
|
|
|
|
#
|
|
|
|
#############################################################
|
2006-11-24 10:49:16 +01:00
|
|
|
MICROPERL_MAJ=5
|
2007-07-11 16:06:06 +02:00
|
|
|
MICROPERL_VERSION=$(MICROPERL_MAJ).8.8
|
|
|
|
MICROPERL_SOURCE=perl-$(MICROPERL_VERSION).tar.bz2
|
2006-11-17 16:43:51 +01:00
|
|
|
MICROPERL_CAT:=$(BZCAT)
|
2005-02-25 03:27:54 +01:00
|
|
|
MICROPERL_SITE=ftp://ftp.cpan.org/pub/CPAN/src/5.0
|
2007-07-11 16:06:06 +02:00
|
|
|
MICROPERL_DIR=$(BUILD_DIR)/perl-$(MICROPERL_VERSION)
|
2005-02-25 03:27:54 +01:00
|
|
|
|
2007-07-11 16:06:06 +02:00
|
|
|
MICROPERL_MODS_DIR=/usr/lib/perl$(MICROPERL_MAJ)/$(MICROPERL_VERSION)
|
2009-07-30 17:31:51 +02:00
|
|
|
MICROPERL_MODS=$(call qstrip,$(BR2_PACKAGE_MICROPERL_MODULES))
|
2007-01-29 21:06:00 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_AUTOMAKE),y)
|
|
|
|
MICROPERL_MODS+=File/Basename.pm Errno.pm Config.pm IO/File.pm Symbol.pm \
|
|
|
|
SelectSaver.pm IO/Seekable.pm IO/Handle.pm IO.pm XSLoader.pm \
|
2007-01-29 21:15:24 +01:00
|
|
|
DynaLoader.pm AutoLoader.pm Carp/Heavy.pm
|
2007-01-29 21:06:00 +01:00
|
|
|
endif
|
2005-02-25 03:27:54 +01:00
|
|
|
$(DL_DIR)/$(MICROPERL_SOURCE):
|
2009-01-16 12:42:52 +01:00
|
|
|
$(call DOWNLOAD,$(MICROPERL_SITE),$(MICROPERL_SOURCE))
|
2005-02-25 03:27:54 +01:00
|
|
|
|
|
|
|
$(MICROPERL_DIR)/.source: $(DL_DIR)/$(MICROPERL_SOURCE)
|
2006-11-17 16:43:51 +01:00
|
|
|
$(MICROPERL_CAT) $(DL_DIR)/$(MICROPERL_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
|
2010-05-27 09:53:01 +02:00
|
|
|
# makedepend contains bashisms
|
|
|
|
$(SED) 's~sh ./makedepend~bash ./makedepend~' \
|
|
|
|
$(MICROPERL_DIR)/Makefile.SH \
|
|
|
|
$(MICROPERL_DIR)/x2p/Makefile.SH \
|
|
|
|
$(MICROPERL_DIR)/pod/Makefile.SH
|
2009-01-26 00:44:53 +01:00
|
|
|
chmod -R u+w $(MICROPERL_DIR)
|
2006-11-24 10:49:16 +01:00
|
|
|
touch $@
|
|
|
|
|
2009-01-25 09:14:37 +01:00
|
|
|
$(MICROPERL_DIR)/.host_configured: $(MICROPERL_DIR)/.source
|
|
|
|
# we need to build a perl for the host just for Errno.pm
|
2011-02-08 22:12:14 +01:00
|
|
|
(cd $(MICROPERL_DIR); ./Configure -Dcc="$(HOSTCC)" -de )
|
2009-01-25 09:14:37 +01:00
|
|
|
touch $@
|
|
|
|
|
|
|
|
|
|
|
|
$(MICROPERL_DIR)/.host_configured_and_fixed: $(MICROPERL_DIR)/.host_configured
|
2009-08-04 15:48:40 +02:00
|
|
|
$(SED) 's/^.*<command-line>.*//g' $(MICROPERL_DIR)/Makefile
|
|
|
|
$(SED) 's/^.*<command-line>.*//g' $(MICROPERL_DIR)/x2p/Makefile
|
2009-11-30 22:31:50 +01:00
|
|
|
$(SED) 's/^.*<command-line>.*//g' $(MICROPERL_DIR)/makefile
|
|
|
|
$(SED) 's/^.*<command-line>.*//g' $(MICROPERL_DIR)/x2p/makefile
|
2009-01-25 09:14:37 +01:00
|
|
|
touch $@
|
|
|
|
|
|
|
|
$(MICROPERL_DIR)/.host_make: $(MICROPERL_DIR)/.host_configured_and_fixed
|
|
|
|
$(MAKE) -C $(MICROPERL_DIR) || echo "An error is expected on make"
|
|
|
|
touch $@
|
|
|
|
|
|
|
|
$(MICROPERL_DIR)/.host_make_fixed: $(MICROPERL_DIR)/.host_make
|
|
|
|
$(MAKE) -C $(MICROPERL_DIR) test || echo "An error is expected on make test"
|
|
|
|
touch $@
|
|
|
|
|
|
|
|
$(MICROPERL_DIR)/.configured: $(MICROPERL_DIR)/.host_make_fixed
|
2007-01-29 21:06:00 +01:00
|
|
|
# we need to build a perl for the host just for Errno.pm
|
2009-01-25 09:14:37 +01:00
|
|
|
(cd $(MICROPERL_DIR); \
|
|
|
|
chmod a+x ext/util/make_ext; \
|
|
|
|
ext/util/make_ext nonxs Errno MAKE="$(firstword $(MAKE))" \
|
2007-01-29 21:06:00 +01:00
|
|
|
)
|
2009-01-25 09:14:37 +01:00
|
|
|
(cd $(MICROPERL_DIR); \
|
|
|
|
chmod u+w uconfig.h; ./uconfig.sh; \
|
|
|
|
$(MAKE) -f $(MICROPERL_DIR)/Makefile.micro regen_uconfig; \
|
2006-12-15 14:34:29 +01:00
|
|
|
$(SED) 's,PRIVLIB ".*,PRIVLIB "/$(MICROPERL_MODS_DIR)",' \
|
|
|
|
-e 's,PRIVLIB_EXP ".*,PRIVLIB_EXP "$(MICROPERL_MODS_DIR)",' \
|
|
|
|
-e 's,BIN ".*,BIN "/usr/bin",' \
|
2007-08-22 11:56:41 +02:00
|
|
|
./uconfig.h; \
|
2006-11-24 10:49:16 +01:00
|
|
|
)
|
|
|
|
touch $@
|
|
|
|
|
|
|
|
$(MICROPERL_DIR)/microperl: $(MICROPERL_DIR)/.configured
|
2010-07-06 09:27:32 +02:00
|
|
|
$(MAKE) -f $(MICROPERL_DIR)/Makefile.micro CC="$(TARGET_CC)" \
|
2006-11-24 10:49:16 +01:00
|
|
|
OPTIMIZE="$(TARGET_CFLAGS)" -C $(MICROPERL_DIR)
|
2007-01-29 21:06:00 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_AUTOMAKE),y)
|
2007-08-22 11:56:41 +02:00
|
|
|
#(cd $(@D); \
|
|
|
|
# CONFIG=uconfig.h $(SHELL) ext/util/make_ext nonxs Errno MAKE="$(firstword $(MAKE))"; \
|
2007-01-29 21:06:00 +01:00
|
|
|
#)
|
|
|
|
endif
|
2005-02-25 03:27:54 +01:00
|
|
|
|
|
|
|
$(TARGET_DIR)/usr/bin/microperl: $(MICROPERL_DIR)/microperl
|
2006-12-15 14:34:29 +01:00
|
|
|
ifneq ($(MICROPERL_MODS),)
|
2007-08-22 11:56:41 +02:00
|
|
|
(cd $(MICROPERL_DIR); \
|
|
|
|
for i in $(patsubst %,$(TARGET_DIR)/$(MICROPERL_MODS_DIR)/%,$(dir $(MICROPERL_MODS))); do \
|
|
|
|
[ -d $$i ] || mkdir -p $$i; \
|
|
|
|
done; \
|
|
|
|
for i in $(MICROPERL_MODS); do \
|
2009-01-25 09:14:37 +01:00
|
|
|
cp -dpf $(MICROPERL_DIR)/lib/$$i $(TARGET_DIR)/$(MICROPERL_MODS_DIR)/$$i; \
|
2006-12-15 14:34:29 +01:00
|
|
|
done; \
|
|
|
|
)
|
|
|
|
endif
|
2009-02-05 00:51:06 +01:00
|
|
|
cp -dpf $(MICROPERL_DIR)/microperl $@
|
|
|
|
ifneq ($(BR2_STRIP_none),y)
|
|
|
|
$(STRIPCMD) $(STRIP_STRIP_ALL) $@
|
|
|
|
endif
|
2007-08-22 11:56:41 +02:00
|
|
|
(cd $(TARGET_DIR)/usr/bin; rm -f perl; ln -s microperl perl;)
|
2005-02-25 03:27:54 +01:00
|
|
|
|
2009-09-02 17:02:02 +02:00
|
|
|
microperl: $(TARGET_DIR)/usr/bin/microperl
|
2005-02-25 03:27:54 +01:00
|
|
|
|
|
|
|
microperl-source: $(DL_DIR)/$(MICROPERL_SOURCE)
|
|
|
|
|
2009-01-25 09:14:37 +01:00
|
|
|
microperl-unpacked: $(MICROPERL_DIR)/.source
|
|
|
|
|
|
|
|
microperl-config: $(MICROPERL_DIR)/.host_configured
|
|
|
|
|
|
|
|
microperl-host: $(MICROPERL_DIR)/.host_make
|
|
|
|
|
|
|
|
microperl-host-fixed: $(MICROPERL_DIR)/.host_make_fixed
|
|
|
|
|
2005-02-25 03:27:54 +01:00
|
|
|
microperl-clean:
|
2007-01-29 21:06:00 +01:00
|
|
|
rm -rf $(TARGET_DIR)/usr/bin/microperl \
|
|
|
|
$(TARGET_DIR)/$(MICROPERL_MODS_DIR) $(TARGET_DIR)/usr/bin/perl
|
2006-12-15 14:34:29 +01:00
|
|
|
-rmdir $(TARGET_DIR)/usr/lib/perl$(MICROPERL_MAJ)
|
|
|
|
-$(MAKE) -C $(MICROPERL_DIR) -f Makefile.micro clean
|
2005-02-25 03:27:54 +01:00
|
|
|
|
|
|
|
microperl-dirclean:
|
|
|
|
rm -rf $(MICROPERL_DIR)
|
|
|
|
|
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# Toplevel Makefile options
|
|
|
|
#
|
|
|
|
#############################################################
|
2008-12-08 09:15:27 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_MICROPERL),y)
|
2005-02-25 03:27:54 +01:00
|
|
|
TARGETS+=microperl
|
|
|
|
endif
|