EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

2002  2003  2004  2005  <20062007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 2002  2003  2004  2005  <20062007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: yet another bug in mkmf.pl
From: Benjamin Franksen <[email protected]>
To: [email protected]
Date: Wed, 20 Dec 2006 14:49:39 +0100
Hi All,

there is another bug in mkmf.pl: If the full file path of a dependency 
gets too long, it gets wrapped (and line-ending backslashes inserted at 
the wrong places). In fact there is a call wrap(...) from module 
Text::Wrap and its docs say: "Lines are wrapped at $Text::Wrap::columns 
columns. $Text::Wrap::columns should be set to the full width of your 
output device.  In fact, every resulting line will have length of no 
more than $columns - 1." which is clearly not acceptable for a file 
that may contain arbitrarily long file names.

I have attached a patch to fix this, relative to R3.14.8.2 (apply in 
configure/tools). The patch also removes the code that adds each 
dependency as an additional target. The script said that this is to 
avoid "no rule to make target..." warnings; I think this is an artefact 
of the old (3.13) build system and is no longer necessary in 3.14.

Cheers
Ben
-- 
To the functional programmer's eye a loop is just a degenerate
form of linear recursion written in an adhoc special syntax.
Index: mkmf.pl
===================================================================
RCS file: /opt/repositories/controls/epics/base/3.14/configure/tools/mkmf.pl,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 mkmf.pl
28,30d27
< use Text::Wrap;
< 
< $Text::Wrap::columns = 76;
34d30
< my %delim_match = ( q/'/ => q/'/, q/"/ => q/"/);
78c74
<    my $line;
---
>    my $deps;
90,101c86,87
<    $line = "$objFile : @includes";
<    $fmtline = wrap ("", "  ", $line);
<    $fmtline =~ s/\n/ \\\n/mg;
<    print $fmtline;
< 
<    print "\n\n";
<    print "#Depend files must be targets to avoid 'No rule to make target ...' errors\n";
< 
<    #$line = "@includes";
<    foreach $file (@includes) {
<        print "$file :\n";
<    }
---
>    $deps = join(" \\\n  ",@includes);
>    print "$objFile :$deps\n";
142,145c128,130
<    return 0 if !($line =~ m/^[	  ]*\#?[	 ]*include/);
<    return 0 if !($line =~ /^[\#?\s]*include\s*(['""'<])([\w\.\/]*)$delim_match{\1}/ix);
<    return 0 if !$2;
<    $incname = $2;
---
>    return 0 if not $line =~ /^#?\s*include\s*('.*?'|<.*?>|".*?")/;
>    $incname = substr $1, 1, length($1)-2;
>    print "DEBUG: $incname\n" if $debug;
158d142
< 

Replies:
Re: yet another bug in mkmf.pl Janet Anderson
References:
Patches for recognizing external dependencies Benjamin Franksen
Re: Patches for recognizing external dependencies Andrew Johnson
Re: Patches for recognizing external dependencies Benjamin Franksen

Navigate by Date:
Prev: Re: EPICS on Tru64unix and HP-UX Kazuro FURUKAWA
Next: Re: yet another bug in mkmf.pl Janet Anderson
Index: 2002  2003  2004  2005  <20062007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: Patches for recognizing external dependencies Benjamin Franksen
Next: Re: yet another bug in mkmf.pl Janet Anderson
Index: 2002  2003  2004  2005  <20062007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 02 Feb 2012 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·