}
else {
@paths = (File::Spec->curdir(), $Config{usrinc},
- (split ' ', $Config{locincpth}), '/usr/include');
+ (split / +/, $Config{locincpth} // ""), '/usr/include');
}
foreach my $path_h (@path_h) {
$name ||= $path_h;
$rest =~ s!/\*.*?(\*/|\n)|//.*!!g; # Remove comments
$rest =~ s/^\s+//;
$rest =~ s/\s+$//;
+ if ($rest eq '') {
+ print("Skip empty $def\n") if $opt_d;
+ next defines;
+ }
# Cannot do: (-1) and ((LHANDLE)3) are OK:
#print("Skip non-wordy $def => $rest\n"),
# next defines if $rest =~ /[^\w\$]/;
}
else {
# Work from miniperl too - on "normal" systems
- my $SEEK_SET = eval 'use Fcntl qw/SEEK_SET/; SEEK_SET' or 0;
+ my $SEEK_SET = eval 'use Fcntl qw/SEEK_SET/; SEEK_SET' || 0;
seek CH, 0, $SEEK_SET;
my $src = do { local $/; <CH> };
close CH;
}
warn "Scanning $filename for functions...\n";
my @styles = $Config{gccversion} ? qw(C++ C9X GNU) : qw(C++ C9X);
- $c = new C::Scan 'filename' => $filename, 'filename_filter' => $filter,
- 'add_cppflags' => $addflags, 'c_styles' => \@styles;
+ $c = C::Scan->new('filename' => $filename, 'filename_filter' => $filter,
+ 'add_cppflags' => $addflags, 'c_styles' => \@styles);
$c->set('includeDirs' => ["$Config::Config{archlib}/CORE", $cwd]);
$c->get('keywords')->{'__restrict'} = 1;
warn "Writing $ext$modpname/$modfname.xs\n";
print XS <<"END";
+#define PERL_NO_GET_CONTEXT
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
$prereq_pm .= q%'Test' => 0, %;
}
-if ( $compat_version < 5.006 and !$opt_X and $use_xsloader)
+if (!$opt_X and $use_xsloader)
{
$prereq_pm .= q%'XSLoader' => 0, %;
}
# the contents of the Makefile that is written.
WriteMakefile(
NAME => '$module',
- VERSION_FROM => '$modpmname', # finds \$VERSION
+ VERSION_FROM => '$modpmname', # finds \$VERSION, requires EU::MM from perl >= 5.5
PREREQ_PM => {$prereq_pm}, # e.g., Module::Name => 1.1
- (\$] >= 5.005 ? ## Add these new keywords supported since 5.005
- (ABSTRACT_FROM => '$modpmname', # retrieve abstract from module
- AUTHOR => '$author <$email>') : ()),
+ ABSTRACT_FROM => '$modpmname', # retrieve abstract from module
+ AUTHOR => '$author <$email>',
+ #LICENSE => 'perl',
+ #Value must be from legacy list of licenses here
+ #http://search.cpan.org/perldoc?Module%3A%3ABuild%3A%3AAPI
END
if (!$opt_X) { # print C stuff, unless XS is disabled
$opt_F = '' unless defined $opt_F;
open EX, ">$testfile" or die "Can't create $ext$modpname/$testfile: $!\n";
print EX <<_END_;
-# Before `make install' is performed this script should be runnable with
-# `make test'. After `make install' it should work as `perl $modpname.t'
+# Before 'make install' is performed this script should be runnable with
+# 'make test'. After 'make install' it should work as 'perl $modpname.t'
#########################