Mesa (master): progs/egl: Fix building on cygwin.

Chia-I Wu olv at kemper.freedesktop.org
Wed May 19 19:39:47 UTC 2010


Module: Mesa
Branch: master
Commit: 70ae8bf26fbbac58900237b815ce86c01d09eb96
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=70ae8bf26fbbac58900237b815ce86c01d09eb96

Author: Chia-I Wu <olv at lunarg.com>
Date:   Tue May 18 10:22:57 2010 -0600

progs/egl: Fix building on cygwin.

Update the Makefiles to use variables such as EGL_LIB_NAME.  Define M_PI
if it hasn't been defined yet.

---

 configure.ac                     |    2 +-
 progs/egl/opengl/Makefile        |    4 ++--
 progs/egl/opengl/eglgears.c      |    4 ++++
 progs/egl/opengles1/Makefile     |    8 ++++----
 progs/egl/opengles1/pbuffer.c    |    3 +++
 progs/egl/opengles1/render_tex.c |    4 ++++
 progs/egl/opengles1/torus.c      |    4 ++++
 progs/egl/opengles2/Makefile     |    8 ++++----
 progs/egl/opengles2/es2gears.c   |    4 ++++
 progs/egl/opengles2/tri.c        |    4 ++++
 progs/egl/openvg/Makefile        |    2 +-
 11 files changed, 35 insertions(+), 12 deletions(-)

diff --git a/configure.ac b/configure.ac
index 7f6f8db..eb3460e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -265,7 +265,7 @@ else
     darwin* )
         LIB_EXTENSION='dylib' ;;
     cygwin* )
-        LIB_EXTENSION='dll' ;;
+        LIB_EXTENSION='dll.a' ;;
     aix* )
         LIB_EXTENSION='a' ;;
     * )
diff --git a/progs/egl/opengl/Makefile b/progs/egl/opengl/Makefile
index 79cd5fc..a49255b 100644
--- a/progs/egl/opengl/Makefile
+++ b/progs/egl/opengl/Makefile
@@ -7,9 +7,9 @@ include $(TOP)/configs/current
 INCLUDE_DIRS = -I$(TOP)/include $(X11_CFLAGS)
 
 HEADERS = $(TOP)/include/GLES/egl.h
-LIB_DEP = $(TOP)/$(LIB_DIR)/libEGL.so
+LIB_DEP = $(TOP)/$(LIB_DIR)/$(EGL_LIB_NAME)
 
-LIBS = -L$(TOP)/$(LIB_DIR) -lEGL -lGL -lm
+LIBS = -L$(TOP)/$(LIB_DIR) -l$(EGL_LIB) -l$(GL_LIB) -lm
 
 EGLUT_DIR = $(TOP)/progs/egl/eglut
 
diff --git a/progs/egl/opengl/eglgears.c b/progs/egl/opengl/eglgears.c
index 28da9c0..430deb2 100644
--- a/progs/egl/opengl/eglgears.c
+++ b/progs/egl/opengl/eglgears.c
@@ -33,6 +33,10 @@
 
 #include "eglut.h"
 
+#ifndef M_PI
+#define M_PI 3.14159265
+#endif
+
 static GLfloat view_rotx = 20.0, view_roty = 30.0, view_rotz = 0.0;
 static GLint gear1, gear2, gear3;
 static GLfloat angle = 0.0;
diff --git a/progs/egl/opengles1/Makefile b/progs/egl/opengles1/Makefile
index 593145d..e7802f8 100644
--- a/progs/egl/opengles1/Makefile
+++ b/progs/egl/opengles1/Makefile
@@ -12,13 +12,13 @@ HEADERS = $(TOP)/include/GLES/egl.h
 
 
 ES1_LIB_DEPS = \
-	$(TOP)/$(LIB_DIR)/libEGL.so \
-	$(TOP)/$(LIB_DIR)/libGLESv1_CM.so
+	$(TOP)/$(LIB_DIR)/$(EGL_LIB_NAME) \
+	$(TOP)/$(LIB_DIR)/$(GLESv1_CM_LIB_NAME)
 
 
 ES1_LIBS = \
-	-L$(TOP)/$(LIB_DIR) -lEGL \
-	-L$(TOP)/$(LIB_DIR) -lGLESv1_CM $(LIBDRM_LIB) $(X11_LIBS)
+	-L$(TOP)/$(LIB_DIR) -l$(EGL_LIB) -l$(GLESv1_CM_LIB) \
+	$(LIBDRM_LIB) $(X11_LIBS)
 
 EGLUT_DIR = $(TOP)/progs/egl/eglut
 
diff --git a/progs/egl/opengles1/pbuffer.c b/progs/egl/opengles1/pbuffer.c
index 60f8644..1b4dbb6 100644
--- a/progs/egl/opengles1/pbuffer.c
+++ b/progs/egl/opengles1/pbuffer.c
@@ -22,6 +22,9 @@
 #include <EGL/egl.h>
 
 
+#ifndef M_PI
+#define M_PI 3.14159265
+#endif
 
 static int WinWidth = 300, WinHeight = 300;
 
diff --git a/progs/egl/opengles1/render_tex.c b/progs/egl/opengles1/render_tex.c
index 0200fa4..cd2abbd 100644
--- a/progs/egl/opengles1/render_tex.c
+++ b/progs/egl/opengles1/render_tex.c
@@ -22,6 +22,10 @@
 #include <EGL/egl.h>
 
 
+#ifndef M_PI
+#define M_PI 3.14159265
+#endif
+
 static int TexWidth = 256, TexHeight = 256;
 
 static int WinWidth = 300, WinHeight = 300;
diff --git a/progs/egl/opengles1/torus.c b/progs/egl/opengles1/torus.c
index 8f262b5..18ddff3 100644
--- a/progs/egl/opengles1/torus.c
+++ b/progs/egl/opengles1/torus.c
@@ -17,6 +17,10 @@
 
 #include "eglut.h"
 
+#ifndef M_PI
+#define M_PI 3.14159265
+#endif
+
 static const struct {
    GLenum internalFormat;
    const char *name;
diff --git a/progs/egl/opengles2/Makefile b/progs/egl/opengles2/Makefile
index 89feb34..bf14513 100644
--- a/progs/egl/opengles2/Makefile
+++ b/progs/egl/opengles2/Makefile
@@ -14,13 +14,13 @@ HEADERS = $(TOP)/include/GLES/egl.h
 
 
 ES2_LIB_DEPS = \
-	$(TOP)/$(LIB_DIR)/libEGL.so \
-	$(TOP)/$(LIB_DIR)/libGLESv2.so
+	$(TOP)/$(LIB_DIR)/$(EGL_LIB_NAME) \
+	$(TOP)/$(LIB_DIR)/$(GLESv2_LIB_NAME)
 
 
 ES2_LIBS = \
-	-L$(TOP)/$(LIB_DIR) -lEGL \
-	-L$(TOP)/$(LIB_DIR) -lGLESv2 $(LIBDRM_LIB) $(X11_LIBS) \
+	-L$(TOP)/$(LIB_DIR) -l$(EGL_LIB) -l$(GLESv2_LIB) \
+	$(LIBDRM_LIB) $(X11_LIBS)
 
 PROGRAMS = \
 	es2_info \
diff --git a/progs/egl/opengles2/es2gears.c b/progs/egl/opengles2/es2gears.c
index 8e7a3e5..6bd6594 100644
--- a/progs/egl/opengles2/es2gears.c
+++ b/progs/egl/opengles2/es2gears.c
@@ -46,6 +46,10 @@
 #include <EGL/eglext.h>
 #include "eglut.h"
 
+#ifndef M_PI
+#define M_PI 3.14159265
+#endif
+
 struct gear {
    GLfloat *vertices;
    GLuint vbo;
diff --git a/progs/egl/opengles2/tri.c b/progs/egl/opengles2/tri.c
index 8981d8a..812dbf0 100644
--- a/progs/egl/opengles2/tri.c
+++ b/progs/egl/opengles2/tri.c
@@ -29,6 +29,10 @@
 #include <EGL/egl.h>
 
 
+#ifndef M_PI
+#define M_PI 3.14159265
+#endif
+
 #define FLOAT_TO_FIXED(X)   ((X) * 65535.0)
 
 
diff --git a/progs/egl/openvg/Makefile b/progs/egl/openvg/Makefile
index 3b11933..9a96ccc 100644
--- a/progs/egl/openvg/Makefile
+++ b/progs/egl/openvg/Makefile
@@ -3,7 +3,7 @@
 TOP = ../../..
 include $(TOP)/configs/current
 
-VG_LIBS=-lm -lEGL -lOpenVG -L$(TOP)/lib -L$(TOP)/lib/gallium
+VG_LIBS=-lm -L$(TOP)/$(LIB_DIR) -l$(EGL_LIB) -l$(VG_LIB)
 INCLUDE_DIRS = -I$(TOP)/include $(X11_CFLAGS)
 
 EGLUT_DIR = $(TOP)/progs/egl/eglut




More information about the mesa-commit mailing list