1 #############################################################
5 #############################################################
7 MICROPERL_VERSION
=$(MICROPERL_MAJ
).8.8
8 MICROPERL_SOURCE
=perl-
$(MICROPERL_VERSION
).
tar.bz2
9 MICROPERL_CAT
:=$(BZCAT
)
10 MICROPERL_SITE
=http
://www.cpan.org
/src
11 MICROPERL_DIR
=$(BUILD_DIR
)/microperl-
$(MICROPERL_VERSION
)
13 MICROPERL_MODS_DIR
=/usr
/lib
/perl
$(MICROPERL_MAJ
)/$(MICROPERL_VERSION
)
14 MICROPERL_MODS
=$(subst ",,$(BR2_PACKAGE_MICROPERL_MODULES))
16 ifeq ($(BR2_PACKAGE_AUTOMAKE
),y
)
17 MICROPERL_MODS
+=File
/Basename.pm Errno.pm Config.pm IO
/File.pm Symbol.pm \
18 SelectSaver.pm IO
/Seekable.pm IO
/Handle.pm IO.pm XSLoader.pm \
19 DynaLoader.pm AutoLoader.pm Carp
/Heavy.pm
21 $(DL_DIR
)/$(MICROPERL_SOURCE
):
22 $(WGET
) -P
$(DL_DIR
) $(MICROPERL_SITE
)/$(MICROPERL_SOURCE
)
24 $(MICROPERL_DIR
)/.unpacked
: $(DL_DIR
)/$(MICROPERL_SOURCE
)
25 rm -rf
$(BUILD_DIR
)/tmp.microperl
26 mkdir
-p
$(BUILD_DIR
)/tmp.microperl
27 $(MICROPERL_CAT
) $(DL_DIR
)/$(MICROPERL_SOURCE
) |
tar -C
$(BUILD_DIR
)/tmp.microperl
$(TAR_OPTIONS
) -
28 mv
$(BUILD_DIR
)/tmp.microperl
/perl-
$(MICROPERL_VERSION
) $(@D
)
31 $(MICROPERL_DIR
)/.configured
: $(MICROPERL_DIR
)/.unpacked
32 ifeq ($(BR2_PACKAGE_AUTOMAKE
),y
)
33 # we need to build a perl for the host just for Errno.pm
34 (cd
$(MICROPERL_DIR
); .
/Configure
-de
; \
35 $(MAKE
) CC
="$(HOSTCC)"; \
36 $(SHELL
) ext
/util
/make_ext nonxs Errno MAKE
="$(firstword $(MAKE))"; \
39 (cd
$(MICROPERL_DIR
); chmod u
+w uconfig.h
; . .
/uconfig.sh
; \
40 $(MAKE
) -f Makefile.micro regen_uconfig
; \
41 $(SED
) 's,PRIVLIB ".*,PRIVLIB "/$(MICROPERL_MODS_DIR)",' \
42 -e
's,PRIVLIB_EXP ".*,PRIVLIB_EXP "$(MICROPERL_MODS_DIR)",' \
43 -e
's,BIN ".*,BIN "/usr/bin",' \
48 $(MICROPERL_DIR
)/microperl
: $(MICROPERL_DIR
)/.configured
49 $(MAKE
) -f Makefile.micro CC
=$(TARGET_CC
) \
50 OPTIMIZE
="$(TARGET_CFLAGS)" -C
$(MICROPERL_DIR
)
51 ifeq ($(BR2_PACKAGE_AUTOMAKE
),y
)
53 # CONFIG=uconfig.h $(SHELL) ext/util/make_ext nonxs Errno MAKE="$(firstword $(MAKE))"; \
57 $(TARGET_DIR
)/usr
/bin
/microperl
: $(MICROPERL_DIR
)/microperl
58 ifneq ($(MICROPERL_MODS
),)
59 (cd
$(MICROPERL_DIR
); \
60 for i in
$(MICROPERL_MODS
); do \
61 $(INSTALL
) -D lib
/$$i $(TARGET_DIR
)/$(MICROPERL_MODS_DIR
)/$$i; \
65 $(INSTALL
) -D
-m
0755 $(MICROPERL_DIR
)/microperl
$(TARGET_DIR
)/usr
/bin
/microperl
66 (cd
$(TARGET_DIR
)/usr
/bin
; rm -f perl
; ln
-s microperl perl
;)
68 microperl
: $(TARGET_DIR
)/usr
/bin
/microperl
70 microperl-source
: $(DL_DIR
)/$(MICROPERL_SOURCE
)
73 rm -rf
$(TARGET_DIR
)/usr
/bin
/microperl \
74 $(TARGET_DIR
)/$(MICROPERL_MODS_DIR
) $(TARGET_DIR
)/usr
/bin
/perl
75 -rmdir
$(TARGET_DIR
)/usr
/lib
/perl
$(MICROPERL_MAJ
)
76 -$(MAKE
) -C
$(MICROPERL_DIR
) -f Makefile.micro
clean
79 rm -rf
$(MICROPERL_DIR
)
81 #############################################################
83 # Toplevel Makefile options
85 #############################################################
86 ifeq ($(BR2_PACKAGE_MICROPERL
),y
)