delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/08/30/03:04:18

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
From: Stephan Mueller <Stephan DOT Mueller AT microsoft DOT com>
To: Phil Smith <phil AT voltage DOT com>, "cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com>
Date: Sat, 30 Aug 2008 00:00:14 -0700
Subject: RE: Probably stupid make question
Message-ID: <2A9FABB3664AF8459CBADA1CE4E4024642D52EA2B1@DF-MASTIFF-MSG.exchange.corp.microsoft.com>
References: <B870629719727B4BA82A6C06A31C291207429E06EA AT hqmailsvr01 DOT voltage DOT com> <48B706FB DOT 4CAE7693 AT dessent DOT net> <20080828203234 DOT GB17369 AT ednor DOT casa DOT cgf DOT cx> <B870629719727B4BA82A6C06A31C291207429E0893 AT hqmailsvr01 DOT voltage DOT com>
In-Reply-To: <B870629719727B4BA82A6C06A31C291207429E0893@hqmailsvr01.voltage.com>
Accept-Language: en-US
acceptlanguage: en-US
MIME-Version: 1.0
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id m7U74G1V024551

<offtopic>
Yes, it's awful, but the batch file isn't totally at a loss.  If, in the batch file, you refer to parameters %1 %2 etc., as you've discovered, the parsing treats equals signs (and semicolons, and perhaps others; I forget) as spaces.  But, if you refer to %*, you can get the whole original command line, unmolested, inside the batch file.  At worst, you can tokenize it yourself (with the cryptic but powerful-enough batch 'for' command, perhaps), but at best, you can just use it as is and pass it to your compiler.

At one time, and perhaps still, Microsoft compilers support(ed) using # in place of = on the command line: -DSOMETHING#AVALUE.  I'm willing to bet it was to work around this misfeature of batch.
</offtopic>

stephan();


-----Original Message-----
From: cygwin-owner AT cygwin DOT com [mailto:cygwin-owner AT cygwin DOT com] On Behalf Of Phil Smith
Sent: Friday, August 29, 2008 2:36 PM
To: cygwin AT cygwin DOT com
Subject: RE: Probably stupid make question

Well, this is just ducky. I'm posting this so it goes in the archives and maybe saves someone else a LOT of heartache.

Batch files treat incoming, unquoted equals signs as spaces!

For the cross-compiling I'm doing, I have to use a .BAT file (or equivalent), because the cross-compiler is two-stage -- it generates assembler from C, then must assemble that.

Thus my batch file to do the compiles gets invoked correctly as (say):

-DSOMETHING=AVALUE Banana.c

but the batch file sees this as:

-DSOMETHING AVALUE Banana.c

Quick, someone build me a time machine so I can go back and kill whoever implemented THAT (I know, get in line...)!

...phsiii

-----Original Message-----
From: cygwin-owner AT cygwin DOT com [mailto:cygwin-owner AT cygwin DOT com] On Behalf Of Christopher Faylor
Sent: Thursday, August 28, 2008 4:33 PM
To: cygwin AT cygwin DOT com
Subject: Re: Probably stupid make question

On Thu, Aug 28, 2008 at 01:13:47PM -0700, Brian Dessent wrote:
>Phil Smith wrote:
>>We're perverting CMake and Cygwin make to use a cross-compiler for z/OS
>>(IBM mainframe).  We've beaten it mostly into submission, but are
>>hitting an issue with definitions being passed.  Cygwin make seems to
>>be passing them in the format:
>>
>>         -Dvarname value
>>
>> rather than:
>>
>>         -Dvarname=value
>>
>>and the cross-compiler doesn't like that much.  Some discussion with
>>more *IX-savvy friends suggests that the "blank" format is older, and
>>is deprecated due to ambiguity (does "-Dvarname abc.c xyz.c" mean "set
>>varname to abc.c and compile xyz.c", or "set varname to 1 and compile
>>abc.c and xyz.c"?).
>
>I think you're going to have to be more specific, such as providing a
>testcase that reproduces the problem.  This must be due to some aspect
>of cmake, because there's nothing in plain make (AFAIK) that has
>anything to do with how -D or any other parameter is passed to any tool
>-- make executes commands exactly as written in the Makefile, no more
>no less.

As the make maintainer, let me say:  What he said.

cgf

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019