Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2005:
[Freeciv-Dev] (PR#11927) cross-compiling libiconv for windows
Home

[Freeciv-Dev] (PR#11927) cross-compiling libiconv for windows

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#11927) cross-compiling libiconv for windows
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 14 Jan 2005 23:10:10 -0800
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=11927 >

I tried cross-compiling libiconv 1.9.1 on Debian/unstable 
(--build=i686-pc-linux-gnu) for Windows (--host=i586-mingw32msvc).

The documentation said this should work out of the box, but it didn't 
for me.  A few #includes were missing, without which some symbols (like 
WINAPI) were undefined.  The attached patch fixes this.

- windef.h and winbase.h were needed for those symbols.

- stdarg.h was needed for winbase.h (but this was only a warning).

- The AC_CHECK_HEADERS checks are so the .h includes are safe.

- When rerunning the auto* tools I got a warning about @ALLOCA@ so I 
included AC_FUNC_ALLOCA.  I think this is readly included somewhere in 
m4/*.m4 but it may be safer to include it directly.

BTW, I also tried compiling the libiconv from 
http://sourceforge.net/projects/gnuwin32.  However I had even more 
problems with their tarball (which was version 1.8-1).

-jason short

Index: configure.in
===================================================================
RCS file: /home/jdorje/CVSROOT/libiconv-1.9.1/configure.in,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- configure.in        15 Jan 2005 05:27:06 -0000      1.1.1.1
+++ configure.in        15 Jan 2005 06:40:18 -0000      1.2
@@ -83,7 +83,7 @@
 dnl           checks for header files
 
 AC_HEADER_STDC
-AC_CHECK_HEADERS([locale.h stddef.h stdlib.h string.h])
+AC_CHECK_HEADERS([locale.h stddef.h stdlib.h string.h windef.h winbase.h])
 
 dnl           checks for typedefs
 
@@ -98,6 +98,7 @@
 fi
 AC_SUBST(ICONV_CONST)
 
+AC_FUNC_ALLOCA
 AC_CHECK_FUNCS([getc_unlocked mbrtowc wcrtomb mbsinit setlocale])
 AC_REPLACE_FUNCS([memmove])
 
Index: lib/relocatable.c
===================================================================
RCS file: /home/jdorje/CVSROOT/libiconv-1.9.1/lib/relocatable.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- lib/relocatable.c   15 Jan 2005 05:27:12 -0000      1.1.1.1
+++ lib/relocatable.c   15 Jan 2005 06:40:18 -0000      1.2
@@ -55,6 +55,13 @@
 # include <libintl.h>
 #endif
 
+#ifdef HAVE_WINDEF_H
+# include <windef.h>
+#endif
+#ifdef HAVE_WINBASE_H
+# include <winbase.h>
+#endif
+
 /* Faked cheap 'bool'.  */
 #undef bool
 #undef false
Index: libcharset/lib/relocatable.c
===================================================================
RCS file: /home/jdorje/CVSROOT/libiconv-1.9.1/libcharset/lib/relocatable.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- libcharset/lib/relocatable.c        15 Jan 2005 05:27:12 -0000      1.1.1.1
+++ libcharset/lib/relocatable.c        15 Jan 2005 06:40:18 -0000      1.2
@@ -34,6 +34,7 @@
 
 #if ENABLE_RELOCATABLE
 
+#include <stdarg.h>
 #include <stddef.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -55,6 +56,13 @@
 # include <libintl.h>
 #endif
 
+#ifdef HAVE_WINDEF_H
+# include <windef.h>
+#endif
+#ifdef HAVE_WINBASE_H
+# include <winbase.h>
+#endif
+
 /* Faked cheap 'bool'.  */
 #undef bool
 #undef false

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#11927) cross-compiling libiconv for windows, Jason Short <=