summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authordoko@ubuntu.com <doko@ubuntu.com>2012-06-30 14:52:05 (GMT)
committerdoko@ubuntu.com <doko@ubuntu.com>2012-06-30 14:52:05 (GMT)
commitba01583eef8741deb837191aa2e58d860e756f41 (patch)
tree60a17da264c45521a5d4b7fe37b8ec1a84cf9b13 /configure.ac
parent51f6594054c9c35bad92a8c488692766a180cbdd (diff)
downloadcpython-ba01583eef8741deb837191aa2e58d860e756f41.zip
cpython-ba01583eef8741deb837191aa2e58d860e756f41.tar.gz
cpython-ba01583eef8741deb837191aa2e58d860e756f41.tar.bz2
- Issue #14324: use a linker test to check for profiling support
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac35
1 files changed, 18 insertions, 17 deletions
diff --git a/configure.ac b/configure.ac
index 16b20f9..60f8541 100644
--- a/configure.ac
+++ b/configure.ac
@@ -348,7 +348,7 @@ then
linux*) MACHDEP="linux";;
cygwin*) MACHDEP="cygwin";;
darwin*) MACHDEP="darwin";;
- irix646) MACHDEP="irix6";;
+ irix646) MACHDEP="irix6";;
'') MACHDEP="unknown";;
esac
fi
@@ -813,22 +813,23 @@ AC_MSG_RESULT($enable_shared)
AC_MSG_CHECKING(for --enable-profiling)
AC_ARG_ENABLE(profiling,
- AS_HELP_STRING([--enable-profiling], [enable C-level code profiling]),
-[ac_save_cc="$CC"
- CC="$CC -pg"
- AC_RUN_IFELSE([AC_LANG_SOURCE([[int main() { return 0; }]])],
- [ac_enable_profiling="yes"],
- [ac_enable_profiling="no"],
- [ac_enable_profiling="no"])
- CC="$ac_save_cc"])
-AC_MSG_RESULT($ac_enable_profiling)
-
-case "$ac_enable_profiling" in
- "yes")
- BASECFLAGS="-pg $BASECFLAGS"
- LDFLAGS="-pg $LDFLAGS"
- ;;
-esac
+ AS_HELP_STRING([--enable-profiling], [enable C-level code profiling]))
+if test "x$enable_profiling" = xyes; then
+ ac_save_cc="$CC"
+ CC="$(CC) -pg"
+ AC_LINK_IFELSE([AC_LANG_SOURCE([[int main() { return 0; }]])],
+ [],
+ [enable_profiling=no])
+ CC="$ac_save_cc"
+else
+ enable_profiling=no
+fi
+AC_MSG_RESULT($enable_profiling)
+
+if test "x$enable_profiling" = xyes; then
+ BASECFLAGS="-pg $BASECFLAGS"
+ LDFLAGS="-pg $LDFLAGS"
+fi
AC_MSG_CHECKING(LDLIBRARY)