aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rwxr-xr-xconfigure20
-rw-r--r--configure.in17
3 files changed, 39 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 26f5235ead..769f58c21b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2009-07-03 Dan Nicolaescu <[email protected]>
+
+ * configure.in (--enable-profiling): New option.
+
2009-06-27 Glenn Morris <[email protected]>
* configure: Restore netbsd on mips, mipsel, mipseb.
diff --git a/configure b/configure
index c528b611df..b850521aba 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"`
diff --git a/configure.in b/configure.in
index a1b02dced8..3bcd60b386 100644
--- a/configure.in
+++ b/configure.in
@@ -273,6 +273,19 @@ if test x$ac_gc_check_cons_list != x ; then
[Define this to check for errors in cons list.])
fi
+AC_ARG_ENABLE(profiling,
+[ --enable-profiling
+ Build emacs with profiling support.
+ This might not work on all platforms.],
+[ac_enable_profiling="${enableval}"],[])
+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
@@ -931,7 +944,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
@@ -939,6 +952,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"`