<div class="gmail_quote">On Sat, Aug 6, 2011 at 12:08 AM, Alex Villací­s Lasso <span dir="ltr">&lt;<a href="mailto:a_villacis@palosanto.com">a_villacis@palosanto.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

El 02/08/11 17:38, Octavian Voicu escribió:<div class="im"><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
When building a 32-bit wine in a 64-bit build environment with<br>
default glib headers (gstreamer uses glib.h), glib 64-bit types<br>
(such as gint64 and guint64) are not properly defined, causing<br>
many compiler warnings and most likely a broken winegstreamer.dll.<br>
<br>
Although both gstreamer and glib are included in the ia32-libs<br>
package (on Ubuntu, and possibly others), the lack of a proper<br>
glibconfig.h makes the gstreamer headers unusable for 32-bit<br>
builds.<br>
</blockquote></div>
My build system is a Fedora 14 x86_64, and I am affected by this.<br>
<br>
What is really happening is that, on my 64-bit system, both glib2-devel.i686 and glib2-devel.x86_64 are installed:<br>
<br>
[alex@srv64 wine-build]$ rpm -qf /usr/lib64/glib-2.0/include/<u></u>glibconfig.h<br>
glib2-devel-2.26.0-2.fc14.x86_<u></u>64<br>
[alex@srv64 wine-build]$ rpm -qf /usr/lib/glib-2.0/include/<u></u>glibconfig.h<br>
glib2-devel-2.26.0-2.fc14.i686<br>
[alex@srv64 wine-build]$<br>
<br>
Instead of shipping a single header file that uses compiler or preprocessor defines, like /usr/include/stdint.h, glib2 ships two include files, one for each architecture. The pkg-config --cflags option does not handle the concept of an architecture-dependent include file correctly (or at all), so it ends up reporting the 64-bit header even for the 32-bit build. The 32-bit header defined gint64 as signed long long, but it is defined as signed long in the 64 bit header. Therefore the bug.<br>

</blockquote><div><br></div><div>Hello,</div><div><br></div><div>Ubuntu also has multiarch support, but it&#39;s not enabled by default so I guess it&#39;s not that widespread yet (and the legacy ia32-libs is still a dependency in many places). But this would be the proper way, having separate architecture-dependent include files like you have. I guess that can be made to work on latest Ubuntu also, but it&#39;s not that easy as an `apt-get install`.</div>

<div><br></div><div>Problem is, like you noticed, tools like pkg-config don&#39;t have proper support for multiarch yet.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

A workaround I am testing is to force PKG_CONFIG_PATH to the 32-bit directory for the configure and make steps:<br>
<br>
[alex@srv64 wine-build]$ pkg-config --cflags gstreamer-app-0.10<br>
-pthread -I/usr/include/gstreamer-0.10 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/libxml2<br>
[alex@srv64 wine-build]$ PKG_CONFIG_PATH=/usr/lib/<u></u>pkgconfig pkg-config --cflags gstreamer-app-0.10<br>
-pthread -I/usr/include/gstreamer-0.10 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libxml2<br>
[alex@srv64 wine-build]$<br>

<br>
Is there any standard/known way of automating this?<br>
</blockquote></div><br>I guess you could specify your own PKG_CONFIG_PATH when running configure, like this (which is probably what you do already):<div><br></div><div>PKG_CONFIG_PATH=/usr/lib/<u></u>pkgconfig ./configure<br clear="all">

<br>A proper fix would be a patch to <a href="http://configure.ac">configure.ac</a> to detect the correct PKG_CONFIG_PATH for the target architecture. There is also a proposed change [1] to pkgconfig to allow you to specify the host system type for cross-compiles, but I&#39;m not sure what the status of that is.</div>

<div><br>Octavian</div><div><br>
</div>