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 Perl#21550
  • Loading branch information
tonycoz committed Apr 4, 2024
1 parent bcd28b1 commit 935b631
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 935b631

Please sign in to comment.