You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl-cvs@perl.apache.org by ri...@apache.org on 2010/03/13 14:21:09 UTC

svn commit: r922550 - in /perl/embperl/trunk: Changes.pod Makefile.PL xsbuilder/WrapXS.pm

Author: richter
Date: Sat Mar 13 13:21:09 2010
New Revision: 922550

URL: http://svn.apache.org/viewvc?rev=922550&view=rev
Log:
Support for 32Bit on 64Bit system

Modified:
    perl/embperl/trunk/Changes.pod
    perl/embperl/trunk/Makefile.PL
    perl/embperl/trunk/xsbuilder/WrapXS.pm

Modified: perl/embperl/trunk/Changes.pod
URL: http://svn.apache.org/viewvc/perl/embperl/trunk/Changes.pod?rev=922550&r1=922549&r2=922550&view=diff
==============================================================================
--- perl/embperl/trunk/Changes.pod (original)
+++ perl/embperl/trunk/Changes.pod Sat Mar 13 13:21:09 2010
@@ -3,7 +3,8 @@
 =head 2.4.0
 
     - Increased size limit for errormessage from 1024 to 4096
-
+    - Makefile.PL can now handle compiling 32Bit code on 64Bit 
+      sytsem if Perl was compiled as 32Bit application
 
 =head1 2.3.1
 

Modified: perl/embperl/trunk/Makefile.PL
URL: http://svn.apache.org/viewvc/perl/embperl/trunk/Makefile.PL?rev=922550&r1=922549&r2=922550&view=diff
==============================================================================
--- perl/embperl/trunk/Makefile.PL (original)
+++ perl/embperl/trunk/Makefile.PL Sat Mar 13 13:21:09 2010
@@ -15,6 +15,7 @@ use Data::Dumper ;
 
 $win32 = ($Config{osname} =~ /win32/i) ;
 $aix = ($Config{osname} =~ /aix/i);
+$perl32bit = $Config{ptrsize} == 4 ;
 $dynlib = {};
 print "\nRunning on Win 32\n" if ($win32) ;
 
@@ -247,12 +248,12 @@ sub MY::cflags 
             $txt =~ s/-O\d//g if ($ccdebug =~ /-O\d/) ;
             $txt =~ /CCFLAGS\s*=(.*?)\n/s ;
 	    my $flags = $mp2cfg->{MODPERL_CCOPTS} || $1 ;
-            $txt =~ s/CCFLAGS\s*=(.*?)\n/CCFLAGS = $ccdebug $flags\n/s ;
+            $txt =~ s/CCFLAGS\s*=(.*?)\n/CCFLAGS = $ccdebug $flags $addcflags\n/s ;
             }
         else
             {
             $txt =~ s/-O\d//g if ($ccdebug =~ /-O\d/) ;
-	    $txt =~ s/CCFLAGS\s*=/CCFLAGS = $ccdebug / ;
+	    $txt =~ s/CCFLAGS\s*=/CCFLAGS = $ccdebug $addcflags/ ;
             }
 
         
@@ -1226,6 +1227,11 @@ if ($win32)
 $d .= ' -DEP2' if ($EP2) ;
 
 $dynlib->{'OTHERLDFLAGS'} .= " $lddebug" ;
+if ($perl32bit)
+    {
+    $dynlib->{'OTHERLDFLAGS'} .= " -m32" ;
+    $dynlib->{'OTHERLDFLAGS'} .= " -L" . join (' -L', @{$mp2cfg->{libpth}}) if ($mp2cfg) ;
+    }
 
 # 
 # See if we need to link to any other libraries
@@ -1283,6 +1289,7 @@ if ($mp2cfg && $mp2cfg->{'MP_INCLUDE_DIR
     $i .= ' -I' . join (' -I', @inc) if (@inc) ;
     }
 
+$addcflags = $perl32bit?'-m32':'' ;
 
 %MMARGS = (
     'LIBS'	   => [$libs || ''],   			 
@@ -1301,7 +1308,7 @@ If you done a SVN checkout you need to c
 xsbuilder/source_scan.pl and xsbuilder/xs_generate.pl.
 --------------------------------------------------------------------------
 \n" ;
-print FH Data::Dumper -> Dump ([\%MMARGS, $mp2cfg, $ccdebug], ['MMARGS', 'mp2cfg', 'ccdebug']) ;
+print FH Data::Dumper -> Dump ([\%MMARGS, $mp2cfg, $ccdebug, $addcflags], ['MMARGS', 'mp2cfg', 'ccdebug', 'addcflags']) ;
 close FH ;
 
 

Modified: perl/embperl/trunk/xsbuilder/WrapXS.pm
URL: http://svn.apache.org/viewvc/perl/embperl/trunk/xsbuilder/WrapXS.pm?rev=922550&r1=922549&r2=922550&view=diff
==============================================================================
--- perl/embperl/trunk/xsbuilder/WrapXS.pm (original)
+++ perl/embperl/trunk/xsbuilder/WrapXS.pm Sat Mar 13 13:21:09 2010
@@ -73,11 +73,13 @@ sub pm_text { undef } ;
 sub makefilepl_text {
     my $self = shift ;
 
-    my $code = "local \$mp2cfg ;\nlocal \$ccdebug ;\n" .
+    my $code = "local \$mp2cfg ;\nlocal \$ccdebug ;\nlocal \$addcflags;\n" .
                 $self -> SUPER::makefilepl_text (@_) ;
 
     $code .= q[
 
+
+
 sub MY::top_targets
 	{
 	my ($txt) = shift -> MM::top_targets (@_) ;
@@ -97,12 +99,12 @@ sub MY::cflags 
             $txt =~ s/-O\d//g if ($ccdebug =~ /-O\d/) ;
             $txt =~ /CCFLAGS\s*=(.*?)\n/s ;
 	    my $flags = $mp2cfg->{MODPERL_CCOPTS} || $1 ;
-            $txt =~ s/CCFLAGS\s*=(.*?)\n/CCFLAGS = $ccdebug $flags\n/s ;
+            $txt =~ s/CCFLAGS\s*=(.*?)\n/CCFLAGS = $ccdebug $flags $addcflags\n/s ;
             }
         else
             {
             $txt =~ s/-O\d//g if ($ccdebug =~ /-O\d/) ;
-	    $txt =~ s/CCFLAGS\s*=/CCFLAGS = $ccdebug / ;
+	    $txt =~ s/CCFLAGS\s*=/CCFLAGS = $ccdebug $addcfalgs/ ;
             }
 
         



---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-cvs-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-cvs-help@perl.apache.org