[gmime] simplified cross-compilation support



commit 0a06346c12199bda28c21745578a09472ca42ef3
Author: Jeffrey Stedfast <fejj gnome org>
Date:   Thu Jul 2 09:19:16 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    |    9 ++++++++-
 configure.ac |   23 +++++++++++++++--------
 2 files changed, 23 insertions(+), 9 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 9abe5df..961f6fa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+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.
+
 2009-05-07  Jeffrey Stedfast  <fejj novell com>
 
 	* gmime/gmime-stream-fs.c (stream_read): Removed gross hack.
@@ -11,7 +18,7 @@
 2009-05-02  Jeffrey Stedfast  <fejj novell com>
 
 	* gmime/gmime-stream-buffer.c (stream_seek_cache_read): Fixed a
-	64bit cleanlines issue.
+	64bit cleanliness issue.
 	(stream_seek_cache_read): Cap the max cache size to G_MAXSIZE.
 
 2009-04-30  Jeffrey Stedfast  <fejj novell com>
diff --git a/configure.ac b/configure.ac
index b79a475..b307f43 100644
--- a/configure.ac
+++ b/configure.ac
@@ -244,14 +244,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
@@ -261,7 +268,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]