From a50878682cda541766c830e49ab406c78b38d903 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Wed, 6 Apr 2011 16:23:45 +0100 Subject: configure: Look for Khronos OpenGL spec files using pkg-config Look for Khronos OpenGL spec files using pkg-config, rather than downloading them Also add a --with-khronos-spec-dir=PATH configure option so XWin can be directed where to find these files without using the khronos-spec-files package XWin with AIGLX requires OpenGL spec files in order to generate wrapper code which: (1) thunks from the glapi dispatch table which uses the default cdecl calling convention to native GL functions using the stdcall calling convention. (2) performs function address lookup for OpenGL 1.2+ functions, which are treated as extensions and so not directly linkable. v2: KHRONOS_SPEC_DIR is only valid when XWIN_GLX_WINDOWS is defined. Avoid 'make dist' seeing invalid dependencies by only including rules using KHRONOS_SPEC_DIR if XWIN_GLX_WINDOWS is defined Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison Reviewed-by: Ian Romanick --- hw/xwin/glx/.gitignore | 4 ---- hw/xwin/glx/Makefile.am | 33 ++++++++------------------------- 2 files changed, 8 insertions(+), 29 deletions(-) (limited to 'hw/xwin') diff --git a/hw/xwin/glx/.gitignore b/hw/xwin/glx/.gitignore index e7c7617e9..20d1c1e19 100644 --- a/hw/xwin/glx/.gitignore +++ b/hw/xwin/glx/.gitignore @@ -1,8 +1,4 @@ # ignore downloaded and generated files generated_gl_wrappers.c generated_wgl_wrappers.c -gl.spec -gl.tm -wgl.tm -wglext.spec wglext.h diff --git a/hw/xwin/glx/Makefile.am b/hw/xwin/glx/Makefile.am index 303ff53f2..499e3cb82 100644 --- a/hw/xwin/glx/Makefile.am +++ b/hw/xwin/glx/Makefile.am @@ -25,36 +25,19 @@ AM_CFLAGS = -DHAVE_XWIN_CONFIG_H $(DIX_CFLAGS) \ -I$(top_srcdir) \ -I$(top_srcdir)/hw/xwin/ -glwrap.c: generated_gl_wrappers.c -wgl_ext_api.c: generated_wgl_wrappers.c wglext.h -wgl_ext_api.h: wglext.h -indirect.c: wgl_ext_api.h +if XWIN_GLX_WINDOWS +generated_gl_wrappers.c: gen_gl_wrappers.py $(KHRONOS_SPEC_DIR)/gl.spec $(KHRONOS_SPEC_DIR)/gl.tm + $(srcdir)/gen_gl_wrappers.py --spec=$(KHRONOS_SPEC_DIR)/gl.spec --typemap=$(KHRONOS_SPEC_DIR)/gl.tm --dispatch-header=$(top_srcdir)/glx/dispatch.h --staticwrappers >generated_gl_wrappers.c -SPEC_FILES = gl.spec gl.tm wglext.spec wgl.tm - -gl.spec: - wget http://www.opengl.org/registry/api/gl.spec - -gl.tm: - wget http://www.opengl.org/registry/api/gl.tm - -wglext.spec: - wget http://www.opengl.org/registry/api/wglext.spec - -wgl.tm: - wget http://www.opengl.org/registry/api/wgl.tm - -generated_gl_wrappers.c: gen_gl_wrappers.py gl.spec gl.tm - $(srcdir)/gen_gl_wrappers.py --spec=`test -e gl.spec || echo $(srcdir)/`gl.spec --typemap=`test -e gl.tm || echo $(srcdir)/`gl.tm --dispatch-header=$(top_srcdir)/glx/dispatch.h --staticwrappers >generated_gl_wrappers.c - -generated_wgl_wrappers.c: gen_gl_wrappers.py wglext.spec wgl.tm - $(srcdir)/gen_gl_wrappers.py --spec=`test -e wglext.spec || echo $(srcdir)/`wglext.spec --typemap=`test -e wgl.tm || echo $(srcdir)/`wgl.tm --prefix=wgl --preresolve >generated_wgl_wrappers.c +generated_wgl_wrappers.c: gen_gl_wrappers.py $(KHRONOS_SPEC_DIR)/wglext.spec $(KHRONOS_SPEC_DIR)/wgl.tm + $(srcdir)/gen_gl_wrappers.py --spec=$(KHRONOS_SPEC_DIR)/wglext.spec --typemap=$(KHRONOS_SPEC_DIR)/wgl.tm --prefix=wgl --preresolve >generated_wgl_wrappers.c +endif wglext.h: wget http://www.opengl.org/registry/api/wglext.h BUILT_SOURCES = generated_gl_wrappers.c generated_wgl_wrappers.c CLEANFILES = $(BUILT_SOURCES) -DISTCLEANFILES = $(SPEC_FILES) wglext.h +DISTCLEANFILES = wglext.h -EXTRA_DIST = gen_gl_wrappers.py $(SPEC_FILES) wglext.h +EXTRA_DIST = gen_gl_wrappers.py wglext.h -- cgit v1.2.3 From 4d8735d388c3c6af27ef3d6a645e38e556f392f4 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Wed, 6 Apr 2011 16:26:45 +0100 Subject: hw/xwin: wglext.h should be provided by w32api, rather than downloaded wglext.h should be provided by the w32api package, rather than downloaded. if it's not, do 'wget -P /usr/include/w32api/GL http://www.opengl.org/registry/api/wglext.h' Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison Reviewed-by: Ian Romanick --- hw/xwin/glx/.gitignore | 3 +-- hw/xwin/glx/Makefile.am | 7 ++----- hw/xwin/glx/wgl_ext_api.c | 2 +- hw/xwin/glx/wgl_ext_api.h | 2 +- 4 files changed, 5 insertions(+), 9 deletions(-) (limited to 'hw/xwin') diff --git a/hw/xwin/glx/.gitignore b/hw/xwin/glx/.gitignore index 20d1c1e19..062fd8573 100644 --- a/hw/xwin/glx/.gitignore +++ b/hw/xwin/glx/.gitignore @@ -1,4 +1,3 @@ -# ignore downloaded and generated files +# ignore generated files generated_gl_wrappers.c generated_wgl_wrappers.c -wglext.h diff --git a/hw/xwin/glx/Makefile.am b/hw/xwin/glx/Makefile.am index 499e3cb82..cdcba35c9 100644 --- a/hw/xwin/glx/Makefile.am +++ b/hw/xwin/glx/Makefile.am @@ -26,6 +26,7 @@ AM_CFLAGS = -DHAVE_XWIN_CONFIG_H $(DIX_CFLAGS) \ -I$(top_srcdir)/hw/xwin/ if XWIN_GLX_WINDOWS + generated_gl_wrappers.c: gen_gl_wrappers.py $(KHRONOS_SPEC_DIR)/gl.spec $(KHRONOS_SPEC_DIR)/gl.tm $(srcdir)/gen_gl_wrappers.py --spec=$(KHRONOS_SPEC_DIR)/gl.spec --typemap=$(KHRONOS_SPEC_DIR)/gl.tm --dispatch-header=$(top_srcdir)/glx/dispatch.h --staticwrappers >generated_gl_wrappers.c @@ -33,11 +34,7 @@ generated_wgl_wrappers.c: gen_gl_wrappers.py $(KHRONOS_SPEC_DIR)/wglext.spec $(K $(srcdir)/gen_gl_wrappers.py --spec=$(KHRONOS_SPEC_DIR)/wglext.spec --typemap=$(KHRONOS_SPEC_DIR)/wgl.tm --prefix=wgl --preresolve >generated_wgl_wrappers.c endif -wglext.h: - wget http://www.opengl.org/registry/api/wglext.h - BUILT_SOURCES = generated_gl_wrappers.c generated_wgl_wrappers.c CLEANFILES = $(BUILT_SOURCES) -DISTCLEANFILES = wglext.h -EXTRA_DIST = gen_gl_wrappers.py wglext.h +EXTRA_DIST = gen_gl_wrappers.py diff --git a/hw/xwin/glx/wgl_ext_api.c b/hw/xwin/glx/wgl_ext_api.c index 4b8359fb1..1020916dc 100644 --- a/hw/xwin/glx/wgl_ext_api.c +++ b/hw/xwin/glx/wgl_ext_api.c @@ -35,7 +35,7 @@ #include #include #include -#include "wglext.h" +#include #include #include "glwindows.h" diff --git a/hw/xwin/glx/wgl_ext_api.h b/hw/xwin/glx/wgl_ext_api.h index e4462ac5c..77efd7069 100644 --- a/hw/xwin/glx/wgl_ext_api.h +++ b/hw/xwin/glx/wgl_ext_api.h @@ -29,7 +29,7 @@ #ifndef wgl_ext_api_h #define wgl_ext_api_h -#include "wglext.h" +#include void wglResolveExtensionProcs(void); -- cgit v1.2.3