aboutsummaryrefslogtreecommitdiff
path: root/lang/perl/Makefile
diff options
context:
space:
mode:
authorMarcel Denia <naoir@gmx.net>2015-02-03 11:33:24 +0100
committerMarcel Denia <naoir@gmx.net>2015-02-04 13:51:16 +0100
commit4248b8b72d6a8d5965885eb63fd610ea0bda7d54 (patch)
tree5a3b52b76a75a699a0ff0083a48265e67cb131c2 /lang/perl/Makefile
parentd654a226fba50d7ccc8bd676f22c2cd357119e5d (diff)
perl: Add new CONFIG_PERL_THREADS option for enabling threading support
Signed-off-by: Marcel Denia <naoir@gmx.net>
Diffstat (limited to 'lang/perl/Makefile')
-rw-r--r--lang/perl/Makefile20
1 files changed, 18 insertions, 2 deletions
diff --git a/lang/perl/Makefile b/lang/perl/Makefile
index 8bf42bd74..5bba2ead8 100644
--- a/lang/perl/Makefile
+++ b/lang/perl/Makefile
@@ -44,6 +44,20 @@ endif
TARGET_CFLAGS_PERL:=$(patsubst -g3,-g,$(TARGET_CFLAGS))
TARGET_CPPFLAGS_PERL:=$(patsubst -g3,-g,$(TARGET_CPPFLAGS))
+# Handle threading
+ifdef CONFIG_PERL_THREADS
+ PERL_CONFIG_SUFFIX:=-mt
+
+ # uclibc doesn't provide crypt_r(). Enable crypt() usage for glibc builds only
+ ifdef CONFIG_USE_EGLIBC
+ CRYPT_R_PROTO:=REENTRANT_PROTO_B_CCS
+ CRYPT:=define
+ else
+ CRYPT_R_PROTO:=0
+ CRYPT:=undef
+ endif
+endif
+
# A list of disabled testss
# ExtUtils tests are disabled for now as we don't support building
# native extensions on the target machine at the moment
@@ -64,7 +78,7 @@ define Package/perl
CATEGORY:=Languages
TITLE:=The Perl intepreter
URL:=http://www.perl.com/
- DEPENDS:=+USE_EGLIBC:libbsd
+ DEPENDS:=+USE_EGLIBC:libbsd +PERL_THREADS:libpthread
endef
define Package/perl/description
@@ -108,8 +122,10 @@ define Build/Configure
-e 's!%%EXTRA_PERLLIBDIRS%%!$(EXTRA_LIBDIRS:%=-L%)!g' \
-e 's!%%IPV6%%!$(if $($(CONFIG_IPV6)),define,undef)!g' \
-e 's!%%HOSTMINIPERL%%!$(HOST_PERL_PREFIX)/bin/perl!g' \
+ -e 's!%%CRYPT_R_PROTO%%!$(CRYPT_R_PROTO)!g' \
+ -e 's!%%CRYPT%%!$(CRYPT)!g' \
-e 's!%%HOSTGENERATE%%!$(HOST_PERL_PREFIX)/bin/generate_uudmap!g' \
- files/config.sh-$(patsubst i386,i486,$(ARCH)).in \
+ files/config.sh-$(patsubst i386,i486,$(ARCH))$(PERL_CONFIG_SUFFIX).in \
> $(PKG_BUILD_DIR)/config.sh
(cd $(PKG_BUILD_DIR) && ./Configure -S)
install -m 0644 $(PKG_BUILD_DIR)/config.h $(PKG_BUILD_DIR)/xconfig.h