source: packages/lang/perl/Makefile @ 28153

Last change on this file since 28153 was 28153, checked in by swalker, 5 years ago

[packages] perl: remove Peter as he is no longer the maintainer

  • Property copyright set to Copyright (C) 2006 OpenWrt.org
  • Property licence set to GPLv2
  • Property svn:eol-style set to native
File size: 5.3 KB
Line 
1#
2# Copyright (C) 2006-2011 OpenWrt.org
3#
4# This is free software, licensed under the GNU General Public License v2.
5# See /LICENSE for more information.
6#
7
8include $(TOPDIR)/rules.mk
9
10PKG_NAME:=perl
11PKG_VERSION:=5.10.0
12PKG_RELEASE:=6
13PKG_MD5SUM:=d2c39b002ebfd2c3c5dba589365c5a71
14
15PKG_SOURCE_URL:=ftp://ftp.cpan.org/pub/CPAN/src/5.0 \
16                ftp://ftp.mpi-sb.mpg.de/pub/perl/CPAN/src/5.0 \
17                ftp://ftp.gmd.de/mirrors/CPAN/src/5.0 \
18                ftp://ftp.funet.fi/pub/languages/perl/CPAN/src/5.0
19PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
20
21PKG_BUILD_DIR:=$(BUILD_DIR)/perl/$(PKG_NAME)-$(PKG_VERSION)
22
23include $(INCLUDE_DIR)/package.mk
24
25ifneq ($(CONFIG_USE_EGLIBC)$(CONFIG_USE_GLIBC),)
26EXTRA_LIBS:=bsd
27EXTRA_LIBDIRS:=$(STAGING_DIR)/lib
28endif
29
30define Package/perl/Default
31  SUBMENU:=Perl
32  SECTION:=lang
33  CATEGORY:=Languages
34  TITLE:=The Perl intepreter
35  URL:=http://www.perl.com/
36  DEPENDS:=+USE_EGLIBC:libbsd +USE_GLIBC:libbsd
37endef
38
39define Package/microperl
40$(call Package/perl/Default)
41  TITLE+=(minimal version)
42endef
43
44define Package/microperl/description
45 A perl package without operating-specific functions such as readdir.
46endef
47
48define Build/Template
49
50$(STAMP_CONFIGURED)-$(1): $(STAMP_PREPARED)
51        -$(MAKE) -C $(PKG_BUILD_DIR) clean
52        $(call Build/$(1)/Configure)
53        touch $$@
54
55$(STAMP_BUILT)-$(1): $(STAMP_CONFIGURED)-$(1)
56        $(call Build/$(1)/Compile)
57        touch $$@
58
59$(STAMP_BUILT): $(STAMP_BUILT)-$(1)
60
61endef
62
63define Build/microperl/Configure
64endef
65
66define Build/microperl/Compile
67        $(MAKE) -C $(PKG_BUILD_DIR) -f Makefile.micro \
68                CC="$(TARGET_CC)" OPTIMIZE="$(TARGET_CFLAGS)"
69        $(INSTALL_DIR) $(PKG_INSTALL_DIR)/usr/bin/
70        $(CP) $(PKG_BUILD_DIR)/microperl $(PKG_INSTALL_DIR)/usr/bin/
71endef
72
73define Package/microperl/install
74        $(INSTALL_DIR) $(1)/usr/bin
75        $(INSTALL_BIN) $(PKG_BUILD_DIR)/microperl $(1)/usr/bin/
76endef
77
78include perlmod.mk
79
80define Package/perl
81$(call Package/perl/Default)
82endef
83
84define Package/perl/description
85 Perl is a stable, cross platform programming language.
86 It is used for mission critical projects in the public and private sectors
87 and is widely used to program web applications of all needs.
88endef
89
90define Build/perl/Configure
91        @echo
92        @echo "===> Stage 1: Configure host perl"
93        @echo
94        mkdir -p $(PKG_BUILD_DIR)/host-perl
95        (cd $(PKG_BUILD_DIR)/host-perl && sh ../Configure -der -Dmksymlinks -Uusedl -Dotherlibdirs=$(PERL_LIB))
96
97        @echo
98        @echo "===> Stage 2: Build host perl binary with static extensions"
99        @echo
100        $(MAKE) -C $(PKG_BUILD_DIR)/host-perl
101
102        @echo
103        @echo "===> Stage 3: Configure target perl"
104        @echo
105        -$(MAKE) -C $(PKG_BUILD_DIR) clean
106        sed \
107                -e 's!%%CC%%!$(TARGET_CC)!g' \
108                -e 's!%%CFLAGS%%!$(TARGET_CFLAGS) -DUSE_CROSS_COMPILE $(TARGET_CPPFLAGS)!g' \
109                -e 's!%%CPP%%!$(TARGET_CROSS)gcc -E!g' \
110                -e 's!%%AR%%!$(TARGET_CROSS)ar!g' \
111                -e 's!%%LD%%!$(TARGET_CROSS)gcc!g' \
112                -e 's!%%LDFLAGS%%!-rdynamic $(TARGET_LDFLAGS)!g' \
113                -e 's!%%LIBDIRS%%!$(STAGING_DIR)/lib $(STAGING_DIR)/usr/lib!g' \
114                -e 's!%%INCDIRS%%!$(STAGING_DIR)/include $(STAGING_DIR)/usr/include!g' \
115                -e 's!%%EXTRA_PERLLIBS%%!$(EXTRA_LIBS:%=-l%)!g' \
116                -e 's!%%EXTRA_PERLLIBDIRS%%!$(EXTRA_LIBDIRS:%=-L%)!g' \
117                files/config.sh-$(patsubst i386,i486,$(ARCH)).in \
118                > $(PKG_BUILD_DIR)/config.sh
119        (cd $(PKG_BUILD_DIR) && ./Configure -S)
120endef
121
122define Build/perl/Compile
123        @echo
124        @echo "===> Stage 4: Build target miniperl binary"
125        @echo
126        install -m 0644 $(PKG_BUILD_DIR)/config.h $(PKG_BUILD_DIR)/xconfig.h
127        -rm -f $(PKG_BUILD_DIR)/miniperl
128        $(MAKE) -C $(PKG_BUILD_DIR) miniperl
129        mkdir -p $(PKG_BUILD_DIR)/target-bin
130        install -m 0755 $(PKG_BUILD_DIR)/miniperl $(PKG_BUILD_DIR)/target-bin/
131
132        @echo
133        @echo "===> Stage 5: Build target perl binary"
134        @echo
135        -rm -f $(PKG_BUILD_DIR)/miniperl $(PKG_BUILD_DIR)/perl
136        install -m 0755 $(PKG_BUILD_DIR)/host-perl/miniperl $(PKG_BUILD_DIR)/
137        touch $(PKG_BUILD_DIR)/miniperl
138        $(MAKE) -C $(PKG_BUILD_DIR) perl
139        install -m 0755 $(PKG_BUILD_DIR)/perl $(PKG_BUILD_DIR)/target-bin/
140
141        @echo
142        @echo "===> Stage 6: Build target extensions and utils"
143        @echo
144        -rm -f $(PKG_BUILD_DIR)/miniperl $(PKG_BUILD_DIR)/perl
145        install -m 0755 $(PKG_BUILD_DIR)/host-perl/miniperl $(PKG_BUILD_DIR)/
146        ln -sf miniperl $(PKG_BUILD_DIR)/perl
147        touch $(PKG_BUILD_DIR)/miniperl $(PKG_BUILD_DIR)/perl
148        $(MAKE) -C $(PKG_BUILD_DIR)
149
150        @echo
151        @echo "===> Stage 7: Install Perl into staging dir"
152        @echo
153        -rm -f $(PKG_BUILD_DIR)/perl
154        $(INSTALL_BIN) $(PKG_BUILD_DIR)/host-perl/perl $(PKG_BUILD_DIR)/
155        (cd $(PKG_BUILD_DIR) && ./perl installperl --destdir=$(STAGING_DIR))
156
157        @echo
158        @echo "===> Stage 8: Install Perl into a temporary root"
159        @echo
160        -rm -f $(PKG_BUILD_DIR)/perl
161        $(INSTALL_BIN) $(PKG_BUILD_DIR)/target-bin/perl $(PKG_BUILD_DIR)
162        -rm -rf $(PKG_INSTALL_DIR)
163        mkdir -p $(PKG_INSTALL_DIR)
164        (cd $(PKG_BUILD_DIR) && host-perl/miniperl installperl --destdir=$(PKG_INSTALL_DIR))
165endef
166
167define Package/perl/install
168        $(INSTALL_DIR) $(1)/usr/bin
169        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/perl$(PKG_VERSION) $(1)/usr/bin
170        ln -nsf perl$(PKG_VERSION) $(1)/usr/bin/perl
171endef
172
173ifneq ($(CONFIG_PACKAGE_microperl),)
174define Build/microperl
175        $(call Build/Template,microperl)
176endef
177endif
178$(eval $(Build/microperl))
179
180ifneq ($(CONFIG_PACKAGE_perl),)
181define Build/perl
182        $(call Build/Template,perl)
183endef
184endif
185$(eval $(Build/perl))
186
187define Build/Configure
188endef
189
190define Build/Compile
191endef
192
193$(eval $(call RequireCommand,rsync, \
194        $(PKG_NAME) requires rsync installed on the host-system. \
195))
196
197$(eval $(call BuildPackage,microperl))
198$(eval $(call BuildPackage,perl))
199
200-include perlbase.mk
Note: See TracBrowser for help on using the repository browser.