cpython: 575efae8ec57 (original) (raw)
Mercurial > cpython
changeset 77869:575efae8ec57
- Issue #14324: use a linker test to check for profiling support [#14324]
doko@ubuntu.com | |
---|---|
date | Sat, 30 Jun 2012 16:52:05 +0200 |
parents | af15910d2ffb |
children | d158b0a78390 |
files | configure configure.ac |
diffstat | 2 files changed, 43 insertions(+), 44 deletions(-)[+] [-] configure 52 configure.ac 35 |
line wrap: on
line diff
--- a/configure +++ b/configure @@ -3211,7 +3211,7 @@ then linux*) MACHDEP="linux";; cygwin*) MACHDEP="cygwin";; darwin*) MACHDEP="darwin";;
irix646) MACHDEP="irix6";;[](#l1.7)
- irix646) MACHDEP="irix6";;
'') MACHDEP="unknown";;
esac
fi
@@ -5424,36 +5424,34 @@ fi
$as_echo_n "checking for --enable-profiling... " >&6; }
if test "${enable_profiling+set}" = set; then : Check whether --enable-profiling was given.
- enableval=$enable_profiling; ac_save_cc="$CC"
- CC="$CC -pg"
- if test "$cross_compiling" = yes; then :
- ac_enable_profiling="no" -else
- enableval=$enable_profiling; +fi + +if test "x$enable_profiling" = xyes; then
- ac_save_cc="$CC"
- CC="$(CC) -pg" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main() { return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then :
- ac_enable_profiling="yes" -else
- ac_enable_profiling="no" -fi -rm -f core .core core.conftest. gmon.out bb.out conftest$ac_exeext [](#l1.36)
- conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -
- CC="$ac_save_cc" -fi - -{ asecho"as_echo "asecho"as_me:${as_lineno-$LINENO}: result: $ac_enable_profiling" >&5 -$as_echo "$ac_enable_profiling" >&6; } - -case "$ac_enable_profiling" in
- "yes")
- BASECFLAGS="-pg $BASECFLAGS"
- LDFLAGS="-pg $LDFLAGS"
- ;;
-esac +if ac_fn_c_try_link "$LINENO"; then : + +else
- enable_profiling=no +fi +rm -f core conftest.err conftest.$ac_objext [](#l1.57)
- conftest$ac_exeext conftest.$ac_ext
- CC="$ac_save_cc" +else
- enable_profiling=no +fi +{ asecho"as_echo "asecho"as_me:${as_lineno-$LINENO}: result: $enable_profiling" >&5 +$as_echo "$enable_profiling" >&6; } + +if test "x$enable_profiling" = xyes; then
- BASECFLAGS="-pg $BASECFLAGS"
- LDFLAGS="-pg $LDFLAGS" +fi { asecho"as_echo "asecho"as_me:${as_lineno-$LINENO}: checking LDLIBRARY" >&5 $as_echo_n "checking LDLIBRARY... " >&6; }
--- a/configure.ac +++ b/configure.ac @@ -348,7 +348,7 @@ then linux*) MACHDEP="linux";; cygwin*) MACHDEP="cygwin";; darwin*) MACHDEP="darwin";;
irix646) MACHDEP="irix6";;[](#l2.7)
- 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]),[](#l2.16)
- 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"
- ;;
AS_HELP_STRING([--enable-profiling], [enable C-level code profiling]))[](#l2.32)
+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)