[gmime/gmime-2-4] simplified cross-compilation support



commit 76317209b37066f2ef4aeaa156a40fa14a17a208
Author: Jeffrey Stedfast <fejj gnome org>
Date:   Thu Jul 2 09:10:10 2009 -0400

    simplified cross-compilation support
    
    2009-07-02  Stanislav Brabec  <sbrabec sue cz>
    
    	* configure.in: Simplified configuring of gmime in a
    	cross-compilation environment. Make it possible to work-around
    	AC_TRY_RUN limitations by copying of target system iconv-detect.h
    	and setting ac_cv_have_iconv_detect_h=yes.

 ChangeLog    |    7 +++++++
 configure.in |   23 +++++++++++++++--------
 2 files changed, 22 insertions(+), 8 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 97094bc..34ee2af 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -444,6 +444,13 @@
 	* gmime/gmime-parser.c (parser_init): Initialize the headerbuf and
 	rawbuf buffers to something more reasonable.
 
+2009-07-02  Stanislav Brabec  <sbrabec sue cz>
+
+	* configure.in: Simplified configuring of gmime in a
+	cross-compilation environment. Make it possible to work-around
+	AC_TRY_RUN limitations by copying of target system iconv-detect.h
+	and setting ac_cv_have_iconv_detect_h=yes.
+
 2008-09-14  Jeffrey Stedfast  <fejj novell com>
 
 	* README: Bumped version
diff --git a/configure.in b/configure.in
index 2869a78..8bb0e74 100644
--- a/configure.in
+++ b/configure.in
@@ -181,14 +181,21 @@ CFLAGS="$CFLAGS -I$srcdir"
 LIBS_save="$LIBS"
 LIBS="$LIBS $LIBICONV"
 
-AC_MSG_CHECKING(preferred charset formats for system iconv)
-AC_TRY_RUN([
-#define CONFIGURE_IN
-#include "iconv-detect.c"
-],[
-	AC_MSG_RESULT(found)
+AC_CACHE_CHECK([preferred charset formats for system iconv], [ac_cv_have_iconv_detect_h], [
+	AC_RUN_IFELSE([AC_LANG_SOURCE([
+		#define CONFIGURE_IN
+		#include "iconv-detect.c"
+		])],
+	[ac_cv_have_iconv_detect_h=yes], [ac_cv_have_iconv_detect_h=no],
+	[
+		AC_MSG_RESULT([cannot run test program while cross compiling])
+		AC_MSG_ERROR([Please set ac_cv_have_iconv_detect_h to yes iconv-detect.h file.])
+	])
+])
+if test "x$ac_cv_have_iconv_detect_h" = xyes; then
+	AC_MSG_RESULT([found])
 	AC_DEFINE(HAVE_ICONV_DETECT_H, 1, [Define to 1 to use auto-detected iconv-friendly charset names.])
-],[
+else
 	AC_MSG_RESULT([not found
 	*** The iconv-detect program was unable to determine the
 	*** preferred charset formats recognized by your system
@@ -198,7 +205,7 @@ AC_TRY_RUN([
 	*** 
 	*** Default charset formats will be used.
 	])
-])
+fi
 
 CFLAGS="$CFLAGS_save"
 LIBS="$LIBS_save"



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]