summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authorBruce Momjian2007-02-21 15:12:39 +0000
committerBruce Momjian2007-02-21 15:12:39 +0000
commit6765df9174a45f3306b1e20f8472c6eedbf24341 (patch)
tree7d8f140ee911e160f1741e5abbaaa162526458b0 /configure.in
parent879caf13693031f32ec050966cd20bf72b535adb (diff)
Add configure --enable-profiling to enable GCC profiling. Patches from
Korry Douglas and Nikhil S
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in20
1 files changed, 19 insertions, 1 deletions
diff --git a/configure.in b/configure.in
index c927bccc5db..e5d72eb1d30 100644
--- a/configure.in
+++ b/configure.in
@@ -1,5 +1,5 @@
dnl Process this file with autoconf to produce a configure script.
-dnl $PostgreSQL: pgsql/configure.in,v 1.501 2007/02/07 00:28:54 petere Exp $
+dnl $PostgreSQL: pgsql/configure.in,v 1.502 2007/02/21 15:12:39 momjian Exp $
dnl
dnl Developers, please strive to achieve this order:
dnl
@@ -206,6 +206,13 @@ PGAC_ARG_BOOL(enable, debug, no,
AC_SUBST(enable_debug)
#
+# --enable-profiling enables gcc profiling
+#
+PGAC_ARG_BOOL(enable, profiling, no,
+ [ --enable-profiling build with profiling enabled ])
+AC_SUBST(enable_profiling)
+
+#
# DTrace
#
PGAC_ARG_BOOL(enable, dtrace, no,
@@ -297,6 +304,17 @@ if test "$enable_debug" = yes && test "$ac_cv_prog_cc_g" = yes; then
CFLAGS="$CFLAGS -g"
fi
+# enable profiling if --enable-profiling
+if test "$enable_profiling" = yes && test "$ac_cv_prog_cc_g" = yes; then
+ if test "$GCC" = yes; then
+ AC_DEFINE([PROFILE_PID_DIR], 1,
+ [Define to 1 to enable profiling. (--enable-profiling)])
+ CFLAGS="$CFLAGS -pg"
+ else
+ AC_MSG_ERROR([--enable-profiling is supported only when using GCC])
+ fi
+fi
+
AC_MSG_NOTICE([using CFLAGS=$CFLAGS])
# We already have this in Makefile.win32, but configure needs it too