Commit 4bb1db66 authored by Ryan Jackson's avatar Ryan Jackson

Added Perl.

- /usr/bin/perl is only 850K (due to being linked against uClibc)
- 99.572% of test cases pass (some Embed tests and pwent/grent tests fail)
- First pass at installing only modules we need: /usr/lib/perl5/5.88
  is only 1.2 meg decompressed.
parent 98d65f7e
......@@ -9,7 +9,7 @@ STAGING_DIR = $(PWD)/buildroot/build_i386/staging_dir
INITRAMFS = $(PWD)/initramfs.gz
BOOT_PATH = $(PWD)/boot
MODULES := busybox zlib linux dropbear testbed hdparm target_template sudo e2fsprogs openssl
MODULES := busybox zlib linux dropbear testbed hdparm target_template sudo e2fsprogs openssl wget perl
INSTALL_MODULES := $(addsuffix -install,$(MODULES))
EXTRACT_MODULES := $(addsuffix -extract,$(MODULES))
PATCH_MODULES := $(addsuffix -patch,$(MODULES))
......
include ../../variables.mk
PERL_VERSION = 5.8.8
PERL_PATH = $(TARGET_BUILD_PATH)/perl-$(PERL_VERSION)
PERL_MODULES = Digest Errno Fcntl File IO PerlIO POSIX \
Socket Sys Time XS \
DynaLoader \
Carp Config Cwd English Env Errno Exporter \
FileHandle Shell Switch UNIVERSAL XSLoader \
attributes attrs base bytes charnames constant \
fields if integer less lib locale open sigtrap \
sort strict subs utf8 vars warnings
.PHONY: extract patch config \
perl install clean all
all: perl
extract: $(PERL_PATH)/.extract-stamp
patch: $(PERL_PATH)/.patch-stamp
config: $(PERL_PATH)/.config-stamp
perl: config
PATH=$(STAGING_DIR)/usr/bin:$(PATH) \
LD_LIBRARY_PATH=$(STAGING_DIR)/lib \
$(MAKE) -C $(PERL_PATH)
install:
$(STRIPCMD) --strip-unneeded $(PERL_PATH)/perl
find $(PERL_PATH)/lib -name \*.so | xargs \
$(STRIPCMD) --strip-unneeded
mkdir -p $(TARGET_PATH)/usr/lib/perl5/$(PERL_VERSION)
mkdir -p $(TARGET_PATH)/usr/bin
install -m 755 $(PERL_PATH)/perl $(TARGET_PATH)/usr/bin/perl
$(SOURCE_PATH)/perl/install_modules $(PERL_PATH) \
$(TARGET_PATH)/usr/lib/perl5/$(PERL_VERSION) \
$(PERL_MODULES)
clean:
$(MAKE) -C $(PERL_PATH) clean
$(PERL_PATH)/.extract-stamp:
mkdir -p $(TARGET_BUILD_PATH)
cd $(TARGET_BUILD_PATH); tar xjf $(SOURCE_PATH)/perl/perl-$(PERL_VERSION).tar.bz2
touch $@
$(PERL_PATH)/.patch-stamp: $(PERL_PATH)/.extract-stamp
$(SCRIPTS_PATH)/patch-kernel.sh $(PERL_PATH) $(SOURCE_PATH)/perl/ '*.patch'
touch $@
$(PERL_PATH)/.config-stamp: $(PERL_PATH)/.patch-stamp
cp $(SOURCE_PATH)/perl/config.sh $(PERL_PATH)
(export PATH=$(STAGING_DIR)/usr/bin:$(PATH) \
LD_LIBRARY_PATH=$(STAGING_DIR)/lib; \
cd $(PERL_PATH); \
sh ./Configure -der && \
sh ./makedepend)
sed -i /command-line/d $(PERL_PATH)/makefile
sed -i /command-line/d $(PERL_PATH)/x2p/makefile
touch $@
This diff is collapsed.
#! /bin/sh
build_dir="$1"
target_dir="$2"
shift
shift
modules="$@"
install_file()
{
local file="$1"
local target="$2"
local target_file="${file##*$build_dir/lib}"
echo mkdir -p "$target_dir/${target_file%/*}"
mkdir -p "$target_dir/${target_file%/*}"
echo install -m 444 "$file" "$target_dir/$target_file"
install -m 444 "$file" "$target_dir/$target_file"
}
for module in $modules; do
module_file="$build_dir/lib/$module.pm"
module_dir="$build_dir/lib/$module"
auto_dir="$build_dir/lib/auto/$module"
if [ -f "$module_file" ]; then
install_file "$module_file" "$target_dir"
fi
if [ -d "$module_dir" ]; then
find $module_dir -type f \! -name \*.t \! -name README \
\! -name Changes \! -name .exists | while read f; do
install_file "$f" "$target_dir"
done
fi
# XXX If you want to use AutoLoader, remove the exceptions for
# *.ix and *.al from the find command below
if [ -d "$auto_dir" ]; then
find $auto_dir -type f \! -name \*.t \! -name .exists \
\! -name \*.al \! -name \*.ix | \
while read f; do
install_file "$f" "$target_dir"
done
fi
done
--- perl-5.8.8/makedepend.SH.orig 2008-12-23 10:46:05.000000000 -0700
+++ perl-5.8.8/makedepend.SH 2008-12-23 10:46:58.000000000 -0700
@@ -128,7 +128,7 @@
*.y) filebase=`basename $file .y` ;;
esac
case "$file" in
- */*) finc="-I`echo $file | sed 's#/[^/]*$##`" ;;
+ */*) finc="-I`echo $file | sed 's#/[^/]*$##'`" ;;
*) finc= ;;
esac
$echo "Finding dependencies for $filebase$_o."
--- perl-5.8.8/ext/IPC/SysV/SysV.xs.orig 2008-12-23 10:48:32.000000000 -0700
+++ perl-5.8.8/ext/IPC/SysV/SysV.xs 2008-12-23 10:48:46.000000000 -0700
@@ -3,9 +3,6 @@
#include "XSUB.h"
#include <sys/types.h>
-#ifdef __linux__
-# include <asm/page.h>
-#endif
#if defined(HAS_MSG) || defined(HAS_SEM) || defined(HAS_SHM)
#ifndef HAS_SEM
# include <sys/ipc.h>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment