~ubuntu-branches/debian/sid/libembperl-perl/sid

« back to all changes in this revision

Viewing changes to Makefile.PL

  • Committer: Bazaar Package Importer
  • Author(s): Angus Lees
  • Date: 2005-04-20 19:25:44 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 hoary)
  • Revision ID: james.westby@ubuntu.com-20050420192544-dcp6nkxni4puc6h6
Tags: 2.0rc3-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
#
4
4
# (C) 1997-2004 G.Richter (richter@dev.ecos.de) / ECOS
5
5
#
6
 
# $Id: Makefile.PL,v 1.68 2004/01/23 07:37:12 richter Exp $
 
6
# $Id: Makefile.PL,v 1.76 2005/03/14 13:41:45 richter Exp $
7
7
#
8
8
 
9
9
 
90
90
        {
91
91
        my ($txt) = shift -> MM::test_via_harness (@_) ;
92
92
        $txt =~ s/PERL_DL_NONLAZY=1/PERL_DL_NONLAZY=0/ ;
93
 
        #$txt =~ s/\$\(FULLPERL\)/\$\(FULLPERL\) \-T / ;
94
 
        $txt =~ s/\$\(FULLPERL\)/SET PATH=\$\(PATH\)\;$EPENVPATH\n\t\$\(FULLPERL\)/ if ($win32) ;
 
93
        if ($win32)
 
94
            {
 
95
            if (!($txt =~ s/\$\(FULLPERL\)/SET PATH=\$\(PATH\)\;$EPENVPATH\n\t\$\(FULLPERL\)/ ))
 
96
                {
 
97
                $txt =~ s/\$\(FULLPERLRUN\)/SET PATH=\$\(PATH\)\;$EPENVPATH\n\t\$\(FULLPERLRUN\)/ 
 
98
                }
 
99
            }
95
100
        return $txt ;
96
101
        }
97
102
 
99
104
        {
100
105
        my ($txt) = shift -> MM::test_via_script (@_) ;
101
106
        $txt =~ s/PERL_DL_NONLAZY=1/PERL_DL_NONLAZY=0/ ;
102
 
        #$txt =~ s/\$\(FULLPERL\)/\$\(FULLPERL\) \-T / ;
103
 
        $txt =~ s/\$\(FULLPERL\)/SET PATH=\$\(PATH\)\;$EPENVPATH\n\t\$\(FULLPERL\)/ if ($win32) ;
104
 
 
 
107
        if ($win32)
 
108
            {
 
109
            if (!($txt =~ s/\$\(FULLPERL\)/SET PATH=\$\(PATH\)\;$EPENVPATH\n\t\$\(FULLPERL\)/ ))
 
110
                {
 
111
                $txt =~ s/\$\(FULLPERLRUN\)/SET PATH=\$\(PATH\)\;$EPENVPATH\n\t\$\(FULLPERLRUN\)/ 
 
112
                }
 
113
            }
105
114
        $txt =~ s/\$\(TEST_FILE\)/\$(TEST_FILE) \$(TESTARGS)/g ;
106
115
 
107
116
        return $txt ;
231
240
 
232
241
        if ($mp2cfg)
233
242
            { # with Apache 2, make sure we have the same defines as mod_perl
234
 
            $txt =~ s/CCFLAGS\s*=.*?\n/CCFLAGS = $ccdebug $mp2cfg->{MODPERL_CCOPTS}\n/s ;
 
243
            my $ccflags = "$ccdebug $Config{cppflags} " . `apxs2 -q CFLAGS` ;
 
244
            $txt =~ s/-O\d//g if ($ccdebug =~ /-O\d/) ;
 
245
            $txt =~ s/CCFLAGS\s*=.*?\n/CCFLAGS = $ccflags $mp2cfg->{MODPERL_CCOPTS}\n/s ;
235
246
            }
236
247
        else
237
248
            {
238
 
            $txt =~ s/CCFLAGS\s*=/CCFLAGS = $ccdebug / ;
 
249
            my $ccflags = "$ccdebug $Config{cppflags} " . Apache::src->new->ccflags ;
 
250
            $txt =~ s/-O\d//g if ($ccdebug =~ /-O\d/) ;
 
251
            $txt =~ s/CCFLAGS\s*=/CCFLAGS = $ccflags / ;
239
252
            }
240
253
 
241
254
        
330
343
       my $txt = $self -> MM::post_constants (@_) ;
331
344
 
332
345
       $txt .= "\n# Change name of dynamic lib, in case we need two of them (with and w/o Apache support)\nINST_DYNAMIC = \$(INST_ARCHAUTODIR)\\\$(DLBASE).NoApache.\$(DLEXT)\n" if ($EPNOAPACHELIB) ;
 
346
       $txt .= "\n# Change name of dynamic lib, in case we need two of them (different Apache versions)\nINST_DYNAMIC = \$(INST_ARCHAUTODIR)/\$(DLBASE)-13.\$(DLEXT)\n" if ($mod_perl::VERSION and $mod_perl::VERSION < 1.99) ;
 
347
 
333
348
 
334
349
       return $txt ;
335
350
 
340
355
sub GetString
341
356
        {
342
357
        my ($prompt, $default) = @_ ;
343
 
 
344
 
        printf ("%s [%s]", $prompt, $default) ;
345
 
        chomp ($_ = <STDIN>) ;
346
 
        s/\s+$//;
347
 
        if (!/^\s*$/)
348
 
            {return $_ ;}
349
 
        else
350
 
        {
351
 
        if ($_ eq "")
352
 
                {return $default ;}
353
 
            else
354
 
            { return "" ; }
355
 
    
356
 
        }
357
 
    }
 
358
        return prompt($prompt, $default) ;
 
359
        }
358
360
 
359
361
## ----------------------------------------------------------------------------
360
362
 
510
512
if ($ARGV[0] eq 'debug')
511
513
    {
512
514
    shift @ARGV;
513
 
    $optdebug = '-g -O0' ;
 
515
    $optdebug = '-g -O0 -Wall -DEPDEBUG' ;
514
516
    if ($win32)
515
517
        {
516
 
        $ccdebug = '-Zi -W3' ;
 
518
        $ccdebug = '-Zi -W3 -DEPDEBUG' ;
517
519
        $lddebug = '-debug -map -profile' ;
518
520
        }
519
521
    else
520
522
        {
521
 
        $ccdebug = '-ggdb -O0' ;
 
523
        $ccdebug = '-g -O0 -Wall -DEPDEBUG' ;
522
524
        $lddebug = '-g' ;
523
525
        }
524
526
    }
550
552
    $apache_src = '' if ($apache_src eq '-') ;
551
553
    }
552
554
 
553
 
if (!$apache && $apache_src eq '')
 
555
if (1)
554
556
    {
555
557
    # check for mod_perl 2.0
556
 
    eval 'use Apache2; use Apache::BuildConfig' ;
 
558
    eval 'use Apache2; use Apache::BuildConfig' unless $ENV{FORCEMP1};
557
559
 
558
 
    if ($@ eq '')
 
560
    if (!$ENV{FORCEMP1} and $@ eq '')
559
561
        { 
560
562
        $mp2cfg = Apache::BuildConfig -> new ;
561
 
        $apache_src = $mp2cfg -> {MP_AP_PREFIX} || $mp2cfg -> {ap_includedir} ;
 
563
        $apache_src ||= $mp2cfg -> {MP_AP_PREFIX} || $mp2cfg -> {ap_includedir} ;
562
564
        print "Found mod_perl 2.0\n" ;
563
565
        }
564
566
    else
567
569
 
568
570
        if ($@ eq '')
569
571
            { 
570
 
            $apache_src = $Apache::MyConfig::Setup{Apache_Src} ; 
 
572
            $apache_src ||= $Apache::MyConfig::Setup{Apache_Src} ; 
571
573
            }
572
574
        else
573
575
            {
574
 
            $apache_src = '' ;
 
576
            $apache_src ||= '' ;
575
577
            }
576
578
        }
577
579
    }
743
745
        $i = "-I$inc_dir -I$apache_src/regex -I$apache_src/os/unix" ; 
744
746
        $o = '' ;
745
747
        }
 
748
 
 
749
    if ($mp2cfg && !-f "$inc_dir/apr.h")
 
750
        {
 
751
        $i .= " -I$mp2cfg->{apr_includedir}" ;
 
752
        }
 
753
 
746
754
    $d .= ' -DAPACHE' ;
747
755
    $d .= ' -DAPACHE2' if ($mp2cfg) ;
748
756
    $EPNOAPACHELIB = 0 ;
761
769
    $i = '' ;
762
770
    $o = '' ;
763
771
    }
764
 
                
 
772
 
 
773
if ($mp2cfg) {
 
774
  $i .= " -I$mp2cfg->{apr_includedir}" if $mp2cfg->{apr_includedir};
 
775
}               
765
776
 
766
777
if ($win32 && $apache)
767
778
    {   # borrowed from mod_perl
804
815
    if (!$win32)
805
816
        {
806
817
        $EPUSER  = getpwuid($>) ||  $> ;
807
 
        $EPGROUP = getgrgid($)) || $) ;
 
818
        $EPGROUP = getgrgid($)) || $) + 0 ;
808
819
        if ($EPUSER eq 'root')
809
820
            {
810
821
            my $nobody = (getpwnam('nobody'))[0] ;
1257
1268
    'INC'          => "-I$EPPATH $i",                            
1258
1269
    'VERSION'      => undef,
1259
1270
    'VERSION_FROM' => "$EPPATH/Embperl.pm",
 
1271
    'CCFLAGS'      => $Config{cppflags}.($mp2cfg?`apxs2 -q CFLAGS`:Apache::src->new->ccflags),
1260
1272
    $optdebug?('OPTIMIZE' => $ccdebug):(),
1261
1273
    ) ;
1262
1274
 
1303
1315
    'DEFINE'       => "$d \$(DEFS)",                     
1304
1316
    'INC'          => $i,                        
1305
1317
    'EXE_FILES'    => [ 'embpexec.pl', 'embpmsgid.pl' ],
1306
 
    'clean'        => { FILES => 'dirent.h test/conf/httpd.conf test/conf/httpd.stop.conf test/tmp/* Embperl.c $(OBJECT)' },
1307
 
    'realclean'    => { FILES => 'embpmsgid.pl embpexec.pl embpexec.bat embpcgi.pl embpcgi.test.pl embpcgi.bat epocgi.pl epocgi.bat epocgi.test.pl embpfastcgi.pl test/conf/config.pl xs/mmargs.pl' },
 
1318
    'clean'        => { FILES => 'dirent.h test/conf/httpd.conf test/conf/httpd.stop.conf test/conf/httpd.min.conf test/tmp/* Embperl.c $(OBJECT)' },
 
1319
    'realclean'    => { FILES => 'embpmsgid.pl embpexec.pl embpexec.bat embpcgi.pl embpcgi.test.pl embpcgi.bat epocgi.pl epocgi.bat epocgi.test.pl embpfastcgi.pl embpfastcgi.test.pl test/conf/config.pl xs/mmargs.pl' },
1308
1320
    'dist'         => { COMPRESS => 'gzip', SUFFIX => 'gz'},
1309
1321
    'dynamic_lib'  => $dynlib,
1310
1322
    'PREREQ_PM'    => { 'File::Spec' => 0.8 },
1322
1334
 
1323
1335
@bins = ('embpexec.pl','embpexec.bat', 
1324
1336
         'embpcgi.pl', 'embpcgi.test.pl', 'embpcgi.bat',
1325
 
         'embpfastcgi.pl', 'embpmsgid.pl',
 
1337
         'embpfastcgi.pl', 'embpfastcgi.test.pl','embpmsgid.pl',
1326
1338
         'epocgi.pl', 'epocgi.test.pl', 'epocgi.bat') ;
1327
1339
 
1328
1340