Mobile-Data-SID
view release on metacpan or search on metacpan
inc/ExtUtils/MakeMaker.pm view on Meta::CPAN
}
sub WriteEmptyMakefile {
Carp::croak "WriteEmptyMakefile: Need an even number of args" if @_ % 2;
my %att = @_;
my $self = MM->new(\%att);
my $new = $self->{MAKEFILE};
my $old = $self->{MAKEFILE_OLD};
if (-f $old) {
_unlink($old) or warn "unlink $old: $!";
}
if ( -f $new ) {
_rename($new, $old) or warn "rename $new => $old: $!"
}
open my $mfh, '>', $new or die "open $new for write: $!";
print $mfh <<'EOP';
all :
clean :
install :
makemakerdflt :
test :
EOP
close $mfh or die "close $new for write: $!";
}
sub check_manifest {
print STDOUT "Checking if your kit is complete...\n";
require ExtUtils::Manifest;
# avoid warning
$ExtUtils::Manifest::Quiet = $ExtUtils::Manifest::Quiet = 1;
my(@missed) = ExtUtils::Manifest::manicheck();
if (@missed) {
print STDOUT "Warning: the following files are missing in your kit:\n";
print "\t", join "\n\t", @missed;
print STDOUT "\n";
print STDOUT "Please inform the author.\n";
} else {
print STDOUT "Looks good\n";
}
}
sub parse_args{
my($self, @args) = @_;
foreach (@args) {
unless (m/(.*?)=(.*)/) {
++$Verbose if m/^verb/;
next;
}
my($name, $value) = ($1, $2);
if ($value =~ m/^~(\w+)?/) { # tilde with optional username
$value =~ s [^~(\w*)]
[$1 ?
((getpwnam($1))[7] || "~$1") :
(getpwuid($>))[7]
]ex;
}
# Remember the original args passed it. It will be useful later.
$self->{ARGS}{uc $name} = $self->{uc $name} = $value;
}
# catch old-style 'potential_libs' and inform user how to 'upgrade'
if (defined $self->{potential_libs}){
my($msg)="'potential_libs' => '$self->{potential_libs}' should be";
if ($self->{potential_libs}){
print STDOUT "$msg changed to:\n\t'LIBS' => ['$self->{potential_libs}']\n";
} else {
print STDOUT "$msg deleted.\n";
}
$self->{LIBS} = [$self->{potential_libs}];
delete $self->{potential_libs};
}
# catch old-style 'ARMAYBE' and inform user how to 'upgrade'
if (defined $self->{ARMAYBE}){
my($armaybe) = $self->{ARMAYBE};
print STDOUT "ARMAYBE => '$armaybe' should be changed to:\n",
"\t'dynamic_lib' => {ARMAYBE => '$armaybe'}\n";
my(%dl) = %{$self->{dynamic_lib} || {}};
$self->{dynamic_lib} = { %dl, ARMAYBE => $armaybe};
delete $self->{ARMAYBE};
}
if (defined $self->{LDTARGET}){
print STDOUT "LDTARGET should be changed to LDFROM\n";
$self->{LDFROM} = $self->{LDTARGET};
delete $self->{LDTARGET};
}
# Turn a DIR argument on the command line into an array
if (defined $self->{DIR} && ref \$self->{DIR} eq 'SCALAR') {
# So they can choose from the command line, which extensions they want
# the grep enables them to have some colons too much in case they
# have to build a list with the shell
$self->{DIR} = [grep $_, split ":", $self->{DIR}];
}
# Turn a INCLUDE_EXT argument on the command line into an array
if (defined $self->{INCLUDE_EXT} && ref \$self->{INCLUDE_EXT} eq 'SCALAR') {
$self->{INCLUDE_EXT} = [grep $_, split '\s+', $self->{INCLUDE_EXT}];
}
# Turn a EXCLUDE_EXT argument on the command line into an array
if (defined $self->{EXCLUDE_EXT} && ref \$self->{EXCLUDE_EXT} eq 'SCALAR') {
$self->{EXCLUDE_EXT} = [grep $_, split '\s+', $self->{EXCLUDE_EXT}];
}
foreach my $mmkey (sort keys %$self){
next if $mmkey eq 'ARGS';
print STDOUT " $mmkey => ", neatvalue($self->{$mmkey}), "\n" if $Verbose;
print STDOUT "'$mmkey' is not a known MakeMaker parameter name.\n"
unless exists $Recognized_Att_Keys{$mmkey};
}
$| = 1 if $Verbose;
}
sub check_hints {
my($self) = @_;
# We allow extension-specific hints files.
( run in 1.227 second using v1.01-cache-2.11-cpan-39bf76dae61 )