LibZip

 view release on metacpan or  search on metacpan

myldr/Makefile.PL  view on Meta::CPAN

#!/usr/bin/perl -w

use strict;

require 5.006 ;

use ExtUtils::MakeMaker ;
use ExtUtils::Embed ;

use Config ;
use File::Copy ;

BEGIN
{
    eval { require File::Spec::Functions ; File::Spec::Functions->import() } ;
    if ($@)
    {
        *catfile = sub { return "$_[0]/$_[1]" }
    }
}

########
# VARS #
########

## EMBED

my $debug = 0;

my $exe = $Config{_exe};
my $o = $Config{_o};
my $pccflags = ccopts;
my $pldflags = ldopts;
my $ld = $Config{ld};
my $cc = $Config{cc};
my $f2c = "./file2c.pl";

my( $out, $ccdebug, $lddebug, $warn, $res , $rm, $mv );

my $is_MSVC = $cc =~ m/^cl/;
if( $is_MSVC ) {
  $out = '-out:';
  $ccdebug = $debug ? '-Zi ' : '';
  $lddebug = $debug ? '-debug ' : '-release ';
  $warn = '-W3';
  $res = 'win32.res';
} else {
  $out = '-o ';
  $ccdebug = $debug ? '-g ' : '';
  $lddebug = $debug ? '' : '-s ';
  $warn = '-Wall -Wno-comments ';
  $res = ($^O =~ /^(?:MSWin|cygwin)/) ? 'win32.coff' : '';
}

$rm = $^O eq 'MSWin32' ? '$(PERL) -MExtUtils::Command -e rm_f' : 'rm';
$mv = $^O eq 'MSWin32' ? '$(PERL) -MExtUtils::Command -e mv' : 'mv';

my  $cflags = "$ccdebug$warn$pccflags";
my $ldflags = "$lddebug$pldflags";

my $rm_exe = "-\$(RM) *$exe" if $exe ;

## ZLIB

my $ZLIB_LIB = './zlib-src' ;
my $ZLIB_INCLUDE = './zlib-src' ;
my $BUILD_ZLIB = 1 ;
my $OLD_ZLIB = '' ;

#################
# WRITEMAKEFILE #
#################

my %zlib = zlib_files($ZLIB_LIB) ;

#use Data::Dumper ; print Dumper( \%zlib ) ;

my $C_FILES = join(" ", @{$zlib{C}}) ;
my $H_FILES = join(" ", @{$zlib{H}}) ;
my $O_FILES = $zlib{OBJECT} ;

################################################################################

print "Writing Makefile for the embed program (LibZipBin)\n";

open OUT, "> Makefile" or die "open 'Makefile': $!";



( run in 0.566 second using v1.01-cache-2.11-cpan-71847e10f99 )