From: Grzegorz J. <ja...@ac...> - 2004-10-18 13:12:03
|
Marc, Sorry for late response. This is a valid path, would you find time to apply it? If so, pls. send me you SF.net userid. Best regards Grzegorz Marc Waeckerlin wrote: > The following problem(s): > > - I built a compiler that should insert tracing information > into methods (function trace). The name is: trace > > - To compile my programs, I call: > ./trace -- -o xxx xxx.cxx > > - Now, my tracer needs the inclusion of file fntracer.hxx. > So I compile with: > ./trace -d-include -dfntrace.hxx -- -o xxx xxx.cxx > > Problem: > > The option "-include fntrace.hxx" is not passed to the > preprocessor. If I call ./trace -DX -- -o xxx xxx.cxx, this > is also not passed to the preprocessor, nor is any other > option, as -I and so on. > > Solution: > > One possible solution: Apply my patch. > > My patch does the following: > > - Add a method to get the CC options to > OpencxxConfiguration > > - In file driver2.cc method RunPreprocessor, inserts the CC > options after argv.push_back(compiler) > > That's it. > > You can find my code in "opencxx-problem.tar.gz". There will > follow more mails on that subject later in this mailing > list... > > Please fix this problem for the next release. > > Thank's > Marc > > > ------------------------------------------------------------------------ > > diff -ur opencxx-2.8/opencxx/driver2.cc opencxx-patched/opencxx/driver2.cc > --- opencxx-2.8/opencxx/driver2.cc 2004-08-10 09:48:05.000000000 +0200 > +++ opencxx-patched/opencxx/driver2.cc 2004-10-14 14:49:27.870216699 +0200 > @@ -241,9 +241,11 @@ > string compiler = config.CompilerCommand(); > > vector<string> argv; > - > + > argv.push_back(compiler); > > + argv.insert(argv.end(), config.CppOptions().begin(), config.CppOptions().end()); > + > if(config.RecognizeOccExtensions()) > argv.push_back("-D__opencxx"); > > diff -ur opencxx-2.8/opencxx/MetacompilerConfiguration.h opencxx-patched/opencxx/MetacompilerConfiguration.h > --- opencxx-2.8/opencxx/MetacompilerConfiguration.h 2004-08-10 09:48:05.000000000 +0200 > +++ opencxx-patched/opencxx/MetacompilerConfiguration.h 2004-10-14 14:42:21.060422444 +0200 > @@ -20,6 +20,7 @@ > #include <opencxx/defs.h> > #include <string> > #include <memory> > +#include <vector> > > namespace Opencxx > { > @@ -95,7 +96,7 @@ > virtual Opencxx::ErrorLog& ErrorLog() const = 0; > > virtual Iterator CcOptions() const = 0; > - > + virtual const std::vector<std::string>& CppOptions() const = 0; > virtual Iterator Metaclasses() const = 0; > }; > > diff -ur opencxx-2.8/opencxx/OpencxxConfiguration.h opencxx-patched/opencxx/OpencxxConfiguration.h > --- opencxx-2.8/opencxx/OpencxxConfiguration.h 2004-08-10 09:48:05.000000000 +0200 > +++ opencxx-patched/opencxx/OpencxxConfiguration.h 2004-10-14 14:42:32.511592506 +0200 > @@ -117,6 +117,9 @@ > { > cc2Options_.push_back(option); > } > + const std::vector<std::string>& CppOptions() const { > + return cc2Options_; > + } > void SetDoPreprocess(bool v) { doPreprocess_ = v; } > bool DoPreprocess() const { return doPreprocess_; } > |