When cross compiling, AC_TRY_RUN should not be used. This patch fixes it
in a way that for a cross scenario the test can be overwritten on the
command line.

Signed-off-by: Robert Schwebel <r.schwe...@pengutronix.de>

---
 configure.in |   23 ++++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)

Index: Python-3.0/configure.in
===================================================================
--- Python-3.0.orig/configure.in
+++ Python-3.0/configure.in
@@ -2526,7 +2526,7 @@ no)
 esac
 
 AC_MSG_CHECKING(for lchflags)
-AC_TRY_RUN([
+AC_RUN_IFELSE([
 #include <sys/stat.h>
 #include <unistd.h>
 int main(int argc, char*argv[])
@@ -2535,10 +2535,27 @@ int main(int argc, char*argv[])
     return 1;
   return 0;
 }
-],AC_DEFINE(HAVE_LCHFLAGS, 1, Define to 1 if you have the `lchflags' function.)
-  AC_MSG_RESULT(yes),
+],[
+  AC_CACHE_VAL(ac_cv_have_lchflags, ac_cv_have_lchflags=yes)
+  AC_MSG_RESULT(yes)
+],[
+  AC_CACHE_VAL(ac_cv_have_lchflags, ac_cv_have_lchflags=no)
   AC_MSG_RESULT(no)
+],[
+  AC_CACHE_VAL(ac_cv_have_lchflags, ac_cv_have_lchflags=undef)
+  AC_MSG_RESULT([crosscompiling, ac_cv_have_lchflags=$ac_cv_have_lchflags])
+]
 )
+case $ac_cv_have_lchflags in
+yes)
+  AC_DEFINE(HAVE_LCHFLAGS, 1, Define to 1 if you have the 'lchflags' function.)
+  ;;
+no)
+  ;;
+*)
+  AC_MSG_ERROR([please specify ac_cv_have_lchflags=yes|no])
+  ;;
+esac
 
 dnl Check if system zlib has *Copy() functions
 dnl

-- 
Pengutronix e.K.                           | Dipl.-Ing. Robert Schwebel  |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to