This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Supressing @path expansion


I'm wondering if there is a way to make a cygwin-compiled program always
receive its @pathname arguments unexpanded.  Here's my situation:

I'm working on the jikes compiler, a C++ program for compiling Java
files, with cygwin.dll 1.3.3 on Win98. I'm trying to make jikes a
drop-in replacement for Sun's javac, which has special rules for parsing
@files.  For example:

$ cat filelist
'A.java'B.java

Calling `javac @filelist' will compile both A.java and B.java, as if I
had called `javac A.java B.java' (javac is doing all the expansion,
since the executable is not compiled against cygwin).  However, when
calling `jikes @filelist' at a DOS prompt, cygwin pre-expands the
argument, so that jikes sees argv[1] == "'A.java'B.java" instead of
"@filelist".  At this point, execution fails because the file
'A.java'B.java does not exist.

I note that calling `jikes "@filelist"' on my patched version of jikes
does work, giving me argv[1] == "@filelist".  But this is not always an
option.

For example, part of the jikes test suite is written in Tcl, and relies
on the exec command of tcl 8.3 (not the cygwin release of 8.0, but the
Windows version available from a Tcl website).  In the Tcl exec command,
there is no way to pass the original argument un-expanded.  Calling
`exec jikes "@filelist"' gives argv[1] == "'A.java'B.java", while
calling `exec jikes {"@filelist"}' gives argv[1] == "\\@filelist\"" (I'm
not sure if that strange expansion is a bug in Tcl or cygwin).  Even
something like `exec jikes "{@filelist}"' is unacceptable, because
although it gives jikes argv[1] == "@filelist", it gives javac argv[1]
== "{@filelist}" (in other words, cygwin is also unwrapping {} as part
of argument pre-processing).

As a result, it is impossible for both jikes and javac to pass the test
suite, because I cannot determine a way to pass the raw @ argument to
the program.

Does anyone know a work around to this, or know of a way to supress the
command-line argument pre-processing that goes on in the cygwin API
before the main method of my program even starts up?

-- 
This signature intentionally left boring.

Eric Blake             ebb9@email.byu.edu
  BYU student, free software programmer

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]