Browse Source

lang/perl: Clean up, add comments

Signed-off-by: Marcel Denia <naoir@gmx.net>
Marcel Denia 10 years ago
parent
commit
2bc4222ffb
2 changed files with 16 additions and 8 deletions
  1. 11
    7
      lang/perl/Makefile
  2. 5
    1
      lang/perl/perlmod.mk

+ 11
- 7
lang/perl/Makefile View File

@@ -26,20 +26,23 @@ 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)
30 31
 PKG_INSTALL:=1
31 32
 PKG_BUILD_DEPENDS:=perl/host
32 33
 PKG_BUILD_PARALLEL:=1
33 34
 HOST_BUILD_PARALLEL:=1
34 35
 
35
-include $(INCLUDE_DIR)/package.mk
36
-include $(INCLUDE_DIR)/host-build.mk
37
-
36
+# Variables used during configuration/build
37
+HOST_PERL_PREFIX:=$(STAGING_DIR_HOST)/usr
38 38
 ifneq ($(CONFIG_USE_EGLIBC),)
39
-EXTRA_LIBS:=bsd
40
-EXTRA_LIBDIRS:=$(STAGING_DIR)/lib
39
+	EXTRA_LIBS:=bsd
40
+	EXTRA_LIBDIRS:=$(STAGING_DIR)/lib
41 41
 endif
42 42
 
43
+include $(INCLUDE_DIR)/package.mk
44
+include $(INCLUDE_DIR)/host-build.mk
45
+
43 46
 define Package/perl
44 47
   SUBMENU:=Perl
45 48
   SECTION:=lang
@@ -55,17 +58,17 @@ define Package/perl/description
55 58
   and is widely used to program web applications of all needs.
56 59
 endef
57 60
 
58
-HOST_PERL_PREFIX:=$(STAGING_DIR_HOST)/usr
61
+# Static host perl
59 62
 define Host/Configure
60 63
 	( cd $(HOST_BUILD_DIR); ./Configure -der -Uusedl -Dprefix=$(HOST_PERL_PREFIX) )
61 64
 endef
62 65
 
63 66
 define Host/Install
64 67
 	( cd $(HOST_BUILD_DIR); ./miniperl installperl )
65
-	#--destdir=$(STAGING_DIR_HOST)
66 68
 	$(CP) $(HOST_BUILD_DIR)/generate_uudmap $(HOST_PERL_PREFIX)/bin/
67 69
 endef
68 70
 
71
+# Target perl
69 72
 define Build/Configure
70 73
 	sed \
71 74
 		-e 's!%%CC%%!$(TARGET_CC)!g' \
@@ -97,6 +100,7 @@ define Package/perl/install
97 100
 	ln -nsf perl$(PKG_VERSION) $(1)/usr/bin/perl
98 101
 endef
99 102
 
103
+
100 104
 $(eval $(call RequireCommand,rsync, \
101 105
 	$(PKG_NAME) requires rsync installed on the host-system. \
102 106
 ))

+ 5
- 1
lang/perl/perlmod.mk View File

@@ -3,6 +3,10 @@
3 3
 
4 4
 # Build environment
5 5
 HOST_PERL_PREFIX:=$(STAGING_DIR_HOST)/usr
6
+ifneq ($(CONFIG_USE_EGLIBC),)
7
+	EXTRA_LIBS:=bsd
8
+	EXTRA_LIBDIRS:=$(STAGING_DIR)/lib
9
+endif
6 10
 PERL_CMD:=$(STAGING_DIR_HOST)/usr/bin/perl5.20.0
7 11
 
8 12
 # Module install prefix
@@ -24,7 +28,7 @@ define perlmod/Configure
24 28
 		FULL_AR=$(GNU_TARGET_NAME)-ar \
25 29
 		LD=$(GNU_TARGET_NAME)-gcc \
26 30
 		LDDLFLAGS="-shared $(TARGET_LDFLAGS)"  \
27
-		LDFLAGS=" " \
31
+		LDFLAGS="$(EXTRA_LIBDIRS:%=-L%) $(EXTRA_LIBS:%=-l%) " \
28 32
 		LIBC=" " \
29 33
 		LIB_EXT=.a \
30 34
 		OBJ_EXT=.o \