Browse Source

Merge pull request #1403 from jow-/perl-musl-compat

perl: fix musl compatibility
Naoir 9 years ago
parent
commit
7c32778cbf
2 changed files with 32 additions and 1 deletions
  1. 21
    1
      lang/perl/Makefile
  2. 11
    0
      lang/perl/patches/100-musl-compat.patch

+ 21
- 1
lang/perl/Makefile View File

@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
9 9
 
10 10
 PKG_NAME:=perl
11 11
 PKG_VERSION:=5.20.2
12
-PKG_RELEASE:=2
12
+PKG_RELEASE:=3
13 13
 
14 14
 PKG_SOURCE_URL:=ftp://ftp.cpan.org/pub/CPAN/src/5.0 \
15 15
 		http://www.cpan.org/src/5.0/perl-5.20.0.tar.gz \
@@ -128,6 +128,26 @@ define Build/Configure
128 128
 		-e 's!%%HOSTGENERATE%%!$(HOST_PERL_PREFIX)/bin/generate_uudmap!g' \
129 129
 		files/config.sh-$(patsubst i386,i486,$(ARCH))$(PERL_CONFIG_SUFFIX).in \
130 130
 		> $(PKG_BUILD_DIR)/config.sh
131
+  ifeq ($(CONFIG_USE_MUSL),y)
132
+	sed -i \
133
+		-e "s,\(d_stdio_ptr_lval=\)'define',\1'undef',g" \
134
+		-e "s,\(d_stdio_ptr_lval_sets_cnt=\)'define',\1'undef',g" \
135
+		-e "s,\(d_stdiobase=\)'define',\1'undef',g" \
136
+		-e "s,\(d_stdstdio=\)'define',\1'undef',g" \
137
+		-e "s,\(d_getnetbyname_r=\)'define',\1'undef',g" \
138
+		-e "s,\(getprotobyname_r=\)'define',\1'undef',g" \
139
+		-e "s,\(getpwent_r=\)'define',\1'undef',g" \
140
+		-e "s,\(getservent_r=\)'define',\1'undef',g" \
141
+		-e "s,\(gethostent_r=\)'define',\1'undef',g" \
142
+		-e "s,\(getnetent_r=\)'define',\1'undef',g" \
143
+		-e "s,\(getnetbyaddr_r=\)'define',\1'undef',g" \
144
+		-e "s,\(getprotoent_r=\)'define',\1'undef',g" \
145
+		-e "s,\(getprotobynumber_r=\)'define',\1'undef',g" \
146
+		-e "s,\(getgrent_r=\)'define',\1'undef',g" \
147
+		-e "s,\(i_fcntl=\)'undef',\1'define',g" \
148
+		-e "s,\(h_fcntl=\)'false',\1'true',g" \
149
+		$(PKG_BUILD_DIR)/config.sh
150
+  endif
131 151
 	(cd $(PKG_BUILD_DIR) && ./Configure -S)
132 152
 	install -m 0644 $(PKG_BUILD_DIR)/config.h $(PKG_BUILD_DIR)/xconfig.h
133 153
 endef

+ 11
- 0
lang/perl/patches/100-musl-compat.patch View File

@@ -0,0 +1,11 @@
1
+--- a/pp.c
2
++++ b/pp.c
3
+@@ -43,7 +43,7 @@ extern Pid_t getpid (void);
4
+  * Some BSDs and Cygwin default to POSIX math instead of IEEE.
5
+  * This switches them over to IEEE.
6
+  */
7
+-#if defined(LIBM_LIB_VERSION)
8
++#if defined(LIBM_LIB_VERSION) && (defined(__GLIBC__) || defined(__UCLIBC__))
9
+     _LIB_VERSION_TYPE _LIB_VERSION = _IEEE_;
10
+ #endif
11
+