Add WIP GLEW port.

This commit is contained in:
Philippe Houdoin
2010-12-03 16:10:46 +00:00
parent 17933309a0
commit 53a09eee7f
2 changed files with 245 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
DESCRIPTION="The OpenGL Extension Wrangler Library"
HOMEPAGE="http://glew.sourceforge.net"
SRC_URI="http://downloads.sourceforge.net/project/glew/glew/1.5.7/glew-1.5.7.tgz"
REVISION="1"
STATUS_HAIKU="broken"
DEPEND=""
CHECKSUM_MD5="f913ce9dbde4cd250b932731b3534ded"
BUILD {
cd glew-1.5.7
make
}
INSTALL {
cd glew-1.5.7
make install
}
LICENSE="BSD MIT"
COPYRIGHT="???"

View File

@@ -0,0 +1,226 @@
diff -NaurbE glew-1.5.7/config/Makefile.haiku glew-1.5.7-haiku/config/Makefile.haiku
--- glew-1.5.7/config/Makefile.haiku 1970-01-01 01:00:00.000000000 +0100
+++ glew-1.5.7-haiku/config/Makefile.haiku 2010-12-03 16:25:41.782499840 +0100
@@ -0,0 +1,24 @@
+NAME = $(GLEW_NAME)
+GLEW_DEST = /boot/common
+CC = cc
+LD = cc
+ifneq (undefined, $(origin GLEW_MX))
+ CFLAGS.EXTRA = -DGLEW_MX
+endif
+
+LDFLAGS.SO = -shared -Wl,-soname=$(LIB.SONAME)
+
+LDFLAGS.GL = -lGL
+LDFLAGS.STATIC = -Wl,-Bstatic
+LDFLAGS.DYNAMIC = -Wl,-Bdynamic
+
+NAME = GLEW
+WARN = -Wall -W
+POPT = -O2
+
+BIN.SUFFIX =
+
+LIB.SONAME = lib$(NAME).so.$(SO_MAJOR)
+LIB.DEVLNK = lib$(NAME).so
+LIB.SHARED = lib$(NAME).so.$(SO_VERSION)
+LIB.STATIC = lib$(NAME).a
diff -NaurbE glew-1.5.7/src/glew.c glew-1.5.7-haiku/src/glew.c
--- glew-1.5.7/src/glew.c 2010-11-03 21:55:35.016252928 +0100
+++ glew-1.5.7-haiku/src/glew.c 2010-12-03 16:24:32.925892608 +0100
@@ -32,7 +32,7 @@
#include <GL/glew.h>
#if defined(_WIN32)
# include <GL/wglew.h>
-#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX)
+#elif !defined(__APPLE__) && !defined(__HAIKU__) || defined(GLEW_APPLE_GLX)
# include <GL/glxew.h>
#endif
@@ -110,7 +110,7 @@
#endif /* MAC_OS_X_VERSION_10_3 */
#endif /* __APPLE__ */
-#if defined(__sgi) || defined (__sun)
+#if defined(__sgi) || defined (__sun) || defined(__HAIKU__)
#include <dlfcn.h>
#include <stdio.h>
#include <stdlib.h>
@@ -142,7 +142,7 @@
# if defined(__APPLE__)
# define glewGetProcAddress(name) NSGLGetProcAddress(name)
# else
-# if defined(__sgi) || defined(__sun)
+# if defined(__sgi) || defined(__sun) || defined(__HAIKU__)
# define glewGetProcAddress(name) dlGetProcAddress(name)
# else /* __linux */
# define glewGetProcAddress(name) (*glXGetProcAddressARB)(name)
@@ -10308,7 +10308,7 @@
return GLEW_OK;
}
-#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX)
+#elif !defined(__APPLE__) && !defined(__HAIKU__) || defined(GLEW_APPLE_GLX)
PFNGLXGETCURRENTDISPLAYPROC __glewXGetCurrentDisplay = NULL;
@@ -11303,7 +11303,7 @@
return GLEW_OK;
}
-#endif /* !__APPLE__ || GLEW_APPLE_GLX */
+#endif /* !__APPLE__ && !__HAIKU__ || GLEW_APPLE_GLX */
/* ------------------------------------------------------------------------ */
diff -NaurbE glew-1.5.7/src/glewinfo.c glew-1.5.7-haiku/src/glewinfo.c
--- glew-1.5.7/src/glewinfo.c 2010-11-03 21:55:35.014680064 +0100
+++ glew-1.5.7-haiku/src/glewinfo.c 2010-12-03 16:36:44.346030080 +0100
@@ -35,7 +35,7 @@
#include <GL/glew.h>
#if defined(_WIN32)
#include <GL/wglew.h>
-#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX)
+#elif !defined(__APPLE__) && !defined(__HAIKU__) || defined(GLEW_APPLE_GLX)
#include <GL/glxew.h>
#endif
@@ -47,7 +47,7 @@
#ifdef _WIN32
WGLEWContext _wglewctx;
#define wglewGetContext() (&_wglewctx)
-#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX)
+#elif !defined(__APPLE__)&& !defined(__HAIKU__) || defined(GLEW_APPLE_GLX)
GLXEWContext _glxewctx;
#define glxewGetContext() (&_glxewctx)
#endif
@@ -55,7 +55,7 @@
#if defined(_WIN32)
GLboolean glewCreateContext (int* pixelformat);
-#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX)
+#elif !defined(__APPLE__) && !defined(__HAIKU__) || defined(GLEW_APPLE_GLX)
GLboolean glewCreateContext (const char* display, int* visual);
#else
GLboolean glewCreateContext ();
@@ -8850,6 +8850,22 @@
/* ------------------------------------------------------------------------ */
+#elif defined(__HAIKU__)
+
+GLboolean glewCreateContext ()
+{
+ // TODO
+ return GL_FALSE;
+}
+
+void glewDestroyContext ()
+{
+ // TODO
+}
+
+
+/* ------------------------------------------------------------------------ */
+
#else /* __UNIX || (__APPLE__ && GLEW_APPLE_GLX) */
Display* dpy = NULL;
diff -NaurbE glew-1.5.7/src/visualinfo.c glew-1.5.7-haiku/src/visualinfo.c
--- glew-1.5.7/src/visualinfo.c 2010-11-03 21:55:35.016252928 +0100
+++ glew-1.5.7-haiku/src/visualinfo.c 2010-12-03 16:46:50.315621376 +0100
@@ -37,7 +37,7 @@
#include <GL/wglew.h>
#elif defined(__APPLE__) && !defined(GLEW_APPLE_GLX)
#include <AGL/agl.h>
-#else
+#elif !defined(__HAIKU__)
#include <GL/glxew.h>
#endif
@@ -47,7 +47,7 @@
# ifdef _WIN32
WGLEWContext _wglewctx;
# define wglewGetContext() (&_wglewctx)
-# elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX)
+# elif !defined(__APPLE__) && !defined(__HAIKU__) || defined(GLEW_APPLE_GLX)
GLXEWContext _glxewctx;
# define glxewGetContext() (&_glxewctx)
# endif
@@ -61,7 +61,7 @@
HGLRC rc;
#elif defined(__APPLE__) && !defined(GLEW_APPLE_GLX)
AGLContext ctx, octx;
-#else
+#elif !defined(__HAIKU__)
Display* dpy;
XVisualInfo* vi;
GLXContext ctx;
@@ -129,7 +129,7 @@
err = glewContextInit(glewGetContext());
# ifdef _WIN32
err = err || wglewContextInit(wglewGetContext());
-# elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX)
+# elif !defined(__APPLE__) && !defined(__HAIKU__) || defined(GLEW_APPLE_GLX)
err = err || glxewContextInit(glxewGetContext());
# endif
#else
@@ -179,6 +179,8 @@
}
#elif defined(__APPLE__) && !defined(GLEW_APPLE_GLX)
+#elif defined(__HAIKU__)
+
#else
/* GLX extensions */
fprintf(file, "GLX extensions (GLX_): \n");
@@ -593,6 +595,16 @@
*/
}
+/* ---------------------------------------------------------------------- */
+
+#elif defined(__HAIKU__)
+
+void
+VisualInfo (GLContext* ctx)
+{
+ // TODO
+}
+
#else /* GLX */
void
@@ -1069,6 +1081,31 @@
/* ------------------------------------------------------------------------ */
+#elif defined(__HAIKU__)
+
+void
+InitContext (GLContext* ctx)
+{
+ // TODO
+}
+
+
+GLboolean
+CreateContext (GLContext* ctx)
+{
+ // TODO
+ return GL_FALSE;
+}
+
+
+void
+DestroyContext (GLContext* ctx)
+{
+ // TODO
+}
+
+/* ------------------------------------------------------------------------ */
+
#else /* __UNIX || (__APPLE__ && GLEW_APPLE_GLX) */
void InitContext (GLContext* ctx)