add config.*
[catagits/fcgi2.git] / perl / Makefile.PL
index 9acd9bb..e749f38 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: Makefile.PL,v 1.17 2001/08/30 22:09:21 robs Exp $
+# $Id: Makefile.PL,v 1.25 2001/09/21 16:14:11 skimo Exp $
 
 use ExtUtils::MakeMaker;
 use IO::File;
@@ -9,14 +9,13 @@ use Getopt::Long;
 @h1 = qw(fastcgi.h fcgiapp.h fcgimisc.h fcgios.h);
 @h = (@h1, 'fcgi_config.h');
 @o = qw(FCGI.o);
-@dist1 = qw(LICENSE.TERMS acconfig.h configure configure.in);
+@dist1 = qw(LICENSE.TERMS configure configure.in install.sh missing
+            config.sub config.guess ltmain.sh);
 @dist2 = qw(fcgiapp.c os_unix.c os_win32.c);
 @dist3 = (@h1, qw(fcgi_config.h.in fcgi_config_x86.h));
 
 GetOptions ("pure-perl!" => \$pure);
-$pure = 
-    (prompt("Do you want to use the pure perl implementation", "no") =~ /^y/) 
-    ? "1" : "0" unless defined $pure;
+$pure = "0" unless defined $pure;
 open(CFG,">FCGI.cfg");
 print CFG "\$pure = $pure;1;\n";
 close CFG;
@@ -41,9 +40,10 @@ if (! $pure) {
            use File::Copy qw(copy);
 
                # TODO: stop or save if a local file has been modified
-               foreach (@dist3, @dist2) { unlink };
+               foreach (@dist1, @dist2, @dist3) { unlink };
+               foreach (@dist1) { copy("$devkit/$_", ".") || die $! };
+               foreach (@dist2) { copy("$devkit/libfcgi/$_", ".") || die $! };
                foreach (@dist3) { copy("$devkit/include/$_", ".") || die $! };
-               foreach (@dist2)  { copy("$devkit/libfcgi/$_", ".") || die $! };
        }
        else {
            # CPAN  
@@ -88,7 +88,9 @@ if ($pure) {
 } else {
 
        if ("$sys" eq "win32") {
-               @libs = (@libs) ? map { "$_ ws2_32.lib" } @libs : ('ws2_32.lib');
+               @libs = (scalar @libs)
+                       ? map { "$_ :nosearch -lws2_32" } @libs 
+                       : (':nosearch -lws2_32');
                push @extras, 'DEFINE' => '-DDLLAPI=__declspec(dllexport)';
        }
 
@@ -107,7 +109,7 @@ WriteMakefile(NAME => 'FCGI')
 
 $mm = MM->new({
     'NAME'             => 'FCGI',
-    'VERSION_FROM'     => 'FCGI.PL',
+    'VERSION_FROM'     => 'version.pm',
     'dist'             => { 'COMPRESS' => 'gzip -9f', 
                             'SUFFIX' => 'gz',
                             'PREOP' => '$(CP) '.join(' ',
@@ -154,5 +156,5 @@ if ($sys eq "win32") {
     print "Please read configure.readme for information on how to run it yourself\n";
 
     $ENV{'CC'} = $Config{'cc'};
-    system("./configure");
+    system("$Config{sh} configure");
 }