summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorDan Nicolaescu <dann@ics.uci.edu>2009-07-03 13:04:57 +0000
committerDan Nicolaescu <dann@ics.uci.edu>2009-07-03 13:04:57 +0000
commit3dbc66f7480f847c1f7caa109be083da682a3cf1 (patch)
treefdea3806be8cc10d220c578a948baf2ac36c747c /configure
parent57debc3e6c5de3ae40d117e0794d555bededa1f7 (diff)
downloademacs-3dbc66f7480f847c1f7caa109be083da682a3cf1.tar.gz
(--enable-profiling): New option.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure20
1 files changed, 19 insertions, 1 deletions
diff --git a/configure b/configure
index c528b611df0..b850521aba9 100755
--- a/configure
+++ b/configure
@@ -1352,6 +1352,9 @@ Optional Features:
Categories are: all,yes,no.
Flags are: stringbytes, stringoverrun, stringfreelist,
xmallocoverrun, conslist
+ --enable-profiling
+ Build emacs with profiling support.
+ This might not work on all platforms.
--disable-largefile omit support for large files
Optional Packages:
@@ -2286,6 +2289,19 @@ _ACEOF
fi
+# Check whether --enable-profiling was given.
+if test "${enable_profiling+set}" = set; then
+ enableval=$enable_profiling; ac_enable_profiling="${enableval}"
+fi
+
+if test x$ac_enable_profiling != x ; then
+ PROFILING_CFLAGS="-DPROFILING=1 -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
@@ -5599,7 +5615,7 @@ configure___ CFLAGS=C_DEBUG_SWITCH '${SPECIFIED_CFLAGS}'
/* Get the CFLAGS for real compilation. */
#ifdef __GNUC__
-configure___ REAL_CFLAGS=C_DEBUG_SWITCH C_OPTIMIZE_SWITCH C_WARNINGS_SWITCH '${SPECIFIED_CFLAGS}'
+configure___ REAL_CFLAGS=C_DEBUG_SWITCH C_OPTIMIZE_SWITCH C_WARNINGS_SWITCH ${PROFILING_CFLAGS} '${SPECIFIED_CFLAGS}'
#else
configure___ REAL_CFLAGS=C_DEBUG_SWITCH '${SPECIFIED_CFLAGS}'
#endif
@@ -5607,6 +5623,8 @@ configure___ REAL_CFLAGS=C_DEBUG_SWITCH '${SPECIFIED_CFLAGS}'
#endif /* not THIS_IS_CONFIGURE */
' > ${tempcname}
+LDFLAGS="${LDFLAGS} ${PROFILING_LDFLAGS}"
+
# The value of CPP is a quoted variable reference, so we need to do this
# to get its actual value...
CPP=`eval "echo $CPP"`