aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/libgmime/files/configure-cross.patch
blob: 3b63d0b2e947daa77a066d969e83f8d8fb772c0d (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
Index: gmime-2.2.23/configure.in
===================================================================
--- gmime-2.2.23.orig/configure.in	2008-09-14 15:28:35.000000000 +0000
+++ gmime-2.2.23/configure.in	2009-06-30 20:36:00.000000000 +0000
@@ -169,14 +169,21 @@
 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
@@ -186,7 +193,7 @@
 	*** 
 	*** Default charset formats will be used.
 	])
-])
+fi
 
 CFLAGS="$CFLAGS_save"
 LIBS="$LIBS_save"