From: Martin Kraemer Date: Mon, 6 May 2002 08:34:13 +0000 (+0000) Subject: src/support/apxs.pl: re-arranged things to handle DSO extensions X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=395307278eb6b80bdda4ac5676cad53de7da5548;p=thirdparty%2Fapache%2Fhttpd.git src/support/apxs.pl: re-arranged things to handle DSO extensions in a less hardcoded way. (.so) because the shared building chain would fail for Cygwin which uses native Win32 extensions (.dll). Submitted by: Stipe Tolj git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x@94950 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/CHANGES b/src/CHANGES index 769bb25c2af..bb74b2f22dd 100644 --- a/src/CHANGES +++ b/src/CHANGES @@ -1,5 +1,8 @@ Changes with Apache 1.3.25 + *) Make apxs.pl more flexible (file extensions like .so or .dll are + no longer hardcoded). [Stipe Tolj ] + *) Add an intelligent error message should no proxy submodules be valid to handle a request. PR 8407 [Graham Leggett] diff --git a/src/support/apxs.pl b/src/support/apxs.pl index 059522fb2e8..463f7346d58 100644 --- a/src/support/apxs.pl +++ b/src/support/apxs.pl @@ -112,6 +112,12 @@ my $opt_a = 0; my $opt_A = 0; my $opt_q = 0; +# default for DSO file extension +my $dso_ext = "so"; +if ($^O eq "cygwin") { + $dso_ext = "dll"; +} + # this subroutine is derived from Perl's getopts.pl with the enhancement of # the "+" metacharater at the format string to allow a list to be build by # subsequent occurance of the same option. @@ -270,6 +276,7 @@ if ($opt_g) { my $data = join('', ); $data =~ s|%NAME%|$name|sg; $data =~ s|%TARGET%|$CFG_TARGET|sg; + $data =~ s|%DSO_EXT%|$dso_ext|sg; my ($mkf, $src) = ($data =~ m|^(.+)-=#=-\n(.+)|s); @@ -340,14 +347,14 @@ if ($opt_c) { if ($opt_o eq '') { if ($#srcs > -1) { $dso_file = $srcs[0]; - $dso_file =~ s|\.[^.]+$|.so|; + $dso_file =~ s|\.[^.]+$|.$dso_ext|; } elsif ($#objs > -1) { $dso_file = $objs[0]; - $dso_file =~ s|\.[^.]+$|.so|; + $dso_file =~ s|\.[^.]+$|.$dso_ext|; } else { - $dso_file = "mod_unknown.so"; + $dso_file = "mod_unknown.$dso_ext"; } } else { @@ -452,7 +459,7 @@ if ($opt_i or $opt_e) { my @cmds = (); my $f; foreach $f (@args) { - if ($f !~ m|\.so$|) { + if ($f !~ m|\.$dso_ext$|) { print STDERR "apxs:Error: file $f is not a DSO\n"; exit(1); } @@ -592,20 +599,20 @@ APACHECTL=apachectl #LIB=-Lmy/lib/dir -lmylib # the default target -all: mod_%NAME%.so +all: mod_%NAME%.%DSO_EXT% # compile the DSO file -mod_%NAME%.so: mod_%NAME%.c +mod_%NAME%.%DSO_EXT%: mod_%NAME%.c $(APXS) -c $(DEF) $(INC) $(LIB) mod_%NAME%.c # install the DSO file into the Apache installation # and activate it in the Apache configuration install: all - $(APXS) -i -a -n '%NAME%' mod_%NAME%.so + $(APXS) -i -a -n '%NAME%' mod_%NAME%.%DSO_EXT% # cleanup clean: - -rm -f mod_%NAME%.o mod_%NAME%.so + -rm -f mod_%NAME%.o mod_%NAME%.%DSO_EXT% # simple test test: reload @@ -637,7 +644,7 @@ stop: ** for the URL /%NAME%, as follows: ** ** # %TARGET%.conf -** LoadModule %NAME%_module libexec/mod_%NAME%.so +** LoadModule %NAME%_module libexec/mod_%NAME%.%DSO_EXT% ** ** SetHandler %NAME% **