I have done most of the work now, changing the compilation toolchain to use lists of argument strings instead of strings. Doing this enables the System command line quoting mechanism to be applied transparently, relieving the toolchain from this task.
Its not quite finished. A couple of issue have raised ugly heads! 1. At first, my idea was that each argument should be passed "as is" to the executable named on the command line, and quoting was arranged to do that. In other words "as if exec() family function had been called". In particular "$" in an argument was quoted. Unfortunately Felix is doing env LD_LIBRARY_PATH=something:$LD_LIBRARY_PATH executable and quoting the $ here prevents this working. however NOT quoting it prevents $ occurring in filenames (for example). [The right way is probably to grab the environment variable inside flx] 2. Some arguments vary between VC++ and gcc in their style. For example executable name on link line: CL /FeExename ... gcc -o Exename ... noting that CL requires ONE argument, whereas gcc requires two. This is handled in the config by adding a space for the gcc style, however it means that manual quoting is required for that bit. 3. More generally the existing mechanism only works with some hacks and kludges. For example we "just" get away with particular ordering of arguments that works for both VC++ and gcc. So this refactoring is itself only transitional. The only correct way to do this is to use a dedicated function for each compiler-operation-os combination. Providing a set of such functions, ultimately also allowing plugins, reduces the complex configuration crap being done now to a simple choice. If none of the prebuilt choices work for you, you have to create a new one (probably in the litterbox repository). -- john skaller skal...@users.sourceforge.net http://felix-lang.org ------------------------------------------------------------------------------ Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the endpoint security space. For insight on selecting the right partner to tackle endpoint security challenges, access the full report. http://p.sf.net/sfu/symantec-dev2dev _______________________________________________ Felix-language mailing list Felix-language@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/felix-language