* [Qemu-devel] [PATCH] Allow the use of X11 from a non standard location.
@ 2015-01-09 19:08 Jeremy White
2015-01-09 22:44 ` Paolo Bonzini
0 siblings, 1 reply; 2+ messages in thread
From: Jeremy White @ 2015-01-09 19:08 UTC (permalink / raw)
To: qemu-devel
Signed-off-by: Jeremy White <jwhite@codeweavers.com>
---
configure | 24 +++++++++++++++++++-----
hw/display/Makefile.objs | 1 +
2 files changed, 20 insertions(+), 5 deletions(-)
diff --git a/configure b/configure
index cae588c..6c698ed 100755
--- a/configure
+++ b/configure
@@ -2034,6 +2034,15 @@ if test "$sparse" != "no" ; then
fi
##########################################
+# X11 probe
+x11_cflags=
+x11_libs=-lX11
+if $pkg_config --exists "x11"; then
+ x11_cflags=`$pkg_config --cflags x11`
+ x11_libs=`$pkg_config --libs x11`
+fi
+
+##########################################
# GTK probe
if test "$gtkabi" = ""; then
@@ -2060,7 +2069,8 @@ if test "$gtk" != "no"; then
gtk_cflags=`$pkg_config --cflags $gtkpackage`
gtk_libs=`$pkg_config --libs $gtkpackage`
if $pkg_config --exists "$gtkx11package >= $gtkversion"; then
- gtk_libs="$gtk_libs -lX11"
+ gtk_cflags="$gtk_cflags $x11_cflags"
+ gtk_libs="$gtk_libs $x11_libs"
fi
libs_softmmu="$gtk_libs $libs_softmmu"
gtk="yes"
@@ -2185,8 +2195,9 @@ if test "$sdl" = "yes" ; then
#endif
int main(void) { return 0; }
EOF
- if compile_prog "$sdl_cflags" "$sdl_libs" ; then
- sdl_libs="$sdl_libs -lX11"
+ if compile_prog "$sdl_cflags $x11_cflags" "$sdl_libs $x11_libs" ; then
+ sdl_cflags="$sdl_cflags $x11_cflags"
+ sdl_libs="$sdl_libs $x11_libs"
fi
libs_softmmu="$sdl_libs $libs_softmmu"
fi
@@ -3058,19 +3069,21 @@ libs_softmmu="$libs_softmmu $fdt_libs"
##########################################
# GLX probe, used by milkymist-tmu2
if test "$glx" != "no" ; then
- glx_libs="-lGL -lX11"
+ glx_cflags="$x11_cflags"
+ glx_libs="-lGL $x11_libs"
cat > $TMPC << EOF
#include <X11/Xlib.h>
#include <GL/gl.h>
#include <GL/glx.h>
int main(void) { glBegin(0); glXQueryVersion(0,0,0); return 0; }
EOF
- if compile_prog "" "-lGL -lX11" ; then
+ if compile_prog "$glx_cflags" "$glx_libs" ; then
glx=yes
else
if test "$glx" = "yes" ; then
feature_not_found "glx" "Install GL devel (e.g. MESA)"
fi
+ glx_cflags=
glx_libs=
glx=no
fi
@@ -4684,6 +4697,7 @@ fi
if test "$glx" = "yes" ; then
echo "CONFIG_GLX=y" >> $config_host_mak
+ echo "GLX_CFLAGS=$glx_cflags" >> $config_host_mak
echo "GLX_LIBS=$glx_libs" >> $config_host_mak
fi
diff --git a/hw/display/Makefile.objs b/hw/display/Makefile.objs
index 7ed76a9..11235a4 100644
--- a/hw/display/Makefile.objs
+++ b/hw/display/Makefile.objs
@@ -20,6 +20,7 @@ common-obj-$(CONFIG_ZAURUS) += tc6393xb.o
ifeq ($(CONFIG_MILKYMIST_TMU2),y)
common-obj-y += milkymist-tmu2.o
+milkymist-tmu2.o-cflags := $(GLX_CFLAGS)
libs_softmmu += $(GLX_LIBS)
endif
--
1.7.10.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH] Allow the use of X11 from a non standard location.
2015-01-09 19:08 [Qemu-devel] [PATCH] Allow the use of X11 from a non standard location Jeremy White
@ 2015-01-09 22:44 ` Paolo Bonzini
0 siblings, 0 replies; 2+ messages in thread
From: Paolo Bonzini @ 2015-01-09 22:44 UTC (permalink / raw)
To: Jeremy White, qemu-devel
On 09/01/2015 20:08, Jeremy White wrote:
> Signed-off-by: Jeremy White <jwhite@codeweavers.com>
> ---
> configure | 24 +++++++++++++++++++-----
> hw/display/Makefile.objs | 1 +
> 2 files changed, 20 insertions(+), 5 deletions(-)
>
> diff --git a/configure b/configure
> index cae588c..6c698ed 100755
> --- a/configure
> +++ b/configure
> @@ -2034,6 +2034,15 @@ if test "$sparse" != "no" ; then
> fi
>
> ##########################################
> +# X11 probe
> +x11_cflags=
> +x11_libs=-lX11
> +if $pkg_config --exists "x11"; then
> + x11_cflags=`$pkg_config --cflags x11`
> + x11_libs=`$pkg_config --libs x11`
> +fi
> +
> +##########################################
> # GTK probe
>
> if test "$gtkabi" = ""; then
> @@ -2060,7 +2069,8 @@ if test "$gtk" != "no"; then
> gtk_cflags=`$pkg_config --cflags $gtkpackage`
> gtk_libs=`$pkg_config --libs $gtkpackage`
> if $pkg_config --exists "$gtkx11package >= $gtkversion"; then
> - gtk_libs="$gtk_libs -lX11"
> + gtk_cflags="$gtk_cflags $x11_cflags"
> + gtk_libs="$gtk_libs $x11_libs"
> fi
> libs_softmmu="$gtk_libs $libs_softmmu"
> gtk="yes"
> @@ -2185,8 +2195,9 @@ if test "$sdl" = "yes" ; then
> #endif
> int main(void) { return 0; }
> EOF
> - if compile_prog "$sdl_cflags" "$sdl_libs" ; then
> - sdl_libs="$sdl_libs -lX11"
> + if compile_prog "$sdl_cflags $x11_cflags" "$sdl_libs $x11_libs" ; then
> + sdl_cflags="$sdl_cflags $x11_cflags"
> + sdl_libs="$sdl_libs $x11_libs"
> fi
> libs_softmmu="$sdl_libs $libs_softmmu"
> fi
> @@ -3058,19 +3069,21 @@ libs_softmmu="$libs_softmmu $fdt_libs"
> ##########################################
> # GLX probe, used by milkymist-tmu2
> if test "$glx" != "no" ; then
> - glx_libs="-lGL -lX11"
> + glx_cflags="$x11_cflags"
> + glx_libs="-lGL $x11_libs"
> cat > $TMPC << EOF
> #include <X11/Xlib.h>
> #include <GL/gl.h>
> #include <GL/glx.h>
> int main(void) { glBegin(0); glXQueryVersion(0,0,0); return 0; }
> EOF
> - if compile_prog "" "-lGL -lX11" ; then
> + if compile_prog "$glx_cflags" "$glx_libs" ; then
> glx=yes
> else
> if test "$glx" = "yes" ; then
> feature_not_found "glx" "Install GL devel (e.g. MESA)"
> fi
> + glx_cflags=
> glx_libs=
> glx=no
> fi
> @@ -4684,6 +4697,7 @@ fi
>
> if test "$glx" = "yes" ; then
> echo "CONFIG_GLX=y" >> $config_host_mak
> + echo "GLX_CFLAGS=$glx_cflags" >> $config_host_mak
> echo "GLX_LIBS=$glx_libs" >> $config_host_mak
> fi
>
> diff --git a/hw/display/Makefile.objs b/hw/display/Makefile.objs
> index 7ed76a9..11235a4 100644
> --- a/hw/display/Makefile.objs
> +++ b/hw/display/Makefile.objs
> @@ -20,6 +20,7 @@ common-obj-$(CONFIG_ZAURUS) += tc6393xb.o
>
> ifeq ($(CONFIG_MILKYMIST_TMU2),y)
> common-obj-y += milkymist-tmu2.o
> +milkymist-tmu2.o-cflags := $(GLX_CFLAGS)
> libs_softmmu += $(GLX_LIBS)
> endif
>
>
Thanks, looks good.
Paolo
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-01-09 22:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-09 19:08 [Qemu-devel] [PATCH] Allow the use of X11 from a non standard location Jeremy White
2015-01-09 22:44 ` Paolo Bonzini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).