Marpa-R2
view release on metacpan or search on metacpan
engine/read_only/win32/do_config_h.pl view on Meta::CPAN
use IPC::Cmd qw/run/;
use Module::Load qw/load/;
use POSIX qw/EXIT_SUCCESS EXIT_FAILURE/;
use Getopt::Long;
our %PERL_AUTOCONF_OS = map { $_ => 1 } qw( MSWin32 openbsd solaris sunos midnightbsd );
my $MARPA_DEBUG = $ENV{MARPA_DEBUG} || 0;
my $USE_PERL_AUTOCONF = $ENV{MARPA_USE_PERL_AUTOCONF} || ( $PERL_AUTOCONF_OS{$^O} // 0 );
my $CC = $ENV{CC} || $Config{cc} || 'cc';
my $CCFLAGS = $ENV{CCFLAGS} || $Config{ccflags} || '';
my $SH = $ENV{SH} || $Config{sh} || '';
my $OBJ_EXT = $ENV{OBJ_EXT} || $Config{obj_ext} || '.o';
GetOptions ('marpa_debug!' => \$MARPA_DEBUG,
'use_perl_autoconf!' => \$USE_PERL_AUTOCONF,
'cc=s' => \$CC,
'ccflags=s' => \$CCFLAGS,
'sh=s' => \$SH,
'obj_ext=s' => \$OBJ_EXT,
'help!' => \$help) ||
engine/read_only/win32/do_config_h.pl view on Meta::CPAN
load Config::AutoConf || die "Please install Config::AutoConf module";
}
my $rc = do_config_h();
exit($rc ? EXIT_SUCCESS : EXIT_FAILURE);
sub do_config_h {
$ENV{CC} = $CC;
$ENV{CCFLAGS} = $CCFLAGS;
$ENV{OBJ_EXT} = $OBJ_EXT;
# If current directory exists and contains a stamp file more recent than an eventual config.h
# we are done.
if (-e 'config.h' && -e 'stamp-h1' && up_to_date( 'config.h', 'stamp-h1' )) {
printf "%s is up-to-date v.s. %s. Remove one of them to force a new %s generation\n", 'config.h', 'stamp-h1', 'config.h';
return 1;
}
unlink('config.h');
engine/read_only/win32/do_config_h.pl view on Meta::CPAN
say join q{ }, "Doing config.h with configure"
or die "print failed: $ERRNO";
my $shell = $SH;
##no critic(ValuesAndExpressions::RequireInterpolationOfMetachars)
$shell or die q{No Bourne shell available says $SH};
##use critic
}
my $original_cflags = $ENV{CFLAGS};
local $ENV{CFLAGS};
$ENV{CFLAGS} = $original_cflags if defined $original_cflags;
# We need PIC, but do not want the overhead of building the shared library
my @configure_command_args = qw(--with-pic --disable-shared);
my @debug_flags = ();
if ( $MARPA_DEBUG ) {
if ( defined $ENV{LIBMARPA_CFLAGS} ) {
$ENV{CFLAGS} = $ENV{LIBMARPA_CFLAGS};
}
push @debug_flags, '-DMARPA_DEBUG=1';
push @debug_flags, '-fno-inline', '-Wno-inline' if ($CC eq 'gcc');
push @configure_command_args,
'MARPA_DEBUG_FLAG=' . ( join q{ }, @debug_flags );
} ## end if ( $MARPA_DEBUG )
if ($USE_PERL_AUTOCONF) {
my $libmarpa_version = read_file('LIB_VERSION');
inc/Marpa/R2/Build_Me.pm view on Meta::CPAN
# which breaks shell heredocs; this is for both
# configure and libtool
$ENV{TMPDIR} ||= File::Spec->tmpdir();
# 'configure' hardcodes /bin/sh in several spots;
# setting CONFIG_SHELL gets all but one, the test
# for PATH_SEPARATOR.
$ENV{CONFIG_SHELL} ||= $Config{sh};
$ENV{PATH_SEPARATOR} ||= $Config{path_sep};
}
my $original_cflags = $ENV{CFLAGS};
local $ENV{CFLAGS};
$ENV{CFLAGS} = $original_cflags if defined $original_cflags;
my @configure_command_args = ();
# We need PIC, but do not want the overhead of building the shared library
push @configure_command_args, qw(--with-pic --disable-shared --disable-maintainer-mode);
# Dependency tracking is buggy on many platforms, causing installations to
# fail. We turn it off here. As a side effect, this makes the build
# faster. It has no effect on builds from scratch -- builds where there
# are no pre-existing object files.
#
inc/Marpa/R2/Build_Me.pm view on Meta::CPAN
# (which to our knowledge has never happened). Their dependencies may get
# out of sync, causing objects that should be re-built not to be re-built.
# A developer who really wants to use the Perl distribution for development,
# instead of the git repo, can either avoid changing the dependencies,
# or remove the all the object files every time they build.
push @configure_command_args, qw(--disable-dependency-tracking);
my @debug_flags = ();
if ( defined $self->args('Marpa-debug') ) {
if ( defined $ENV{LIBMARPA_CFLAGS} ) {
$ENV{CFLAGS} = $ENV{LIBMARPA_CFLAGS};
}
push @debug_flags, '-DMARPA_DEBUG=1';
push @debug_flags, '-fno-inline', '-Wno-inline' if ($self->config('cc') eq 'gcc');
push @configure_command_args,
'MARPA_DEBUG_FLAG=' . ( join q{ }, @debug_flags );
} ## end if ( defined $self->args('Marpa-debug') )
# As of this writing, only used by Config::AutoConf logic,
# but that may change.
my $libmarpa_version = $self->file_slurp('LIB_VERSION');
( run in 0.667 second using v1.01-cache-2.11-cpan-8d75d55dd25 )