summaryrefslogtreecommitdiffstats
path: root/patches/Python-2.6.6/0003-use-AC_COMPILE_IFELSE-rather-than-AC_TRY_RUN.patch
blob: c306d9231efca87acde041542d4e7aa089d8d807 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
From: Marc Kleine-Budde <mkl@pengutronix.de>
Date: Fri, 24 Apr 2009 18:35:19 +0200
Subject: [PATCH] use AC_COMPILE_IFELSE rather than AC_TRY_RUN

AC_TRY_RUN relys on executing the test, not working while cross
compiling. Thus a hard wired value for the cross compilation must and is
used.

Switching to AC_COMPILE_IFELSE just tries to compile the test program
which has the save effect and works even in the cross compiling
scenario.

This patch uses AC_COMPILE_IFELSE for these tests:
"--enable-profiling, enable C-level code profiling"
"whether $CC accepts -fno-strict-aliasing"
"whether $CC accepts -OPT:Olimit=0"
"whether $CC accepts -Olimit 1500"

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 configure.in |   12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/configure.in b/configure.in
index 87fad98..8d130b4 100644
--- a/configure.in
+++ b/configure.in
@@ -697,9 +697,8 @@ AC_ARG_ENABLE(profiling,
               AC_HELP_STRING(--enable-profiling, enable C-level code profiling),
 [ac_save_cc="$CC"
  CC="$CC -pg"
- AC_TRY_RUN([int main() { return 0; }],
+ AC_COMPILE_IFELSE([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)
@@ -922,9 +921,8 @@ yes)
     AC_MSG_CHECKING(whether $CC accepts -fno-strict-aliasing)
      ac_save_cc="$CC"
      CC="$CC -fno-strict-aliasing"
-     AC_TRY_RUN([int main() { return 0; }],
+     AC_COMPILE_IFELSE([int main() { return 0; }],
      ac_cv_no_strict_aliasing_ok=yes,
-     ac_cv_no_strict_aliasing_ok=no,
      ac_cv_no_strict_aliasing_ok=no)
      CC="$ac_save_cc"
     AC_MSG_RESULT($ac_cv_no_strict_aliasing_ok)
@@ -1093,9 +1091,8 @@ AC_MSG_CHECKING(whether $CC accepts -OPT:Olimit=0)
 AC_CACHE_VAL(ac_cv_opt_olimit_ok,
 [ac_save_cc="$CC"
 CC="$CC -OPT:Olimit=0"
-AC_TRY_RUN([int main() { return 0; }],
+AC_COMPILE_IFELSE([int main() { return 0; }],
   ac_cv_opt_olimit_ok=yes,
-  ac_cv_opt_olimit_ok=no,
   ac_cv_opt_olimit_ok=no)
 CC="$ac_save_cc"])
 AC_MSG_RESULT($ac_cv_opt_olimit_ok)
@@ -1115,9 +1112,8 @@ else
   AC_CACHE_VAL(ac_cv_olimit_ok,
   [ac_save_cc="$CC"
   CC="$CC -Olimit 1500"
-  AC_TRY_RUN([int main() { return 0; }],
+  AC_COMPILE_IFELSE([int main() { return 0; }],
     ac_cv_olimit_ok=yes,
-    ac_cv_olimit_ok=no,
     ac_cv_olimit_ok=no)
   CC="$ac_save_cc"])
   AC_MSG_RESULT($ac_cv_olimit_ok)