package/perl: add option to enable threads
authorHector Kesari <hector.kesari@rockwellcollins.com>
Tue, 21 Jan 2020 19:29:16 +0000 (13:29 -0600)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Tue, 5 Jan 2021 21:38:38 +0000 (22:38 +0100)
Add config option for Perl to enable threads usage.

Signed-off-by: Hector Kesari <hector.kesari@rockwellcollins.com>
Signed-off-by: Clayton Shotwell <clayton.shotwell@rockwellcollins.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
package/perl/Config.in
package/perl/perl.mk

index 32a3fd2ee9519b5f80662063fbd46a2010a52bbf..0ead1c4a46f1fce875b530eedc290514f0b33ef0 100644 (file)
@@ -24,4 +24,14 @@ config BR2_PACKAGE_PERL_MODULES
          Leave empty for all modules (as far as the external libraries
          are available).
 
+config BR2_PACKAGE_PERL_THREADS
+       bool "thread support"
+       depends on BR2_TOOLCHAIN_HAS_THREADS
+       help
+         Enable use of threads in Perl scripts
+
+         WARNING: The use of interpreter-based threads in Perl
+         is officially discouraged.
+         See https://perldoc.perl.org/threads.html#WARNING
+
 endif
index 2f82e1d6d5243eecef88e5d6898923cfe86102d5..5f6aa97674658eb98c8d943af6d10b92b6a78db8 100644 (file)
@@ -62,6 +62,10 @@ ifeq ($(shell expr $(PERL_VERSION_MAJOR) % 2), 1)
 PERL_CONF_OPTS += -Dusedevel
 endif
 
+ifeq ($(BR2_PACKAGE_PERL_THREADS),y)
+PERL_CONF_OPTS += -Dusethreads
+endif
+
 ifeq ($(BR2_STATIC_LIBS),y)
 PERL_CONF_OPTS += --all-static --no-dynaloader
 endif