Re: [PATCH xserver] meson: Add dependency on generated code fragments in hw/xwin/glx/

2017-12-13 Thread Adam Jackson
On Tue, 2017-10-10 at 13:43 +0100, Jon Turney wrote:
> Somehow I'd managed to write this with this dependency missing, so this only
> works correctly when the generated files already exist and the correct
> automatic dependencies generated, but fails on a clean build.
> 
> Including generated files with a .c extension into the sources for a target
> causes meson to want to compile them (and it seems to be hard to say "make
> the directory containing this generated file available to include").
> 
> So, change the extension of included generated C fragments to .ic
> 
> Update the autotools build to align.
> 
> Signed-off-by: Jon Turney 

remote: I: patch #181423 updated using rev 
3265d0c81f7a501258fa91e49fcc137714b4af5e.
remote: I: 1 patch(es) updated to state Accepted.
To ssh://git.freedesktop.org/git/xorg/xserver
   edda951fa5..3265d0c81f  master -> master

- ajax
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

[PATCH xserver] meson: Add dependency on generated code fragments in hw/xwin/glx/

2017-10-10 Thread Jon Turney
Somehow I'd managed to write this with this dependency missing, so this only
works correctly when the generated files already exist and the correct
automatic dependencies generated, but fails on a clean build.

Including generated files with a .c extension into the sources for a target
causes meson to want to compile them (and it seems to be hard to say "make
the directory containing this generated file available to include").

So, change the extension of included generated C fragments to .ic

Update the autotools build to align.

Signed-off-by: Jon Turney 
---
 hw/xwin/glx/Makefile.am   | 8 
 hw/xwin/glx/glshim.c  | 2 +-
 hw/xwin/glx/glthunk.c | 2 +-
 hw/xwin/glx/meson.build   | 9 ++---
 hw/xwin/glx/wgl_ext_api.c | 2 +-
 5 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/hw/xwin/glx/Makefile.am b/hw/xwin/glx/Makefile.am
index f19995086..1fc57f239 100644
--- a/hw/xwin/glx/Makefile.am
+++ b/hw/xwin/glx/Makefile.am
@@ -51,20 +51,20 @@ else
 GENGLWRAPPERSOPTS="-nodebug"
 endif
 
-generated_wgl_wrappers.c: $(srcdir)/gen_gl_wrappers.py 
$(KHRONOS_SPEC_DIR)/wgl.xml $(KHRONOS_SPEC_DIR)/reg.py
+generated_wgl_wrappers.ic: $(srcdir)/gen_gl_wrappers.py 
$(KHRONOS_SPEC_DIR)/wgl.xml $(KHRONOS_SPEC_DIR)/reg.py
$(AM_V_GEN)PYTHONPATH=$(KHRONOS_SPEC_DIR) $(PYTHON3) 
$(srcdir)/gen_gl_wrappers.py -registry $(KHRONOS_SPEC_DIR)/wgl.xml -prefix wgl 
-wrapper -preresolve $(GENGLWRAPPERSOPTS) -outfile $@
 
-generated_gl_shim.c: $(srcdir)/gen_gl_wrappers.py $(KHRONOS_SPEC_DIR)/gl.xml 
$(KHRONOS_SPEC_DIR)/reg.py
+generated_gl_shim.ic: $(srcdir)/gen_gl_wrappers.py $(KHRONOS_SPEC_DIR)/gl.xml 
$(KHRONOS_SPEC_DIR)/reg.py
$(AM_V_GEN)PYTHONPATH=$(KHRONOS_SPEC_DIR) $(PYTHON3) 
$(srcdir)/gen_gl_wrappers.py -registry $(KHRONOS_SPEC_DIR)/gl.xml -shim 
$(GENGLWRAPPERSOPTS) -outfile $@
 
-generated_gl_thunks.c: $(srcdir)/gen_gl_wrappers.py $(KHRONOS_SPEC_DIR)/gl.xml 
$(KHRONOS_SPEC_DIR)/reg.py
+generated_gl_thunks.ic: $(srcdir)/gen_gl_wrappers.py 
$(KHRONOS_SPEC_DIR)/gl.xml $(KHRONOS_SPEC_DIR)/reg.py
$(AM_V_GEN)PYTHONPATH=$(KHRONOS_SPEC_DIR) $(PYTHON3) 
$(srcdir)/gen_gl_wrappers.py -registry $(KHRONOS_SPEC_DIR)/gl.xml -thunk 
$(GENGLWRAPPERSOPTS) -outfile $@
 
 generated_gl_thunks.def: $(srcdir)/gen_gl_wrappers.py 
$(KHRONOS_SPEC_DIR)/gl.xml $(KHRONOS_SPEC_DIR)/reg.py
$(AM_V_GEN)PYTHONPATH=$(KHRONOS_SPEC_DIR) $(PYTHON3) 
$(srcdir)/gen_gl_wrappers.py -registry $(KHRONOS_SPEC_DIR)/gl.xml -thunkdefs 
$(GENGLWRAPPERSOPTS) -outfile $@
 endif
 
-BUILT_SOURCES = generated_gl_shim.c generated_gl_thunks.c 
generated_gl_thunks.def generated_wgl_wrappers.c
+BUILT_SOURCES = generated_gl_shim.ic generated_gl_thunks.ic 
generated_gl_thunks.def generated_wgl_wrappers.ic
 CLEANFILES = $(BUILT_SOURCES)
 
 EXTRA_DIST = gen_gl_wrappers.py
diff --git a/hw/xwin/glx/glshim.c b/hw/xwin/glx/glshim.c
index df5a932ff..a27040257 100644
--- a/hw/xwin/glx/glshim.c
+++ b/hw/xwin/glx/glshim.c
@@ -106,7 +106,7 @@ int glWinSelectImplementation(int native)
 #define RESOLVED_PROC proc
 
 /* Include generated shims for direct linkage to GL functions which are in the 
ABI */
-#include "generated_gl_shim.c"
+#include "generated_gl_shim.ic"
 
 /*
   Special wrapper for glAddSwapHintRectWIN for copySubBuffers
diff --git a/hw/xwin/glx/glthunk.c b/hw/xwin/glx/glthunk.c
index d49fe487c..3d2702ddb 100644
--- a/hw/xwin/glx/glthunk.c
+++ b/hw/xwin/glx/glthunk.c
@@ -84,4 +84,4 @@ glWinResolveHelper(PROC * cache, const char *symbol)
   found using wglGetProcAddress(), but also stdcall so still need wrappers...
 */
 
-#include "generated_gl_thunks.c"
+#include "generated_gl_thunks.ic"
diff --git a/hw/xwin/glx/meson.build b/hw/xwin/glx/meson.build
index 7843a5f00..e9969536d 100644
--- a/hw/xwin/glx/meson.build
+++ b/hw/xwin/glx/meson.build
@@ -15,7 +15,7 @@ wgl_wrappers = custom_target(
 'gen_wgl_wrappers',
 command: [gen_gl_wrappers_cmd, '-registry', '@INPUT@', '-prefix', 'wgl', 
'-wrapper', '-preresolve', '-outfile', '@OUTPUT@'],
 input: join_paths(khronos_spec_dir, 'wgl.xml'),
-output: 'generated_wgl_wrappers.c',
+output: 'generated_wgl_wrappers.ic',
 depend_files: join_paths(khronos_spec_dir, 'reg.py'),
 )
 
@@ -23,7 +23,7 @@ gl_shim = custom_target(
 'gen_gl_shim',
 command: [gen_gl_wrappers_cmd, '-registry', '@INPUT@', '-shim', 
'-outfile', '@OUTPUT@'],
 input: join_paths(khronos_spec_dir, 'gl.xml'),
-output: 'generated_gl_shim.c',
+output: 'generated_gl_shim.ic',
 depend_files: join_paths(khronos_spec_dir, 'reg.py'),
 )
 
@@ -31,7 +31,7 @@ gl_thunks = custom_target(
 'gen_gl_thunks',
 command: [gen_gl_wrappers_cmd, '-registry', '@INPUT@', '-thunk', 
'-outfile', '@OUTPUT@'],
 input: join_paths(khronos_spec_dir, 'gl.xml'),
-output: 'generated_gl_thunks.c',
+output: 'generated_gl_thunks.ic',
 depend_files: join_paths(khronos_spec_dir, 'reg.py'),
 )
 
@@ -48,9 +48,11 @@ srcs_windows_glx = [
 'winpriv.h',