Hello Shizheng, please don't top-post, thank you.
* isulsz wrote on Tue, Apr 13, 2010 at 05:02:09AM CEST: > I have another question regarding to the flag of the g++ compiler. I want to > debug the code carefully so I want to add -O0 option to the g++ so that it > will not optimize the code. Here is what I am doing now. I use > ./configure CXXFLAGS = '-g -O0' > > It works. I am just wondering if it is the commonly used method. Yes. The user of your code (the one running configure) is supposed to be able to override the developer (the one writing Makefile.am), because the developer cannot know of all system-specific issues. Typically, you can use multiple build trees together with one source tree, e.g., you can have one debug tree where you .../path/to/configure CXXFLAGS=-g and a tree with optimized code, a profiling tree, etc. See 'info Automake "VPATH Builds"' for more information; the whole chapter around that is helpful, too. Cheers, Ralf