]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
src/support/apxs.pl: re-arranged things to handle DSO extensions
authorMartin Kraemer <martin@apache.org>
Mon, 6 May 2002 08:34:13 +0000 (08:34 +0000)
committerMartin Kraemer <martin@apache.org>
Mon, 6 May 2002 08:34:13 +0000 (08:34 +0000)
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 <tolj@wapme-systems.de>

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x@94950 13f79535-47bb-0310-9956-ffa450edef68

src/CHANGES
src/support/apxs.pl

index 769bb25c2af771a5906ecdc33f1755a82a3c5495..bb74b2f22dd84ea417a686ca7a32c1b476758bc8 100644 (file)
@@ -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 <tolj@wapme-systems.de>]
+
   *) Add an intelligent error message should no proxy submodules be
      valid to handle a request. PR 8407 [Graham Leggett]
 
index 059522fb2e8e103919274d4f555476504ce9bf25..463f7346d58b17bb540943cc58dca9e65467433f 100644 (file)
@@ -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>);
     $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%
 **    <Location /%NAME%>
 **    SetHandler %NAME%
 **    </Location>