[cairo] cross-compiling on Linux for Windows

mpsuzuki at hiroshima-u.ac.jp mpsuzuki at hiroshima-u.ac.jp
Sun Oct 11 00:19:09 PDT 2009


Hi,

Just I've written a preliminary addon to autotoolize
zlib-1.2.3.

It can be used as:

$ tar xfz zlib-1.2.3.tar.gz
$ lzma -cd < zlib-1.2.3_addon-skel.tar.lzma | tar xf-
$ cd zlib-1.2.3/gnu-auto
$ sh ./autogen.sh
$ ./configure --host=i586-mswin32msvc --build=i386-pc-linux-gnu

# To avoid overwriting the genuine configure of zlib,
# I dig a subdirectory zlib-1.2.3/gnu-auto, and
# everything goes there. Using & building with autotool
# should be executed in zlib-1.2.3/gnu-auto, not
# zlib-1.2.3.

I also attached modified building script and its output.
You can find that libz.dll.a is built without special
technique. Also libtool warning about the dependency
tracking info is not found.

To reduce the size of attachment, addon-skel.tar.lzma
includes only 2 skeltons: Makefile.am & configure.ac.in,
and a script autogen.sh to generate autotool scripts.
No ready-to-use configure is included. For the people
who don't believe libtoolize/aclocal/automake/autoconf
on their systems, I uploaded large tarball including
ready-to-use configure.

https://sourceforge.net/projects/ttf2ttc/files/zlib-1.2.3_addon.tar.lzma/download

It can be used as:

$ tar xfz zlib-1.2.3.tar.gz
$ lzma -cd < zlib-1.2.3_addon.tar.lzma | tar xf-
$ cd zlib-1.2.3/gnu-auto
$ ./configure --host=i586-mswin32msvc --build=i386-pc-linux-gnu

I wish you can build Win32 DLL of zlib.

Regards,
mpsuzuki

On Sat, 10 Oct 2009 18:25:33 +0900
mpsuzuki at hiroshima-u.ac.jp wrote:

>Hi,
>
>Maybe your script builds static zlib library (libz.a) directly,
>and libtool of libpng, pixman and cairo could not write info
>to track the shared library dependency into libpng.la,
>libpixman.la and libcairo.la. If I disable shared library when
>libpng is configured, the warnings you got will disappear. But,
>DLL of cairo is either disabled.
>
>To solve the problem, full GNU autotoolization of zlib is
>expected. In the case of Fedora Core, a patched win32/Makefile
>is used to build static & shared zlib, without GNU libtool.
>
>If anybody (in cairo list) knows the patch to autotoolize zlib,
>please let me know.
>
>Regards,
>mpsuzuki
>
>On Fri, 09 Oct 2009 19:03:00 +0400
>Kozhevnikov Mikhail <mikhailkozhevnikov at yandex.ru> wrote:
>
>>Hi suzuki,
>>
>>I've just tried cross-compiling windows binaries on Ubuntu with the script attached. It has built something, but libtool has given me some warnings:
>>
>>*** Warning: This system can not link to static lib archive /home/qnan/Desktop/test/out/libpng/lib/libpng12.la.
>>*** I have the capability to make that library automatically link in when
>>*** you link to this library. But I can only do this if you have a
>>*** shared version of the library, which you do not appear to have.
>>libtool: link: rm -fr .libs/libcairo.a .libs/libcairo.la .libs/libcairo.lai
>>
>>*** Warning: linker path does not have real file for library -lgdi32.
>>*** I have the capability to make that library automatically link in when
>>*** you link to this library. But I can only do this if you have a
>>*** shared version of the library, which you do not appear to have
>>*** because I did check the linker path looking for a file starting
>>*** with libgdi32 and none of the candidates passed a file format test
>>*** using a file magic. Last file checked: /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/lib//libgdi32.a
>>
>>*** Warning: linker path does not have real file for library -lmsimg32.
>>*** I have the capability to make that library automatically link in when
>>*** you link to this library. But I can only do this if you have a
>>*** shared version of the library, which you do not appear to have
>>*** because I did check the linker path looking for a file starting
>>*** with libmsimg32 and none of the candidates passed a file format test
>>*** using a file magic. Last file checked: /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/lib//libmsimg32.a
>>
>>*** Warning: linker path does not have real file for library -lz.
>>*** I have the capability to make that library automatically link in when
>>*** you link to this library. But I can only do this if you have a
>>*** shared version of the library, which you do not appear to have
>>*** because I did check the linker path looking for a file starting
>>*** with libz and none of the candidates passed a file format test
>>*** using a file magic. Last file checked: /home/qnan/Desktop/test/out/zlib/lib/libz.a
>>*** The inter-library dependencies that have been dropped here will be
>>*** automatically added whenever a program is linked with this library
>>*** or is declared to -dlopen it.
>>
>>*** Since this library must not contain undefined symbols,
>>*** because either the platform does not support them or
>>*** it was explicitly requested with -no-undefined,
>>*** libtool will only create a static version of it.
>>
>>I have no idea why could libtool not accept these libraries. It's clear that it does check the files built, though. I'll try further.
>>
>>There's also a trouble with pkg-config finding some libraries for which I only have Linux binaries installed. That is why all these --enable-xxx=no options in cairo configure.
>>
>>Best regards,
>>Mikhail. 
>>
>>09.10.09, 10:42, "suzuki toshiya" <mpsuzuki at hiroshima-u.ac.jp>:
>>
>>> Hi,
>>> Yet I've not tried to rebuild it, Fedora Core has
>>> mingw32-cairo package. According to its source rpm,
>>> the package is configured and built on GNU/Linux.
>>> http://rpmfind.net//linux/RPM/fedora/devel/src/mingw32-cairo-1.8.8-1.fc12.src.html
>>> Have you experience any troubles?
>>> Kozhevnikov Mikhail wrote (2009/10/09 15:28):
>>> > Hi All,
>>> > 
>>> > If anybody tried cross-compiling cairo Windows binaries on Linux?
>>> > 
>>> > Thanks,
>>> > Mikhail.
>>> > _______________________________________________
>>> > cairo mailing list
>>> > cairo at cairographics.org
>>> > http://lists.cairographics.org/mailman/listinfo/cairo
>_______________________________________________
>cairo mailing list
>cairo at cairographics.org
>http://lists.cairographics.org/mailman/listinfo/cairo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: zlib-1.2.3_addon-skel.tar.lzma
Type: application/octet-stream
Size: 2108 bytes
Desc: not available
Url : http://lists.cairographics.org/archives/cairo/attachments/20091011/7a1305a4/attachment-0003.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: build_mingw32.sh.lzma
Type: application/octet-stream
Size: 561 bytes
Desc: not available
Url : http://lists.cairographics.org/archives/cairo/attachments/20091011/7a1305a4/attachment-0004.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: build_mingw32.log.lzma
Type: application/octet-stream
Size: 18545 bytes
Desc: not available
Url : http://lists.cairographics.org/archives/cairo/attachments/20091011/7a1305a4/attachment-0005.obj 


More information about the cairo mailing list