summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane2007-09-21 02:33:46 +0000
committerTom Lane2007-09-21 02:33:46 +0000
commite5bc7e1116cad50c92c9d01c3c226c590d8825bf (patch)
tree81241916b84918cce138189f9e089d4accfa5e4b
parentf5368a8ecba3ef4edd7c6b3db7ede1dc350b0793 (diff)
If we're gonna provide an --enable-profiling configure option, surely
it ought to know that you need -DLINUX_PROFILE on Linux.
-rwxr-xr-xconfigure2
-rw-r--r--configure.in4
-rw-r--r--src/include/pg_config.h.in3
-rw-r--r--src/template/linux3
4 files changed, 8 insertions, 4 deletions
diff --git a/configure b/configure
index 930ee945be..5d502ddc46 100755
--- a/configure
+++ b/configure
@@ -3244,7 +3244,7 @@ cat >>confdefs.h <<\_ACEOF
#define PROFILE_PID_DIR 1
_ACEOF
- CFLAGS="$CFLAGS -pg"
+ CFLAGS="$CFLAGS -pg $PLATFORM_PROFILE_FLAGS"
else
{ { echo "$as_me:$LINENO: error: --enable-profiling is supported only when using GCC" >&5
echo "$as_me: error: --enable-profiling is supported only when using GCC" >&2;}
diff --git a/configure.in b/configure.in
index 1e442a26c6..4eae902352 100644
--- a/configure.in
+++ b/configure.in
@@ -307,8 +307,8 @@ fi
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"
+ [Define to 1 to allow profiling output to be saved separately for each process.])
+ CFLAGS="$CFLAGS -pg $PLATFORM_PROFILE_FLAGS"
else
AC_MSG_ERROR([--enable-profiling is supported only when using GCC])
fi
diff --git a/src/include/pg_config.h.in b/src/include/pg_config.h.in
index a0e451b0e0..0f58395376 100644
--- a/src/include/pg_config.h.in
+++ b/src/include/pg_config.h.in
@@ -617,7 +617,8 @@
/* A string containing the version number, platform, and C compiler */
#undef PG_VERSION_STR
-/* Define to 1 to enable profiling. (--enable-profiling) */
+/* Define to 1 to allow profiling output to be saved separately for each
+ process. */
#undef PROFILE_PID_DIR
/* Define to the necessary symbol if this constant uses a non-standard name on
diff --git a/src/template/linux b/src/template/linux
index 48e448716d..bbb0458383 100644
--- a/src/template/linux
+++ b/src/template/linux
@@ -2,3 +2,6 @@
# Force _GNU_SOURCE on; plperl is broken with Perl 5.8.0 otherwise
CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
+
+# If --enable-profiling is specified, we need -DLINUX_PROFILE
+PLATFORM_PROFILE_FLAGS="-DLINUX_PROFILE"