Permalink
Browse files

Find Perl embedding options at configure time

This removes the dependency on command interpolation in makefiles, hopefully
unbreaking nmake, and is in any event a neccessary step towards supporting
compilation on non-default Perls.
  • Loading branch information...
1 parent 4a310c5 commit d5f00d1f3d2c84b6d7b79cb039a65e7c9062dd93 @sorear sorear committed Apr 24, 2010
Showing with 12 additions and 8 deletions.
  1. +8 −1 Configure.pl
  2. +1 −1 build/Makefile.in
  3. +3 −6 build/src/pmc/Makefile.in
View
@@ -21,6 +21,8 @@ =head1 SYNOPSIS
use Getopt::Long qw(:config auto_help);
+use ExtUtils::Embed;
+
our ( $opt_parrot_config, $opt_gen_parrot);
GetOptions( 'parrot-config=s', 'gen-parrot' );
@@ -51,6 +53,10 @@ =head1 SYNOPSIS
."Please give me the path to it with the --parrot-config=... option.";
}
+$config{p5_ldopts} = ldopts(1);
+$config{p5_ccopts} = ccopts(1);
+$config{p5_perl} = $^X;
+
# Create the Makefile using the information we just got
create_makefile('Makefile' => %config);
create_makefile('src/pmc/Makefile' => %config);
@@ -79,7 +85,8 @@ sub create_makefile {
my $maketext = slurp( "build/$name.in" );
$config{'win32_libparrot_copy'} = $^O eq 'MSWin32' ? 'copy $(PARROT_BIN_DIR)\libparrot.dll .' : '';
- $maketext =~ s/@(\w+)@/$config{$1}/g;
+ $maketext =~ s{#IF\((\w+)\):(.*\n)}{$config{osname} eq $1 ? $2 : ""}eg;
+ $maketext =~ s/@(\w+)@/exists $config{$1} ? $config{$1} : die("No such config var $1")/eg;
if ($^O eq 'MSWin32') {
$maketext =~ s{/}{\\}g;
$maketext =~ s{\\\*}{\\\\*}g;
View
@@ -20,7 +20,7 @@ PMC_DIR = src/pmc
## Setup some commands
MAKE = @make_c@
-PERL = @perl@
+PERL = @p5_perl@
CAT = @cat@
CHMOD = @chmod@
CP = @cp@
@@ -10,15 +10,12 @@ STAGING_DIR = ../../dynext
#INSTALL_DIR = $(LIB_DIR)/languages/blizkost/dynext
INSTALL_DIR = $(LIB_DIR)/dynext
-EMBLFLAGS := $(shell perl -MExtUtils::Embed -e ldopts)
-EMBCFLAGS := $(shell perl -MExtUtils::Embed -e ccopts)
-
# Set up extensions
LOAD_EXT = @load_ext@
O = @o@
# Setup some commands
-PERL = @perl@
+PERL = @p5_perl@
RM_F = @rm_f@
MKPATH = @mkpath@
CHMOD = @chmod@
@@ -27,7 +24,7 @@ CC = @cc@ -c
LD = @ld@
LDFLAGS = @ldflags@ @ld_debug@ @libs@
LD_LOAD_FLAGS = @ld_load_flags@
-CFLAGS = @ccflags@ @cc_shared@ @cc_debug@ @ccwarn@ @cc_hasjit@ @cg_flag@ @gc_flag@ $(EMBCFLAGS)
+CFLAGS = @ccflags@ @cc_shared@ @cc_debug@ @ccwarn@ @cc_hasjit@ @cg_flag@ @gc_flag@ @p5_ccopts@
CC_OUT = @cc_o_out@
LD_OUT = @ld_out@
LIBPARROT = @inst_libparrot_ldflags@
@@ -38,7 +35,7 @@ PMC2CD = $(PMC2C) --dump $(PMC2C_INCLUDES)
PMC2CC = $(PMC2C) -c $(PMC2C_INCLUDES)
INCLUDES = -I$(INCLUDE_DIR) -I$(INCLUDE_DIR)/pmc
-LINKARGS = $(LDFLAGS) $(LD_LOAD_FLAGS) $(LIBPARROT) $(EMBLFLAGS)
+LINKARGS = $(LDFLAGS) $(LD_LOAD_FLAGS) $(LIBPARROT) @p5_ldopts@
BLIZKOST_GROUP = blizkost_group

0 comments on commit d5f00d1

Please sign in to comment.