Author: chromatic
Date: Tue Feb 20 13:19:53 2007
New Revision: 17104

Added:
   trunk/ext/Parrot-Embed/tools/
   trunk/ext/Parrot-Embed/tools/write_typemap.pl
Modified:
   trunk/MANIFEST
   trunk/config/gen/makefiles/parrot_embed.in
   trunk/config/init/defaults.pm

Log:
[Parrot::Embed] More Makefile fixes in the hopes that Win32 builds work now.

Modified: trunk/MANIFEST
==============================================================================
--- trunk/MANIFEST      (original)
+++ trunk/MANIFEST      Tue Feb 20 13:19:53 2007
@@ -713,6 +713,7 @@
 ext/Parrot-Embed/lib/Parrot/PMC.pm                          []
 ext/Parrot-Embed/t/greet.pir                                []
 ext/Parrot-Embed/t/interp.t                                 []
+ext/Parrot-Embed/tools/write_typemap.pl                     []
 ext/Parrot-Embed/typemap                                    []
 include/parrot/atomic.h                                     [main]include
 include/parrot/atomic/fallback.h                            [main]include

Modified: trunk/config/gen/makefiles/parrot_embed.in
==============================================================================
--- trunk/config/gen/makefiles/parrot_embed.in  (original)
+++ trunk/config/gen/makefiles/parrot_embed.in  Tue Feb 20 13:19:53 2007
@@ -7,19 +7,20 @@
 MKPATH          = @mkpath@
 CP              = @cp@
 PERL            = @perl@
-PERL_INC       = $(shell $(PERL) -MConfig -e "print 
\$$Config::Config{archlib}")/CORE
-PERL_TYPEMAP    = $(shell $(PERL) -MExtUtils::MakeMaker -e "\$$_ = 
\$$INC{\"ExtUtils/MakeMaker.pm\"}; s/MakeMaker.pm/typemap/; print")
 PARROT          = ../../parrot$(EXE)
 
 # compilation options
+#CONDITIONED_LINE(win32):LIB_PREFIX := ../../
+#INVERSE_CONDITIONED_LINE(win32):LIB_PREFIX =
+A               = @a@
 O               = @o@
 SHARE_EXT       = @share_ext@
 C_LIBS          = @libs@
-ALL_PARROT_LIBS = @libparrot_ldflags@ $(ICU_SHARED) $(C_LIBS)
+ALL_PARROT_LIBS = $(LIB_PREFIX)@libparrot_ldflags@ $(ICU_SHARED) $(C_LIBS)
 LINKFLAGS       = @linkflags@ @link_debug@ @ld_debug@
 LINK            = @link@
 LD_SHARE_FLAGS  = @ld_share_flags@
-CC_INC          = -I$(PERL_INC) -I../../include
+CC_INC          = [EMAIL PROTECTED]@ -I../../include
 CFLAGS          = $(CC_INC) @ccflags@ @cc_debug@ @ccwarn@ @cc_hasjit@ 
@cg_flag@ @gc_flag@ $(CC_SHARED)
 
 # files needing compilation
@@ -42,10 +43,10 @@
 
 $(SO_FILE) : $(O_FILE)
        $(MKPATH) blib/arch/auto/Parrot/Embed
-       $(LINK) $(LD_SHARE_FLAGS) -o $(SO_FILE) $(O_FILE) @rpath_blib@ 
$(ALL_PARROT_LIBS) $(LINKFLAGS)
+       $(LINK) $(LD_SHARE_FLAGS) @[EMAIL PROTECTED]@ $(SO_FILE) $(O_FILE) 
@rpath_blib@ $(ALL_PARROT_LIBS) $(LINKFLAGS)
 
 $(C_FILE) : lib/Parrot/Embed.xs
-       ( cd lib/Parrot; xsubpp -prototypes -typemap $(PERL_TYPEMAP) -typemap 
../../typemap Embed.xs > Embed.c )
+       $(PERL) tools/write_typemap.pl
 
 $(PBC) : t/greet.pir
        $(PARROT) -o $(PBC) t/greet.pir
@@ -53,5 +54,5 @@
 test : $(TEST_FILES)
        prove -b $(TEST_FILES)
 
-clean : 
+clean :
        $(RM_RF) blib $(C_FILE) $(O_FILE)

Modified: trunk/config/init/defaults.pm
==============================================================================
--- trunk/config/init/defaults.pm       (original)
+++ trunk/config/init/defaults.pm       Tue Feb 20 13:19:53 2007
@@ -23,6 +23,7 @@
 use FindBin;    # see build_dir
 use Parrot::Configure::Step;
 use Cwd qw(abs_path);
+use File::Spec;
 
 $description = q{Setting up Configure's default values};
 
@@ -135,6 +136,7 @@
         libparrot_soname => '',
 
         perl      => $^X,
+        perl_inc  => $self->find_perl_headers(),
         test_prog => 'parrot',
         rm_f      => '$(PERL) -MExtUtils::Command -e rm_f',
         rm_rf     => '$(PERL) -MExtUtils::Command -e rm_rf',
@@ -228,6 +230,11 @@
     return $self;
 }
 
+sub find_perl_headers {
+    my $self = shift;
+    return File::Spec->catdir( $Config::Config{archlib}, 'CORE' );
+}
+
 1;
 
 # Local Variables:

Added: trunk/ext/Parrot-Embed/tools/write_typemap.pl
==============================================================================
--- (empty file)
+++ trunk/ext/Parrot-Embed/tools/write_typemap.pl       Tue Feb 20 13:19:53 2007
@@ -0,0 +1,17 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use File::Spec::Functions;
+use ExtUtils::MakeMaker;
+
+chdir( catdir( qw( lib Parrot ) ) );
+my $custom_typemap = catfile( qw( .. .. typemap ) );
+
+(my $perl_typemap = $INC{'ExtUtils/MakeMaker.pm'} ) =~ s/MakeMaker.pm/typemap/;
+
+my $c_file = qx/xsubpp -prototypes -typemap $perl_typemap -typemap 
$custom_typemap Embed.xs/;
+open( my $file, '>', 'Embed.c' ) or die "Cannot write Embed.c\n";
+print { $file } $c_file;
+close $file;

Reply via email to