Make Porting/expand-macro.pl work with a make other than `make`, also Win32 compatibility fixes

--------------040507080907060101050501
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Hello,

recently it came to my attention that `Porting/expand-macro.pl` does not 
work if your `make` tool is named anything other than `make`. The first 
attached patch changes it so that it loads Config.pm and uses the 
configured $Config{make} from there. I presume that anybody running 
`Porting/expand-macro.pl` also knows about how to give `perl` the 
appropriate Config.pm resp. how to invoke the proper Perl.

The second patch assumes that `Porting/expand-macro.pl` will be run from 
the root directory, and under that assumption fixes the build process 
under Win32+gcc , which expects to have a current directory of /Win32, 
so it finds the Makefile.mk (for dmake).

I haven't tested the change against VC+nmake , but as I'm fairly certain 
that it never worked for that combination before, these patches can only 
improve that situation.

-max

--------------040507080907060101050501
Content-Type: text/x-patch;
 name="0001-Make-Porting-expand-macro.pl-use-Config-make-instead.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename*0="0001-Make-Porting-expand-macro.pl-use-Config-make-instead.pa";
 filename*1="tch"

From d1e2e8ae868aa4898072f3efa1777447179a163c Mon Sep 17 00:00:00 2001
From: Max Maischein <corion@corion.net>
Date: Sat, 11 Dec 2010 15:20:13 +0100
Subject: [PATCH 1/2] Make Porting/expand-macro.pl use $Config{make} instead of hardcoded `make`

---
 Porting/expand-macro.pl |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/Porting/expand-macro.pl b/Porting/expand-macro.pl
index df2b002..772bff6 100755
--- a/Porting/expand-macro.pl
+++ b/Porting/expand-macro.pl
@@ -3,6 +3,7 @@ use strict;
 
 use Pod::Usage;
 use Getopt::Std;
+use Config;
 $Getopt::Std::STANDARD_HELP_VERSION = 1;
 
 my $trysource = "try.c";
@@ -80,8 +81,10 @@ EOF
 
 close $out or die "Can't close $trysource: $!";
 
-print "doing: make $tryout\n" if $opt{v};
-system "make $tryout" and die;
+print "doing: $Config{make} $tryout\n" if $opt{v};
+my $cmd = "$Config{make} $tryout";
+system( $cmd ) == 0
+    or die "Couldn't launch [$cmd]: $! / $?";
 
 # if user wants 'indent' formatting ..
 my $out_fh;
-- 
1.6.5.1.1367.gcd48


--------------040507080907060101050501
Content-Type: text/x-patch;
 name="0002-Windows-compatibility-fixes-for-running-expand-macro.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename*0="0002-Windows-compatibility-fixes-for-running-expand-macro.pa";
 filename*1="tch"

From 3beae29465193252937efef4d16a80c0b6e31681 Mon Sep 17 00:00:00 2001
From: Max Maischein <corion@corion.net>
Date: Sat, 11 Dec 2010 15:21:11 +0100
Subject: [PATCH 2/2] Windows compatibility fixes for running expand-macro.pl:

a) Close filehandle to try.i so we can erase it
b) The build process wants to be run from bleadperl/Win32
---
 Porting/expand-macro.pl |   19 ++++++++++++++-----
 1 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/Porting/expand-macro.pl b/Porting/expand-macro.pl
index 772bff6..6b33f74 100755
--- a/Porting/expand-macro.pl
+++ b/Porting/expand-macro.pl
@@ -51,6 +51,13 @@ while (<>) {
 }
 die "$macro not found\n" unless defined $header;
 
+if ($^O =~ /MSWin(32|64)/) {
+    # The Win32 (and Win64) build process expects to be run from
+    # bleadperl/Win32
+    chdir "Win32"
+	or die "Couldn't chdir to win32: $!";
+};
+
 open my $out, '>', $trysource or die "Can't open $trysource: $!";
 
 my $sentinel = "$macro expands to";
@@ -107,15 +114,17 @@ if ($opt{f} || $opt{F}) {
     $out_fh = \*STDOUT;
 }
 
-open my $fh, '<', $tryout or die "Can't open $tryout: $!";
+{
+    open my $fh, '<', $tryout or die "Can't open $tryout: $!";
 
-while (<$fh>) {
-    print $out_fh $_ if /$sentinel/o .. 1;
-}
+    while (<$fh>) {
+	print $out_fh $_ if /$sentinel/o .. 1;
+    }
+};
 
 unless ($opt{k}) {
     foreach($trysource, $tryout) {
-	die "Can't unlink $_" unless unlink $_;
+	die "Can't unlink $_: $!" unless unlink $_;
     }
 }
 
-- 
1.6.5.1.1367.gcd48


--------------040507080907060101050501--
0
corion
12/11/2010 2:26:20 PM
perl.perl5.porters 48206 articles. 1 followers. Follow

1 Replies
669 Views

Similar Articles

[PageSpeed] 11

Max Maischein wrote:
> recently it came to my attention that `Porting/expand-macro.pl` does not
> work if your `make` tool is named anything other than `make`. The first
> attached patch changes it so that it loads Config.pm and uses the
> configured $Config{make} from there.

> The second patch assumes that `Porting/expand-macro.pl` will be run from
> the root directory, and under that assumption fixes the build process
> under Win32+gcc

Thank you. Applied as 2c949ea and 390bf17.

0
sprout
12/11/2010 10:12:57 PM
Reply:

Similar Artilces:

Making should be make
Name: Scott Melton Email: scott_rides_againatyahoodotcom Product: Firefox Summary: Making should be make Comments: The opening page for Bugzilla is poorly worded. http://www.mozilla.org/projects/seamonkey/start/ The second line: If you want to help making this application even better, we would encourage you to take part in the should be MAKE, not MAKING Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.2) Gecko/20070222 SeaMonkey/1.1.1 ...

How Do I make I make this validation work?
HiI have a textbox that is for email. I want to make sure that something has been entered in it. The thing is though an email address is optional on my form until the user clicks click the radio button(that represents "Do you want a email response").So I don't think I can stick a required field validator on that area since it will always go off. I tried to make a custom validtor but that did not work too well since it seems to get activated once you click on the textbox and start typeing away and then leave that box.So I am not sure how I could make it check this. I am doing th...

Keep The new tab option like in opera and ie 7.0 it makes more easier to open new tab and also when we click on a link to open it in new tab make it to open by adjacent to that tab so it makes easier
Name: y vinod kumar reddy Product: Firefox Summary: Keep The new tab option like in opera and ie 7.0 it makes more easier to open new tab and also when we click on a link to open it in new tab make it to open by adjacent to that tab so it makes easier for the end user Comments: i think u may make these changes in the next coming version Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9) Gecko/2008051206 Firefox/3.0 From URL: http://hendrix.mozilla.org/ ...

Making make depend easy
Autrijus, I'd like for it to be easy for a Makefile to know all the dependencies of a pp-generated executable, since mine depends on a large number of locally maintained .pm files. I just modified pp by adding a new option which then results in this code being executed right after the call to Module::ScanDeps (I named the option -m after gcc's -M, since -M was already taken for pp, but probably --depend would be better): if ($Options->{m}) { print join(" \\\n\t", map($map{$_}{file}, keys %map))."\n"; exit 0; } I then pu...

how to make a make a snp report?
below is my code behind. I get my access mdb to open but how do i open a report and convert it to a snp file? also... since i am using "Inherits System.Web.UI.Page" does that mean i could use a textbox as method of sending a prama to my codebehind? Imports Microsoft.VisualBasic Imports System.Diagnostics Partial Class _Default 'notice the class names now matchInherits System.Web.UI.Page Protected Sub Button8_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button8.clickDim access As New Process access.StartInfo.FileName = "C:\Documents and Setti...

[PATCH] make C< make parrot > work
The instructions say to run "make parrot", but that won't work because Configure.pl tells Makefile.in that the test program's name is 'test_parrot'. This tiny patch fixes that nit. diff -r -u parrot/Configure.pl parrot-andy/Configure.pl --- parrot/Configure.pl Fri Dec 14 20:39:40 2001 +++ parrot-andy/Configure.pl Tue Dec 18 13:31:08 2001 @@ -84,7 +84,7 @@ ld_debug => '', # include debug info in executable perl => $^X, - test_prog => 'test_parrot' . $Config{_exe}, + test_prog => 'parrot' . $Config{_exe},...

make ok / make nok
Shouldn't 'make ok' and 'make nok' also try to find out the version of the C compiler used if it's not gcc. Some examples: HP-UX: swlist -l bundle | grep B3901BA 11.00: B3901BA B.11.01.07 HP C/ANSI C Developer's Bundle for HP-UX 11.00 (S800) 10.20: B3901BA B.10.20.14 HP C/ANSI C Developer's Bundle for HP-UX 10.20 (S800) AIX: lslpp -L | grep 'C for AIX' 4.3.2: vac.C 4.4.0.2 C C for AIX Compiler 4.2.1: xlC.C 3.1.4.0 C C for AIX Compiler OSF/1: setld -i | grep ^OSFCMPLRS; cc -V | head -3 OSFCMPLRS425 instal...

keeps making me download update, but, update doesn't work, makes me download update, update doesn't work..................
Name: donald davis Email: galenachefatyahoodotcom Product: Firefox Summary: keeps making me download update, but, update doesn't work, makes me download update, update doesn't work.................. Comments: That's pretty much the whole deal. An update screen pops up, I update, the update doesn't take and the next time I use firefox mozilla the same thing happens over and over and over. Thanks Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.4 ...

Help make the build faster by porting make rules to the misc tier
We added a capability to the Firefox build system that will ultimately lead to speeding up the build and we need your help to realize its potential. Background ========== The Firefox build executes as a pipeline of stages called tiers. The tiers are currently export -> compile -> misc -> libs -> tools. The build system iterates the tiers and builds directories in those tiers. The export, compile, and misc tiers are mostly concurrent. If you execute with |make -j32| or more, they should saturate your cores. If you have access to a modern, multi-core machine, yo...

Help make the build faster by porting make rules to the misc tier
We added a capability to the Firefox build system that will ultimately lead to speeding up the build and we need your help to realize its potential. Background ========== The Firefox build executes as a pipeline of stages called tiers. The tiers are currently export -> compile -> misc -> libs -> tools. The build system iterates the tiers and builds directories in those tiers. The export, compile, and misc tiers are mostly concurrent. If you execute with |make -j32| or more, they should saturate your cores. If you have access to a modern, multi-core machine, yo...

make
I have some SUSE appliances and I need to install some software. When I ran the install script it said I need "make" but I cant find it anywhere on the system. Anyone know where I can download a rpm for make? SUSE ver 9 Zippy San Antonio, Tx -- zippdaw2001 ------------------------------------------------------------------------ It's on your installation DVD's in the development section. -- LRE ------------------------------------------------------------------------ LRE's Profile: http://forums.opensuse.org/member.php?userid=1100 Vi...

MAKE
Hello, i am writing my first app for palm os with mobilink. I have ran the sqlpp and tried to 'make' my app in codewarrior 6. I get the following error... Error: Illegal use of precompiled header ulstore.h line 654 } This file sits in the Sql Anywhere/h folder. I am using SQL Anywhere 7. Any ideas ? JK Please always include version information: Target operating system Palm OS 3.5 Codewarrior CW6 Release (ie service pack) ASA - 7.0.1.918 (Always include the BUILD number 918) First thing I would recommend is to make sure you are using ASA 7.0.1.918 at ...

[PATCH] skip t/op/incfilter.t for "make clean;make miniperl;make minitest"
--- t/op/incfilter.t.dist 2006-05-28 14:06:23.000000000 +0300 +++ t/op/incfilter.t 2006-05-28 14:07:17.000000000 +0300 @@ -5,6 +5,10 @@ BEGIN { chdir 't' if -d 't'; @INC = qw(. ../lib); + if ($ENV{PERL_CORE_MINITEST}) { + print "1..0 # Skip: no dynamic loading on miniperl\n"; + exit 0; + } unless (find PerlIO::Layer 'perlio') { print "1..0 # Skip: not perlio\n"; exit 0; Jarkko Hietaniemi wrote: > --- t/op/incfilter.t.dist 2006-05-28 14:06:23.000000000 +0300 > +++ t/op/incfilter.t 2006-05-2...

superreview requested: [Bug 218210] find nodes does not work when searching for attribute : [Attachment 141183] fix, also make searches case insensitive and match against substrings
timeless@myrealbox.com (working) <timeless@bemail.org> has asked Boris Zbarsky <bzbarsky@mit.edu> for superreview: Bug 218210: find nodes does not work when searching for attribute http://bugzilla.mozilla.org/show_bug.cgi?id=218210 Attachment 141183: fix, also make searches case insensitive and match against substrings http://bugzilla.mozilla.org/attachment.cgi?id=141183&action=edit ...

Web resources about - Make Porting/expand-macro.pl work with a make other than `make`, also Win32 compatibility fixes - perl.perl5.porters

Astrological compatibility - Wikipedia, the free encyclopedia
This article has an unclear citation style . The references used may be made clearer with a different or consistent style of citation , footnoting ...

A Love Test: Compatibility Calculator on the App Store on iTunes
Get A Love Test: Compatibility Calculator on the App Store. See screenshots and ratings, and read customer reviews.

Android Design in Action: Sleep Monitors and Backward Compatibility - YouTube
Join Nick Butcher, Adam Koch and Roman Nurik as they discuss various elements of Android Design. This week, we'll take a look at the sleep monitor ...

Is compatibility in the stars or your gut?
Is compatability in the stars or your gut? Compatibility; we’re obsessed with it. Does this job suit me? Does this apartment meet my needs? Does ...

E3: Xbox One to gain backwards compatibility
Older Xbox games to work with new console, Microsoft has announced at E3 2015 in Las Vegas.

Xbox One finally finds its feet with backwards compatibility, games-focused dashboard
... snappy video game system. On Friday Microsoft began rolling out the biggest software update yet to its Xbox One console, adding backwards compatibility ...

Apple unveils longer, thinner iPhone 5 with Australian 4G LTE compatibility
APPLE has unveiled a longer iPhone with a large 4-inch screen that will work on Australia's 4G LTE networks operated by Telstra and Optus.

Human frailty and masculinity: Mitch Clark shows their compatibility
Raw and unedited, this was a private hell made instantly public.

Sony brings backwards compatibility to PlayStation with Gaikai deal
First and third-party games to be streamed to hardware

Lego teases updated Mindstorms EV3 with new Linux firmware, infrared, and iOS compatibility
... that it will launch an updated Mindstorms EV 3 kit later this year that runs new Linux firmware with out-of-the box iOS and Android compatibility. ...

Resources last updated: 12/26/2015 2:19:26 PM