[Cogl] Add some support files and updates to Visual C++ support

Fan Chun-wei fanc999 at yahoo.com.tw
Mon May 14 07:50:07 PDT 2012


Hi,

For compiling Cogl master, I also have the following patch to the Visual 
C++ project files, the [cogl|cogl-pango].rc.in files, and updates to the 
autotools files to put the versioning items in 
cogl-defines.h[.win32|.win32_SDL] so that the Visual C++ builds could be 
done correctly on Cogl master.

With blessings, thank you!
-------------- next part --------------
From a0ea04a679988c5133a1e8d46935a6f29df63c5a Mon Sep 17 00:00:00 2001
From: Chun-wei Fan <fanchunwei at src.gnome.org>
Date: Mon, 14 May 2012 12:53:02 +0800
Subject: [PATCH 3/3] Fix Visual C++ build

-Create a pre-defined cogl/cogl-gl-header.h(.win32) that is to be used on
 any Windows builds, and adapt the MSVC build process to set up and use
 that file.
-Fix up glib-mkenums code generation .bat file that is generated during
 "make"/"make dist", like the autotools-based builds.
-Since cogl/cogl-defines.h now contain versionioning info, and it no longer
 directly includes the GL headers, update the pre-configured
 cogl-defines.h[.win32|.win32_SDL] and use autotools to fill in the
 versioning info during "make"/"make dist".
-Fix up cogl/cogl-pango.rc.in so that they reflect the cogl-2.x versioning
 stuff correctly and versioning info can be filled in correctly during
 "make"/"make dist"
---
 build/win32/vs10/cogl.props      |    2 +
 build/win32/vs9/cogl.vsprops     |    1 +
 cogl-pango/cogl-pango.rc.in      |   12 +++---
 cogl/Makefile.am                 |    7 +++-
 cogl/cogl-defines.h.win32        |   68 ------------------------------------
 cogl/cogl-defines.h.win32.in     |   70 +++++++++++++++++++++++++++++++++++++
 cogl/cogl-defines.h.win32_SDL    |   69 ------------------------------------
 cogl/cogl-defines.h.win32_SDL.in |   71 ++++++++++++++++++++++++++++++++++++++
 cogl/cogl-gl-header.h.win32      |   41 ++++++++++++++++++++++
 cogl/cogl.rc.in                  |   12 +++---
 configure.ac                     |    2 +
 12 files changed, 212 insertions(+), 151 deletions(-)
 delete mode 100644 cogl/cogl-defines.h.win32
 create mode 100644 cogl/cogl-defines.h.win32.in
 delete mode 100644 cogl/cogl-defines.h.win32_SDL
 create mode 100644 cogl/cogl-defines.h.win32_SDL.in
 create mode 100644 cogl/cogl-gl-header.h.win32

diff --git a/build/win32/vs10/cogl.props b/build/win32/vs10/cogl.props
index 9b98067..d257fc3 100644
--- a/build/win32/vs10/cogl.props
+++ b/build/win32/vs10/cogl.props
@@ -39,6 +39,8 @@ copy ..\..\..\config.h.win32 ..\..\..\config.h
 
 :DONE_CONFIG_H
 
+if not exist ..\..\..\cogl\cogl-gl-header.h copy ..\..\..\cogl\cogl-gl-header.h.win32 copy ..\..\..\cogl\cogl-gl-header.h
+
 
 cd ..
 
diff --git a/build/win32/vs9/cogl.vsprops b/build/win32/vs9/cogl.vsprops
index b9886d6..1aedc44 100644
--- a/build/win32/vs9/cogl.vsprops
+++ b/build/win32/vs9/cogl.vsprops
@@ -89,6 +89,7 @@ copy ..\..\..\cogl\WGL_DEFINES ..\..\..\cogl\cogl-defines.h&#x0D;&#x0A;
 		Value="
 if exist ..\..\..\config.h goto DONE_CONFIG_H&#x0D;&#x0A;
 copy ..\..\..\config.h.win32 ..\..\..\config.h&#x0D;&#x0A;
+if not exist ..\..\..\cogl\cogl-gl-header.h copy ..\..\..\cogl\cogl-gl-header.h.win32 copy ..\..\..\cogl\cogl-gl-header.h&#x0D;&#x0A;
 :DONE_CONFIG_H&#x0D;&#x0A;
 
 cd ..&#x0D;&#x0A;
diff --git a/cogl-pango/cogl-pango.rc.in b/cogl-pango/cogl-pango.rc.in
index ab8ff2d..64242e4 100644
--- a/cogl-pango/cogl-pango.rc.in
+++ b/cogl-pango/cogl-pango.rc.in
@@ -1,8 +1,8 @@
 #include <winver.h>
 
 VS_VERSION_INFO VERSIONINFO
-  FILEVERSION 1, at COGL_1_MINOR_VERSION@, at COGL_1_MICRO_VERSION@,0
-  PRODUCTVERSION 1, at COGL_1_MINOR_VERSION@, at COGL_1_MICRO_VERSION@,0
+  FILEVERSION 1, at COGL_MINOR_VERSION@, at COGL_MICRO_VERSION@,0
+  PRODUCTVERSION 1, at COGL_MINOR_VERSION@, at COGL_MICRO_VERSION@,0
   FILEFLAGSMASK 0
   FILEFLAGS 0
   FILEOS VOS__WINDOWS32
@@ -15,12 +15,12 @@ VS_VERSION_INFO VERSIONINFO
       BEGIN
 	VALUE "CompanyName", "Intel Corporation"
 	VALUE "FileDescription", "cogl-pango"
-	VALUE "FileVersion", "@COGL_1_VERSION at .0"
-	VALUE "InternalName", "libcogl-pango-1.0- at COGL_LT_AGE@"
+	VALUE "FileVersion", "@COGL_VERSION at .0"
+	VALUE "InternalName", "libcogl-pango-2.0- at COGL_LT_AGE@"
 	VALUE "LegalCopyright", "Copyright 1995-2011 �Intel Corporation"
-	VALUE "OriginalFilename", "libcogl-pango-1.0- at COGL_LT_AGE@.dll"
+	VALUE "OriginalFilename", "libcogl-pango-2.0- at COGL_LT_AGE@.dll"
 	VALUE "ProductName", "cogl-pango"
-	VALUE "ProductVersion", "@COGL_1_VERSION@"
+	VALUE "ProductVersion", "@COGL_VERSION@"
       END
     END
     BLOCK "VarFileInfo"
diff --git a/cogl/Makefile.am b/cogl/Makefile.am
index dd50466..c363f9b 100644
--- a/cogl/Makefile.am
+++ b/cogl/Makefile.am
@@ -514,7 +514,7 @@ dist-hook: ../build/win32/vs9/cogl.vcproj ../build/win32/vs10/cogl.vcxproj ../bu
 	rm cogl.vs10.sourcefiles.filters
 
 cogl.vsenums_h:
-	echo 'perl %1\bin\glib-mkenums --template ../../cogl/cogl-enum-types.h.in ' >vsenums_h.temp1
+	echo 'perl %1\bin\glib-mkenums --symbol-prefix cogl_gtype --template ../../cogl/cogl-enum-types.h.in ' >vsenums_h.temp1
 	for F in `echo $(cogl_1_public_h) $(srcdir)/cogl-win32-renderer.h`; do \
 		case $$F in \
 		*xlib*.h|*wayland*.h) ;; \
@@ -529,7 +529,7 @@ cogl.vsenums_h:
 	rm vsenums_h.temp
 
 cogl.vsenums_c:
-	echo 'perl %1\bin\glib-mkenums --template ../../cogl/cogl-enum-types.c.in ' >vsenums_c.temp1
+	echo 'perl %1\bin\glib-mkenums --symbol-prefix cogl_gtype --template ../../cogl/cogl-enum-types.c.in ' >vsenums_c.temp1
 	for F in `echo $(cogl_1_public_h) $(srcdir)/cogl-win32-renderer.h`; do \
 		case $$F in \
 		*xlib*.h|*wayland*.h) ;; \
@@ -554,8 +554,11 @@ cogl.vsenums_c:
 	rm cogl.vsenums_c
 
 EXTRA_DIST += \
+	cogl-defines.h.win32.in	\
 	cogl-defines.h.win32	\
+	cogl-defines.h.win32_SDL.in	\
 	cogl-defines.h.win32_SDL	\
+	cogl-gl-header.h.win32	\
 	cogl.symbols	\
 	cogl.rc.in	\
 	cogl.rc
diff --git a/cogl/cogl-defines.h.win32 b/cogl/cogl-defines.h.win32
deleted file mode 100644
index 75a70ba..0000000
--- a/cogl/cogl-defines.h.win32
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Cogl
- *
- * An object oriented GL/GLES Abstraction/Utility Layer
- *
- * Copyright (C) 2007,2008,2009,2010 Intel Corporation.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library. If not, see <http://www.gnu.org/licenses/>.
- *
- *
- */
- 
-#if !defined(__COGL_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
-#error "Only <cogl/cogl.h> can be included directly."
-#endif
-
-#ifndef __COGL_DEFINES_H__
-#define __COGL_DEFINES_H__
-
-#include <glib.h>
-#include <windows.h>
-#include <GL/GL.h>
-#include <GL/glext.h>
-
-G_BEGIN_DECLS
-
-#define COGL_HAS_GLIB_SUPPORT 1
-#define COGL_HAS_WGL_SUPPORT 1
-#define COGL_HAS_WIN32_SUPPORT 1
-#define COGL_HAS_GL 1
-#define CLUTTER_COGL_HAS_GL 1
-
-#ifdef COGL_HAS_EGL_SUPPORT
-#ifdef COGL_HAS_GLES1
-#include <GLES/gl.h>
-#include <GLES/egl.h>
-#else
-#include <EGL/egl.h>
-#define NativeDisplayType EGLNativeDisplayType
-#define NativeWindowType EGLNativeWindowType
-#endif
-#endif
-
-#ifndef GL_OES_EGL_image
-#define GLeglImageOES void *
-#endif
-
-#define COGL_SYSDEF_POLLIN 1
-#define COGL_SYSDEF_POLLPRI 2
-#define COGL_SYSDEF_POLLOUT 4
-#define COGL_SYSDEF_POLLERR 8
-#define COGL_SYSDEF_POLLHUP 16
-#define COGL_SYSDEF_POLLNVAL 32
-
-G_END_DECLS
-
-#endif
diff --git a/cogl/cogl-defines.h.win32.in b/cogl/cogl-defines.h.win32.in
new file mode 100644
index 0000000..b6e6d04
--- /dev/null
+++ b/cogl/cogl-defines.h.win32.in
@@ -0,0 +1,70 @@
+/*
+ * Cogl
+ *
+ * An object oriented GL/GLES Abstraction/Utility Layer
+ *
+ * Copyright (C) 2007,2008,2009,2010 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ */
+
+#if !defined(__COGL_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
+#error "Only <cogl/cogl.h> can be included directly."
+#endif
+
+#ifndef __COGL_DEFINES_H__
+#define __COGL_DEFINES_H__
+
+#include <glib.h>
+
+G_BEGIN_DECLS
+
+#define COGL_HAS_GLIB_SUPPORT 1
+#define COGL_HAS_WGL_SUPPORT 1
+#define COGL_HAS_WIN32_SUPPORT 1
+#define COGL_HAS_GL 1
+#define CLUTTER_COGL_HAS_GL 1
+
+#ifdef COGL_HAS_EGL_SUPPORT
+#ifdef COGL_HAS_GLES1
+#include <GLES/gl.h>
+#include <GLES/egl.h>
+#else
+#include <EGL/egl.h>
+#define NativeDisplayType EGLNativeDisplayType
+#define NativeWindowType EGLNativeWindowType
+#endif
+#endif
+
+#ifndef GL_OES_EGL_image
+#define GLeglImageOES void *
+#endif
+
+#define COGL_SYSDEF_POLLIN 1
+#define COGL_SYSDEF_POLLPRI 2
+#define COGL_SYSDEF_POLLOUT 4
+#define COGL_SYSDEF_POLLERR 8
+#define COGL_SYSDEF_POLLHUP 16
+#define COGL_SYSDEF_POLLNVAL 32
+
+#define COGL_VERSION_MAJOR_INTERNAL @COGL_MAJOR_VERSION@
+#define COGL_VERSION_MINOR_INTERNAL @COGL_MINOR_VERSION@
+#define COGL_VERSION_MICRO_INTERNAL @COGL_MICRO_VERSION@
+#define COGL_VERSION_STRING_INTERNAL "@COGL_VERSION@"
+
+G_END_DECLS
+
+#endif
diff --git a/cogl/cogl-defines.h.win32_SDL b/cogl/cogl-defines.h.win32_SDL
deleted file mode 100644
index 5141857..0000000
--- a/cogl/cogl-defines.h.win32_SDL
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Cogl
- *
- * An object oriented GL/GLES Abstraction/Utility Layer
- *
- * Copyright (C) 2007,2008,2009,2010 Intel Corporation.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library. If not, see <http://www.gnu.org/licenses/>.
- *
- *
- */
-
-#if !defined(__COGL_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
-#error "Only <cogl/cogl.h> can be included directly."
-#endif
-
-#ifndef __COGL_DEFINES_H__
-#define __COGL_DEFINES_H__
-
-#include <glib.h>
-#include <windows.h>
-#include <GL/GL.h>
-#include <GL/glext.h>
-
-G_BEGIN_DECLS
-
-#define COGL_HAS_GLIB_SUPPORT 1
-#define COGL_HAS_WGL_SUPPORT 1
-#define COGL_HAS_WIN32_SUPPORT 1
-#define COGL_HAS_SDL_SUPPORT 1
-#define COGL_HAS_GL 1
-#define CLUTTER_COGL_HAS_GL 1
-
-#ifdef COGL_HAS_EGL_SUPPORT
-#ifdef COGL_HAS_GLES1
-#include <GLES/gl.h>
-#include <GLES/egl.h>
-#else
-#include <EGL/egl.h>
-#define NativeDisplayType EGLNativeDisplayType
-#define NativeWindowType EGLNativeWindowType
-#endif
-#endif
-
-#ifndef GL_OES_EGL_image
-#define GLeglImageOES void *
-#endif
-
-#define COGL_SYSDEF_POLLIN 1
-#define COGL_SYSDEF_POLLPRI 2
-#define COGL_SYSDEF_POLLOUT 4
-#define COGL_SYSDEF_POLLERR 8
-#define COGL_SYSDEF_POLLHUP 16
-#define COGL_SYSDEF_POLLNVAL 32
-
-G_END_DECLS
-
-#endif
diff --git a/cogl/cogl-defines.h.win32_SDL.in b/cogl/cogl-defines.h.win32_SDL.in
new file mode 100644
index 0000000..0cc9f9d
--- /dev/null
+++ b/cogl/cogl-defines.h.win32_SDL.in
@@ -0,0 +1,71 @@
+/*
+ * Cogl
+ *
+ * An object oriented GL/GLES Abstraction/Utility Layer
+ *
+ * Copyright (C) 2007,2008,2009,2010 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ */
+
+#if !defined(__COGL_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
+#error "Only <cogl/cogl.h> can be included directly."
+#endif
+
+#ifndef __COGL_DEFINES_H__
+#define __COGL_DEFINES_H__
+
+#include <glib.h>
+
+G_BEGIN_DECLS
+
+#define COGL_HAS_GLIB_SUPPORT 1
+#define COGL_HAS_WGL_SUPPORT 1
+#define COGL_HAS_WIN32_SUPPORT 1
+#define COGL_HAS_SDL_SUPPORT 1
+#define COGL_HAS_GL 1
+#define CLUTTER_COGL_HAS_GL 1
+
+#ifdef COGL_HAS_EGL_SUPPORT
+#ifdef COGL_HAS_GLES1
+#include <GLES/gl.h>
+#include <GLES/egl.h>
+#else
+#include <EGL/egl.h>
+#define NativeDisplayType EGLNativeDisplayType
+#define NativeWindowType EGLNativeWindowType
+#endif
+#endif
+
+#ifndef GL_OES_EGL_image
+#define GLeglImageOES void *
+#endif
+
+#define COGL_SYSDEF_POLLIN 1
+#define COGL_SYSDEF_POLLPRI 2
+#define COGL_SYSDEF_POLLOUT 4
+#define COGL_SYSDEF_POLLERR 8
+#define COGL_SYSDEF_POLLHUP 16
+#define COGL_SYSDEF_POLLNVAL 32
+
+#define COGL_VERSION_MAJOR_INTERNAL @COGL_MAJOR_VERSION@
+#define COGL_VERSION_MINOR_INTERNAL @COGL_MINOR_VERSION@
+#define COGL_VERSION_MICRO_INTERNAL @COGL_MICRO_VERSION@
+#define COGL_VERSION_STRING_INTERNAL "@COGL_VERSION@"
+
+G_END_DECLS
+
+#endif
diff --git a/cogl/cogl-gl-header.h.win32 b/cogl/cogl-gl-header.h.win32
new file mode 100644
index 0000000..710d1fa
--- /dev/null
+++ b/cogl/cogl-gl-header.h.win32
@@ -0,0 +1,41 @@
+/*
+ * Cogl
+ *
+ * An object oriented GL/GLES Abstraction/Utility Layer
+ *
+ * Copyright (C) 2012 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ */
+
+#if !defined(CLUTTER_COMPILATION)
+#error "cogl-gl-header.h should only be included when compiling Cogl"
+#endif
+
+#ifndef __COGL_GL_HEADER_H__
+#define __COGL_GL_HEADER_H__
+
+#include "cogl-defines.h"
+
+#include <windows.h>
+#include <GL/GL.h>
+#include <GL/glext.h>
+
+#ifndef GL_OES_EGL_image
+#define GLeglImageOES void *
+#endif
+
+#endif /* __COGL_GL_HEADER_H__ */
diff --git a/cogl/cogl.rc.in b/cogl/cogl.rc.in
index 0911559..976c855 100644
--- a/cogl/cogl.rc.in
+++ b/cogl/cogl.rc.in
@@ -1,8 +1,8 @@
 #include <winver.h>
 
 VS_VERSION_INFO VERSIONINFO
-  FILEVERSION 1, at COGL_1_MINOR_VERSION@, at COGL_1_MICRO_VERSION@,0
-  PRODUCTVERSION 1, at COGL_1_MINOR_VERSION@, at COGL_1_MICRO_VERSION@,0
+  FILEVERSION 1, at COGL_MINOR_VERSION@, at COGL_MICRO_VERSION@,0
+  PRODUCTVERSION 1, at COGL_MINOR_VERSION@, at COGL_MICRO_VERSION@,0
   FILEFLAGSMASK 0
   FILEFLAGS 0
   FILEOS VOS__WINDOWS32
@@ -15,12 +15,12 @@ VS_VERSION_INFO VERSIONINFO
       BEGIN
 	VALUE "CompanyName", "Intel Corporation"
 	VALUE "FileDescription", "cogl"
-	VALUE "FileVersion", "@COGL_1_VERSION at .0"
-	VALUE "InternalName", "libcogl-1.0- at COGL_LT_AGE@"
+	VALUE "FileVersion", "@COGL_VERSION at .0"
+	VALUE "InternalName", "libcogl-2.0- at COGL_LT_AGE@"
 	VALUE "LegalCopyright", "Copyright 1995-2011 �Intel Corporation"
-	VALUE "OriginalFilename", "libcogl-1.0- at COGL_LT_AGE@.dll"
+	VALUE "OriginalFilename", "libcogl-2.0- at COGL_LT_AGE@.dll"
 	VALUE "ProductName", "cogl"
-	VALUE "ProductVersion", "@COGL_1_VERSION@"
+	VALUE "ProductVersion", "@COGL_VERSION@"
       END
     END
     BLOCK "VarFileInfo"
diff --git a/configure.ac b/configure.ac
index 2ba1a7c..c92f6dc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1137,6 +1137,8 @@ build/win32/vs10/Makefile
 cogl/Makefile
 cogl/cogl2.pc
 cogl/cogl-defines.h
+cogl/cogl-defines.h.win32
+cogl/cogl-defines.h.win32_SDL
 cogl/cogl-gl-header.h
 cogl/cogl.rc
 cogl-pango/Makefile
-- 
1.7.7.1.msysgit.0


More information about the Cogl mailing list