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

[Freeciv-Dev] (PR#11930) cross-compiling gettext for windows

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#11930) cross-compiling gettext for windows
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 15 Jan 2005 01:31:58 -0800
Reply-to: bugs@xxxxxxxxxxx

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

I tried cross-compiling gettext 0.14.1 on Debian/unstable
(--build=i686-pc-linux-gnu) for Windows (--host=i586-mingw32msvc).  I'm 
using the mingw included in Debian.

It came very close to working out of the box.  The only problem was that 
a crucial library needs to be linked to by libgettextlib - otherwise the 
mbrtowc() function is undefined.

The attached patch checks in configure for a mingw build and links to 
libmsvcp60 (yes, libmsvcp60 - this is the only library included in mingw 
that references this symbol) if mingw is being used.  This shouldn't 
break anything and allows cross-compilation using mingw.  There may be a 
better check however.

(Actually the AC_CHECK_LIB function is a duplicate of the $host_os 
check, since they both set the same thing.  I left the AC_CHECK_LIB part 
in by mistake...it should compile without but I haven't tested this. 
The problem is the AC_CHECK_LIB check doesn't find the library, although 
you'd think it would (a problem I commonly find while cross-compiling). 
  That's why the $host_os check is done.  Of course the $host_os check 
must come after AC_CANONICAL_HOST which is up above.)

-jason short

Index: gettext-tools/configure.ac
===================================================================
RCS file: /home/jdorje/CVSROOT/gettext-0.14.1/gettext-tools/configure.ac,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 configure.ac
--- gettext-tools/configure.ac  15 Jan 2005 07:33:50 -0000      1.1.1.1
+++ gettext-tools/configure.ac  15 Jan 2005 08:30:32 -0000
@@ -98,6 +98,11 @@
 AC_RELOCATABLE
 
 dnl Checks for libraries.
+AC_CHECK_LIB(msvcp60, mbswidth, LTLIBMBS="-lmsvcp60")
+case $host_os in
+  *mingw32* ) LTLIBMBS="-lmsvcp60";;
+esac
+AC_SUBST(LTLIBMBS)
 
 dnl Checks for header files.
 AC_HEADER_STDC
Index: gettext-tools/lib/Makefile.am
===================================================================
RCS file: /home/jdorje/CVSROOT/gettext-0.14.1/gettext-tools/lib/Makefile.am,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 Makefile.am
--- gettext-tools/lib/Makefile.am       15 Jan 2005 07:33:53 -0000      1.1.1.1
+++ gettext-tools/lib/Makefile.am       15 Jan 2005 07:38:57 -0000
@@ -116,7 +116,7 @@
 # Need @LTLIBICONV@ because linebreak.c uses iconv().
 libgettextlib_la_LDFLAGS = \
   -release @VERSION@ \
-  @LTLIBINTL@ @LTLIBICONV@ -lc -no-undefined
+  @LTLIBINTL@ @LTLIBICONV@ @LTLIBMBS@ -lc -no-undefined
 
 # No need to install libgettextlib.a.
 install-exec-local: install-libLTLIBRARIES install-exec-clean

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