Hi Steven, * Steven Woody wrote on Thu, Nov 10, 2005 at 06:56:52PM CET: > i have a main.cpp in top directory and some modules in sub-directories. each > module compiled as a .a library and the main.cpp staticly linked with those > .a's. it work no problem for compile/link. > > but, now i want to add gprof capability to the resulting executable. so i add > '-pg' to _CXXFLAGS for each modules's Makefile.am as well as to the main > program's Makefile.am. automake reported no error and produced an > executable. but after i run the executable, there is no .out profile > generated. so i think '-pg' flag has not take effect.
Hmm. You should not have to modify any files at all for this. Just, in a new build directory, do ../source/configure CXXFLAGS=-pg make and you should be set. If you use more than one language, you may want to add CFLAGS=-pg as well. If that still doesn't work, maybe you should show a couple of compiler commands executed by make. Hmm, do you use libtool perchance? Then, you might make LDFLAGS=-Wc,-pg (this will be fixed in Libtool-1.5.22). Cheers, Ralf