On Mon, 15 Sep 2003, Steve Hay wrote:

> Randy Kobes wrote:
>
> >Having an APACHE_INST would be a good idea, as it's then
> >more intuitive of what it represents ... Perhaps a
> >combination of APACHE_INST and INSTALL_LIB would be
> >good, in order to keep the flavour of the current
> >build procedure:
> >
> >- APACHE_INST: the Apache install directory,
> >   or
> >- APACHE_SRC, which can be either the Apache build or
> >install directory,
> >
> >With this,
> >- INSTALL_DLL: where to put mod_perl.so. If not given,
> >defaults to APACHE_INST/modules, or to APACHE_SRC/modules,
> >if these exist;
> >- INSTALL_LIB: where to put mod_perl.lib. If not given,
> >defaults to APACHE_INST/libexec, or to APACHE_SRC/libexec,
> >if these exist;

In the interests of not introducing another layer of
complexity, in the patch below I just added an INSTALL_LIB -
the INSTALL.win32 docs point out that APACHE_SRC can either
be the Apache source directory or the Apache install
directory, so APACHE_INST is a bit redundant (although
more descriptive). And like the installation of mod_perl.so,
which defaults to APACHE_SRC/modules (if this exists) if
INSTALL_DLL isn't given, mod_perl.lib will get installed
to APACHE_SRC/libexec (if this exists) if INSTALL_LIB isn't
given.

> >
> >In Apache::MyConfig, the location of the mod_perl lib would
> >then be the value of INSTALL_LIB, if that exists or was set;
> >if not, then it would stay at the current value of the
> >mod_perl source location.
> >
> This all sounds excellent.
> >
> >As for the location of the mod_perl header files in
> >Apache::MyConfig, right now for Win32 they're set as
> >/Path/to/mod_perl/sources/src/modules/perl. One instead
> >could use Apache::src->new->inc, which gives the installed
> >path (under the Perl tree). However, this wouldn't be a
> >compatible change with the current behaviour, as
> >Apache::src->new->inc is a string including the '-I' before
> >the directories, so that it can be used directly in a $(CC)
> >command. But I think it would be more convenient to use
> >Apache::src->new->inc, for the same reason as specifying an
> >installed location for the mod_perl.lib - that way, people
> >can delete the mod_perl build directory after installation.
> >What does this sound like?
> >
> >
> Setting MODPERL_INC to the installed location rather than the build
> location certainly makes a lot of sense.  A definite thumbs-up to that.
>
> But I'm not so sure about introducing the '-I' if that breaks backwards
> compatibility.  Depends how much you think people would be affected by
> it; I don't really know.
>
> Would it be possible to play it safe, and set MODPERL_INC to the
> installed location, but without the '-I's?

The values of MODPERL_LIB and MODPERL_INC in
Apache::MyConfig I ended up leaving alone, as changing them
now will break compatibility. Using Apache::src->new->inc
for MODPERL_INC (which would be the installed header
location) would be more convenient, but has the '-I'
switches already in it, and removing them would leave you
with a list of directories - both options would present
different behaviour to the current one. Changing MODPERL_LIB
to the installed directory, while more convenient, would
also break compatibility, as with the current MODPERL_LIB
both mod_perl.so and mod_perl.lib are present in that
directory, which isn't the case with the installed
directories.

If one wants to use the installed locations, one can use
Apache::src->new->inc, rather than MODPERL_INC from
Apache::MyConfig, for the headers, and then use
APACHE_LIB, rather than MODPERL_LIB, for the libraries.

So, the patch below keeps backwards compatibility, and
adds an INSTALL_LIB capability to 'perl Makefile.PL' to
point to where to install mod_perl.lib, if it can't
find the location in the installed Apache tree.
================================================================
Index: Makefile.PL
===================================================================
RCS file: /home/cvs/modperl/Makefile.PL,v
retrieving revision 1.216
diff -u -r1.216 Makefile.PL
--- Makefile.PL 19 Aug 2003 05:07:44 -0000      1.216
+++ Makefile.PL 25 Sep 2003 23:57:45 -0000
@@ -330,7 +330,8 @@

 my $vcpp = ($Config{cc} =~ /^cl(\.exe)?$/);
 my %win32_args;
-my %win32_accept = map {$_ => 1} qw(APACHE_SRC INSTALL_DLL DEBUG EAPI);
+my %win32_accept = map {$_ => 1}
+    qw(APACHE_SRC INSTALL_DLL INSTALL_LIB DEBUG EAPI);

 while($_ = shift) {
     ($k,$v) = split /=/, $_, 2;
@@ -375,6 +376,10 @@
     my $w32_ap_mod = $fixed_apsrc . '/modules';
     $win32_args{INSTALL_DLL} = $w32_ap_mod if -d $w32_ap_mod;
   }
+  unless ($win32_args{INSTALL_LIB}) {
+    my $w32_ap_lib = $fixed_apsrc . '/libexec';
+    $win32_args{INSTALL_LIB} = $w32_ap_lib if -d $w32_ap_lib;
+  }
 }

 my %very_experimental = map {$_,1}
@@ -1341,7 +1346,8 @@
     if($USE_APXS) {
        $add = "apxs_install";
     }
-    elsif ($win32_auto and $win32_args{INSTALL_DLL}) {
+    elsif ($win32_auto and
+           ($win32_args{INSTALL_DLL} or $win32_args{INSTALL_LIB})) {
       $add = 'amp_install';
     }
     elsif($USE_APACI) {
@@ -1372,12 +1378,11 @@
        $win32_args{INSTALL_DLL} .
          ($win32_args{APACHE_VERS} < 1315 ?
           '/ApacheModulePerl.dll' : '/mod_perl.so');
-        if (-d "$win32_args{APACHE_SRC}/libexec") {
-          my $libexec = win32_fix_path($win32_args{APACHE_SRC}) . '/libexec';
-          $string .= sprintf qq{\n\t\$(CP) "%s" "%s"},
-            "$win32_path{MODPERL_LIB}/mod_perl.lib",
-              $libexec . '/mod_perl.lib';
-        }
+      }
+      if ($win32_args{INSTALL_LIB}) {
+        $string .= sprintf qq{\n\t\$(CP) "%s" "%s"},
+          "$win32_path{MODPERL_LIB}/mod_perl.lib",
+            $win32_args{INSTALL_LIB} . '/mod_perl.lib';
       }
       return $string;
     }
@@ -2155,7 +2160,7 @@

   if ($win32_args{INSTALL_DLL} ) {
     $win32_args{INSTALL_DLL} =
-       win32_fix_path($win32_args{INSTALL_DLL});
+      win32_fix_path($win32_args{INSTALL_DLL});
     unless ( -d $win32_args{INSTALL_DLL}) {
       my @dirs = grep {-d}
        ('\Program Files\Apache Group\Apache\modules',
@@ -2170,6 +2175,28 @@

 ****  The Apache/modules directory was not found.    *******
 ****      Please install mod_perl.so manually.       *******
+
+END
+      }
+    }
+  }
+  if ($win32_args{INSTALL_LIB} ) {
+    $win32_args{INSTALL_LIB} =
+      win32_fix_path($win32_args{INSTALL_LIB});
+    unless ( -d $win32_args{INSTALL_LIB}) {
+      my @dirs = grep {-d}
+       ('\Program Files\Apache Group\Apache\libexec',
+        '\Apache\libexec', '\Program Files\Apache\libexec');
+      $win32_args{INSTALL_LIB} = find_dir([EMAIL PROTECTED], 'Apache/libexec');
+      if ($win32_args{INSTALL_LIB} and -d $win32_args{INSTALL_LIB}) {
+       $win32_args{INSTALL_LIB} =
+         win32_fix_path($win32_args{INSTALL_LIB});
+      }
+      else {
+       print <<'END';
+
+****  The Apache/libexec directory was not found.    *******
+****      Please install mod_perl.lib manually.       *******

 END
       }
Index: INSTALL.win32
===================================================================
RCS file: /home/cvs/modperl/INSTALL.win32,v
retrieving revision 1.10
diff -u -r1.10 INSTALL.win32
--- INSTALL.win32       6 Jul 2003 13:42:56 -0000       1.10
+++ INSTALL.win32       25 Sep 2003 23:57:45 -0000
@@ -131,6 +131,12 @@
 (eg, \Apache\modules). If not given, a value of APACHE_SRC\modules
 will be used, if this directory exists.

+=item INSTALL_LIB
+
+This gives the location of where to install mod_perl.lib
+(eg, \Apache\libexec). If not given, a value of APACHE_SRC\libexec
+will be used, if this directory exists.
+
 =item DEBUG

 If true (DEBUG=1), a Debug version will be built (this assumes
===================================================================

-- 
best regards,
randy

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to