[AD] Teaching CMake to generate files

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Hi,

I created some patches to make CMake automtically generate generated
files on Unix.

First, misc/make_converters.py has an indentation error, which is fixed
by [1]:

$ misc/make_converters.py
  File "misc/make_converters.py", line 179
    if (shift > 0):
    ^
IndentationError: unexpected indent


Two of the generated files differ between 5.0.7 and newly generated
files. The diffs are attached. Please check if they are just outdated or
if something else is wrong.

[2] is a patch to require directx_shaders.c only on Windows.

I changed CMakeLists.txt [3], misc/gl_mkalias.sh [4] and
misc/make_converters.py [5] to allow them being run by CMake. It should
still be possible to run them manually the same way as before.

Also, the allegro CMake target needs to depend on
src/scanline_drawers.c, but this file is not supposed to be built, but
is just included in another file. To allow for the allegro target to
depend on it without CMake causing it to be built, I renamed it to
src/scanline_drawers.h. The patch for that is [6].

With all these patches, the build succeeds if the following files are
either present or not:

include/allegro5/opengl/GLext/*gl*_ext_alias.h
src/convert.c
include/allegro5/internal/aintern_convert.h
src/scanline_drawers.*
addons/primitives/directx_shaders.c

I hope you apply the patches. :)

You can find them at

http://anonscm.debian.org/gitweb/?p=pkg-games/allegro5.git;a=tree;f=debian/patches;hb=HEAD

[1] fix-python-indent.patch
[2] require-directx_shaders.c-only-on-windows.patch
[3] let-cmake-generate-files.patch
[4] allow-specifying-build-dir-for-gl_mkalias.patch
[5] add-directory-parameters-to-python-file-generators.patch
[6] rename-scanline_drawers.c-to-scanline_drawers.h.patch

Best regards,
Tobias
diff --git a/include/allegro5/internal/aintern_convert.h b/include/allegro5/internal/aintern_convert.h
index af4a0eb..ea1b224 100644
--- a/include/allegro5/internal/aintern_convert.h
+++ b/include/allegro5/internal/aintern_convert.h
@@ -1,6 +1,6 @@
 // Warning: This file was created by make_converters.py - do not edit.
-#ifndef __al_included_allegro5_aintern_convert_h
-#define __al_included_allegro5_aintern_convert_h
+#ifndef _ALLEGRO_CONVERT_H
+#define _ALLEGRO_CONVERT_H
 
 #include "allegro5/allegro.h"
 #include "allegro5/internal/aintern_pixels.h"
diff --git a/include/allegro5/opengl/GLext/gl_ext_alias.h b/include/allegro5/opengl/GLext/gl_ext_alias.h
index 4cb71a0..afe0b8d 100644
--- a/include/allegro5/opengl/GLext/gl_ext_alias.h
+++ b/include/allegro5/opengl/GLext/gl_ext_alias.h
@@ -359,10 +359,10 @@
 /*ARB_provoking_vertex*/
 /*ARB_sync*/
 /*ARB_texture_multisample*/
-#define glGetInteger64i_v _al_glGetInteger64i_v
-#define glGetBufferParameteri64v _al_glGetBufferParameteri64v
-#define glProgramParameteri _al_glProgramParameteri
-#define glFramebufferTexture _al_glFramebufferTexture
+#define glglGetInteger64i_v _al_glglGetInteger64i_v
+#define glglGetBufferParameteri64v _al_glglGetBufferParameteri64v
+#define glglProgramParameteri _al_glglProgramParameteri
+#define glglFramebufferTexture _al_glglFramebufferTexture
 #endif
 
 #if defined _ALLEGRO_GL_VERSION_3_3


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/