apxs.in revision 6261cda41b17025b1a77fd630833758dfb6349e4
d4205751d4643c272059a3728045929dd0e5e800Lennart Poettering# ====================================================================
d4205751d4643c272059a3728045929dd0e5e800Lennart Poettering# The Apache Software License, Version 1.1
d4205751d4643c272059a3728045929dd0e5e800Lennart Poettering# Copyright (c) 2000-2003 The Apache Software Foundation. All rights
d4205751d4643c272059a3728045929dd0e5e800Lennart Poettering# Redistribution and use in source and binary forms, with or without
d4205751d4643c272059a3728045929dd0e5e800Lennart Poettering# modification, are permitted provided that the following conditions
d4205751d4643c272059a3728045929dd0e5e800Lennart Poettering# 1. Redistributions of source code must retain the above copyright
d4205751d4643c272059a3728045929dd0e5e800Lennart Poettering# notice, this list of conditions and the following disclaimer.
d4205751d4643c272059a3728045929dd0e5e800Lennart Poettering# 2. Redistributions in binary form must reproduce the above copyright
d4205751d4643c272059a3728045929dd0e5e800Lennart Poettering# notice, this list of conditions and the following disclaimer in
d4205751d4643c272059a3728045929dd0e5e800Lennart Poettering# the documentation and/or other materials provided with the
d4205751d4643c272059a3728045929dd0e5e800Lennart Poettering# distribution.
d4205751d4643c272059a3728045929dd0e5e800Lennart Poettering# 3. The end-user documentation included with the redistribution,
d4205751d4643c272059a3728045929dd0e5e800Lennart Poettering# if any, must include the following acknowledgment:
d4205751d4643c272059a3728045929dd0e5e800Lennart Poettering# "This product includes software developed by the
d4205751d4643c272059a3728045929dd0e5e800Lennart Poettering# Apache Software Foundation (http://www.apache.org/)."
d4205751d4643c272059a3728045929dd0e5e800Lennart Poettering# Alternately, this acknowledgment may appear in the software itself,
d4205751d4643c272059a3728045929dd0e5e800Lennart Poettering# if and wherever such third-party acknowledgments normally appear.
d4205751d4643c272059a3728045929dd0e5e800Lennart Poettering# 4. The names "Apache" and "Apache Software Foundation" must
d4205751d4643c272059a3728045929dd0e5e800Lennart Poettering# not be used to endorse or promote products derived from this
d4205751d4643c272059a3728045929dd0e5e800Lennart Poettering# software without prior written permission. For written
d4205751d4643c272059a3728045929dd0e5e800Lennart Poettering# permission, please contact apache@apache.org.
d4205751d4643c272059a3728045929dd0e5e800Lennart Poettering# 5. Products derived from this software may not be called "Apache",
d4205751d4643c272059a3728045929dd0e5e800Lennart Poettering# nor may "Apache" appear in their name, without prior written
d4205751d4643c272059a3728045929dd0e5e800Lennart Poettering# permission of the Apache Software Foundation.
d4205751d4643c272059a3728045929dd0e5e800Lennart Poettering# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
d4205751d4643c272059a3728045929dd0e5e800Lennart Poettering# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
d4205751d4643c272059a3728045929dd0e5e800Lennart Poettering# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
d4205751d4643c272059a3728045929dd0e5e800Lennart Poettering# DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
d4205751d4643c272059a3728045929dd0e5e800Lennart Poettering# ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
d4205751d4643c272059a3728045929dd0e5e800Lennart Poettering# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
d4205751d4643c272059a3728045929dd0e5e800Lennart Poettering# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
d4205751d4643c272059a3728045929dd0e5e800Lennart Poettering# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
d4205751d4643c272059a3728045929dd0e5e800Lennart Poettering# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
d4205751d4643c272059a3728045929dd0e5e800Lennart Poettering# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
d4205751d4643c272059a3728045929dd0e5e800Lennart Poettering# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
d4205751d4643c272059a3728045929dd0e5e800Lennart Poettering# ====================================================================
d4205751d4643c272059a3728045929dd0e5e800Lennart Poettering# This software consists of voluntary contributions made by many
d4205751d4643c272059a3728045929dd0e5e800Lennart Poettering# individuals on behalf of the Apache Software Foundation. For more
d4205751d4643c272059a3728045929dd0e5e800Lennart Poettering# information on the Apache Software Foundation, please see
d4205751d4643c272059a3728045929dd0e5e800Lennart Poettering## Configuration
d4205751d4643c272059a3728045929dd0e5e800Lennart Poetteringmy $installbuilddir = "@exp_installbuilddir@";
d4205751d4643c272059a3728045929dd0e5e800Lennart Poetteringget_config_vars("$installbuilddir/config_vars.mk",\%config_vars);
d4205751d4643c272059a3728045929dd0e5e800Lennart Poettering# read the configuration variables once
d4205751d4643c272059a3728045929dd0e5e800Lennart Poetteringmy $exec_prefix = get_vars("exec_prefix");
d4205751d4643c272059a3728045929dd0e5e800Lennart Poetteringmy $localstatedir = get_vars("localstatedir");
d4205751d4643c272059a3728045929dd0e5e800Lennart Poetteringmy $CFG_SYSCONFDIR = get_vars("sysconfdir");
d4205751d4643c272059a3728045929dd0e5e800Lennart Poetteringmy $CFG_CFLAGS = join ' ', map { get_vars($_) }
d4205751d4643c272059a3728045929dd0e5e800Lennart Poettering qw(SHLTCFLAGS CFLAGS NOTEST_CPPFLAGS EXTRA_CPPFLAGS EXTRA_CFLAGS);
d4205751d4643c272059a3728045929dd0e5e800Lennart Poetteringmy $CFG_INCLUDEDIR = eval qq("$includedir");
d4205751d4643c272059a3728045929dd0e5e800Lennart Poetteringmy $CFG_LIBEXECDIR = eval qq("$libexecdir");
d4205751d4643c272059a3728045929dd0e5e800Lennart Poettering qw(TARGET CC CFLAGS CFLAGS_SHLIB LD_SHLIB LDFLAGS_SHLIB LIBS_SHLIB
d4205751d4643c272059a3728045929dd0e5e800Lennart Poettering PREFIX SBINDIR INCLUDEDIR LIBEXECDIR SYSCONFDIR);
d4205751d4643c272059a3728045929dd0e5e800Lennart Poettering## parse argument line
d4205751d4643c272059a3728045929dd0e5e800Lennart Poettering# defaults for parameters
my $opt_c = 0;
my $opt_e = 0;
my $opt_i = 0;
my $opt_a = 0;
my $opt_A = 0;
my $opt_q = 0;
my $opt_h = 0;
my $opt_p = 0;
# this subroutine is derived from Perl's getopts.pl with the enhancement of
my $errs = 0;
my @args = split / */, $argumentative;
shift @ARGV;
last;
shift @ARGV;
$errs++;
shift @ARGV;
$errs++;
$errs++;
my $rc;
&usage;
&usage;
$result =~ s|;;$||;
$result =~ s|:| |;
return $result;
foreach $cmd (@cmds) {
notice($cmd);
if ($rc) {
if ($opt_g) {
if (-d $name) {
$data =~ s|%TARGET%|$CFG_TARGET|sg;
$data =~ s|%INSTALLBUILDDIR%|$installbuilddir|sg;
my $dso_file;
my $mod;
my $slo = $s;
my $lo = $s;
my $la = $s;
push(@cmds, "$libtool $ltflags --mode=compile $CFG_CC $cflags -I$CFG_INCLUDEDIR $apr_includedir $apu_includedir $opt -c -o $lo $s && touch $slo");
my $lo;
my $base = $f;
$base =~ s|\.[^.]+$||;
$filename =~ s|^[^/]+/||;
$filename =~ s|^[^/]+/||;
# activate module via LoadModule/AddModule directive
if (not -f "$CFG_SYSCONFDIR/$CFG_TARGET.conf") {
error("Config file $CFG_SYSCONFDIR/$CFG_TARGET.conf not found");
open(FP, "<$CFG_SYSCONFDIR/$CFG_TARGET.conf") || die;
error("Activation failed for custom $CFG_SYSCONFDIR/$CFG_TARGET.conf file.");
my $lmd;
$c = '#' if ($opt_A);
foreach $lmd (@lmd) {
my $found =
$content =~ s!\A ( # string and capture start
if (open(FP, ">$CFG_SYSCONFDIR/$CFG_TARGET.conf.new")) {
system("cp $CFG_SYSCONFDIR/$CFG_TARGET.conf $CFG_SYSCONFDIR/$CFG_TARGET.conf.bak && " .
"cp $CFG_SYSCONFDIR/$CFG_TARGET.conf.new $CFG_SYSCONFDIR/$CFG_TARGET.conf && " .
"rm $CFG_SYSCONFDIR/$CFG_TARGET.conf.new");
include %INSTALLBUILDDIR%/special.mk
lynx -mime_header http://localhost/%NAME%
DISTCLEAN_TARGETS = modules.mk
** $ lynx -mime_header http://localhost/%NAME%
#include "httpd.h"
#include "http_config.h"
#include "http_protocol.h"
#include "ap_config.h"