Make quoted strings problem running from cmd.exe...

Kevin Hill kevin_hill@bigfoot.com
Tue Aug 31 23:49:00 GMT 1999


Earie et Al,

You seem to have hit the nail on the head. CMD.exe is a standard NT app
(of course) and my CmdLineLook app is also compiled with MSVC (produces
standard NT executables). However, if I use John's source code and
compile within Cygwin, I get the following results from the same
makefile, but with the two command line inspectors as the shells...

CmdLineLook -i "BEGIN { $^W=1; }"
0       -F:/GAP/NEWDEV/GAP/TESTING/TEST1/LATEST/ANOTHER/CmdLineLook.exe-
1       -/c-
2       -CmdLineLook -i "BEGIN-
3       -{-
4       -$^W=1;-
5       -}"-


CmdLineLook -i "BEGIN { $^W=1; }"
arg 0: <//F/GAP/NEWDEV/GAP/TESTING/TEST1/LATEST/ANOTHER/prtcmd.exe>
arg 1: </c>
arg 2: <CmdLineLook -i "BEGIN { $^W=1; }">


What does this tell us? It seems to suggest that standard NT C runtime
code is different between Cygwin and MSVC. This is good to be finally
getting to the bottom of the problem.

I guess what I really need to do is rebuild CMD.EXE with the Cygwin
toolkit!!! Wonder whether I can get the source code.

If I cannot rebuild CMD.EXE, is there anything I can do in the make
syntax to get it to put things in the way I need them to be for standard
NT executables? Any guesses? As mentioned before, when there are no
quotes on the command line, GNUmake outputs stuff differently from when
there is, as demonstrated below. However, when running the
Cygwin-compiled shell, it appears the same. It must, however, be doing
something different, mustn't it, or is the change in fact in the C
runtime itself. Now I am confused.

Can anyone help out here?

CmdLineLook -i BEGIN { $^W=1; }
0       -F:/GAP/NEWDEV/GAP/TESTING/TEST1/LATEST/ANOTHER/CmdLineLook.exe-
1       -/c-
2       -CmdLineLook -i BEGIN { $^W=1; }-
SHELL=F:/GAP/NEWDEV/GAP/TESTING/TEST1/LATEST/ANOTHER/CmdLineLook.exe

F:\GAP\NEWDEV\GAP\TESTING\TEST1\LATEST\ANOTHER>make
CmdLineLook -i "BEGIN { $^W=1; }"
0       -F:/GAP/NEWDEV/GAP/TESTING/TEST1/LATEST/ANOTHER/CmdLineLook.exe-
1       -/c-
2       -CmdLineLook -i "BEGIN-
3       -{-
4       -$^W=1;-
5       -}"-
SHELL=F:/GAP/NEWDEV/GAP/TESTING/TEST1/LATEST/ANOTHER/CmdLineLook.exe


Thanks everyone for their help so far.

Kev.
Kevin.Hill@tab.co.nz



     Hmm.  I bet you used cygwin to build your program didn't you. 
Whereas
     Kevin
     used MSVC to build his.  If you build your program with mingw32,
you'll
     have
     the same problem as Kevin.

     Earnie.

     --- John Wiersba <John.Wiersba@medstat.com> wrote:
     > I'm running make 3.75 with no problems.  Maybe this is a binary
vs text
     > problem (I'm running all binary mounts).
     >
     > file prtcmd.c
     >    #include "stdio.h"
     >    main(int argc, char ** argv) {
     >         int j;
     >         for (j = 0; j < argc; ++j) {
     >              printf("arg %d: <%s>\n", j, argv[j]);
     >         exit(0);
     >
     > $ gcc prtcmd.c
     > $ mv a.exe prtcmd.exe
     >
     > file Makefile
     >    a:
     >         prtcmd a "b c" d
     >         prtcmd -i "BEGIN { $$^W=1; }"
     >
     > output running bash and cmd.exe is identical:
     >
     > $ make -v
     > GNU Make version 3.75, by Richard Stallman and Roland McGrath.
     > Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 95, 96
     >         Free Software Foundation, Inc.
     > This is free software; see the source for copying conditions.
     > There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR
A
     > PARTICULAR PURPOSE.
     >
     > Report bugs to <bug-gnu-utils@prep.ai.mit.edu>.
     >
     > $ make
     > prtcmd a "b c" d
     > arg 0: <prtcmd>
     > arg 1: <a>
     > arg 2: <b c>
     > arg 3: <d>
     > prtcmd -i "BEGIN { $^W=1; }"
     > arg 0: <prtcmd>
     > arg 1: <-i>
     > arg 2: <BEGIN { $^W=1; }>
     >
     > > -----Original Message-----
     > > From: Glenn Spell [ mailto:glenn@gs.fay.nc.us ]
     > > Sent: Tuesday, August 17, 1999 5:41 PM
     > > To: cygwin@sourceware.cygnus.com
     > > Subject: Re: Make quoted strings problem running from
cmd.exe...
     > >
     > >
     > > On 18 Aug 1999 around 9:05AM (+1200) Kevin Hill wrote:
     > >
     > > > My problem now is not "is this a bug or strange feature in
     > > > make.exe?",  but more one of "how can I fix this so I can
move on
     > > > and get on with my project?".
     > >
     > > You might try upgrading from 3.75 to 3.77. There were various
changes
     > > in the way make reads lines in makefiles since 3.75.
     > >
     > > -glenn
     > >
     > > --
     > >  )      Glenn Spell <glenn@gs.fay.nc.us>      )   _       _____
     > >  )   Fayetteville, North Carolina, U. S. A.   )_ (__\____o /_/_
|
     > >  )  _  _  _  _  _  _  _  _  _  _  _  _  _  _  )  
>-----._/_/__]>
     > >  )- blue skies - happy trails - sweet dreams -)             `0 
|
     > >
     > > --
     > > Want to unsubscribe from this list?
     > > Send a message to cygwin-unsubscribe@sourceware.cygnus.com
     > >
     >
     > --
     > Want to unsubscribe from this list?
     > Send a message to cygwin-unsubscribe@sourceware.cygnus.com
     >
     >

     _________________________________________________________
     Do You Yahoo!?
     Get your free @yahoo.com address at http://mail.yahoo.com


     --
     Want to unsubscribe from this list?
     Send a message to cygwin-unsubscribe@sourceware.cygnus.com

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com



More information about the Cygwin mailing list