configure: use glib in glib pkg-config check.
PATCH 1/1 configure: use glib in glib pkg-config check.
Building against with a recent glib in a custom prefix fails because the gthread cflags in the pkg-config file do not have the correct path while the glib pc file does.
--- configure | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
configure +3 -3
@@ -2343,9 +2343,9 @@ if test "$mingw32" = yes; then else glib_req_ver=2.12 fi -if $pkg_config --atleast-version=$glib_req_ver gthread-2.0; then - glib_cflags=`$pkg_config --cflags gthread-2.0` - glib_libs=`$pkg_config --libs gthread-2.0` +if $pkg_config --atleast-version=$glib_req_ver glib-2.0; then + glib_cflags=`$pkg_config --cflags glib-2.0` + glib_libs=`$pkg_config --libs glib-2.0` LIBS="$glib_libs $LIBS" libs_qga="$glib_libs $libs_qga" else
Signature · 1 line
1.8.3.4 (Apple Git-47)
Quoted 16 lines · Chris Johns
Building against with a recent glib in a custom prefix fails because the gthread cflags in the pkg-config file do not have the correct path while the glib pc file does.
Signed-off-by Chris Johns <[email protected]>--- configure | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)configure +0
-0@@ -2343,9 +2343,9 @@ if test "$mingw32" = yes; then else glib_req_ver=2.12
configure if test "$mingw32" = yes; then · line 2351
Quoted 10 lines
configure +3
-3fi -if $pkg_config --atleast-version=$glib_req_ver gthread-2.0; then - glib_cflags=`$pkg_config --cflags gthread-2.0` - glib_libs=`$pkg_config --libs gthread-2.0` +if $pkg_config --atleast-version=$glib_req_ver glib-2.0; then + glib_cflags=`$pkg_config --cflags glib-2.0` + glib_libs=`$pkg_config --libs glib-2.0` LIBS="$glib_libs $LIBS" libs_qga="$glib_libs $libs_qga" else
This change will cause -pthread linker + compiler flag to be lost.
What glib version are you seeing a problem with ? It seems we should really fix glib, since this will affect countless 1000's of apps using it, not try to workaround in all downstream apps.
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 :|
Quoted 21 lines · Daniel P. Berrange
Quoted 20 lines · Chris Johns
Building against with a recent glib in a custom prefix fails because the gthread cflags in the pkg-config file do not have the correct path while the glib pc file does.
Signed-off-by Chris Johns <[email protected]>--- configure | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)configure +0
-3@@ -2343,9 +2343,9 @@ if test "$mingw32" = yes; then else glib_req_ver=2.12 fi -if $pkg_config --atleast-version=$glib_req_ver gthread-2.0; then - glib_cflags=`$pkg_config --cflags gthread-2.0` - glib_libs=`$pkg_config --libs gthread-2.0`
Quoted 9 lines
configure if test "$mingw32" = yes; then · line 2351
Quoted 6 lines
configure +3
-0+if $pkg_config --atleast-version=$glib_req_ver glib-2.0; then + glib_cflags=`$pkg_config --cflags glib-2.0` + glib_libs=`$pkg_config --libs glib-2.0` LIBS="$glib_libs $LIBS" libs_qga="$glib_libs $libs_qga" elseThis change will cause -pthread linker + compiler flag to be lost.
I see in gthread-2.0.pc ..
Libs: -L${libdir} -lgthread-2.0
Cflags: -D_REENTRANT
and qemu includes 'glib.h'. Without the glib pc flags being used the build fails not being able to find 'glib.h'.
I have no idea about the relationship this has with -pthread. Are both needed ? It is not a problem on darwin. Qemu is building and running the RTEMS testsuite nicely on the arm architecture (with the posted zync reset patch).
Quoted 2 lines
What glib version are you seeing a problem with ?
glib-2.39.3 on darwin 13.0.2 (Mavrick).
Quoted 3 lines
It seems we should
really fix glib, since this will affect countless 1000's of apps using it, not try to workaround in all downstream apps.
This is outside of my field of view; to me it still looks qemu specific.
Chris
Quoted 6 lines · Chris Johns
Quoted 2 lines · Daniel P. Berrange
This change will cause -pthread linker + compiler flag to be lost.
I see in gthread-2.0.pc ..
Quoted 8 lines
Libs: -L${libdir} -lgthread-2.0
Cflags: -D_REENTRANTand qemu includes '
glib.h'. Without the glib pc flags being used the build fails not being able to find 'glib.h'.I have no idea about the relationship this has with -pthread. Are both needed ? It is not a problem on darwin.
If you're going to make changes to configure it would be wiser to test them also on Linux. Darwin is a bit of an outlier as far as QEMU goes.
In particular, the reason you're not noticing a problem:
manooth$ pkg-config --cflags gthread-2.0
-I/sw/include/glib-2.0 -I/sw/lib/glib-2.0/include
because on MacOSX we don't need any special flags for threading. However on Linux it's the gthread-2.0 cflags that add -pthread:
pm215@canth:/tmp$ pkg-config --cflags gthread-2.0 -pthread -I/usr/include/glib-2.0 -I/usr/lib/i386-linux-gnu/glib-2.0/include
because we do need special flags, and you've just dropped those.
Incidentally, on my Mountain Lion system:
manooth$ pkg-config --cflags glib-2.0
-I/sw/include/glib-2.0 -I/sw/lib/glib-2.0/include
and you can see that both gthread-2.0 and glib-2.0 give the same set of includes.
(that's some random glib, I think 2.0.25, from fink packages.)
Quoted 4 lines
Quoted 1 line
What glib version are you seeing a problem with ?
glib-2.39.3 on darwin 13.0.2 (Mavrick).
Do Apple provide that with the system these days, or have you installed that from some third-party (if so, who?)
Anyway, I notice from the glib documentation that the docs for glib 2.30:
https://developer.gnome.org/glib/2.30/glib-compiling.html
talk about using pkg-config gthread-2.0, but the docs for 2.32 and later:
https://developer.gnome.org/glib/2.32/glib-compiling.html
don't any more. Is this the glib devs inflicting random churn on everybody's build scripts?
Do you get the same version number from 'pkg-config --version gthread-2.0' as you do from 'pkg-config --version glib-2.0' or is the gthread pkg info you have an old stale version, maybe?
thanks
-- PMM
Quoted 37 lines · Chris Johns
Quoted 21 lines · Daniel P. Berrange
Quoted 20 lines · Chris Johns
Building against with a recent glib in a custom prefix fails because the gthread cflags in the pkg-config file do not have the correct path while the glib pc file does.
Signed-off-by Chris Johns <[email protected]>--- configure | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)configure +0
-3@@ -2343,9 +2343,9 @@ if test "$mingw32" = yes; then else glib_req_ver=2.12 fi -if $pkg_config --atleast-version=$glib_req_ver gthread-2.0; then - glib_cflags=`$pkg_config --cflags gthread-2.0` - glib_libs=`$pkg_config --libs gthread-2.0`Quoted 9 lines
configure if test "$mingw32" = yes; then · line 2351
Quoted 6 lines
configure +3
-0+if $pkg_config --atleast-version=$glib_req_ver glib-2.0; then + glib_cflags=`$pkg_config --cflags glib-2.0` + glib_libs=`$pkg_config --libs glib-2.0` LIBS="$glib_libs $LIBS" libs_qga="$glib_libs $libs_qga" elseThis change will cause -pthread linker + compiler flag to be lost.
I see in gthread-2.0.pc ..
Libs: -L${libdir} -lgthread-2.0
Cflags: -D_REENTRANT
Quoted 7 lines
and qemu includes '
glib.h'. Without the glib pc flags being used the build fails not being able to find 'glib.h'.I have no idea about the relationship this has with -pthread. Are both needed ? It is not a problem on darwin. Qemu is building and running the RTEMS testsuite nicely on the arm architecture (with the posted zync reset patch).
On Linux there are more flags present in gthread-2.0.pc that are not present in glib-2.0.pc:
Name: GThread
Description: Thread support for GLib
Requires: glib-2.0
Version: 2.38.2
Libs: -L${libdir} -lgthread-2.0 -pthread
Cflags: -pthread
The 'Requires: glib-2.0' line there means that when QEMU asking for flags for 'gthread-2.0', it will *also* get any flags listed in the 'glib-2.0.pc' file.
Quoted 10 lines
Quoted 2 lines
What glib version are you seeing a problem with ?
glib-2.39.3 on darwin 13.0.2 (Mavrick).
Quoted 3 lines
It seems we should
really fix glib, since this will affect countless 1000's of apps using it, not try to workaround in all downstream apps.This is outside of my field of view; to me it still looks qemu specific.
I don't believe so. What QEMU is currently doing is correct so I believe this is either a darwin specific glib bug or a flawed build of glib on darwin.
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 :|
Quoted 12 lines · Daniel P. Berrange
On Linux there are more flags present in gthread-2.0.pc that are not present in glib-2.0.pc:
Name: GThread Description: Thread support for GLib Requires: glib-2.0 Version: 2.38.2 Libs: -L${libdir} -lgthread-2.0 -pthread Cflags: -pthread
Quoted 4 lines
The 'Requires: glib-2.0' line there means that when QEMU asking for flags for 'gthread-2.0', it will *also* get any flags listed in the 'glib-2.0.pc' file.
Ah yes this is correct. I will take a closer look. Thanks for this.
Quoted 9 lines
Quoted 9 lines
Quoted 2 lines
What glib version are you seeing a problem with ?
glib-2.39.3 on darwin 13.0.2 (Mavrick).
Quoted 3 lines
It seems we should
really fix glib, since this will affect countless 1000's of apps using it, not try to workaround in all downstream apps.
Quoted 6 lines
Quoted 1 line
This is outside of my field of view; to me it still looks qemu specific.
I don't believe so. What QEMU is currently doing is correct so I believe this is either a darwin specific glib bug or a flawed build of glib on darwin.
Yes I agree.
Chris