Lines 23-31
Link Here
|
23 |
## Configuration |
23 |
## Configuration |
24 |
## |
24 |
## |
25 |
|
25 |
|
|
|
26 |
my $DESTDIR = $ENV{'DESTDIR'}; |
27 |
|
26 |
my %config_vars = (); |
28 |
my %config_vars = (); |
27 |
|
29 |
|
28 |
my $installbuilddir = "/srv/httpd-2.2.4/prefork/build"; |
30 |
my $installbuilddir = "$DESTDIR/srv/httpd-2.2.4/prefork/build"; |
29 |
get_config_vars("$installbuilddir/config_vars.mk",\%config_vars); |
31 |
get_config_vars("$installbuilddir/config_vars.mk",\%config_vars); |
30 |
|
32 |
|
31 |
# read the configuration variables once |
33 |
# read the configuration variables once |
Lines 48-53
Link Here
|
48 |
my $CFG_SBINDIR = eval qq("$sbindir"); |
50 |
my $CFG_SBINDIR = eval qq("$sbindir"); |
49 |
my $ltflags = $ENV{'LTFLAGS'}; |
51 |
my $ltflags = $ENV{'LTFLAGS'}; |
50 |
$ltflags or $ltflags = "--silent"; |
52 |
$ltflags or $ltflags = "--silent"; |
|
|
53 |
my $libdir = get_vars("libdir"); |
54 |
$ENV{'LD_LIBRARY_PATH'} = $DESTDIR . $libdir; |
51 |
|
55 |
|
52 |
my %internal_vars = map {$_ => 1} |
56 |
my %internal_vars = map {$_ => 1} |
53 |
qw(TARGET CC CFLAGS CFLAGS_SHLIB LD_SHLIB LDFLAGS_SHLIB LIBS_SHLIB |
57 |
qw(TARGET CC CFLAGS CFLAGS_SHLIB LD_SHLIB LDFLAGS_SHLIB LIBS_SHLIB |
Lines 199-210
Link Here
|
199 |
($httpd = $0) =~ s:support/apxs$::; |
203 |
($httpd = $0) =~ s:support/apxs$::; |
200 |
} |
204 |
} |
201 |
|
205 |
|
202 |
unless (-x "$httpd") { |
206 |
unless (-x "$DESTDIR$httpd") { |
203 |
error("$httpd not found or not executable"); |
207 |
error("$httpd not found or not executable"); |
204 |
exit 1; |
208 |
exit 1; |
205 |
} |
209 |
} |
206 |
|
210 |
|
207 |
unless (grep /mod_so/, `. $envvars && $httpd -l`) { |
211 |
unless (grep /mod_so/, `. $DESTDIR$envvars && $DESTDIR$httpd -l`) { |
208 |
error("Sorry, no shared object support for Apache"); |
212 |
error("Sorry, no shared object support for Apache"); |
209 |
error("available under your platform. Make sure"); |
213 |
error("available under your platform. Make sure"); |
210 |
error("the Apache module mod_so is compiled into"); |
214 |
error("the Apache module mod_so is compiled into"); |
Lines 292-297
Link Here
|
292 |
$data =~ s|%TARGET%|$CFG_TARGET|sg; |
296 |
$data =~ s|%TARGET%|$CFG_TARGET|sg; |
293 |
$data =~ s|%PREFIX%|$prefix|sg; |
297 |
$data =~ s|%PREFIX%|$prefix|sg; |
294 |
$data =~ s|%INSTALLBUILDDIR%|$installbuilddir|sg; |
298 |
$data =~ s|%INSTALLBUILDDIR%|$installbuilddir|sg; |
|
|
299 |
$data =~ s|%DESTDIR%|$DESTDIR|sg; |
295 |
|
300 |
|
296 |
my ($mkf, $mods, $src) = ($data =~ m|^(.+)-=#=-\n(.+)-=#=-\n(.+)|s); |
301 |
my ($mkf, $mods, $src) = ($data =~ m|^(.+)-=#=-\n(.+)-=#=-\n(.+)|s); |
297 |
|
302 |
|
Lines 324-350
Link Here
|
324 |
print "$result\n"; |
329 |
print "$result\n"; |
325 |
} |
330 |
} |
326 |
|
331 |
|
327 |
my $apr_config = get_vars("APR_CONFIG"); |
332 |
my $apr_config = $DESTDIR . get_vars("APR_CONFIG"); |
328 |
|
333 |
|
329 |
if (! -x "$apr_config") { |
334 |
if (! -x "$apr_config") { |
330 |
error("$apr_config not found!"); |
335 |
error("$apr_config not found!"); |
331 |
exit(1); |
336 |
exit(1); |
332 |
} |
337 |
} |
333 |
|
338 |
|
334 |
my $apu_config = get_vars("APU_CONFIG"); |
339 |
my $apu_config = $DESTDIR . get_vars("APU_CONFIG"); |
335 |
|
340 |
|
336 |
if (! -x "$apu_config") { |
341 |
if (! -x "$apu_config") { |
337 |
error("$apu_config not found!"); |
342 |
error("$apu_config not found!"); |
338 |
exit(1); |
343 |
exit(1); |
339 |
} |
344 |
} |
340 |
|
345 |
|
341 |
my $libtool = `$apr_config --apr-libtool`; |
346 |
my $libtool = $DESTDIR . `$apr_config --apr-libtool`; |
342 |
chomp($libtool); |
347 |
chomp($libtool); |
343 |
|
348 |
|
344 |
my $apr_includedir = `$apr_config --includes`; |
349 |
my $apr_includedir = `$apr_config --includes`; |
345 |
chomp($apr_includedir); |
350 |
chomp($apr_includedir); |
|
|
351 |
$apr_includedir =~ s/ -I$CFG_PREFIX/ -I$DESTDIR$CFG_PREFIX/; |
346 |
my $apu_includedir = `$apu_config --includes`; |
352 |
my $apu_includedir = `$apu_config --includes`; |
347 |
chomp($apu_includedir); |
353 |
chomp($apu_includedir); |
|
|
354 |
$apu_includedir =~ s/ -I$CFG_PREFIX/ -I$DESTDIR$CFG_PREFIX/; |
348 |
|
355 |
|
349 |
if ($opt_c) { |
356 |
if ($opt_c) { |
350 |
## |
357 |
## |
Lines 409-415
Link Here
|
409 |
$la =~ s|\.c$|.la|; |
416 |
$la =~ s|\.c$|.la|; |
410 |
my $o = $s; |
417 |
my $o = $s; |
411 |
$o =~ s|\.c$|.o|; |
418 |
$o =~ s|\.c$|.o|; |
412 |
push(@cmds, "$libtool $ltflags --mode=compile $CFG_CC $cflags -I$CFG_INCLUDEDIR $apr_includedir $apu_includedir $opt -c -o $lo $s && touch $slo"); |
419 |
push(@cmds, "$libtool $ltflags --mode=compile $CFG_CC $cflags -I$DESTDIR$CFG_INCLUDEDIR $apr_includedir $apu_includedir $opt -c -o $lo $s && touch $slo"); |
413 |
unshift(@objs, $lo); |
420 |
unshift(@objs, $lo); |
414 |
} |
421 |
} |
415 |
|
422 |
|
Lines 479-486
Link Here
|
479 |
$t =~ s|\.[^./\\]+$|\.so|; |
486 |
$t =~ s|\.[^./\\]+$|\.so|; |
480 |
if ($opt_i) { |
487 |
if ($opt_i) { |
481 |
push(@cmds, "$installbuilddir/instdso.sh SH_LIBTOOL='" . |
488 |
push(@cmds, "$installbuilddir/instdso.sh SH_LIBTOOL='" . |
482 |
"$libtool' $f $CFG_LIBEXECDIR"); |
489 |
"$libtool' $f $DESTDIR$CFG_LIBEXECDIR"); |
483 |
push(@cmds, "chmod 755 $CFG_LIBEXECDIR/$t"); |
490 |
push(@cmds, "chmod 755 $DESTDIR$CFG_LIBEXECDIR/$t"); |
484 |
} |
491 |
} |
485 |
|
492 |
|
486 |
# determine module symbolname and filename |
493 |
# determine module symbolname and filename |
Lines 527-543
Link Here
|
527 |
|
534 |
|
528 |
# activate module via LoadModule/AddModule directive |
535 |
# activate module via LoadModule/AddModule directive |
529 |
if ($opt_a or $opt_A) { |
536 |
if ($opt_a or $opt_A) { |
530 |
if (not -f "$CFG_SYSCONFDIR/$CFG_TARGET.conf") { |
537 |
if (not -f "$DESTDIR$CFG_SYSCONFDIR/$CFG_TARGET.conf") { |
531 |
error("Config file $CFG_SYSCONFDIR/$CFG_TARGET.conf not found"); |
538 |
error("Config file $DESTDIR$CFG_SYSCONFDIR/$CFG_TARGET.conf not found"); |
532 |
exit(1); |
539 |
exit(1); |
533 |
} |
540 |
} |
534 |
|
541 |
|
535 |
open(FP, "<$CFG_SYSCONFDIR/$CFG_TARGET.conf") || die; |
542 |
open(FP, "<$DESTDIR$CFG_SYSCONFDIR/$CFG_TARGET.conf") || die; |
536 |
my $content = join('', <FP>); |
543 |
my $content = join('', <FP>); |
537 |
close(FP); |
544 |
close(FP); |
538 |
|
545 |
|
539 |
if ($content !~ m|\n#?\s*LoadModule\s+|) { |
546 |
if ($content !~ m|\n#?\s*LoadModule\s+|) { |
540 |
error("Activation failed for custom $CFG_SYSCONFDIR/$CFG_TARGET.conf file."); |
547 |
error("Activation failed for custom $DESTDIR$CFG_SYSCONFDIR/$CFG_TARGET.conf file."); |
541 |
error("At least one `LoadModule' directive already has to exist."); |
548 |
error("At least one `LoadModule' directive already has to exist."); |
542 |
exit(1); |
549 |
exit(1); |
543 |
} |
550 |
} |
Lines 613-627
Link Here
|
613 |
$content =~ s|^(.*\n)#?\s*$lmd[^\n]*\n|$1$c$lmd\n|s; |
620 |
$content =~ s|^(.*\n)#?\s*$lmd[^\n]*\n|$1$c$lmd\n|s; |
614 |
} |
621 |
} |
615 |
$lmd =~ m|LoadModule\s+(.+?)_module.*|; |
622 |
$lmd =~ m|LoadModule\s+(.+?)_module.*|; |
616 |
notice("[$what module `$1' in $CFG_SYSCONFDIR/$CFG_TARGET.conf]"); |
623 |
notice("[$what module `$1' in $DESTDIR$CFG_SYSCONFDIR/$CFG_TARGET.conf]"); |
617 |
} |
624 |
} |
618 |
if (@lmd) { |
625 |
if (@lmd) { |
619 |
if (open(FP, ">$CFG_SYSCONFDIR/$CFG_TARGET.conf.new")) { |
626 |
if (open(FP, ">$DESTDIR$CFG_SYSCONFDIR/$CFG_TARGET.conf.new")) { |
620 |
print FP $content; |
627 |
print FP $content; |
621 |
close(FP); |
628 |
close(FP); |
622 |
system("cp $CFG_SYSCONFDIR/$CFG_TARGET.conf $CFG_SYSCONFDIR/$CFG_TARGET.conf.bak && " . |
629 |
system("cp $DESTDIR$CFG_SYSCONFDIR/$CFG_TARGET.conf $DESTDIR$CFG_SYSCONFDIR/$CFG_TARGET.conf.bak && " . |
623 |
"cp $CFG_SYSCONFDIR/$CFG_TARGET.conf.new $CFG_SYSCONFDIR/$CFG_TARGET.conf && " . |
630 |
"cp $DESTDIR$CFG_SYSCONFDIR/$CFG_TARGET.conf.new $DESTDIR$CFG_SYSCONFDIR/$CFG_TARGET.conf && " . |
624 |
"rm $CFG_SYSCONFDIR/$CFG_TARGET.conf.new"); |
631 |
"rm $DESTDIR$CFG_SYSCONFDIR/$CFG_TARGET.conf.new"); |
625 |
} else { |
632 |
} else { |
626 |
notice("unable to open configuration file"); |
633 |
notice("unable to open configuration file"); |
627 |
} |
634 |
} |
Lines 645-650
Link Here
|
645 |
## |
652 |
## |
646 |
|
653 |
|
647 |
builddir=. |
654 |
builddir=. |
|
|
655 |
DESTDIR=%DESTDIR% |
648 |
top_srcdir=%PREFIX% |
656 |
top_srcdir=%PREFIX% |
649 |
top_builddir=%PREFIX% |
657 |
top_builddir=%PREFIX% |
650 |
include %INSTALLBUILDDIR%/special.mk |
658 |
include %INSTALLBUILDDIR%/special.mk |