Subject: bug#3707 closed by Dan Nicolaescu <[email-masked]> (Re: bug#3707: add a configure option to enable profiling)

From: [email-masked] (Emacs bug Tracking System)
Date: Fri, 03 Jul 2009 18:15:30 +0000

This is an automatic notification regarding your bug report
which was filed against the emacs package:

#3707: add a configure option to enable profiling

It has been closed by Dan Nicolaescu <[email-masked]>.

Their explanation is attached below along with your original report.
If this explanation is unsatisfactory and you have not received a
better one in a separate message then please contact Dan Nicolaescu <[email-masked]> by
replying to this email.

-- 
3707: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3707
Emacs Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#3707: add a configure option to enable profiling
From: Dan Nicolaescu <[email-masked]>
To: Stefan Monnier <[email-masked]>
Cc: [email-masked]
Date: Fri, 3 Jul 2009 06:20:13 -0700 (PDT)

Stefan Monnier <[email-masked]> writes:

  > > Building emacs with profiling support is not very straight forward at
  > > the moment.
  > > It would be better if we had a configure option to do it:
  > 
  > > ./configure --enable-profiling
  > > make
  > 
  > > Adding the configure flag can be done like this:
  > 
  > Looks good, please install,

Thanks.  Done.

Subject: add a configure option to enable profiling
From: Dan Nicolaescu <[email-masked]>
To: bug-gnu-emacs <[email-masked]>
Date: Sun, 28 Jun 2009 14:43:41 -0700 (PDT)

Building emacs with profiling support is not very straight forward at
the moment.
It would be better if we had a configure option to do it:

./configure --enable-profiling
make

Adding the configure flag can be done like this:

--- configure.in.~1.600.~       2009-06-26 18:46:22.000000000 -0700
+++ configure.in                2009-06-28 06:00:37.000000000 -0700
@@ -273,6 +273,18 @@ if test x$ac_gc_check_cons_list != x ; t
 [Define this to check for errors in cons list.])
 fi
 
+AC_ARG_ENABLE(profiling,
+[  --enable-profiling
+                 Build emacs with profiling support],
+[ac_enable_profiling="${enableval}"],[])
+if test x$ac_enable_profiling != x ; then
+   PROFILING_CFLAGS="-DPROFLING -pg"
+   PROFILING_LDFLAGS="-pg"
+else
+   PROFILING_CFLAGS=
+   PROFILING_LDFLAGS=
+fi
+
 #### Make srcdir absolute, if it isn't already.  It's important to
 #### avoid running the path through pwd unnecessarily, since pwd can
 #### give you automounter prefixes, which can go away.  We do all this

How can PROFILING_CFLAGS and PROFILING_LDFLAGS be added to the default
CFLAGS in the Makefile to enable "make" to just DTRT?