|
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
9
|
9
|
|
10
|
10
|
PKG_NAME:=perl
|
11
|
11
|
PKG_VERSION:=5.20.0
|
12
|
|
-PKG_RELEASE:=1
|
|
12
|
+PKG_RELEASE:=2
|
13
|
13
|
PKG_MD5SUM:=406ec049ebe3afcc80d9c76ec78ca4f8
|
14
|
14
|
|
15
|
15
|
PKG_SOURCE_URL:=ftp://ftp.cpan.org/pub/CPAN/src/5.0 \
|
|
@@ -26,16 +26,24 @@ PKG_LICENSE:=GPLv1 ARTISTIC
|
26
|
26
|
PKG_LICENSE_FILES:=Copying Artistic README
|
27
|
27
|
PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
|
28
|
28
|
|
|
29
|
+# Build settings
|
29
|
30
|
PKG_BUILD_DIR:=$(BUILD_DIR)/perl/$(PKG_NAME)-$(PKG_VERSION)
|
|
31
|
+PKG_INSTALL:=1
|
|
32
|
+PKG_BUILD_DEPENDS:=perl/host
|
|
33
|
+PKG_BUILD_PARALLEL:=1
|
|
34
|
+HOST_BUILD_PARALLEL:=1
|
30
|
35
|
|
31
|
|
-include $(INCLUDE_DIR)/package.mk
|
32
|
|
-
|
|
36
|
+# Variables used during configuration/build
|
|
37
|
+HOST_PERL_PREFIX:=$(STAGING_DIR_HOST)/usr
|
33
|
38
|
ifneq ($(CONFIG_USE_EGLIBC),)
|
34
|
|
-EXTRA_LIBS:=bsd
|
35
|
|
-EXTRA_LIBDIRS:=$(STAGING_DIR)/lib
|
|
39
|
+ EXTRA_LIBS:=bsd
|
|
40
|
+ EXTRA_LIBDIRS:=$(STAGING_DIR)/lib
|
36
|
41
|
endif
|
37
|
42
|
|
38
|
|
-define Package/perl/Default
|
|
43
|
+include $(INCLUDE_DIR)/package.mk
|
|
44
|
+include $(INCLUDE_DIR)/host-build.mk
|
|
45
|
+
|
|
46
|
+define Package/perl
|
39
|
47
|
SUBMENU:=Perl
|
40
|
48
|
SECTION:=lang
|
41
|
49
|
CATEGORY:=Languages
|
|
@@ -44,75 +52,24 @@ define Package/perl/Default
|
44
|
52
|
DEPENDS:=+USE_EGLIBC:libbsd
|
45
|
53
|
endef
|
46
|
54
|
|
47
|
|
-define Package/microperl
|
48
|
|
-$(call Package/perl/Default)
|
49
|
|
- TITLE+=(minimal version)
|
50
|
|
-endef
|
51
|
|
-
|
52
|
|
-define Package/microperl/description
|
53
|
|
- A perl package without operating-specific functions such as readdir.
|
54
|
|
-endef
|
55
|
|
-
|
56
|
|
-define Build/Template
|
57
|
|
-
|
58
|
|
-$(STAMP_CONFIGURED)-$(1): $(STAMP_PREPARED)
|
59
|
|
- -$(MAKE) -C $(PKG_BUILD_DIR) clean
|
60
|
|
- $(call Build/$(1)/Configure)
|
61
|
|
- touch $$@
|
62
|
|
-
|
63
|
|
-$(STAMP_BUILT)-$(1): $(STAMP_CONFIGURED)-$(1)
|
64
|
|
- $(call Build/$(1)/Compile)
|
65
|
|
- touch $$@
|
66
|
|
-
|
67
|
|
-$(STAMP_BUILT): $(STAMP_BUILT)-$(1)
|
68
|
|
-
|
69
|
|
-endef
|
70
|
|
-
|
71
|
|
-define Build/microperl/Configure
|
72
|
|
-endef
|
73
|
|
-
|
74
|
|
-define Build/microperl/Compile
|
75
|
|
- +$(MAKE) $(MAKE_J) -C $(PKG_BUILD_DIR) -f Makefile.micro \
|
76
|
|
- CC="gcc" ugenerate_uudmap
|
77
|
|
- +$(MAKE) $(MAKE_J) -C $(PKG_BUILD_DIR) -f Makefile.micro \
|
78
|
|
- CC="$(TARGET_CC)" OPTIMIZE="$(TARGET_CFLAGS)"
|
79
|
|
- $(INSTALL_DIR) $(PKG_INSTALL_DIR)/usr/bin/
|
80
|
|
- $(CP) $(PKG_BUILD_DIR)/microperl $(PKG_INSTALL_DIR)/usr/bin/
|
81
|
|
-endef
|
82
|
|
-
|
83
|
|
-define Package/microperl/install
|
84
|
|
- $(INSTALL_DIR) $(1)/usr/bin
|
85
|
|
- $(INSTALL_BIN) $(PKG_BUILD_DIR)/microperl $(1)/usr/bin/
|
86
|
|
-endef
|
87
|
|
-
|
88
|
|
-include perlmod.mk
|
89
|
|
-
|
90
|
|
-define Package/perl
|
91
|
|
-$(call Package/perl/Default)
|
92
|
|
-endef
|
93
|
|
-
|
94
|
55
|
define Package/perl/description
|
95
|
56
|
Perl is a stable, cross platform programming language.
|
96
|
57
|
It is used for mission critical projects in the public and private sectors
|
97
|
58
|
and is widely used to program web applications of all needs.
|
98
|
59
|
endef
|
99
|
60
|
|
100
|
|
-define Build/perl/Configure
|
101
|
|
- @echo
|
102
|
|
- @echo "===> Stage 1: Configure host perl"
|
103
|
|
- @echo
|
104
|
|
- mkdir -p $(PKG_BUILD_DIR)/host-perl
|
105
|
|
- (cd $(PKG_BUILD_DIR)/host-perl && sh ../Configure -der -Dmksymlinks -Uusedl -Dotherlibdirs=$(PERL_LIB))
|
106
|
|
-
|
107
|
|
- @echo
|
108
|
|
- @echo "===> Stage 2: Build host perl binary with static extensions"
|
109
|
|
- @echo
|
110
|
|
- +$(MAKE) $(MAKE_J) -C $(PKG_BUILD_DIR)/host-perl miniperl
|
111
|
|
-
|
112
|
|
- @echo
|
113
|
|
- @echo "===> Stage 3: Configure target perl"
|
114
|
|
- @echo
|
115
|
|
- -$(MAKE) -C $(PKG_BUILD_DIR) clean
|
|
61
|
+# Static host perl
|
|
62
|
+define Host/Configure
|
|
63
|
+ ( cd $(HOST_BUILD_DIR); ./Configure -der -Uusedl -Duserelocatableinc -Dprefix=$(HOST_PERL_PREFIX) )
|
|
64
|
+endef
|
|
65
|
+
|
|
66
|
+define Host/Install
|
|
67
|
+ ( cd $(HOST_BUILD_DIR); ./miniperl installperl )
|
|
68
|
+ $(CP) $(HOST_BUILD_DIR)/generate_uudmap $(HOST_PERL_PREFIX)/bin/
|
|
69
|
+endef
|
|
70
|
+
|
|
71
|
+# Target perl
|
|
72
|
+define Build/Configure
|
116
|
73
|
sed \
|
117
|
74
|
-e 's!%%CC%%!$(TARGET_CC)!g' \
|
118
|
75
|
-e 's!%%CFLAGS%%!$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)!g' \
|
|
@@ -125,37 +82,16 @@ define Build/perl/Configure
|
125
|
82
|
-e 's!%%EXTRA_PERLLIBS%%!$(EXTRA_LIBS:%=-l%)!g' \
|
126
|
83
|
-e 's!%%EXTRA_PERLLIBDIRS%%!$(EXTRA_LIBDIRS:%=-L%)!g' \
|
127
|
84
|
-e 's!%%IPV6%%!$(if $($(CONFIG_IPV6)),define,undef)!g' \
|
128
|
|
- -e 's!%%HOSTMINIPERL%%!$(PKG_BUILD_DIR)/host-perl/miniperl!g' \
|
129
|
|
- -e 's!%%HOSTGENERATE%%!$(PKG_BUILD_DIR)/host-perl/generate_uudmap!g' \
|
|
85
|
+ -e 's!%%HOSTMINIPERL%%!$(HOST_PERL_PREFIX)/bin/perl!g' \
|
|
86
|
+ -e 's!%%HOSTGENERATE%%!$(HOST_PERL_PREFIX)/bin/generate_uudmap!g' \
|
130
|
87
|
files/config.sh-$(patsubst i386,i486,$(ARCH)).in \
|
131
|
88
|
> $(PKG_BUILD_DIR)/config.sh
|
132
|
89
|
(cd $(PKG_BUILD_DIR) && ./Configure -S)
|
|
90
|
+ install -m 0644 $(PKG_BUILD_DIR)/config.h $(PKG_BUILD_DIR)/xconfig.h
|
133
|
91
|
endef
|
134
|
92
|
|
135
|
|
-define Build/perl/Compile
|
136
|
|
- @echo
|
137
|
|
- @echo "===> Stage 4: Build target perl binary"
|
138
|
|
- @echo
|
139
|
|
- install -m 0644 $(PKG_BUILD_DIR)/config.h $(PKG_BUILD_DIR)/xconfig.h
|
140
|
|
- +$(MAKE) $(MAKE_J) -C $(PKG_BUILD_DIR) perl
|
141
|
|
- mkdir -p $(PKG_BUILD_DIR)/target-bin
|
142
|
|
- install -m 0755 $(PKG_BUILD_DIR)/perl $(PKG_BUILD_DIR)/target-bin/
|
143
|
|
-
|
144
|
|
- @echo
|
145
|
|
- @echo "===> Stage 5: Build target extensions and utils"
|
146
|
|
- @echo
|
147
|
|
- +$(MAKE) $(MAKE_J) -C $(PKG_BUILD_DIR)
|
148
|
|
-
|
149
|
|
- @echo
|
150
|
|
- @echo "===> Stage 6: Install Perl into staging dir"
|
151
|
|
- @echo
|
152
|
|
- (cd $(PKG_BUILD_DIR) && ./miniperl installperl --destdir=$(STAGING_DIR))
|
153
|
|
-
|
154
|
|
- @echo
|
155
|
|
- @echo "===> Stage 7: Install Perl into a temporary root"
|
156
|
|
- @echo
|
157
|
|
- mkdir -p $(PKG_INSTALL_DIR)
|
158
|
|
- (cd $(PKG_BUILD_DIR) && ./miniperl installperl --destdir=$(PKG_INSTALL_DIR))
|
|
93
|
+define Build/Compile
|
|
94
|
+ +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)
|
159
|
95
|
endef
|
160
|
96
|
|
161
|
97
|
define Package/perl/install
|
|
@@ -164,31 +100,13 @@ define Package/perl/install
|
164
|
100
|
ln -nsf perl$(PKG_VERSION) $(1)/usr/bin/perl
|
165
|
101
|
endef
|
166
|
102
|
|
167
|
|
-ifneq ($(CONFIG_PACKAGE_microperl),)
|
168
|
|
-define Build/microperl
|
169
|
|
- $(call Build/Template,microperl)
|
170
|
|
-endef
|
171
|
|
-endif
|
172
|
|
-$(eval $(Build/microperl))
|
173
|
|
-
|
174
|
|
-ifneq ($(CONFIG_PACKAGE_perl),)
|
175
|
|
-define Build/perl
|
176
|
|
- $(call Build/Template,perl)
|
177
|
|
-endef
|
178
|
|
-endif
|
179
|
|
-$(eval $(Build/perl))
|
180
|
|
-
|
181
|
|
-define Build/Configure
|
182
|
|
-endef
|
183
|
|
-
|
184
|
|
-define Build/Compile
|
185
|
|
-endef
|
186
|
103
|
|
187
|
104
|
$(eval $(call RequireCommand,rsync, \
|
188
|
105
|
$(PKG_NAME) requires rsync installed on the host-system. \
|
189
|
106
|
))
|
190
|
107
|
|
191
|
|
-$(eval $(call BuildPackage,microperl))
|
192
|
108
|
$(eval $(call BuildPackage,perl))
|
|
109
|
+$(eval $(call HostBuild))
|
193
|
110
|
|
|
111
|
+include perlmod.mk
|
194
|
112
|
-include perlbase.mk
|