Forráskód Böngészése

package/perl: add option to enable threads

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>
Hector Kesari 5 éve
szülő
commit
4c20eda273
2 módosított fájl, 14 hozzáadás és 0 törlés
  1. 10 0
      package/perl/Config.in
  2. 4 0
      package/perl/perl.mk

+ 10 - 0
package/perl/Config.in

@@ -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

+ 4 - 0
package/perl/perl.mk

@@ -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