automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Make compile wrapper eat win32 paths


From: Peter Rosin
Subject: Re: Make compile wrapper eat win32 paths
Date: Sun, 01 Feb 2009 20:30:20 +0100
User-agent: Thunderbird 2.0.0.19 (Windows/20081209)

Hi Ralf,

Den 2009-02-01 17:48, skrev Ralf Wildenhues:
Hi Peter,

* Peter Rosin wrote on Sun, Feb 01, 2009 at 05:05:20PM CET:
When the compile wrapper is given win32 paths (with colons and/or
backslashes) it gets into trouble with both creating the lock
directory and guessing the output file of the losing compiler.

Thanks for the report and patch.

Here's a patch.

Ain't no bugfix going into the Automake tree without testsuite exposure,
if at all possible.  So if you don't want to write a test yourself, then
please mention whether there is already a test failing for this system,
that is fixed by this change, or whether I'd need to write one.  In the
latter case, please describe a test with your own words, rather than
with code.

Since *I* am not even successful at building automake on this $host, I
don't think I would want to dig into the testsuite. Sorry. So, I still
can't run the testsuite, see the "Make depmode=cpp work with Microsoft
Visual C++ on MSYS" thread. In short, I get:

Constant name 'HASH(0xa2a1ea8)' has invalid characters at ./automake.tmp line 
293
BEGIN failed--compilation aborted at ./automake.tmp line 293.

I have no clue as to how to debug that.

So, I guess that leaves you with writing a testcase, or someone pointing
out what I'm doing wrong in the other thread. Sorry for that.

Anyway, I hit the trouble in a VPATH build (libtool configured with
../configure). In that case, with win32 paths, compile is given paths like

  -c ..\libltdl\libltdl\slist.c -o libtldl\libltdl\libltdl_libltdl_la-slist.obj

Without my (ahem, your corrected) patch, that translates into compile
trying to "mkdir __\libltdl\libltdl\slist_o.d" (instead of the
intended "mkdir slist_o.d"), which of course fails since there is no
__\libltdl\libltdl directory in which to create slist_o.d.

Thinking about it some more, the lockdir expression does not
need \ in its set, those have been removed by the cofile expression.
Hey, the same goes for /, but I guess the : is best replaced by _, since
it's an illegal filename char on some systems.

Thank you,
Ralf

--- a/lib/compile
+++ b/lib/compile

@@ -102,13 +102,13 @@ if test -z "$ofile" || test -z "$cfile"; then
 fi
# Name of file we expect compiler to create.
-cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'`
+cofile=`echo "$cfile" | sed -e 's|^.*/\\:||' -e 's/\.c$/.o/'`

Surely that should rather be something like this, no?
  cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`

Big *blush*. I had 's|^.*[/\\]||' -e 's/\.c$/.o/' when I tested, then
decided to add the :, then also noticed the script date. I guess the
brackets got lost somewhere in the shuffle. That's no excuse for not
testing what I'm sending in. Sorry for wasting your time and cheers
to your excellent reading skills.

Your extra expression that removes any drive letter: is of course
more accurate than my lazy attempt. What can I say? Works for me!

 # Create the lock directory.
-# Note: use `[/.-]' here to ensure that we don't use the same name
+# Note: use `[/\\:.-]' here to ensure that we don't use the same name
 # that we are using for the .o file.  Also, base the name on the expected
 # object file name, since that is what matters with a parallel build.
-lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d
+lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
 while true; do
   if mkdir "$lockdir" >/dev/null 2>&1; then
     break

Cheers,
Peter




reply via email to

[Prev in Thread] Current Thread [Next in Thread]