mirror of
https://github.com/nigels-com/glew.git
synced 2024-11-11 08:43:49 +00:00
added Solaris support
git-svn-id: https://glew.svn.sourceforge.net/svnroot/glew/trunk/glew@154 783a27ee-832a-0410-bc00-9f386506c6dd
This commit is contained in:
parent
a17580e044
commit
412814404b
32
Makefile
32
Makefile
@ -1,4 +1,4 @@
|
||||
#! gmake
|
||||
#!gmake
|
||||
## The OpenGL Extension Wrangler Library
|
||||
## Copyright (C) 2003, 2002, Milan Ikits <milan.ikits@ieee.org>
|
||||
## Copyright (C) 2003, 2002, Marcelo E. Magallon <mmagallo@debian.org>
|
||||
@ -41,7 +41,6 @@ TARBALL = ../glew_$(GLEW_VERSION).tar.gz
|
||||
SHELL = /bin/sh
|
||||
SYSTEM = $(strip $(shell uname -s))
|
||||
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# Cygwin
|
||||
# ----------------------------------------------------------------------------
|
||||
@ -53,10 +52,9 @@ CFLAGS.EXTRA = -DGLEW_STATIC
|
||||
LDFLAGS.SO = -shared -soname $(LIB.SONAME)
|
||||
LDFLAGS.GL = -lglu32 -lopengl32 -lgdi32 -luser32 -lkernel32
|
||||
LDFLAGS.EXTRA =
|
||||
|
||||
WARN = -Wall -W
|
||||
POPT = -O2
|
||||
BIN.SUFFIX = .exe
|
||||
|
||||
LIB.SONAME = lib$(NAME).so.$(GLEW_MAJOR)
|
||||
LIB.DEVLNK = lib$(NAME).so
|
||||
LIB.SHARED = lib$(NAME).so.$(GLEW_VERSION)
|
||||
@ -76,6 +74,7 @@ LDFLAGS.EXTRA = -L/usr/X11R6/lib
|
||||
LDFLAGS.GL = -lXmu -lXi -lGLU -lGL -lXext -lX11
|
||||
NAME = GLEW
|
||||
WARN = -Wall -W
|
||||
POPT = -O2
|
||||
BIN.SUFFIX =
|
||||
LIB.SONAME = lib$(NAME).so.$(GLEW_MAJOR)
|
||||
LIB.DEVLNK = lib$(NAME).so
|
||||
@ -99,6 +98,7 @@ LDFLAGS.EXTRA =
|
||||
LDFLAGS.GL = -lGL -lXext -lX11
|
||||
NAME = GLEW
|
||||
WARN = -fullwarn -woff 1110,1498
|
||||
POPT = -O2
|
||||
BIN.SUFFIX =
|
||||
LIB.SONAME = lib$(NAME).so.$(GLEW_MAJOR)
|
||||
LIB.DEVLNK = lib$(NAME).so
|
||||
@ -125,11 +125,32 @@ endif
|
||||
NAME = GLEW
|
||||
BIN.SUFFIX =
|
||||
WARN = -Wall -W
|
||||
POPT = -O2
|
||||
LIB.SONAME = lib$(NAME).$(GLEW_MAJOR).dylib
|
||||
LIB.DEVLNK = lib$(NAME).dylib
|
||||
LIB.SHARED = lib$(NAME).$(GLEW_VERSION).dylib
|
||||
LIB.STATIC = lib$(NAME).a
|
||||
|
||||
else
|
||||
# ----------------------------------------------------------------------------
|
||||
# Solaris
|
||||
# ----------------------------------------------------------------------------
|
||||
ifeq ($(patsubst SunOS%,SunOS,$(SYSTEM)), SunOS)
|
||||
NAME = GLEW
|
||||
CC = cc
|
||||
LD = ld
|
||||
CFLAGS.EXTRA = -I/usr/openwin/include
|
||||
LDFLAGS.SO = -shared
|
||||
LDFLAGS.EXTRA = -L/usr/openwin/lib
|
||||
LDFLAGS.GL = -lXmu -lXi -lGLU -lGL -lXext -lX11
|
||||
NAME = GLEW
|
||||
BIN.SUFFIX =
|
||||
WARN =
|
||||
POPT = -xO2
|
||||
LIB.SONAME = lib$(NAME).so.$(GLEW_MAJOR)
|
||||
LIB.DEVLNK = lib$(NAME).so
|
||||
LIB.SHARED = lib$(NAME).so.$(GLEW_VERSION)
|
||||
LIB.STATIC = lib$(NAME).a
|
||||
else
|
||||
# ----------------------------------------------------------------------------
|
||||
$(error "Platform '$(SYSTEM)' not supported")
|
||||
@ -137,6 +158,7 @@ endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
AR = ar
|
||||
INSTALL = install
|
||||
@ -146,7 +168,7 @@ ifeq ($(MAKECMDGOALS), debug)
|
||||
OPT = -g
|
||||
STRIP =
|
||||
else
|
||||
OPT = -O2
|
||||
OPT = $(POPT)
|
||||
STRIP = -s
|
||||
endif
|
||||
INCLUDE = -Iinclude
|
||||
|
@ -18,7 +18,7 @@ do 'bin/make.pl';
|
||||
sub make_pfn_info($%)
|
||||
{
|
||||
my $name = prefixname($_[0]);
|
||||
return " glewInfoFunc(\"$_[0]\", $name == NULL);";
|
||||
return " glewInfoFunc((const GLubyte*)\"$_[0]\", $name == NULL);";
|
||||
}
|
||||
|
||||
#---------------------------------------------------------------------------------------
|
||||
@ -48,12 +48,12 @@ foreach my $ext (sort @extlist)
|
||||
print "static void _glewInfo_$extname (void)\n{\n";
|
||||
if ($extvar =~ /VERSION/)
|
||||
{
|
||||
print " glewPrintExt(\"$extname\", $extvar, $extvar);\n";
|
||||
print " glewPrintExt((const GLubyte*)\"$extname\", $extvar, $extvar);\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
print " glewPrintExt(\"$extname\", $extvar, $extpre" .
|
||||
"ewGetExtension(\"$extname\"));\n";
|
||||
print " glewPrintExt((const GLubyte*)\"$extname\", $extvar, $extpre" .
|
||||
"ewGetExtension((const GLubyte*)\"$extname\"));\n";
|
||||
}
|
||||
output_decls($functions, \&make_pfn_info);
|
||||
print "}\n\n";
|
||||
|
@ -24,7 +24,7 @@ sub make_pfn_def($%)
|
||||
sub make_init_call($%)
|
||||
{
|
||||
my $name = prefixname($_[0]);
|
||||
return " r = r || (" . $name . " = (PFN" . (uc $_[0]) . "PROC)glewGetProcAddress(\"" . $name . "\")) == NULL;";
|
||||
return " r = r || (" . $name . " = (PFN" . (uc $_[0]) . "PROC)glewGetProcAddress((const GLubyte*)\"" . $name . "\")) == NULL;";
|
||||
}
|
||||
|
||||
#---------------------------------------------------------------------------------------
|
||||
|
@ -24,7 +24,7 @@ sub make_pfn_def($%)
|
||||
sub make_pfn_def_init($%)
|
||||
{
|
||||
my $name = prefixname($_[0]);
|
||||
return " r = ((" . $name . " = (PFN" . (uc $_[0]) . "PROC)glewGetProcAddress(\"" . $_[0] . "\")) == NULL) || r;";
|
||||
return " r = ((" . $name . " = (PFN" . (uc $_[0]) . "PROC)glewGetProcAddress((const GLubyte*)\"" . $_[0] . "\")) == NULL) || r;";
|
||||
}
|
||||
|
||||
#---------------------------------------------------------------------------------------
|
||||
|
@ -51,7 +51,7 @@ foreach my $ext (sort @extlist)
|
||||
$extpre =~ s/^(W?)GL(X?).*$/\l$1gl\l$2ew/;
|
||||
|
||||
print "#ifdef $extname\n";
|
||||
print " $extvar = " . $extpre . "GetExtension(\"$extname\");\n";
|
||||
print " $extvar = " . $extpre . "GetExtension((const GLubyte*)\"$extname\");\n";
|
||||
if (keys %$functions)
|
||||
{
|
||||
if ($extname =~ /WGL_.*/)
|
||||
|
@ -75,7 +75,7 @@ my %typemap = (
|
||||
);
|
||||
|
||||
my %voidtypemap = (
|
||||
void => "GLvoid ",
|
||||
void => "GLvoid",
|
||||
);
|
||||
|
||||
my %taboo_tokens = (
|
||||
|
@ -9,11 +9,11 @@ const GLubyte* glewGetErrorString (GLenum error)
|
||||
{
|
||||
static const GLubyte* _glewErrorString[] =
|
||||
{
|
||||
"No error",
|
||||
"Missing GL version",
|
||||
"GL 1.1 and up are not supported",
|
||||
"GLX 1.2 and up are not supported",
|
||||
"Unknown error"
|
||||
(const GLubyte*)"No error",
|
||||
(const GLubyte*)"Missing GL version",
|
||||
(const GLubyte*)"GL 1.1 and up are not supported",
|
||||
(const GLubyte*)"GLX 1.2 and up are not supported",
|
||||
(const GLubyte*)"Unknown error"
|
||||
};
|
||||
const int max_error = sizeof(_glewErrorString)/sizeof(*_glewErrorString) - 1;
|
||||
return _glewErrorString[(int)error > max_error ? max_error : (int)error];
|
||||
@ -23,8 +23,8 @@ const GLubyte* glewGetString (GLenum name)
|
||||
{
|
||||
static const GLubyte* _glewString[] =
|
||||
{
|
||||
NULL,
|
||||
"GLEW_VERSION_STRING"
|
||||
(const GLubyte*)NULL,
|
||||
(const GLubyte*)"GLEW_VERSION_STRING"
|
||||
};
|
||||
const int max_string = sizeof(_glewString)/sizeof(*_glewString) - 1;
|
||||
return _glewString[(int)name > max_string ? 0 : (int)name];
|
||||
|
@ -42,7 +42,7 @@
|
||||
# if defined(__APPLE__)
|
||||
# define glewGetProcAddress(name) NSGLGetProcAddress(name)
|
||||
# else
|
||||
# if defined(__sgi)
|
||||
# if defined(__sgi) || defined(__sun)
|
||||
# define glewGetProcAddress(name) dlGetProcAddress(name)
|
||||
# else /* __linux */
|
||||
# define glewGetProcAddress(name) (*glXGetProcAddressARB)(name)
|
||||
@ -55,13 +55,13 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
static void* NSGLGetProcAddress (const char* name)
|
||||
static void *NSGLGetProcAddress (const GLubyte *name)
|
||||
{
|
||||
NSSymbol symbol;
|
||||
char* symbolName;
|
||||
char *symbolName;
|
||||
/* prepend a '_' for the Unix C symbol mangling convention */
|
||||
symbolName = malloc(strlen(name) + 2);
|
||||
strcpy(symbolName+1, name);
|
||||
symbolName = malloc(strlen((const char *)name) + 2);
|
||||
strcpy(symbolName+1, (const char *)name);
|
||||
symbolName[0] = '_';
|
||||
symbol = NULL;
|
||||
if (NSIsSymbolNameDefined(symbolName))
|
||||
@ -71,14 +71,14 @@ static void* NSGLGetProcAddress (const char* name)
|
||||
}
|
||||
#endif /* __APPLE__ */
|
||||
|
||||
#if defined(__sgi)
|
||||
#if defined(__sgi) || defined (__sun)
|
||||
#include <dlfcn.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
static void* dlGetProcAddress (const char* name)
|
||||
static void *dlGetProcAddress (const GLubyte* name)
|
||||
{
|
||||
static void* h = NULL;
|
||||
static void *h = NULL;
|
||||
static void *gpa;
|
||||
|
||||
if (h == NULL)
|
||||
@ -88,11 +88,11 @@ static void* dlGetProcAddress (const char* name)
|
||||
}
|
||||
|
||||
if (gpa != NULL)
|
||||
return ((void* (*)(const GLubyte*))gpa)((const GLubyte*)name);
|
||||
return ((void *(*)(const GLubyte *))gpa)(name);
|
||||
else
|
||||
return dlsym(h, name);
|
||||
return dlsym(h, (const char *)name);
|
||||
}
|
||||
#endif /* __sgi */
|
||||
#endif /* __sgi || __sun */
|
||||
|
||||
/* ----------------------------- GL_VERSION_1_1 ---------------------------- */
|
||||
|
||||
|
@ -75,7 +75,7 @@ static void glewInfoFunc (const GLubyte* name, GLint undefined)
|
||||
|
||||
static void _glewInfo_GL_VERSION_1_1 (void)
|
||||
{
|
||||
glewPrintExt("GL_VERSION_1_1", GLEW_VERSION_1_1, GLEW_VERSION_1_1);
|
||||
glewPrintExt((const GLubyte*)"GL_VERSION_1_1", GLEW_VERSION_1_1, GLEW_VERSION_1_1);
|
||||
}
|
||||
|
||||
#endif /* GL_VERSION_1_1 */
|
||||
|
Loading…
Reference in New Issue
Block a user