Skip to content

Commit

Permalink
allow perl to build with the re extension is static
Browse files Browse the repository at this point in the history
Previously configuring with -Uusedl built successfully, but didn't
with -Dstatic_ext=re, now both build successfully.

Fixes #21550
  • Loading branch information
tonycoz committed Apr 16, 2024
1 parent 93ed5f0 commit 3b03ffb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions ext/re/Makefile.PL
Expand Up @@ -28,6 +28,13 @@ foreach my $tuple (@files) {
}

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

my @libs;
if ($^O eq 'cygwin' && $Config{usequadmath}) {
Expand Down
4 changes: 2 additions & 2 deletions regcomp.h
Expand Up @@ -1559,12 +1559,12 @@ typedef enum {
* and this is not a DEBUGGING enabled build (identified by
* DEBUGGING_RE_ONLY being defined)
*/
#if ( defined(USE_DYNAMIC_LOADING) && defined(DEBUGGING)) || \
#if ( !defined(PERL_EXT_RE_STATIC) && defined(DEBUGGING)) || \
( defined(PERL_EXT_RE_BUILD) && defined(DEBUGGING_RE_ONLY)) || \
(!defined(PERL_EXT_RE_BUILD) && defined(DEBUGGING))
#define PERL_RE_BUILD_DEBUG
#endif
#if ( defined(USE_DYNAMIC_LOADING) || !defined(PERL_EXT_RE_BUILD) )
#if !defined(PERL_EXT_RE_STATIC)
#define PERL_RE_BUILD_AUX
#endif

Expand Down

0 comments on commit 3b03ffb

Please sign in to comment.