Skip to contentSkip to conversation

MinGW compilation shouldn't include -lglib-2.0 etc.

PATCH In review Kenneth Salerno 5 participants 7 messages Jul 27, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 MinGW compilation shouldn't include -lglib-2.0 etc.

Should check first if using a mingw compiler before forcing the addition of -lglib-2.0, -liconv, and -lintl to $LIBS of config-target.mak.

configure 2011-07-27 11:43:59.859375000 -0400 renamed from configure.ORIG 2011-07-27 11:28:16.859375000 -0400 +5 -3
@@ -1824,9 +1824,11 @@
 # glib support probe
 if $pkg_config --modversion glib-2.0 > /dev/null 2>&1 ; then
     glib_cflags=`$pkg_config --cflags glib-2.0 2>/dev/null`
-    glib_libs=`$pkg_config --libs glib-2.0 2>/dev/null`
-    libs_softmmu="$glib_libs $libs_softmmu"
-    libs_tools="$glib_libs $libs_tools"
+    if test "$mingw32" != "yes" ; then
+        glib_libs=`$pkg_config --libs glib-2.0 2>/dev/null`
+        libs_softmmu="$glib_libs $libs_softmmu"
+        libs_tools="$glib_libs $libs_tools"
+    fi
 else
     echo "glib-2.0 required to compile QEMU"
     exit 1

Regards,
Ken

#1 lore raw
Quoted 8 lines · Kenneth Salerno

Should check first if using a mingw compiler before forcing the addition of -lglib-2.0, -liconv, and -lintl to $LIBS of config-target.mak.

configure 2011-07-27 11:43:59.859375000 -0400 renamed from configure.ORIG 2011-07-27 11:28:16.859375000 -0400 +0 -0
@@ -1824,9 +1824,11 @@
 # glib support probe

configure 2011-07-27 11:43:59.859375000 -0400 line 1831

Quoted 10 lines
configure 2011-07-27 11:43:59.859375000 -0400 renamed from configure.ORIG 2011-07-27 11:28:16.859375000 -0400 +5 -3
 if $pkg_config --modversion glib-2.0 > /dev/null 2>&1 ; then
     glib_cflags=`$pkg_config --cflags glib-2.0 2>/dev/null`
-    glib_libs=`$pkg_config --libs glib-2.0 2>/dev/null`
-    libs_softmmu="$glib_libs $libs_softmmu"
-    libs_tools="$glib_libs $libs_tools"
+    if test "$mingw32" != "yes" ; then
+        glib_libs=`$pkg_config --libs glib-2.0 2>/dev/null`
+        libs_softmmu="$glib_libs $libs_softmmu"
+        libs_tools="$glib_libs $libs_tools"
+    fi

This doesn't feel right to me. pkg-config works for mingw32 and should be used just as it would be on native targets. What was the problem you actually had without this change ?

If I had to guess I'd say your pkg-config program was not configured to prefer mingw32 data files. You need to have an env var like this set to make it pick up mingw32 rules instead of native ones:

export PKG_CONFIG_LIBDIR="/usr/i686-pc-mingw32/sys-root/mingw/lib/pkgconfig:/usr/i686-pc-mingw32/sys-root/mingw/share/pkgconfig" pkg-config

Regards,
Daniel

Signature · 4 lines
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|
#2 lore raw
Quoted 49 lines · Daniel P. Berrange

From: Daniel P. Berrange <[email protected]>
Subject: Re: [Qemu-devel] [PATCH] MinGW compilation shouldn't include -lglib-2.0 etc.
To: "Kenneth Salerno" <[email protected]>
Cc: [email protected]
Date: Wednesday, July 27, 2011, 11:56 AM

Quoted 1 line · Kenneth Salerno

Should check first if using a mingw compiler before

forcing the addition of -lglib-2.0, -liconv, and -lintl to $LIBS of config-target.mak.

Quoted 4 lines

--- configure.ORIG      2011-07-27

11:28:16.859375000 -0400

Quoted 1 line

+++ configure   2011-07-27

11:43:59.859375000 -0400

Quoted 3 lines
configure 2011-07-27 11:43:59.859375000 -0400 renamed from configure.ORIG 2011-07-27 11:28:16.859375000 -0400 +0 -0
@@ -1824,9 +1824,11 @@
   # glib support probe

  if $pkg_config --modversion glib-2.0 >

/dev/null 2>&1 ; then

Quoted 1 line

      glib_cflags=`$pkg_config --cflags

glib-2.0 2>/dev/null`

Quoted 1 line

-    glib_libs=`$pkg_config --libs glib-2.0

2>/dev/null`

Quoted 1 line

-    libs_softmmu="$glib_libs

$libs_softmmu"

Quoted 3 lines

-    libs_tools="$glib_libs $libs_tools"
+    if test "$mingw32" != "yes" ; then
+        glib_libs=`$pkg_config

--libs glib-2.0 2>/dev/null`

Quoted 1 line

+        libs_softmmu="$glib_libs

$libs_softmmu"

Quoted 1 line

+        libs_tools="$glib_libs

$libs_tools"

Quoted 1 line

+    fi

This doesn't feel right to me. pkg-config works for mingw32 and should
be used just as it would be on native targets. What was the problem you
actually had without this change ?

If I had to guess I'd say your pkg-config program was not configured
to prefer mingw32 data files. You need to have an env var like this set
to make it pick up mingw32 rules instead of native ones:

Quoted 19 lines

export
PKG_CONFIG_LIBDIR="/usr/i686-pc-mingw32/sys-root/mingw/lib/pkgconfig:/usr/i686-pc-mingw32/sys-root/mingw/share/pkgconfig" pkg-config

Regards,
Daniel

Signature · 11 lines
|: http://berrange.com      -o- 
  http://www.flickr.com/photos/dberrange/
:|
|: http://libvirt.org         
    -o-         
   http://virt-manager.org :|
|: http://autobuild.org   
   -o-     
   http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org   
   -o-       http://live.gnome.org/gtk-vnc :|

I'll have to fall back to my old plan of compiling glib2 and gettext myself to install into prefix /usr/i686-pc-mingw32/sys-root/mingw (Cygwin doesn't distribute a MinGW version of glib2, and the one available on gtk.org gives me this error "cc1: warning: c:/devel/target/ea4ef54bcf881bcdd4139385601018a2/lib/glib-2.0/include: No such file or directory, but you are correct, I didn't need to modify qemu's 'configure').

Ken

#3 lore raw
Quoted 15 lines · Kenneth Salerno
Quoted 5 lines

--
|: http://berrange.com -o-
http://www.flickr.com/photos/dberrange/
:|
|: http://libvirt.org

Quoted 8 lines
     -o-
    http://virt-manager.org :|
|: http://autobuild.org
    -o-
    http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org
    -o-       http://live.gnome.org/gtk-vnc :|
Quoted 1 line

I'll have to fall back to my old plan of compiling glib2 and gettext myself to install into prefix /usr/i686-pc-mingw32/sys-root/mingw (Cygwin doesn't distribute a MinGW version of glib2, and the one available on gtk.org gives me this error "cc1: warning: c:/devel/target/ea4ef54bcf881bcdd4139385601018a2/lib/glib-2.0/include: No such file or directory, but you are correct, I didn't need to modify qemu's 'configure').

Fedora packages mingw packages including glib:

http://fedoraproject.org/wiki/MinGW

Regards,

Anthony Liguori

Quoted 2 lines

Ken

#4 lore raw
In reply to Kenneth Salerno

Am 27.07.2011 22:46, schrieb Kenneth Salerno:

Quoted 4 lines

I'll have to fall back to my old plan of compiling glib2 and gettext myself to install into prefix /usr/i686-pc-mingw32/sys-root/mingw (Cygwin doesn't distribute a MinGW version of glib2, and the one available on gtk.org gives me this error "cc1: warning: c:/devel/target/ea4ef54bcf881bcdd4139385601018a2/lib/glib-2.0/include: No such file or directory, but you are correct, I didn't need to modify qemu's 'configure').

Ken

You can fix the *.pc files (pkgconfig configuration) using your installation path instead of c:/devel/..., then the gtk.org distribution works (at least for me).

Cheers,
Stefan

#5 lore raw
Quoted 19 lines · Stefan Weil

From: Stefan Weil <[email protected]>
Subject: Re: [Qemu-devel] [PATCH] MinGW compilation shouldn't include -lglib-2.0 etc.
To: "Kenneth Salerno" <[email protected]>
Cc: [email protected]
Date: Wednesday, July 27, 2011, 5:13 PM
Am 27.07.2011 22:46, schrieb Kenneth
Salerno:

Quoted 1 line

I'll have to fall back to my old plan of compiling

glib2 and gettext myself to install into prefix /usr/i686-pc-mingw32/sys-root/mingw (Cygwin doesn't distribute a MinGW version of glib2, and the one available on gtk.org gives me this error "cc1: warning:
c:/devel/target/ea4ef54bcf881bcdd4139385601018a2/lib/glib-2.0/include:
No such file or directory, but you are correct, I didn't need to modify qemu's 'configure').

Quoted 3 lines

Ken

Quoted 10 lines

You can fix the *.pc files (pkgconfig configuration) using your
installation path instead of c:/devel/..., then the gtk.org
distribution works (at least for me).

Cheers,
Stefan

Yes, thank you! I had this exact same thought right after I sent my last message.

#6 lore raw
In reply to Kenneth Salerno
Quoted 1 line · Kenneth Salerno

c:/devel/target/ea4ef54bcf881bcdd4139385601018a2/lib/glib-2.0/include: No such file or directory

This happens if you're not using mingw's pkg-config (which automatically adjusts prefix) - you'll have to edit your .pc files.

Signature · 4 lines
< Jernej Simončič ><><><><>< http://eternallybored.org/ >

It's always the wrong time of the month.
       -- Astrology Law