> I don't object to this change, but I noticed at least one problem that > prevents me from checking these programs in as replacements for the > scripts. In the scripts, we use lines like this : > ${VAR="val"} > to set VAR to "val" unless VAR is already set in the environment. > This way, you can override the default values with commands like this > CXXFLAGS="-ggdb3" mkoctfile foo.cc > (assuming a POSIX shell). I think it would be good to preserve this > capability.
The attached file does it (additionally, it also implemented dependency generation; I have now a cc-msvc that support dependency). Note that
I wouldn't replace the existing shell scripts (at least for a while), which
are is easier to develop and maintain anyway. This C++ version is really
only useful under Win32 with no shell available.
> Also, I would prefer to avoid duplicating the function that > substitutes OCTAVE_HOME (or other code that would be common to these > programs),
I'm not sure yet what's the best option to share this part. I wouldn't like to make those tools dependent on octinterp library.
> and I would prefer to have these programs also follow the > coding conventions of the rest of Octave.
I'm using VI with out-of-the-box settings. What are those coding conventions? Is it possible for you to easily reformat the code?