Skip to content

Commit 3b03ffb

Browse files
committed
allow perl to build with the re extension is static
Previously configuring with -Uusedl built successfully, but didn't with -Dstatic_ext=re, now both build successfully. Fixes #21550
1 parent 93ed5f0 commit 3b03ffb

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

ext/re/Makefile.PL

+7
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ foreach my $tuple (@files) {
2828
}
2929

3030
my $defines = '-DPERL_EXT_RE_BUILD -DPERL_EXT_RE_DEBUG -DPERL_EXT';
31+
my %args;
32+
for my $arg (@ARGV) {
33+
$args{$1} = $2 if $arg =~ /^(\w+)=(.*)$/;
34+
}
35+
if ($args{LINKTYPE} eq "static") {
36+
$defines .= ' -DPERL_EXT_RE_STATIC';
37+
}
3138

3239
my @libs;
3340
if ($^O eq 'cygwin' && $Config{usequadmath}) {

regcomp.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1559,12 +1559,12 @@ typedef enum {
15591559
* and this is not a DEBUGGING enabled build (identified by
15601560
* DEBUGGING_RE_ONLY being defined)
15611561
*/
1562-
#if ( defined(USE_DYNAMIC_LOADING) && defined(DEBUGGING)) || \
1562+
#if ( !defined(PERL_EXT_RE_STATIC) && defined(DEBUGGING)) || \
15631563
( defined(PERL_EXT_RE_BUILD) && defined(DEBUGGING_RE_ONLY)) || \
15641564
(!defined(PERL_EXT_RE_BUILD) && defined(DEBUGGING))
15651565
#define PERL_RE_BUILD_DEBUG
15661566
#endif
1567-
#if ( defined(USE_DYNAMIC_LOADING) || !defined(PERL_EXT_RE_BUILD) )
1567+
#if !defined(PERL_EXT_RE_STATIC)
15681568
#define PERL_RE_BUILD_AUX
15691569
#endif
15701570

0 commit comments

Comments
 (0)