HTML-Embperl

 view release on metacpan or  search on metacpan

Makefile.PL  view on Meta::CPAN

        }
    $d .= ' -DAPACHE' ;
    $EPNOAPACHELIB = 0 ;
    }
else
    {
    $apache = 0 ;
    if ($win32 && ($EPAPACHESRC || $EPNOAPACHELIB) && -f 'blib/arch/auto/HTML/Embperl/Embperl.dll')
        {
        print "\nYou have already build Embperl with support for Apache mod_perl\n" ;
        $EPNOAPACHELIB = GetYesNo ("Do you want to build a separate dynamic library for use without Apache?", 'y') ;
        }


    print "Will build without mod_perl support\n" ;
    $i = '' ;
    $o = '' ;
    }
		

if ($win32 && $apache)
    {	# borrowed from mod_perl
    local *DEFH;
    open DEFH, ">dirent.h" || die "can't write dirent.h $!";
    print DEFH <<EOF;
/* major kludge to workaround conflict(s) between perl's dirent.h and apache's readdir.h */

#ifdef WIN32

#define _INC_DIRENT
#define DIR void

#endif

EOF
    close DEFH;

    if ($ENV{APACHE_PERL_DLL})
	{
	$mpdll = $ENV{APACHE_PERL_DLL} ;
	}
    elsif ($EPMODPERL =~ /^LoadModule perl_module (.*?)$/)
	{
	$mpdll = $1 ;
	}
    }

#
# Check to see which user to use for httpd tests
#
$loadmodules = $EPMODPERL ;
$EPPATH    = cwd ;
$EPMODPERL = '' ;
$EPSTARTUP ='startup.pl' ;

if ($b && $apache)
    {
    $EPPORT  = 8531 ;
    if (!$win32)
        {
        $EPUSER  = getpwuid($>) ||  $> ;
        $EPGROUP = getgrgid($)) || $) ;
        if ($EPUSER eq 'root')
            {
            my $nobody = (getpwnam('nobody'))[0] ;
            $EPUSER = $nobody if $nobody ;
            }

        if ($EPUSER eq 'root')
            {
            print "Cannot run test httpd as User $EPUSER\n" ;
            $EPUSER = GetString ("User to run httpd", 'nobody') ;
            $EPGROUP = GetString ("Group to run httpd", $EPGROUP) ;
            }
        
        $EPHTTPD = "$apache_src/httpd" ;
        $EPHTTPD = $ENV{EPHTTPD} if (defined ($ENV{EPHTTPD})) ;
        $EPHTTPD = "$apache_src/httpsd" if (!-e $EPHTTPD && -e "$apache_src/httpsd") ;
        
        if (!-e $EPHTTPD)
            {
            $EPHTTPD = GetString ("Enter path and file to start as httpd", "$EPHTTPD") ;
            }
	
	$EPMODPERL="" ;
        }
    else
        {
        if (!$EPHTTPD || !-e $EPHTTPD)
            {
            $EPHTTPD = "$EPHTTPDDLL/Apache.exe" ;
            $EPHTTPD =~ s#core([rd])/Apache.exe#Apache$1/Apache.exe#i ;
            $EPHTTPD =~ s#libexec/Apache.exe#Apache.exe#i ;
            }
        $EPUSER  = 'www' ; # dummy value
        $EPGROUP = 'www' ;
        if (!-e $EPHTTPD)
            {
            $EPHTTPD = GetString ("Enter path and file to start as Apache.exe", "$EPHTTPD") ;
            }
        $EPHTTPDPATH = $EPHTTPD ;
        $EPHTTPDPATH =~ s/Apache.exe//i ;
        }
    

    ### check the apache version ###
                                
    $EPENVPATH = ";$Config{bin};$EPHTTPDDLL;$EPHTTPDPATH;$EPHTTPDDLL/../os/win32/release;$EPHTTPDDLL/../os/win32/debug" ;
    $ENV{PATH} .= $EPENVPATH if ($win32) ;
    
    @EPAPACHEVERSION = start ("\"$EPHTTPD\" -v") ;
    @modules         = start ("\"$EPHTTPD\" -l") ;

    chomp ($EPAPACHEVERSION[0]) ;
    print "Apache Version $EPAPACHEVERSION[0]\n" ;

    $EPSTRONGHOLD = ($EPAPACHEVERSION[0] =~ /stronghold/i) ;
    $EPAPACHE_SSL = grep (/apache_ssl.c/, @modules) ;
    $EPMOD_SSL    = !$EPSTRONGHOLD && grep (/mod_ssl.c/, @modules) ;

    $EPBINDIR	  = dirname ($EPHTTPD) ;    



( run in 0.624 second using v1.01-cache-2.11-cpan-e1769b4cff6 )