automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: add '-pg' to compiler/linker


From: Steven Woody
Subject: Re: add '-pg' to compiler/linker
Date: Sat, 12 Nov 2005 14:04:05 +0800
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux)

Ralf Wildenhues <address@hidden> writes:

thank you Ralf. you solved the problem!

> 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
>
>
>

-- 
steven woody (id: narke)

Virginia Woolf: Someone has to die Leonard, in order that the rest of
us should value our life more.

        - The Hours (2002)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]