my $CFG_SYSCONFDIR = get_vars("sysconfdir");
my $CFG_CFLAGS = join ' ', map { get_vars($_) }
qw(SHLTCFLAGS CFLAGS NOTEST_CPPFLAGS EXTRA_CPPFLAGS EXTRA_CFLAGS);
+my $CFG_LDFLAGS = join ' ', map { get_vars($_) }
+ qw(LDFLAGS NOTEST_LDFLAGS SH_LDFLAGS);
my $includedir = get_vars("includedir");
my $CFG_INCLUDEDIR = eval qq("$includedir");
my $CFG_CC = get_vars("CC");
my ($argumentative, @ARGV) = @_;
my $errs = 0;
local $_;
- local $[ = 0;
my @args = split / */, $argumentative;
while (@ARGV && ($_ = $ARGV[0]) =~ /^-(.)(.*)/) {
last;
}
my $pos = index($argumentative,$first);
- if ($pos >= $[) {
+ if ($pos >= 0) {
if ($pos < $#args && $args[$pos+1] eq ':') {
shift @ARGV;
if ($rest eq '') {
}
}
$result =~ s|;;$||;
- $result =~ s|:| |;
return $result;
}
$opt .= " -l$opt_l";
}
+ my $ldflags = "$CFG_LDFLAGS";
if ($opt_p == 1) {
my $apr_libs=`$apr_config --cflags --ldflags --link-libtool --libs`;
$opt .= " -rpath $CFG_LIBEXECDIR -module -avoid-version $apr_ldflags";
}
- push(@cmds, "$libtool $ltflags --mode=link $CFG_CC -o $dso_file $opt $lo");
+ push(@cmds, "$libtool $ltflags --mode=link $CFG_CC $ldflags -o $dso_file $opt $lo");
# execute the commands
&execute_cmds(@cmds);
open(FP, "<$base.c");
my $content = join('', <FP>);
close(FP);
- if ($content =~ m|.*module\s+(?:AP_MODULE_DECLARE_DATA\s+)?([a-zA-Z0-9_]+)_module\s*=\s*.*|s) {
+ if ($content =~ m|.*AP_DECLARE_MODULE\s*\(\s*([a-zA-Z0-9_]+)\s*\)\s*=.*|s || $content =~ m|.*module\s+(?:AP_MODULE_DECLARE_DATA\s+)?([a-zA-Z0-9_]+)_module\s*=\s*.*|s) {
$name = "$1";
$filename = "$base.c";
$filename =~ s|^[^/]+/||;
$c = '#' if ($opt_A);
foreach $lmd (@lmd) {
my $what = $opt_A ? "preparing" : "activating";
- if ($content !~ m|\n#?\s*$lmd|) {
+ my $lmd_re = $lmd;
+ $lmd_re =~ s/\s+/\\s+/g;
+
+ if ($content !~ m|\n#?\s*$lmd_re|) {
# check for open <containers>, so that the new LoadModule
# directive always appears *outside* of an <container>.
}
} else {
# replace already existing LoadModule line
- $content =~ s|^(.*\n)#?\s*$lmd[^\n]*\n|$1$c$lmd\n|s;
+ $content =~ s|^(.*\n)#?\s*$lmd_re[^\n]*\n|$1$c$lmd\n|s;
}
$lmd =~ m|LoadModule\s+(.+?)_module.*|;
notice("[$what module `$1' in $CFG_SYSCONFDIR/$CFG_TARGET.conf]");
include %INSTALLBUILDDIR%/special.mk
# the used tools
-APXS=apxs
APACHECTL=apachectl
# additional defines, includes and libraries