mirror of
https://github.com/izzy2lost/dolphin.git
synced 2026-06-19 01:16:48 -07:00
Trim down the SDL and GLEW libraries to just those files we use.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5720 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Vendored
-73
@@ -1,73 +0,0 @@
|
||||
The OpenGL Extension Wrangler Library
|
||||
Copyright (C) 2002-2007, Milan Ikits <milan ikits[]ieee org>
|
||||
Copyright (C) 2002-2007, Marcelo E. Magallon <mmagallo[]debian org>
|
||||
Copyright (C) 2002, Lev Povalahev
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
* The name of the author may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
Mesa 3-D graphics library
|
||||
Version: 7.0
|
||||
|
||||
Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a
|
||||
copy of this software and associated documentation files (the "Software"),
|
||||
to deal in the Software without restriction, including without limitation
|
||||
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
and/or sell copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included
|
||||
in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
|
||||
Copyright (c) 2007 The Khronos Group Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a
|
||||
copy of this software and/or associated documentation files (the
|
||||
"Materials"), to deal in the Materials without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Materials, and to
|
||||
permit persons to whom the Materials are furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included
|
||||
in all copies or substantial portions of the Materials.
|
||||
|
||||
THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
Vendored
-268
@@ -1,268 +0,0 @@
|
||||
#!gmake
|
||||
## The OpenGL Extension Wrangler Library
|
||||
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
|
||||
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
|
||||
## Copyright (C) 2002, Lev Povalahev
|
||||
## All rights reserved.
|
||||
##
|
||||
## Redistribution and use in source and binary forms, with or without
|
||||
## modification, are permitted provided that the following conditions are met:
|
||||
##
|
||||
## * Redistributions of source code must retain the above copyright notice,
|
||||
## this list of conditions and the following disclaimer.
|
||||
## * Redistributions in binary form must reproduce the above copyright notice,
|
||||
## this list of conditions and the following disclaimer in the documentation
|
||||
## and/or other materials provided with the distribution.
|
||||
## * The name of the author may be used to endorse or promote products
|
||||
## derived from this software without specific prior written permission.
|
||||
##
|
||||
## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
## AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
## ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
## LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
## CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
## SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
## INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
## CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
## ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
## THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
include config/version
|
||||
|
||||
SHELL = /bin/sh
|
||||
SYSTEM = $(shell config/config.guess | cut -d - -f 3 | sed -e 's/[0-9\.]//g;')
|
||||
SYSTEM.SUPPORTED = $(shell test -f config/Makefile.$(SYSTEM) && echo 1)
|
||||
|
||||
ifeq ($(SYSTEM.SUPPORTED), 1)
|
||||
include config/Makefile.$(SYSTEM)
|
||||
else
|
||||
$(error "Platform '$(SYSTEM)' not supported")
|
||||
endif
|
||||
|
||||
GLEW_DEST ?= /usr
|
||||
BINDIR ?= $(GLEW_DEST)/bin
|
||||
LIBDIR ?= $(GLEW_DEST)/lib
|
||||
INCDIR ?= $(GLEW_DEST)/include/GL
|
||||
SHARED_OBJ_EXT ?= o
|
||||
TARDIR = ../glew-$(GLEW_VERSION)
|
||||
TARBALL = ../glew-$(GLEW_VERSION).tar.gz
|
||||
|
||||
DIST_DIR = glew-$(GLEW_VERSION)
|
||||
DIST_WIN32 = glew-$(GLEW_VERSION)-win32.zip
|
||||
DIST_SRC_ZIP = glew-$(GLEW_VERSION).zip
|
||||
DIST_SRC_TGZ = glew-$(GLEW_VERSION).tgz
|
||||
|
||||
AR = ar
|
||||
INSTALL = install
|
||||
STRIP = strip
|
||||
RM = rm -f
|
||||
LN = ln -sf
|
||||
ifeq ($(MAKECMDGOALS), debug)
|
||||
OPT = -g
|
||||
else
|
||||
OPT = $(POPT)
|
||||
endif
|
||||
INCLUDE = -Iinclude
|
||||
CFLAGS = $(OPT) $(WARN) $(INCLUDE) $(CFLAGS.EXTRA)
|
||||
|
||||
LIB.SRCS = src/glew.c
|
||||
LIB.OBJS = $(LIB.SRCS:.c=.o)
|
||||
LIB.SOBJS = $(LIB.SRCS:.c=.$(SHARED_OBJ_EXT))
|
||||
LIB.LDFLAGS = $(LDFLAGS.EXTRA) $(LDFLAGS.GL)
|
||||
LIB.LIBS = $(GL_LDFLAGS)
|
||||
|
||||
GLEWINFO.BIN = glewinfo$(BIN.SUFFIX)
|
||||
GLEWINFO.BIN.SRCS = src/glewinfo.c
|
||||
GLEWINFO.BIN.OBJS = $(GLEWINFO.BIN.SRCS:.c=.o)
|
||||
VISUALINFO.BIN = visualinfo$(BIN.SUFFIX)
|
||||
VISUALINFO.BIN.SRCS = src/visualinfo.c
|
||||
VISUALINFO.BIN.OBJS = $(VISUALINFO.BIN.SRCS:.c=.o)
|
||||
BIN.LIBS = -Llib $(LDFLAGS.DYNAMIC) -l$(NAME) $(LDFLAGS.EXTRA) $(LDFLAGS.GL)
|
||||
|
||||
all debug: lib/$(LIB.SHARED) lib/$(LIB.STATIC) bin/$(GLEWINFO.BIN) bin/$(VISUALINFO.BIN) glew.pc
|
||||
|
||||
lib:
|
||||
mkdir lib
|
||||
|
||||
lib/$(LIB.STATIC): $(LIB.OBJS)
|
||||
$(AR) cr $@ $^
|
||||
|
||||
lib/$(LIB.SHARED): $(LIB.SOBJS)
|
||||
$(LD) $(LDFLAGS.SO) -o $@ $^ $(LIB.LDFLAGS) $(LIB.LIBS)
|
||||
ifeq ($(patsubst mingw%,mingw,$(SYSTEM)), mingw)
|
||||
else
|
||||
$(LN) $(LIB.SHARED) lib/$(LIB.SONAME)
|
||||
$(LN) $(LIB.SHARED) lib/$(LIB.DEVLNK)
|
||||
endif
|
||||
|
||||
bin/$(GLEWINFO.BIN): $(GLEWINFO.BIN.OBJS) lib/$(LIB.SHARED)
|
||||
$(CC) $(CFLAGS) -o $@ $(GLEWINFO.BIN.OBJS) $(BIN.LIBS)
|
||||
|
||||
bin/$(VISUALINFO.BIN): $(VISUALINFO.BIN.OBJS) lib/$(LIB.SHARED)
|
||||
$(CC) $(CFLAGS) -o $@ $(VISUALINFO.BIN.OBJS) $(BIN.LIBS)
|
||||
|
||||
%.o: %.c
|
||||
$(CC) -c $(CFLAGS) -o $@ $<
|
||||
|
||||
src/glew.o: src/glew.c include/GL/glew.h include/GL/wglew.h include/GL/glxew.h
|
||||
$(CC) $(CFLAGS) $(CFLAGS.SO) -o $@ -c $<
|
||||
|
||||
src/glew.pic_o: src/glew.c include/GL/glew.h include/GL/wglew.h include/GL/glxew.h
|
||||
$(CC) $(CFLAGS) $(PICFLAG) $(CFLAGS.SO) -o $@ -c $<
|
||||
|
||||
glew.pc: glew.pc.in
|
||||
sed \
|
||||
-e "s|@prefix@|$(GLEW_DEST)|g" \
|
||||
-e "s|@libdir@|$(LIBDIR)|g" \
|
||||
-e "s|@exec_prefix@|$(BINDIR)|g" \
|
||||
-e "s|@includedir@|$(INCDIR)|g" \
|
||||
-e "s|@version@|$(GLEW_VERSION)|g" \
|
||||
< $< > $@
|
||||
|
||||
install: all
|
||||
# directories
|
||||
$(INSTALL) -d -m 0755 $(BINDIR)
|
||||
$(INSTALL) -d -m 0755 $(INCDIR)
|
||||
$(INSTALL) -d -m 0755 $(LIBDIR)
|
||||
# runtime
|
||||
ifeq ($(patsubst mingw%,mingw,$(SYSTEM)), mingw)
|
||||
$(STRIP) -x lib/$(LIB.SHARED)
|
||||
$(INSTALL) -m 0644 lib/$(LIB.SHARED) $(BINDIR)/
|
||||
else
|
||||
$(STRIP) -x lib/$(LIB.SHARED)
|
||||
$(INSTALL) -m 0644 lib/$(LIB.SHARED) $(LIBDIR)/
|
||||
$(LN) $(LIB.SHARED) $(LIBDIR)/$(LIB.SONAME)
|
||||
endif
|
||||
# development files
|
||||
$(INSTALL) -m 0644 include/GL/wglew.h $(INCDIR)/
|
||||
$(INSTALL) -m 0644 include/GL/glew.h $(INCDIR)/
|
||||
$(INSTALL) -m 0644 include/GL/glxew.h $(INCDIR)/
|
||||
$(INSTALL) -m 0644 glew.pc $(LIBDIR)/pkgconfig/
|
||||
ifeq ($(patsubst mingw%,mingw,$(SYSTEM)), mingw)
|
||||
$(INSTALL) -m 0644 lib/$(LIB.DEVLNK) $(LIBDIR)/
|
||||
else
|
||||
$(STRIP) -x lib/$(LIB.STATIC)
|
||||
$(INSTALL) -m 0644 lib/$(LIB.STATIC) $(LIBDIR)/
|
||||
$(LN) $(LIB.SHARED) $(LIBDIR)/$(LIB.DEVLNK)
|
||||
endif
|
||||
# utilities
|
||||
$(INSTALL) -s -m 0755 bin/$(GLEWINFO.BIN) bin/$(VISUALINFO.BIN) $(BINDIR)/
|
||||
|
||||
uninstall:
|
||||
$(RM) $(INCDIR)/wglew.h
|
||||
$(RM) $(INCDIR)/glew.h
|
||||
$(RM) $(INCDIR)/glxew.h
|
||||
$(RM) $(LIBDIR)/$(LIB.DEVLNK)
|
||||
ifeq ($(patsubst mingw%,mingw,$(SYSTEM)), mingw)
|
||||
$(RM) $(BINDIR)/$(LIB.SHARED)
|
||||
else
|
||||
$(RM) $(LIBDIR)/$(LIB.SONAME)
|
||||
$(RM) $(LIBDIR)/$(LIB.SHARED)
|
||||
$(RM) $(LIBDIR)/$(LIB.STATIC)
|
||||
endif
|
||||
$(RM) $(BINDIR)/$(GLEWINFO.BIN) $(BINDIR)/$(VISUALINFO.BIN)
|
||||
|
||||
clean:
|
||||
$(RM) $(LIB.OBJS)
|
||||
$(RM) $(LIB.SOBJS)
|
||||
$(RM) lib/$(LIB.STATIC) lib/$(LIB.SHARED) lib/$(LIB.DEVLNK) lib/$(LIB.SONAME) $(LIB.STATIC)
|
||||
$(RM) $(GLEWINFO.BIN.OBJS) bin/$(GLEWINFO.BIN) $(VISUALINFO.BIN.OBJS) bin/$(VISUALINFO.BIN)
|
||||
$(RM) glew.pc
|
||||
# Compiler droppings
|
||||
$(RM) so_locations
|
||||
|
||||
distclean: clean
|
||||
find . -name \*~ | xargs $(RM)
|
||||
find . -name .\*.sw\? | xargs $(RM)
|
||||
|
||||
tardist:
|
||||
$(RM) -r $(TARDIR)
|
||||
mkdir $(TARDIR)
|
||||
cp -a . $(TARDIR)
|
||||
find $(TARDIR) -name CVS -o -name .cvsignore | xargs $(RM) -r
|
||||
find $(TARDIR) -name .svn | xargs $(RM) -r
|
||||
$(MAKE) -C $(TARDIR) distclean
|
||||
$(MAKE) -C $(TARDIR)
|
||||
$(MAKE) -C $(TARDIR) distclean
|
||||
$(RM) -r $(TARDIR)/auto/registry
|
||||
env GZIP=-9 tar -C `dirname $(TARDIR)` -cvzf $(TARBALL) `basename $(TARDIR)`
|
||||
|
||||
dist-win32:
|
||||
$(RM) -r $(TARDIR)
|
||||
mkdir -p $(TARDIR)
|
||||
mkdir -p $(TARDIR)/bin
|
||||
mkdir -p $(TARDIR)/lib
|
||||
cp -a include $(TARDIR)
|
||||
cp -a doc $(TARDIR)
|
||||
cp -a *.txt $(TARDIR)
|
||||
cp -a lib/glew32.lib $(TARDIR)/lib
|
||||
cp -a lib/glew32s.lib $(TARDIR)/lib
|
||||
cp -a bin/glew32.dll $(TARDIR)/bin
|
||||
cp -a bin/glewinfo.exe $(TARDIR)/bin
|
||||
cp -a bin/visualinfo.exe $(TARDIR)/bin
|
||||
find $(TARDIR) -name CVS -o -name .cvsignore | xargs $(RM) -r
|
||||
find $(TARDIR) -name .svn | xargs $(RM) -r
|
||||
unix2dos $(TARDIR)/include/GL/*.h
|
||||
unix2dos $(TARDIR)/doc/*.txt
|
||||
unix2dos $(TARDIR)/doc/*.html
|
||||
unix2dos $(TARDIR)/*.txt
|
||||
rm -f ../$(DIST_WIN32)
|
||||
cd .. && zip -rv9 $(DIST_WIN32) $(DIST_DIR)
|
||||
|
||||
dist-src:
|
||||
$(RM) -r $(TARDIR)
|
||||
mkdir -p $(TARDIR)
|
||||
mkdir -p $(TARDIR)/bin
|
||||
mkdir -p $(TARDIR)/lib
|
||||
cp -a auto $(TARDIR)
|
||||
$(RM) -Rf $(TARDIR)/auto/registry
|
||||
cp -a build $(TARDIR)
|
||||
cp -a config $(TARDIR)
|
||||
cp -a src $(TARDIR)
|
||||
cp -a doc $(TARDIR)
|
||||
cp -a include $(TARDIR)
|
||||
cp -a *.txt $(TARDIR)
|
||||
cp -a Makefile $(TARDIR)
|
||||
cp -a glew.pc.in $(TARDIR)
|
||||
find $(TARDIR) -name '*.o' | xargs $(RM) -r
|
||||
find $(TARDIR) -name '*.pic_o' | xargs $(RM) -r
|
||||
find $(TARDIR) -name '*~' | xargs $(RM) -r
|
||||
find $(TARDIR) -name CVS -o -name .cvsignore | xargs $(RM) -r
|
||||
find $(TARDIR) -name .svn | xargs $(RM) -r
|
||||
unix2dos $(TARDIR)/config/*
|
||||
unix2dos $(TARDIR)/auto/core/*
|
||||
unix2dos $(TARDIR)/auto/extensions/*
|
||||
find $(TARDIR) -name '*.h' | xargs unix2dos
|
||||
find $(TARDIR) -name '*.c' | xargs unix2dos
|
||||
find $(TARDIR) -name '*.txt' | xargs unix2dos
|
||||
find $(TARDIR) -name '*.html' | xargs unix2dos
|
||||
find $(TARDIR) -name '*.css' | xargs unix2dos
|
||||
find $(TARDIR) -name '*.sh' | xargs unix2dos
|
||||
find $(TARDIR) -name '*.pl' | xargs unix2dos
|
||||
find $(TARDIR) -name 'Makefile' | xargs unix2dos
|
||||
find $(TARDIR) -name '*.in' | xargs unix2dos
|
||||
find $(TARDIR) -name '*.pm' | xargs unix2dos
|
||||
find $(TARDIR) -name '*.rc' | xargs unix2dos
|
||||
rm -f ../$(DIST_SRC_ZIP)
|
||||
cd .. && zip -rv9 $(DIST_SRC_ZIP) $(DIST_DIR)
|
||||
dos2unix $(TARDIR)/config/*
|
||||
dos2unix $(TARDIR)/auto/core/*
|
||||
dos2unix $(TARDIR)/auto/extensions/*
|
||||
find $(TARDIR) -name '*.h' | xargs dos2unix
|
||||
find $(TARDIR) -name '*.c' | xargs dos2unix
|
||||
find $(TARDIR) -name '*.txt' | xargs dos2unix
|
||||
find $(TARDIR) -name '*.html' | xargs dos2unix
|
||||
find $(TARDIR) -name '*.css' | xargs dos2unix
|
||||
find $(TARDIR) -name '*.sh' | xargs dos2unix
|
||||
find $(TARDIR) -name '*.pl' | xargs dos2unix
|
||||
find $(TARDIR) -name 'Makefile' | xargs dos2unix
|
||||
find $(TARDIR) -name '*.in' | xargs dos2unix
|
||||
find $(TARDIR) -name '*.pm' | xargs dos2unix
|
||||
find $(TARDIR) -name '*.rc' | xargs dos2unix
|
||||
cd .. && env GZIP=-9 tar cvzf $(DIST_SRC_TGZ) $(DIST_DIR)
|
||||
|
||||
extensions:
|
||||
$(MAKE) -C auto
|
||||
|
||||
.PHONY: clean distclean tardist dist-win32 dist-src
|
||||
Vendored
-18
@@ -1,18 +0,0 @@
|
||||
See doc/index.html for more information.
|
||||
|
||||
If you downloaded the tarball from the GLEW website, you just need to:
|
||||
|
||||
Unix:
|
||||
|
||||
make
|
||||
|
||||
Windows:
|
||||
|
||||
use the project file in build/vc6/
|
||||
|
||||
If you wish to build GLEW from scratch (update the extension data from
|
||||
the net or add your own extension information), you need a Unix
|
||||
environment (including wget, perl, and GNU make). The extension data
|
||||
is regenerated from the top level source directory with:
|
||||
|
||||
make extensions
|
||||
Vendored
-12
@@ -1,12 +0,0 @@
|
||||
Major:
|
||||
- add support for windows mini-client drivers
|
||||
- add windows installer (msi)
|
||||
- separate build of static and shared object files (for mingw and
|
||||
cygwin)
|
||||
- start designing GLEW 2.0
|
||||
|
||||
Minor:
|
||||
- make auto scripts work with text mode cygwin mounts
|
||||
- add support for all SUN, MTX, and OML extensions
|
||||
- make auto/Makefile more robust against auto/core/*~ mistakes
|
||||
- web poll on separating glew, glxew and wglew
|
||||
Vendored
-371
@@ -1,371 +0,0 @@
|
||||
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
|
||||
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
|
||||
##
|
||||
## This program is distributed under the terms and conditions of the GNU
|
||||
## General Public License Version 2 as published by the Free Software
|
||||
## Foundation or, at your option, any later version.
|
||||
|
||||
include ../config/version
|
||||
|
||||
#GLEW_SPLIT_SOURCE = yes
|
||||
|
||||
SHELL = bash
|
||||
REGISTRY = registry
|
||||
REGISTRY_URL = http://www.opengl.org/registry/
|
||||
#http://oss.sgi.com/projects/ogl-sample/registry/
|
||||
BIN = bin
|
||||
SRC = src
|
||||
CORE = core
|
||||
EXT = extensions
|
||||
BLACKLIST = blacklist
|
||||
|
||||
GL_CORE_SPEC := $(CORE)/GL_VERSION*
|
||||
GLX_CORE_SPEC := $(CORE)/GLX_VERSION*
|
||||
ifeq (custom,$(MAKECMDGOALS))
|
||||
#GL_CORE_SPEC := $(shell grep GL_VERSION custom.txt | sed -e 's/\(.*\)/$(CORE)\/\1/g;')
|
||||
GL_EXT_SPEC := $(shell grep "^[ \t]*GL_" custom.txt | grep -v GL_VERSION | sed -e 's/\(.*\)/$(EXT)\/\1/g;')
|
||||
WGL_EXT_SPEC := $(shell grep "^[ \t]*WGL_" custom.txt | sed -e 's/\(.*\)/$(EXT)\/\1/g;')
|
||||
#GLX_CORE_SPEC := $(shell grep GLX_VERSION custom.txt | sed -e 's/\(.*\)/$(CORE)\/\1/g;')
|
||||
GLX_EXT_SPEC := $(shell grep "^[ \t]*GLX_" custom.txt | grep -v GLX_VERSION | grep -v GLX_OML_sync_control | sed -e 's/\(.*\)/$(EXT)\/\1/g;')
|
||||
else
|
||||
GL_EXT_SPEC := $(EXT)/GL_*
|
||||
WGL_EXT_SPEC := $(EXT)/WGL_*
|
||||
GLX_EXT_SPEC := $(EXT)/GLX_*
|
||||
endif
|
||||
|
||||
PARSE_SPEC = parse_spec.pl
|
||||
SYSTEM = $(strip $(shell uname -s))
|
||||
|
||||
TOP = ..
|
||||
I.DEST = $(TOP)/include/GL
|
||||
S.DEST = $(TOP)/src
|
||||
D.DEST = $(TOP)/doc
|
||||
B.DEST = $(TOP)/build/vc6
|
||||
|
||||
I.TARGETS = \
|
||||
$(I.DEST)/glew.h \
|
||||
$(I.DEST)/wglew.h \
|
||||
$(I.DEST)/glxew.h
|
||||
|
||||
ifeq (yes,$(GLEW_SPLIT_SOURCE))
|
||||
S.TARGETS = \
|
||||
$(S.DEST)/glew_def.c \
|
||||
$(S.DEST)/glew_init.c \
|
||||
$(S.DEST)/glew_str.c \
|
||||
$(S.DEST)/glewinfo.c
|
||||
else
|
||||
S.TARGETS = \
|
||||
$(S.DEST)/glew.c \
|
||||
$(S.DEST)/glewinfo.c
|
||||
endif
|
||||
|
||||
D.TARGETS = \
|
||||
$(D.DEST)/index.html \
|
||||
$(D.DEST)/install.html \
|
||||
$(D.DEST)/basic.html \
|
||||
$(D.DEST)/advanced.html \
|
||||
$(D.DEST)/credits.html \
|
||||
$(D.DEST)/log.html \
|
||||
$(D.DEST)/glew.html \
|
||||
$(D.DEST)/wglew.html \
|
||||
$(D.DEST)/glxew.html
|
||||
|
||||
B.TARGETS = \
|
||||
$(B.DEST)/glew.rc \
|
||||
$(B.DEST)/glewinfo.rc \
|
||||
$(B.DEST)/visualinfo.rc
|
||||
|
||||
all custom: $(I.TARGETS) $(S.TARGETS) $(D.TARGETS) $(B.TARGETS)
|
||||
|
||||
registry: $(REGISTRY)/.dummy
|
||||
ext: $(EXT)/.dummy
|
||||
|
||||
$(REGISTRY)/.dummy: $(BIN)/update_registry.sh
|
||||
@echo "--------------------------------------------------------------------"
|
||||
@echo "Downloading registry"
|
||||
@echo "--------------------------------------------------------------------"
|
||||
$(BIN)/update_registry.sh $(REGISTRY) $(REGISTRY_URL)
|
||||
touch $@
|
||||
|
||||
$(EXT)/.dummy: $(REGISTRY)/.dummy
|
||||
@echo "--------------------------------------------------------------------"
|
||||
@echo "Creating descriptors"
|
||||
@echo "--------------------------------------------------------------------"
|
||||
rm -rf $(EXT)
|
||||
$(BIN)/update_ext.sh $(EXT) $(REGISTRY) $(BLACKLIST)
|
||||
ifeq ($(patsubst Darwin%,Darwin,$(SYSTEM)), Darwin)
|
||||
find $(CORE) -maxdepth 1 -type f | grep -v VERSION | grep -v "~" | \
|
||||
xargs -J % cp % $(EXT)
|
||||
else
|
||||
find $(CORE) -maxdepth 1 -type f | grep -v VERSION | grep -v "~" | \
|
||||
xargs cp --target-directory=$(EXT)
|
||||
endif
|
||||
touch $@
|
||||
|
||||
$(I.DEST)/glew.h: $(EXT)/.dummy
|
||||
@echo "--------------------------------------------------------------------"
|
||||
@echo "Creating glew.h"
|
||||
@echo "--------------------------------------------------------------------"
|
||||
test -d $(I.DEST) || mkdir -p $(I.DEST)
|
||||
cp -f $(SRC)/glew_license.h $@
|
||||
cat $(SRC)/mesa_license.h >> $@
|
||||
cat $(SRC)/khronos_license.h >> $@
|
||||
cat $(SRC)/glew_head.h >> $@
|
||||
$(BIN)/make_header.pl GLAPIENTRY GL $(GL_CORE_SPEC) >> $@
|
||||
$(BIN)/make_header.pl GLAPIENTRY GL $(GL_EXT_SPEC) >> $@
|
||||
echo -e "/* ------------------------------------------------------------------------- */\n\n#if defined(GLEW_MX) && defined(_WIN32)\n#define GLEW_FUN_EXPORT\n#else\n#define GLEW_FUN_EXPORT GLEWAPI\n#endif /* GLEW_MX */\n" >> $@
|
||||
echo -e "#if defined(GLEW_MX)\n#define GLEW_VAR_EXPORT\n#else\n#define GLEW_VAR_EXPORT GLEWAPI\n#endif /* GLEW_MX */\n" >> $@
|
||||
echo -e "#if defined(GLEW_MX) && defined(_WIN32)\nstruct GLEWContextStruct\n{\n#endif /* GLEW_MX */" >> $@
|
||||
$(BIN)/make_struct_fun.pl GLEW_FUN_EXPORT $(GL_CORE_SPEC) $(GL_EXT_SPEC) >> $@
|
||||
echo -e "\n#if defined(GLEW_MX) && !defined(_WIN32)\nstruct GLEWContextStruct\n{\n#endif /* GLEW_MX */\n" >> $@
|
||||
$(BIN)/make_struct_var.pl GLEW_VAR_EXPORT $(GL_CORE_SPEC) $(GL_EXT_SPEC) >> $@
|
||||
echo -e "\n#ifdef GLEW_MX\n}; /* GLEWContextStruct */\n#endif /* GLEW_MX */\n" >> $@
|
||||
perl -e 's/GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_2;/GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_1;\nGLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_2;/' -pi $@
|
||||
rm -f $@.bak
|
||||
cat $(SRC)/glew_tail.h >> $@
|
||||
|
||||
$(I.DEST)/wglew.h: $(EXT)/.dummy
|
||||
@echo "--------------------------------------------------------------------"
|
||||
@echo "Creating wglew.h"
|
||||
@echo "--------------------------------------------------------------------"
|
||||
cp -f $(SRC)/glew_license.h $@
|
||||
cat $(SRC)/khronos_license.h >> $@
|
||||
cat $(SRC)/wglew_head.h >> $@
|
||||
$(BIN)/make_header.pl WINAPI WGL $(WGL_EXT_SPEC) >> $@
|
||||
echo -e "/* ------------------------------------------------------------------------- */\n\n#ifdef GLEW_MX\n#define WGLEW_EXPORT\n#else\n#define WGLEW_EXPORT GLEWAPI\n#endif /* GLEW_MX */\n\n#ifdef GLEW_MX\nstruct WGLEWContextStruct\n{\n#endif /* GLEW_MX */" >> $@
|
||||
$(BIN)/make_struct_fun.pl WGLEW_EXPORT $(WGL_EXT_SPEC) >> $@
|
||||
$(BIN)/make_struct_var.pl WGLEW_EXPORT $(WGL_EXT_SPEC) >> $@
|
||||
echo -e "\n#ifdef GLEW_MX\n}; /* WGLEWContextStruct */\n#endif /* GLEW_MX */\n" >> $@
|
||||
cat $(SRC)/wglew_tail.h >> $@
|
||||
|
||||
$(I.DEST)/glxew.h: $(EXT)/.dummy
|
||||
@echo "--------------------------------------------------------------------"
|
||||
@echo "Creating glxew.h"
|
||||
@echo "--------------------------------------------------------------------"
|
||||
cp -f $(SRC)/glew_license.h $@
|
||||
cat $(SRC)/mesa_license.h >> $@
|
||||
cat $(SRC)/khronos_license.h >> $@
|
||||
cat $(SRC)/glxew_head.h >> $@
|
||||
$(BIN)/make_header.pl '' GLX $(GLX_CORE_SPEC) >> $@
|
||||
$(BIN)/make_header.pl '' GLX $(GLX_EXT_SPEC) >> $@
|
||||
echo -e "/* ------------------------------------------------------------------------- */\n\n#ifdef GLEW_MX\n#define GLXEW_EXPORT\n#else\n#define GLXEW_EXPORT extern\n#endif /* GLEW_MX */" >> $@
|
||||
$(BIN)/make_struct_fun.pl extern $(GLX_CORE_SPEC) $(GLX_EXT_SPEC) >> $@
|
||||
echo -e "\n#if defined(GLEW_MX)\nstruct GLXEWContextStruct\n{\n#endif /* GLEW_MX */\n" >> $@
|
||||
$(BIN)/make_struct_var.pl GLXEW_EXPORT $(GLX_CORE_SPEC) $(GLX_EXT_SPEC) >> $@
|
||||
echo -e "\n#ifdef GLEW_MX\n}; /* GLXEWContextStruct */\n#endif /* GLEW_MX */\n" >> $@
|
||||
perl -e 's/GLXEW_EXPORT GLboolean __GLXEW_VERSION_1_2;/GLXEW_EXPORT GLboolean __GLXEW_VERSION_1_0;\nGLXEW_EXPORT GLboolean __GLXEW_VERSION_1_1;\nGLXEW_EXPORT GLboolean __GLXEW_VERSION_1_2;/' -pi $@
|
||||
cat $(SRC)/glxew_tail.h >> $@
|
||||
$(BIN)/fix_OML_sync_control.sh $@
|
||||
|
||||
$(S.DEST)/glew.c: $(EXT)/.dummy
|
||||
@echo "--------------------------------------------------------------------"
|
||||
@echo "Creating glew.c"
|
||||
@echo "--------------------------------------------------------------------"
|
||||
cp -f $(SRC)/glew_license.h $@
|
||||
cat $(SRC)/glew_head.c >> $@
|
||||
echo -e "\n#if !defined(_WIN32) || !defined(GLEW_MX)" >> $@
|
||||
$(BIN)/make_def_fun.pl GL $(GL_CORE_SPEC) >> $@
|
||||
$(BIN)/make_def_fun.pl GL $(GL_EXT_SPEC) >> $@
|
||||
echo -e "\n#endif /* !WIN32 || !GLEW_MX */" >> $@
|
||||
echo -e "\n#if !defined(GLEW_MX)" >> $@;
|
||||
echo -e "\nGLboolean __GLEW_VERSION_1_1 = GL_FALSE;" >> $@
|
||||
$(BIN)/make_def_var.pl GL $(GL_CORE_SPEC) >> $@
|
||||
$(BIN)/make_def_var.pl GL $(GL_EXT_SPEC) >> $@
|
||||
echo -e "\n#endif /* !GLEW_MX */\n" >> $@;
|
||||
$(BIN)/make_init.pl GL $(GL_CORE_SPEC) >> $@
|
||||
$(BIN)/make_init.pl GL $(GL_EXT_SPEC) >> $@
|
||||
cat $(SRC)/glew_init_gl.c >> $@
|
||||
$(BIN)/make_list.pl $(GL_CORE_SPEC) | grep -v '\"GL_VERSION' >> $@
|
||||
$(BIN)/make_list.pl $(GL_EXT_SPEC) >> $@
|
||||
echo -e "\n return GLEW_OK;\n}\n" >> $@
|
||||
echo -e "\n#if defined(_WIN32)" >> $@
|
||||
echo -e "\n#if !defined(GLEW_MX)" >> $@
|
||||
$(BIN)/make_def_fun.pl WGL $(WGL_EXT_SPEC) >> $@
|
||||
$(BIN)/make_def_var.pl WGL $(WGL_EXT_SPEC) >> $@
|
||||
echo -e "\n#endif /* !GLEW_MX */\n" >> $@;
|
||||
$(BIN)/make_init.pl WGL $(WGL_EXT_SPEC) >> $@
|
||||
cat $(SRC)/glew_init_wgl.c >> $@
|
||||
$(BIN)/make_list.pl $(WGL_EXT_SPEC) >> $@
|
||||
echo -e "\n return GLEW_OK;\n}" >> $@;
|
||||
echo -e "\n#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX)" >> $@
|
||||
$(BIN)/make_def_fun.pl GLX $(GLX_CORE_SPEC) >> $@
|
||||
$(BIN)/make_def_fun.pl GLX $(GLX_EXT_SPEC) >> $@
|
||||
echo -e "\n#if !defined(GLEW_MX)" >> $@;
|
||||
echo -e "\nGLboolean __GLXEW_VERSION_1_0 = GL_FALSE;" >> $@
|
||||
echo -e "GLboolean __GLXEW_VERSION_1_1 = GL_FALSE;" >> $@
|
||||
$(BIN)/make_def_var.pl GLX $(GLX_CORE_SPEC) >> $@
|
||||
$(BIN)/make_def_var.pl GLX $(GLX_EXT_SPEC) >> $@
|
||||
echo -e "\n#endif /* !GLEW_MX */\n" >> $@;
|
||||
$(BIN)/make_init.pl GLX $(GLX_CORE_SPEC) >> $@
|
||||
$(BIN)/make_init.pl GLX $(GLX_EXT_SPEC) >> $@
|
||||
cat $(SRC)/glew_init_glx.c >> $@
|
||||
$(BIN)/make_list.pl $(CORE)/GLX_VERSION_1_3 | grep -v '\"GLX_VERSION' >> $@
|
||||
$(BIN)/make_list.pl $(GLX_EXT_SPEC) >> $@
|
||||
echo -e "\n return GLEW_OK;\n}" >> $@
|
||||
echo -e "\n#endif /* !__APPLE__ || GLEW_APPLE_GLX */\n" >> $@;
|
||||
cat $(SRC)/glew_init_tail.c >> $@
|
||||
cat $(SRC)/glew_str_head.c >> $@
|
||||
$(BIN)/make_str.pl $(GL_CORE_SPEC) $(GL_EXT_SPEC) >> $@
|
||||
cat $(SRC)/glew_str_wgl.c >> $@
|
||||
$(BIN)/make_str.pl $(WGL_EXT_SPEC) >> $@
|
||||
cat $(SRC)/glew_str_glx.c >> $@
|
||||
$(BIN)/make_str.pl $(GLX_CORE_SPEC) $(GLX_EXT_SPEC) >> $@
|
||||
cat $(SRC)/glew_str_tail.c >> $@
|
||||
perl -e "s/GLEW_VERSION_STRING/$(GLEW_VERSION)/g" -pi $@
|
||||
perl -e "s/GLEW_VERSION_MAJOR_STRING/$(GLEW_MAJOR)/g" -pi $@
|
||||
perl -e "s/GLEW_VERSION_MINOR_STRING/$(GLEW_MINOR)/g" -pi $@
|
||||
perl -e "s/GLEW_VERSION_MICRO_STRING/$(GLEW_MICRO)/g" -pi $@
|
||||
perl -e "s/GLEW_ARB_vertex_shader = !_glewInit_GL_ARB_vertex_shader\(GLEW_CONTEXT_ARG_VAR_INIT\);/{ GLEW_ARB_vertex_shader = !_glewInit_GL_ARB_vertex_shader(GLEW_CONTEXT_ARG_VAR_INIT); _glewInit_GL_ARB_vertex_program(GLEW_CONTEXT_ARG_VAR_INIT); }/g" -pi $@
|
||||
perl -e "s/\(\(glColorSubTable = /((glBlendEquation = (PFNGLBLENDEQUATIONPROC)glewGetProcAddress((const GLubyte*)\"glBlendEquation\")) == NULL) || r;\n r = ((glColorSubTable = /g" -pi $@
|
||||
$(BIN)/fix_OML_sync_control.sh $@
|
||||
rm -f $@.bak
|
||||
|
||||
$(S.DEST)/glew_def.c: $(EXT)/.dummy
|
||||
cp -f $(SRC)/glew_license.h $@
|
||||
echo -e "#include \"glew_utils.h\"\n\n#if !defined(_WIN32) || !defined(GLEW_MX)" >> $@
|
||||
$(BIN)/make_def_fun.pl GL $(GL_CORE_SPEC) >> $@
|
||||
$(BIN)/make_def_fun.pl GL $(GL_EXT_SPEC) >> $@
|
||||
echo -e "\n#endif /* !WIN32 || !GLEW_MX */" >> $@
|
||||
echo -e "\n#if !defined(GLEW_MX)\n\nGLboolean __GLEW_VERSION_1_1 = GL_FALSE;" >> $@
|
||||
$(BIN)/make_def_var.pl GL $(GL_CORE_SPEC) >> $@
|
||||
$(BIN)/make_def_var.pl GL $(GL_EXT_SPEC) >> $@
|
||||
echo -e "\n#if defined(_WIN32)" >> $@
|
||||
$(BIN)/make_def_fun.pl WGL $(WGL_EXT_SPEC) >> $@
|
||||
$(BIN)/make_def_var.pl WGL $(WGL_EXT_SPEC) >> $@
|
||||
echo -e "\n#endif /* _WIN32 */" >> $@
|
||||
echo -e "\n#endif /* !GLEW_MX */" >> $@;
|
||||
echo -e "\n#if !defined(_WIN32) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX))" >> $@
|
||||
$(BIN)/make_def_fun.pl GLX $(GLX_CORE_SPEC) >> $@
|
||||
$(BIN)/make_def_fun.pl GLX $(GLX_EXT_SPEC) >> $@
|
||||
echo -e "\n#if !defined(GLEW_MX)" >> $@;
|
||||
echo -e "\nGLboolean __GLXEW_VERSION_1_0 = GL_FALSE;" >> $@
|
||||
echo -e "GLboolean __GLXEW_VERSION_1_1 = GL_FALSE;" >> $@
|
||||
$(BIN)/make_def_var.pl GLX $(GLX_CORE_SPEC) >> $@
|
||||
$(BIN)/make_def_var.pl GLX $(GLX_EXT_SPEC) >> $@
|
||||
echo -e "\n#endif /* !GLEW_MX */" >> $@;
|
||||
echo -e "\n#endif /* !__APPLE__ || GLEW_APPLE_GLX */" >> $@;
|
||||
rm -f $@.bak
|
||||
|
||||
$(S.DEST)/glew_init.c: $(EXT)/.dummy
|
||||
cp -f $(SRC)/glew_license.h $@
|
||||
echo -e "#include \"glew_utils.h\"\n" >> $@
|
||||
$(BIN)/make_init.pl GL $(GL_CORE_SPEC) >> $@
|
||||
$(BIN)/make_init.pl GL $(GL_EXT_SPEC) >> $@
|
||||
cat $(SRC)/glew_init_gl.c >> $@
|
||||
$(BIN)/make_list.pl $(GL_CORE_SPEC) | grep -v '\"GL_VERSION' >> $@
|
||||
$(BIN)/make_list.pl $(GL_EXT_SPEC) >> $@
|
||||
echo -e "\n return GLEW_OK;\n}\n\n#if defined(_WIN32)\n" >> $@;
|
||||
$(BIN)/make_init.pl WGL $(WGL_EXT_SPEC) >> $@
|
||||
cat $(SRC)/glew_init_wgl.c >> $@
|
||||
$(BIN)/make_list.pl $(WGL_EXT_SPEC) >> $@
|
||||
echo -e "\n return GLEW_OK;\n}\n\n" >> $@;
|
||||
echo -e "\n#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX)\n" >> $@
|
||||
$(BIN)/make_init.pl GLX $(GLX_CORE_SPEC) >> $@
|
||||
$(BIN)/make_init.pl GLX $(GLX_EXT_SPEC) >> $@
|
||||
cat $(SRC)/glew_init_glx.c >> $@
|
||||
$(BIN)/make_list.pl $(CORE)/GLX_VERSION_1_3 | grep -v '\"GLX_VERSION' >> $@
|
||||
$(BIN)/make_list.pl $(GLX_EXT_SPEC) >> $@
|
||||
echo -e "\n return GLEW_OK;\n}\n\n#endif /* !__APPLE__ || GLEW_APPLE_GLX */\n" >> $@;
|
||||
cat $(SRC)/glew_init_tail.c >> $@
|
||||
perl -e "s/GLEW_VERSION_STRING/$(GLEW_VERSION)/g" -pi $@
|
||||
perl -e "s/GLEW_VERSION_MAJOR_STRING/$(GLEW_MAJOR)/g" -pi $@
|
||||
perl -e "s/GLEW_VERSION_MINOR_STRING/$(GLEW_MINOR)/g" -pi $@
|
||||
perl -e "s/GLEW_VERSION_MICRO_STRING/$(GLEW_MICRO)/g" -pi $@
|
||||
perl -e "s/GLEW_ARB_vertex_shader = !_glewInit_GL_ARB_vertex_shader\(GLEW_CONTEXT_ARG_VAR_INIT\);/{ GLEW_ARB_vertex_shader = !_glewInit_GL_ARB_vertex_shader(GLEW_CONTEXT_ARG_VAR_INIT); _glewInit_GL_ARB_vertex_program(GLEW_CONTEXT_ARG_VAR_INIT); }/g" -pi $@
|
||||
perl -e "s/\(\(glBlendColor = /((glBlendEquation = (PFNGLBLENDEQUATIONPROC)glewGetProcAddress((const GLubyte*)\"glBlendEquation\")) == NULL) || r;\n r = ((glBlendColor = /g" -pi $@
|
||||
$(BIN)/fix_OML_sync_control.sh $@
|
||||
rm -f $@.bak
|
||||
|
||||
$(S.DEST)/glew_str.c: $(EXT)/.dummy
|
||||
cp -f $(SRC)/glew_license.h $@
|
||||
echo -e "\n#include \"glew_utils.h\"\n" >> $@
|
||||
cat $(SRC)/glew_str_head.c >> $@
|
||||
$(BIN)/make_str.pl $(GL_CORE_SPEC) $(GL_EXT_SPEC) >> $@
|
||||
cat $(SRC)/glew_str_wgl.c >> $@
|
||||
$(BIN)/make_str.pl $(WGL_EXT_SPEC) >> $@
|
||||
cat $(SRC)/glew_str_glx.c >> $@
|
||||
$(BIN)/make_str.pl $(GLX_CORE_SPEC) $(GLX_EXT_SPEC) >> $@
|
||||
cat $(SRC)/glew_str_tail.c >> $@
|
||||
# $(BIN)/fix_OML_sync_control.sh $@
|
||||
# perl -e "s/GLEW_VERSION_STRING/$(GLEW_VERSION)/g" -pi $@
|
||||
# perl -e "s/GLEW_ARB_vertex_shader = !_glewInit_GL_ARB_vertex_shader\(GLEW_CONTEXT_ARG_VAR_INIT\);/{ GLEW_ARB_vertex_shader = !_glewInit_GL_ARB_vertex_shader(GLEW_CONTEXT_ARG_VAR_INIT); _glewInit_GL_ARB_vertex_program(GLEW_CONTEXT_ARG_VAR_INIT); }/g" -pi $@
|
||||
rm -f $@.bak
|
||||
|
||||
$(S.DEST)/glewinfo.c: $(EXT)/.dummy
|
||||
@echo "--------------------------------------------------------------------"
|
||||
@echo "Creating glewinfo.c"
|
||||
@echo "--------------------------------------------------------------------"
|
||||
cp -f $(SRC)/glew_license.h $@
|
||||
cat $(SRC)/glewinfo_head.c >> $@
|
||||
$(BIN)/make_info.pl $(GL_CORE_SPEC) >> $@
|
||||
$(BIN)/make_info.pl $(GL_EXT_SPEC) >> $@
|
||||
echo -e "#ifdef _WIN32\n" >> $@
|
||||
$(BIN)/make_info.pl $(WGL_EXT_SPEC) >> $@
|
||||
echo -e "#else /* _UNIX */\n" >> $@
|
||||
$(BIN)/make_info.pl $(GLX_CORE_SPEC) >> $@
|
||||
$(BIN)/make_info.pl $(GLX_EXT_SPEC) >> $@
|
||||
echo -e "#endif /* _WIN32 */\n" >> $@
|
||||
|
||||
cat $(SRC)/glewinfo_gl.c >> $@
|
||||
$(BIN)/make_info_list.pl $(GL_CORE_SPEC) >> $@
|
||||
$(BIN)/make_info_list.pl $(GL_EXT_SPEC) >> $@
|
||||
cat $(SRC)/glewinfo_wgl.c >> $@
|
||||
$(BIN)/make_info_list.pl $(WGL_EXT_SPEC) >> $@
|
||||
cat $(SRC)/glewinfo_glx.c >> $@
|
||||
$(BIN)/make_info_list.pl $(GLX_CORE_SPEC) >> $@
|
||||
$(BIN)/make_info_list.pl $(GLX_EXT_SPEC) >> $@
|
||||
cat $(SRC)/glewinfo_tail.c >> $@
|
||||
$(BIN)/fix_OML_sync_control.sh $@
|
||||
perl -e 's/"glColorSubTable"/"glBlendEquation", glBlendEquation == NULL);\n glewInfoFunc("glColorSubTable"/g' -pi $@
|
||||
rm -f $@.bak
|
||||
|
||||
# Update documentation
|
||||
|
||||
$(D.DEST)/%.html: doc/%.html
|
||||
@echo "--------------------------------------------------------------------"
|
||||
@echo "Creating $(@F)"
|
||||
@echo "--------------------------------------------------------------------"
|
||||
cat $(SRC)/header.html $< $(SRC)/footer.html | \
|
||||
sed 's#<a href="$(@F)">\(.*\)</a>#\1#' > $@
|
||||
|
||||
$(D.DEST)/glew.html: $(EXT)/.dummy
|
||||
@echo "--------------------------------------------------------------------"
|
||||
@echo "Creating glew.html"
|
||||
@echo "--------------------------------------------------------------------"
|
||||
cp -f $(SRC)/header.html $@
|
||||
echo -e "<h2>Supported OpenGL Extensions</h2>\n" >> $@
|
||||
$(BIN)/make_html.pl $(GL_EXT_SPEC) >> $@
|
||||
cat $(SRC)/footer.html >> $@
|
||||
sed -i 's#<a href="$(@F)">\(.*\)</a>#\1#' $@
|
||||
|
||||
$(D.DEST)/wglew.html: $(EXT)/.dummy
|
||||
@echo "--------------------------------------------------------------------"
|
||||
@echo "Creating wglew.html"
|
||||
@echo "--------------------------------------------------------------------"
|
||||
cp -f $(SRC)/header.html $@
|
||||
echo -e "<h2>Supported WGL Extensions</h2>\n" >> $@
|
||||
$(BIN)/make_html.pl $(WGL_EXT_SPEC) >> $@
|
||||
cat $(SRC)/footer.html >> $@
|
||||
sed -i 's#<a href="$(@F)">\(.*\)</a>#\1#' $@
|
||||
|
||||
$(D.DEST)/glxew.html: $(EXT)/.dummy
|
||||
@echo "--------------------------------------------------------------------"
|
||||
@echo "Creating glxew.html"
|
||||
@echo "--------------------------------------------------------------------"
|
||||
cp -f $(SRC)/header.html $@
|
||||
echo -e "<h2>Supported GLX Extensions</h2>\n" >> $@
|
||||
$(BIN)/make_html.pl $(GLX_EXT_SPEC) >> $@
|
||||
cat $(SRC)/footer.html >> $@
|
||||
sed -i 's#<a href="$(@F)">\(.*\)</a>#\1#' $@
|
||||
|
||||
$(B.DEST)/%.rc: src/%.rc $(EXT)/.dummy
|
||||
perl -e "s/GLEW_MAJOR/$(GLEW_MAJOR)/g;s/GLEW_MINOR/$(GLEW_MINOR)/g;s/GLEW_MICRO/$(GLEW_MICRO)/g;" -p $< > $@
|
||||
|
||||
clean:
|
||||
rm -rf $(I.TARGETS) $(S.TARGETS) $(D.TARGETS) $(B.TARGETS)
|
||||
|
||||
clobber: clean
|
||||
rm -rf $(EXT)
|
||||
|
||||
destroy: clobber
|
||||
rm -rf $(REGISTRY)
|
||||
-18
@@ -1,18 +0,0 @@
|
||||
#!/bin/sh
|
||||
##
|
||||
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
|
||||
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
|
||||
##
|
||||
## This program is distributed under the terms and conditions of the GNU
|
||||
## General Public License Version 2 as published by the Free Software
|
||||
## Foundation or, at your option, any later version.
|
||||
|
||||
perl -e 's/#ifndef GLX_OML_sync_control/#if !defined(GLX_OML_sync_control) \&\& defined(__STDC_VERSION__) \&\& (__STDC_VERSION__ >= 199901L)\n#include <inttypes.h>/;' -pi $1
|
||||
perl -e 's/#ifdef GLX_OML_sync_control/#if defined(GLX_OML_sync_control) \&\& defined(__STDC_VERSION__) \&\& (__STDC_VERSION__ >= 199901L)\n#include <inttypes.h>/;' -pi $1
|
||||
perl -e 's/(extern PFNGLXGETMSCRATEOMLPROC __glewXGetMscRateOML;)/#ifdef GLX_OML_sync_control\n\1/' -pi $1
|
||||
perl -e 's/(extern PFNGLXWAITFORSBCOMLPROC __glewXWaitForSbcOML;)/\1\n#endif/' -pi $1
|
||||
perl -e 's/(extern GLboolean __GLXEW_OML_sync_control;)/#ifdef GLX_OML_sync_control\n\1\n#endif/' -pi $1
|
||||
perl -e 's/(PFNGLXGETMSCRATEOMLPROC __glewXGetMscRateOML = NULL;)/#ifdef GLX_OML_sync_control\n\1/' -pi $1
|
||||
perl -e 's/(PFNGLXWAITFORSBCOMLPROC __glewXWaitForSbcOML = NULL;)/\1\n#endif/' -pi $1
|
||||
perl -e 's/(GLboolean __GLXEW_OML_sync_control = GL_FALSE;)/#ifdef GLX_OML_sync_control\n\1\n#endif/' -pi $1
|
||||
rm -f $1.bak
|
||||
Vendored
-188
@@ -1,188 +0,0 @@
|
||||
##
|
||||
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
|
||||
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
|
||||
##
|
||||
## This program is distributed under the terms and conditions of the GNU
|
||||
## General Public License Version 2 as published by the Free Software
|
||||
## Foundation or, at your option, any later version.
|
||||
|
||||
my %regex = (
|
||||
extname => qr/^[A-Z][A-Za-z0-9_]+$/,
|
||||
exturl => qr/^http.+$/,
|
||||
function => qr/^(.+) ([a-z][a-z0-9_]*) \((.+)\)$/i,
|
||||
token => qr/^([A-Z][A-Z0-9_x]*)\s+((?:0x)?[0-9A-Fa-f]+|[A-Z][A-Z0-9_]*)$/,
|
||||
type => qr/^typedef\s+(.+)\s+([\*A-Za-z0-9_]+)$/,
|
||||
exact => qr/.*;$/,
|
||||
);
|
||||
|
||||
# prefix function name with glew
|
||||
sub prefixname($)
|
||||
{
|
||||
my $name = $_[0];
|
||||
$name =~ s/^(.*)gl/__$1glew/;
|
||||
return $name;
|
||||
}
|
||||
|
||||
# prefix function name with glew
|
||||
sub prefix_varname($)
|
||||
{
|
||||
my $name = $_[0];
|
||||
$name =~ s/^(.*)GL(X*)EW/__$1GL$2EW/;
|
||||
return $name;
|
||||
}
|
||||
|
||||
#---------------------------------------------------------------------------------------
|
||||
|
||||
sub make_exact($)
|
||||
{
|
||||
my $exact = $_[0];
|
||||
$exact =~ s/(; |{)/$1\n/g;
|
||||
return $exact;
|
||||
}
|
||||
|
||||
sub make_separator($)
|
||||
{
|
||||
my $extname = $_[0];
|
||||
my $l = length $extname;
|
||||
my $s = (71 - $l)/2;
|
||||
print "/* ";
|
||||
my $j = 3;
|
||||
for (my $i = 0; $i < $s; $i++)
|
||||
{
|
||||
print "-";
|
||||
$j++;
|
||||
}
|
||||
print " $_[0] ";
|
||||
$j += $l + 2;
|
||||
while ($j < 76)
|
||||
{
|
||||
print "-";
|
||||
$j++;
|
||||
}
|
||||
print " */\n\n";
|
||||
}
|
||||
|
||||
#---------------------------------------------------------------------------------------
|
||||
|
||||
sub parse_ext($)
|
||||
{
|
||||
my $filename = shift;
|
||||
my %functions = ();
|
||||
my %tokens = ();
|
||||
my %types = ();
|
||||
my @exacts = ();
|
||||
my $extname = ""; # Full extension name GL_FOO_extension
|
||||
my $exturl = ""; # Info URL
|
||||
my $extstring = ""; # Relevant extension string
|
||||
|
||||
open EXT, "<$filename" or return;
|
||||
|
||||
# As of GLEW 1.5.3 the first three lines _must_ be
|
||||
# the extension name, the URL and the GL extension
|
||||
# string (which might be different to the name)
|
||||
#
|
||||
# For example GL_NV_geometry_program4 is available
|
||||
# iff GL_NV_gpu_program4 appears in the extension
|
||||
# string.
|
||||
#
|
||||
# For core OpenGL versions, the third line should
|
||||
# be blank.
|
||||
#
|
||||
# If the URL is unknown, the second line should be
|
||||
# blank.
|
||||
|
||||
$extname = readline(*EXT);
|
||||
$exturl = readline(*EXT);
|
||||
$extstring = readline(*EXT);
|
||||
|
||||
chomp($extname);
|
||||
chomp($exturl);
|
||||
chomp($extstring);
|
||||
|
||||
while(<EXT>)
|
||||
{
|
||||
chomp;
|
||||
if (s/^\s+//)
|
||||
{
|
||||
if (/$regex{exact}/)
|
||||
{
|
||||
push @exacts, $_;
|
||||
}
|
||||
elsif (/$regex{type}/)
|
||||
{
|
||||
my ($value, $name) = ($1, $2);
|
||||
$types{$name} = $value;
|
||||
}
|
||||
elsif (/$regex{token}/)
|
||||
{
|
||||
my ($name, $value) = ($1, $2);
|
||||
$tokens{$name} = $value;
|
||||
}
|
||||
elsif (/$regex{function}/)
|
||||
{
|
||||
my ($return, $name, $parms) = ($1, $2, $3);
|
||||
$functions{$name} = {
|
||||
rtype => $return,
|
||||
parms => $parms,
|
||||
};
|
||||
} else {
|
||||
print STDERR "'$_' matched no regex.\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
close EXT;
|
||||
|
||||
return ($extname, $exturl, $extstring, \%types, \%tokens, \%functions, \@exacts);
|
||||
}
|
||||
|
||||
sub output_tokens($$)
|
||||
{
|
||||
my ($tbl, $fnc) = @_;
|
||||
if (keys %{$tbl})
|
||||
{
|
||||
local $, = "\n";
|
||||
print "\n";
|
||||
print map { &{$fnc}($_, $tbl->{$_}) } sort { hex ${$tbl}{$a} <=> hex ${$tbl}{$b} } keys %{$tbl};
|
||||
print "\n";
|
||||
} else {
|
||||
print STDERR "no keys in table!\n";
|
||||
}
|
||||
}
|
||||
|
||||
sub output_types($$)
|
||||
{
|
||||
my ($tbl, $fnc) = @_;
|
||||
if (keys %{$tbl})
|
||||
{
|
||||
local $, = "\n";
|
||||
print "\n";
|
||||
print map { &{$fnc}($_, $tbl->{$_}) } sort { ${$tbl}{$a} cmp ${$tbl}{$b} } keys %{$tbl};
|
||||
print "\n";
|
||||
}
|
||||
}
|
||||
|
||||
sub output_decls($$)
|
||||
{
|
||||
my ($tbl, $fnc) = @_;
|
||||
if (keys %{$tbl})
|
||||
{
|
||||
local $, = "\n";
|
||||
print "\n";
|
||||
print map { &{$fnc}($_, $tbl->{$_}) } sort keys %{$tbl};
|
||||
print "\n";
|
||||
}
|
||||
}
|
||||
|
||||
sub output_exacts($$)
|
||||
{
|
||||
my ($tbl, $fnc) = @_;
|
||||
if (scalar @{$tbl})
|
||||
{
|
||||
local $, = "\n";
|
||||
print "\n";
|
||||
print map { &{$fnc}($_) } sort @{$tbl};
|
||||
print "\n";
|
||||
}
|
||||
}
|
||||
|
||||
-35
@@ -1,35 +0,0 @@
|
||||
#!/usr/bin/perl
|
||||
##
|
||||
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
|
||||
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
|
||||
##
|
||||
## This program is distributed under the terms and conditions of the GNU
|
||||
## General Public License Version 2 as published by the Free Software
|
||||
## Foundation or, at your option, any later version.
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
do 'bin/make.pl';
|
||||
|
||||
# function pointer declaration
|
||||
sub make_pfn_decl($%)
|
||||
{
|
||||
return "PFN" . (uc $_[0]) . "PROC " . prefixname($_[0]) . " = NULL;";
|
||||
}
|
||||
|
||||
my @extlist = ();
|
||||
my %extensions = ();
|
||||
|
||||
our $type = shift;
|
||||
|
||||
if (@ARGV)
|
||||
{
|
||||
@extlist = @ARGV;
|
||||
|
||||
foreach my $ext (sort @extlist)
|
||||
{
|
||||
my ($extname, $exturl, $extstring, $types, $tokens, $functions, $exacts) = parse_ext($ext);
|
||||
output_decls($functions, \&make_pfn_decl);
|
||||
}
|
||||
}
|
||||
-31
@@ -1,31 +0,0 @@
|
||||
#!/usr/bin/perl
|
||||
##
|
||||
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
|
||||
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
|
||||
##
|
||||
## This program is distributed under the terms and conditions of the GNU
|
||||
## General Public License Version 2 as published by the Free Software
|
||||
## Foundation or, at your option, any later version.
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
do 'bin/make.pl';
|
||||
|
||||
my @extlist = ();
|
||||
my %extensions = ();
|
||||
|
||||
our $type = shift;
|
||||
|
||||
if (@ARGV)
|
||||
{
|
||||
@extlist = @ARGV;
|
||||
|
||||
foreach my $ext (sort @extlist)
|
||||
{
|
||||
my ($extname, $exturl, $extstring, $types, $tokens, $functions, $exacts) = parse_ext($ext);
|
||||
my $extvar = $extname;
|
||||
$extvar =~ s/GL(X*)_/GL$1EW_/;
|
||||
print "GLboolean " . prefix_varname($extvar) . " = GL_FALSE;\n";
|
||||
}
|
||||
}
|
||||
-71
@@ -1,71 +0,0 @@
|
||||
#!/usr/bin/perl
|
||||
##
|
||||
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
|
||||
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
|
||||
##
|
||||
## This program is distributed under the terms and conditions of the GNU
|
||||
## General Public License Version 2 as published by the Free Software
|
||||
## Foundation or, at your option, any later version.
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
do 'bin/make.pl';
|
||||
|
||||
# token
|
||||
sub make_define($$)
|
||||
{
|
||||
return "#define $_[0] $_[1]"
|
||||
}
|
||||
|
||||
# type declaration
|
||||
sub make_type($$)
|
||||
{
|
||||
return "typedef $_[1] $_[0];"
|
||||
}
|
||||
|
||||
# function pointer type declaration
|
||||
sub make_pfn_type($%)
|
||||
{
|
||||
our $api;
|
||||
return join(' ', "typedef", $_[1]->{rtype},
|
||||
"($api * PFN" . (uc $_[0]) . "PROC)",
|
||||
"(" . $_[1]->{parms} . ")") . ";";
|
||||
}
|
||||
|
||||
# function name alias
|
||||
sub make_pfn_alias($%)
|
||||
{
|
||||
our $type;
|
||||
return join(" ", "#define", $_[0], $type . "EW_GET_FUN(" . prefixname($_[0]) . ")")
|
||||
}
|
||||
|
||||
my @extlist = ();
|
||||
my %extensions = ();
|
||||
|
||||
our $api = shift;
|
||||
our $type = shift;
|
||||
|
||||
if (@ARGV)
|
||||
{
|
||||
@extlist = @ARGV;
|
||||
|
||||
foreach my $ext (sort @extlist)
|
||||
{
|
||||
my ($extname, $exturl, $extstring, $types, $tokens, $functions, $exacts) = parse_ext($ext);
|
||||
|
||||
make_separator($extname);
|
||||
print "#ifndef $extname\n#define $extname 1\n";
|
||||
output_tokens($tokens, \&make_define);
|
||||
output_types($types, \&make_type);
|
||||
output_exacts($exacts, \&make_exact);
|
||||
output_decls($functions, \&make_pfn_type);
|
||||
output_decls($functions, \&make_pfn_alias);
|
||||
|
||||
my $extvar = $extname;
|
||||
$extvar =~ s/GL(X*)_/GL$1EW_/;
|
||||
|
||||
print "\n#define $extvar " . $type . "EW_GET_VAR(" . prefix_varname($extvar) . ")\n";
|
||||
print "\n#endif /* $extname */\n\n";
|
||||
}
|
||||
}
|
||||
Vendored
-55
@@ -1,55 +0,0 @@
|
||||
#!/usr/bin/perl
|
||||
##
|
||||
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
|
||||
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
|
||||
##
|
||||
## This program is distributed under the terms and conditions of the GNU
|
||||
## General Public License Version 2 as published by the Free Software
|
||||
## Foundation or, at your option, any later version.
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
do 'bin/make.pl';
|
||||
|
||||
#---------------------------------------------------------------------------------------
|
||||
|
||||
my @extlist = ();
|
||||
my %extensions = ();
|
||||
my $group = "";
|
||||
my $cur_group = "";
|
||||
|
||||
if (@ARGV)
|
||||
{
|
||||
@extlist = @ARGV;
|
||||
my $n = 1;
|
||||
print "<table border=\"0\" width=\"100%\" cellpadding=\"1\" cellspacing=\"0\" align=\"center\">\n";
|
||||
foreach my $ext (sort @extlist)
|
||||
{
|
||||
my ($extname, $exturl, $extstring, $types, $tokens, $functions, $exacts) = parse_ext($ext);
|
||||
$cur_group = $extname;
|
||||
$cur_group =~ s/^(?:W?)GL(?:X?)_([A-Z0-9]+?)_.*$/$1/;
|
||||
$extname =~ s/^(?:W?)GL(?:X?)_(.*)$/$1/;
|
||||
if ($cur_group ne $group)
|
||||
{
|
||||
if ($group ne "")
|
||||
{
|
||||
print "<tr><td><br></td><td></td><td></td></tr>\n";
|
||||
}
|
||||
$group = $cur_group;
|
||||
}
|
||||
|
||||
{
|
||||
if ($exturl)
|
||||
{
|
||||
print "<tr><td class=\"num\">$n</td><td> </td><td><a href=\"$exturl\">$extname</a></td></tr>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
print "<tr><td class=\"num\">$n</td><td> </td><td>$extname</td></tr>\n";
|
||||
}
|
||||
$n++;
|
||||
}
|
||||
}
|
||||
print "</table>\n"
|
||||
}
|
||||
Vendored
-59
@@ -1,59 +0,0 @@
|
||||
#!/usr/bin/perl
|
||||
##
|
||||
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
|
||||
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
|
||||
##
|
||||
## This program is distributed under the terms and conditions of the GNU
|
||||
## General Public License Version 2 as published by the Free Software
|
||||
## Foundation or, at your option, any later version.
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
do 'bin/make.pl';
|
||||
|
||||
#---------------------------------------------------------------------------------------
|
||||
|
||||
# function pointer definition
|
||||
sub make_pfn_info($%)
|
||||
{
|
||||
my $name = $_[0];
|
||||
return " glewInfoFunc(\"$_[0]\", $name == NULL);";
|
||||
}
|
||||
|
||||
#---------------------------------------------------------------------------------------
|
||||
|
||||
my @extlist = ();
|
||||
my %extensions = ();
|
||||
|
||||
if (@ARGV)
|
||||
{
|
||||
@extlist = @ARGV;
|
||||
|
||||
foreach my $ext (sort @extlist)
|
||||
{
|
||||
my ($extname, $exturl, $extstring, $types, $tokens, $functions, $exacts) = parse_ext($ext);
|
||||
my $extvar = $extname;
|
||||
$extvar =~ s/GL(X*)_/GL$1EW_/;
|
||||
my $extpre = $extname;
|
||||
$extpre =~ s/(GLX|GLW|GL).*/$1/;
|
||||
$extpre = lc $extpre;
|
||||
|
||||
#make_separator($extname);
|
||||
print "#ifdef $extname\n\n";
|
||||
print "static void _glewInfo_$extname (void)\n{\n";
|
||||
if ($extvar =~ /VERSION/)
|
||||
{
|
||||
print " glewPrintExt(\"$extname\", $extvar, $extvar, $extvar);\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
print " glewPrintExt(\"$extname\", $extvar, $extpre" .
|
||||
"ewIsSupported(\"$extname\"), $extpre" .
|
||||
"ewGetExtension(\"$extstring\"));\n";
|
||||
}
|
||||
output_decls($functions, \&make_pfn_info);
|
||||
print "}\n\n";
|
||||
print "#endif /* $extname */\n\n";
|
||||
}
|
||||
}
|
||||
-47
@@ -1,47 +0,0 @@
|
||||
#!/usr/bin/perl
|
||||
##
|
||||
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
|
||||
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
|
||||
##
|
||||
## This program is distributed under the terms and conditions of the GNU
|
||||
## General Public License Version 2 as published by the Free Software
|
||||
## Foundation or, at your option, any later version.
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
do 'bin/make.pl';
|
||||
|
||||
#---------------------------------------------------------------------------------------
|
||||
|
||||
# function pointer definition
|
||||
sub make_pfn_def($%)
|
||||
{
|
||||
return "PFN" . (uc $_[0]) . "PROC " . prefixname($_[0]) . " = NULL;";
|
||||
}
|
||||
|
||||
# function pointer definition
|
||||
sub make_init_call($%)
|
||||
{
|
||||
my $name = prefixname($_[0]);
|
||||
return " r = r || (" . $name . " = (PFN" . (uc $_[0]) . "PROC)glewGetProcAddress((const GLubyte*)\"" . $name . "\")) == NULL;";
|
||||
}
|
||||
|
||||
#---------------------------------------------------------------------------------------
|
||||
|
||||
my @extlist = ();
|
||||
my %extensions = ();
|
||||
|
||||
if (@ARGV)
|
||||
{
|
||||
@extlist = @ARGV;
|
||||
|
||||
foreach my $ext (sort @extlist)
|
||||
{
|
||||
my ($extname, $exturl, $extstring, $types, $tokens, $functions, $exacts) = parse_ext($ext);
|
||||
|
||||
print "#ifdef $extname\n";
|
||||
print " _glewInfo_$extname();\n";
|
||||
print "#endif /* $extname */\n";
|
||||
}
|
||||
}
|
||||
Vendored
-55
@@ -1,55 +0,0 @@
|
||||
#!/usr/bin/perl
|
||||
##
|
||||
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
|
||||
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
|
||||
##
|
||||
## This program is distributed under the terms and conditions of the GNU
|
||||
## General Public License Version 2 as published by the Free Software
|
||||
## Foundation or, at your option, any later version.
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
do 'bin/make.pl';
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
# function pointer definition
|
||||
sub make_pfn_def_init($%)
|
||||
{
|
||||
#my $name = prefixname($_[0]);
|
||||
return " r = ((" . $_[0] . " = (PFN" . (uc $_[0]) . "PROC)glewGetProcAddress((const GLubyte*)\"" . $_[0] . "\")) == NULL) || r;";
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
my @extlist = ();
|
||||
my %extensions = ();
|
||||
|
||||
our $type = shift;
|
||||
|
||||
if (@ARGV)
|
||||
{
|
||||
@extlist = @ARGV;
|
||||
|
||||
foreach my $ext (sort @extlist)
|
||||
{
|
||||
my ($extname, $exturl, $extstring, $types, $tokens, $functions, $exacts) =
|
||||
parse_ext($ext);
|
||||
|
||||
#make_separator($extname);
|
||||
print "#ifdef $extname\n\n";
|
||||
my $extvar = $extname;
|
||||
my $extvardef = $extname;
|
||||
$extvar =~ s/GL(X*)_/GL$1EW_/;
|
||||
if (keys %$functions)
|
||||
{
|
||||
print "static GLboolean _glewInit_$extname (" . $type .
|
||||
"EW_CONTEXT_ARG_DEF_INIT)\n{\n GLboolean r = GL_FALSE;\n";
|
||||
output_decls($functions, \&make_pfn_def_init);
|
||||
print "\n return r;\n}\n\n";
|
||||
}
|
||||
#print "\nGLboolean " . prefix_varname($extvar) . " = GL_FALSE;\n\n";
|
||||
print "#endif /* $extname */\n\n";
|
||||
}
|
||||
}
|
||||
Vendored
-66
@@ -1,66 +0,0 @@
|
||||
#!/usr/bin/perl
|
||||
##
|
||||
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
|
||||
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
|
||||
##
|
||||
## This program is distributed under the terms and conditions of the GNU
|
||||
## General Public License Version 2 as published by the Free Software
|
||||
## Foundation or, at your option, any later version.
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
do 'bin/make.pl';
|
||||
|
||||
#---------------------------------------------------------------------------------------
|
||||
|
||||
# function pointer definition
|
||||
sub make_init_call($%)
|
||||
{
|
||||
my $name = prefixname($_[0]);
|
||||
return " r = r || (" . $_[0] . " = (PFN" . (uc $_[0]) . "PROC)glewGetProcAddress(\"" . $name . "\")) == NULL;";
|
||||
}
|
||||
|
||||
#---------------------------------------------------------------------------------------
|
||||
|
||||
my @extlist = ();
|
||||
my %extensions = ();
|
||||
|
||||
if (@ARGV)
|
||||
{
|
||||
@extlist = @ARGV;
|
||||
|
||||
foreach my $ext (sort @extlist)
|
||||
{
|
||||
my ($extname, $exturl, $extstring, $types, $tokens, $functions, $exacts) = parse_ext($ext);
|
||||
|
||||
my $extvar = $extname;
|
||||
$extvar =~ s/GL(X*)_/GL$1EW_/;
|
||||
|
||||
my $extpre = $extname;
|
||||
$extpre =~ s/^(W?)GL(X?).*$/\l$1gl\l$2ew/;
|
||||
|
||||
#my $pextvar = prefix_varname($extvar);
|
||||
|
||||
print "#ifdef $extname\n";
|
||||
|
||||
if (length($extstring))
|
||||
{
|
||||
print " CONST_CAST(" . $extvar . ") = " . $extpre . "GetExtension(\"$extstring\");\n";
|
||||
}
|
||||
|
||||
if (keys %$functions)
|
||||
{
|
||||
if ($extname =~ /WGL_.*/)
|
||||
{
|
||||
print " if (glewExperimental || " . $extvar . "|| crippled) CONST_CAST(" . $extvar . ")= !_glewInit_$extname(GLEW_CONTEXT_ARG_VAR_INIT);\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
print " if (glewExperimental || " . $extvar . ") CONST_CAST(" . $extvar . ") = !_glewInit_$extname(GLEW_CONTEXT_ARG_VAR_INIT);\n";
|
||||
}
|
||||
}
|
||||
print "#endif /* $extname */\n";
|
||||
}
|
||||
|
||||
}
|
||||
Vendored
-53
@@ -1,53 +0,0 @@
|
||||
#!/usr/bin/perl
|
||||
##
|
||||
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
|
||||
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
|
||||
##
|
||||
## This program is distributed under the terms and conditions of the GNU
|
||||
## General Public License Version 2 as published by the Free Software
|
||||
## Foundation or, at your option, any later version.
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
do 'bin/make.pl';
|
||||
|
||||
my @extlist = ();
|
||||
my %extensions = ();
|
||||
|
||||
if (@ARGV)
|
||||
{
|
||||
@extlist = @ARGV;
|
||||
|
||||
my $curexttype = "";
|
||||
foreach my $ext (sort @extlist)
|
||||
{
|
||||
my ($extname, $exturl, $extstring, $types, $tokens, $functions, $exacts) = parse_ext($ext);
|
||||
my $exttype = $extname;
|
||||
$exttype =~ s/(W*?)GL(X*?)_(.*?_)(.*)/$3/;
|
||||
my $extrem = $extname;
|
||||
$extrem =~ s/(W*?)GL(X*?)_(.*?_)(.*)/$4/;
|
||||
my $extvar = $extname;
|
||||
$extvar =~ s/(W*)GL(X*)_/$1GL$2EW_/;
|
||||
if(!($exttype =~ $curexttype))
|
||||
{
|
||||
if(length($curexttype) > 0)
|
||||
{
|
||||
print " }\n";
|
||||
}
|
||||
print " if (_glewStrSame2(&pos, &len, (const GLubyte*)\"$exttype\", " . length($exttype) . "))\n";
|
||||
print " {\n";
|
||||
$curexttype = $exttype;
|
||||
}
|
||||
print "#ifdef $extname\n";
|
||||
print " if (_glewStrSame3(&pos, &len, (const GLubyte*)\"$extrem\", ". length($extrem) . "))\n";
|
||||
#print " return $extvar;\n";
|
||||
print " {\n";
|
||||
print " ret = $extvar;\n";
|
||||
print " continue;\n";
|
||||
print " }\n";
|
||||
print "#endif\n";
|
||||
}
|
||||
|
||||
print " }\n";
|
||||
}
|
||||
-36
@@ -1,36 +0,0 @@
|
||||
#!/usr/bin/perl
|
||||
##
|
||||
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
|
||||
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
|
||||
##
|
||||
## This program is distributed under the terms and conditions of the GNU
|
||||
## General Public License Version 2 as published by the Free Software
|
||||
## Foundation or, at your option, any later version.
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
do 'bin/make.pl';
|
||||
|
||||
# function pointer declaration
|
||||
sub make_pfn_decl($%)
|
||||
{
|
||||
our $export;
|
||||
return $export . " PFN" . (uc $_[0]) . "PROC " . prefixname($_[0]) . ";";
|
||||
}
|
||||
|
||||
my @extlist = ();
|
||||
my %extensions = ();
|
||||
|
||||
our $export = shift;
|
||||
|
||||
if (@ARGV)
|
||||
{
|
||||
@extlist = @ARGV;
|
||||
|
||||
foreach my $ext (sort @extlist)
|
||||
{
|
||||
my ($extname, $exturl, $extstring, $types, $tokens, $functions, $exacts) = parse_ext($ext);
|
||||
output_decls($functions, \&make_pfn_decl);
|
||||
}
|
||||
}
|
||||
-31
@@ -1,31 +0,0 @@
|
||||
#!/usr/bin/perl
|
||||
##
|
||||
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
|
||||
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
|
||||
##
|
||||
## This program is distributed under the terms and conditions of the GNU
|
||||
## General Public License Version 2 as published by the Free Software
|
||||
## Foundation or, at your option, any later version.
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
do 'bin/make.pl';
|
||||
|
||||
my @extlist = ();
|
||||
my %extensions = ();
|
||||
|
||||
our $export = shift;
|
||||
|
||||
if (@ARGV)
|
||||
{
|
||||
@extlist = @ARGV;
|
||||
|
||||
foreach my $ext (sort @extlist)
|
||||
{
|
||||
my ($extname, $exturl, $extstring, $types, $tokens, $functions, $exacts) = parse_ext($ext);
|
||||
my $extvar = $extname;
|
||||
$extvar =~ s/GL(X*)_/GL$1EW_/;
|
||||
print $export . " GLboolean " . prefix_varname($extvar) . ";\n";
|
||||
}
|
||||
}
|
||||
-335
@@ -1,335 +0,0 @@
|
||||
#!/usr/bin/perl
|
||||
##
|
||||
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
|
||||
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
|
||||
##
|
||||
## This program is distributed under the terms and conditions of the GNU
|
||||
## General Public License Version 2 as published by the Free Software
|
||||
## Foundation or, at your option, any later version.
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
sub compile_regex
|
||||
{
|
||||
my $regex = join('', @_);
|
||||
return qr/$regex/
|
||||
}
|
||||
|
||||
my @sections = (
|
||||
"Name",
|
||||
"Name Strings?",
|
||||
"New Procedures and Functions",
|
||||
"New Tokens",
|
||||
);
|
||||
|
||||
my %typemap = (
|
||||
bitfield => "GLbitfield",
|
||||
boolean => "GLboolean",
|
||||
# fsck up in EXT_vertex_array
|
||||
Boolean => "GLboolean",
|
||||
byte => "GLbyte",
|
||||
clampd => "GLclampd",
|
||||
clampf => "GLclampf",
|
||||
double => "GLdouble",
|
||||
enum => "GLenum",
|
||||
# Intel fsck up
|
||||
Glenum => "GLenum",
|
||||
float => "GLfloat",
|
||||
half => "GLhalf",
|
||||
int => "GLint",
|
||||
short => "GLshort",
|
||||
sizei => "GLsizei",
|
||||
ubyte => "GLubyte",
|
||||
uint => "GLuint",
|
||||
ushort => "GLushort",
|
||||
DMbuffer => "void *",
|
||||
# Nvidia video output fsck up
|
||||
int64EXT => "GLint64EXT",
|
||||
uint64EXT=> "GLuint64EXT",
|
||||
|
||||
# ARB VBO introduces these.
|
||||
|
||||
sizeiptr => "GLsizeiptr",
|
||||
intptr => "GLintptr",
|
||||
sizeiptrARB => "GLsizeiptrARB",
|
||||
intptrARB => "GLintptrARB",
|
||||
|
||||
# ARB shader objects introduces these, charARB is at least 8 bits,
|
||||
# handleARB is at least 32 bits
|
||||
charARB => "GLcharARB",
|
||||
handleARB => "GLhandleARB",
|
||||
|
||||
# OpenGL 3.2 and GL_ARB_sync
|
||||
|
||||
int64 => "GLint64",
|
||||
uint64 => "GLuint64",
|
||||
sync => "GLsync",
|
||||
|
||||
# GLX 1.3 defines new types which might not be available at compile time
|
||||
|
||||
#GLXFBConfig => "void*",
|
||||
#GLXFBConfigID => "XID",
|
||||
#GLXContextID => "XID",
|
||||
#GLXWindow => "XID",
|
||||
#GLXPbuffer => "XID",
|
||||
|
||||
# Weird stuff to some SGIX extension
|
||||
|
||||
#GLXFBConfigSGIX => "void*",
|
||||
#GLXFBConfigIDSGIX => "XID",
|
||||
|
||||
);
|
||||
|
||||
my %voidtypemap = (
|
||||
void => "GLvoid",
|
||||
);
|
||||
|
||||
my %taboo_tokens = (
|
||||
GL_ZERO => 1,
|
||||
);
|
||||
|
||||
# list of function definitions to be ignored, unless they are being defined in
|
||||
# the given spec. This is an ugly hack arround the fact that people writing
|
||||
# spec files seem to shut down all brain activity while they are at this task.
|
||||
#
|
||||
# This will be moved to its own file eventually.
|
||||
#
|
||||
# (mem, 2003-03-19)
|
||||
|
||||
my %fnc_ignore_list = (
|
||||
"BindProgramARB" => "ARB_vertex_program",
|
||||
"ColorSubTableEXT" => "EXT_color_subtable",
|
||||
"DeleteProgramsARB" => "ARB_vertex_program",
|
||||
"GenProgramsARB" => "ARB_vertex_program",
|
||||
"GetProgramEnvParameterdvARB" => "ARB_vertex_program",
|
||||
"GetProgramEnvParameterfvARB" => "ARB_vertex_program",
|
||||
"GetProgramLocalParameterdvARB" => "ARB_vertex_program",
|
||||
"GetProgramLocalParameterfvARB" => "ARB_vertex_program",
|
||||
"GetProgramStringARB" => "ARB_vertex_program",
|
||||
"GetProgramivARB" => "ARB_vertex_program",
|
||||
"IsProgramARB" => "ARB_vertex_program",
|
||||
"ProgramEnvParameter4dARB" => "ARB_vertex_program",
|
||||
"ProgramEnvParameter4dvARB" => "ARB_vertex_program",
|
||||
"ProgramEnvParameter4fARB" => "ARB_vertex_program",
|
||||
"ProgramEnvParameter4fvARB" => "ARB_vertex_program",
|
||||
"ProgramLocalParameter4dARB" => "ARB_vertex_program",
|
||||
"ProgramLocalParameter4dvARB" => "ARB_vertex_program",
|
||||
"ProgramLocalParameter4fARB" => "ARB_vertex_program",
|
||||
"ProgramLocalParameter4fvARB" => "ARB_vertex_program",
|
||||
"ProgramStringARB" => "ARB_vertex_program",
|
||||
"glXCreateContextAttribsARB" => "ARB_create_context_profile",
|
||||
"wglCreateContextAttribsARB" => "WGL_ARB_create_context_profile",
|
||||
);
|
||||
|
||||
my %regex = (
|
||||
eofnc => qr/(?:\);?$|^$)/, # )$ | );$ | ^$
|
||||
extname => qr/^[A-Z][A-Za-z0-9_]+$/,
|
||||
none => qr/^\(none\)$/,
|
||||
function => qr/^(.+) ([a-z][a-z0-9_]*) \((.+)\)$/i,
|
||||
prefix => qr/^(?:[aw]?gl|glX)/, # gl | agl | wgl | glX
|
||||
tprefix => qr/^(?:[AW]?GL|GLX)_/, # GL_ | AGL_ | WGL_ | GLX_
|
||||
section => compile_regex('^(', join('|', @sections), ')$'), # sections in spec
|
||||
token => qr/^([A-Z0-9][A-Z0-9_]*):?\s+((?:0x)?[0-9A-F]+)(.*)$/, # define tokens
|
||||
types => compile_regex('\b(', join('|', keys %typemap), ')\b'), # var types
|
||||
voidtype => compile_regex('\b(', keys %voidtypemap, ')\b '), # void type
|
||||
);
|
||||
|
||||
# reshapes the the function declaration from multiline to single line form
|
||||
sub normalize_prototype
|
||||
{
|
||||
local $_ = join(" ", @_);
|
||||
s/\s+/ /g; # multiple whitespace -> single space
|
||||
s/\<.*\>//g; # remove <comments> from direct state access extension
|
||||
s/\<.*$//g; # remove incomplete <comments> from direct state access extension
|
||||
s/\s*\(\s*/ \(/; # exactly one space before ( and none after
|
||||
s/\s*\)\s*/\)/; # no space before or after )
|
||||
s/\s*\*([a-zA-Z])/\* $1/; # "* identifier"
|
||||
s/\*wgl/\* wgl/; # "* wgl"
|
||||
s/\*glX/\* glX/; # "* glX"
|
||||
s/\.\.\./void/; # ... -> void
|
||||
s/;$//; # remove ; at the end of the line
|
||||
return $_;
|
||||
}
|
||||
|
||||
# Ugly hack to work arround the fact that functions are declared in more
|
||||
# than one spec file.
|
||||
sub ignore_function($$)
|
||||
{
|
||||
return exists($fnc_ignore_list{$_[0]}) && $fnc_ignore_list{$_[0]} ne $_[1]
|
||||
}
|
||||
|
||||
sub parse_spec($)
|
||||
{
|
||||
my $filename = shift;
|
||||
my $extname = "";
|
||||
my $vendortag = "";
|
||||
my @extnames = ();
|
||||
my %functions = ();
|
||||
my %tokens = ();
|
||||
|
||||
my $section = "";
|
||||
my @fnc = ();
|
||||
|
||||
my %proc = (
|
||||
"Name" => sub {
|
||||
if (/^([a-z0-9]+)_([a-z0-9_]+)/i)
|
||||
{
|
||||
$extname = "$1_$2";
|
||||
$vendortag = $1;
|
||||
}
|
||||
},
|
||||
|
||||
"Name Strings" => sub {
|
||||
# Add extension name to extension list
|
||||
|
||||
# Initially use $extname if (none) specified
|
||||
if (/$regex{none}/)
|
||||
{
|
||||
$_ = $extname;
|
||||
}
|
||||
|
||||
if (/$regex{extname}/)
|
||||
{
|
||||
# prefix with "GL_" if prefix not present
|
||||
s/^/GL_/ unless /$regex{tprefix}/o;
|
||||
# Add extension name to extension list
|
||||
push @extnames, $_;
|
||||
}
|
||||
},
|
||||
|
||||
"New Procedures and Functions" => sub {
|
||||
# if line matches end of function
|
||||
if (/$regex{eofnc}/)
|
||||
{
|
||||
# add line to function declaration
|
||||
push @fnc, $_;
|
||||
|
||||
# if normalized version of function looks like a function
|
||||
if (normalize_prototype(@fnc) =~ /$regex{function}/)
|
||||
{
|
||||
# get return type, name, and arguments from regex
|
||||
my ($return, $name, $parms) = ($1, $2, $3);
|
||||
if (!ignore_function($name, $extname))
|
||||
{
|
||||
# prefix with "gl" if prefix not present
|
||||
$name =~ s/^/gl/ unless $name =~ /$regex{prefix}/;
|
||||
# is this a pure GL function?
|
||||
if ($name =~ /^gl/ && $name !~ /^glX/)
|
||||
{
|
||||
# apply typemaps
|
||||
$return =~ s/$regex{types}/$typemap{$1}/og;
|
||||
$return =~ s/void\*/GLvoid */og;
|
||||
$parms =~ s/$regex{types}/$typemap{$1}/og;
|
||||
$parms =~ s/$regex{voidtype}/$voidtypemap{$1}/og;
|
||||
}
|
||||
# add to functions hash
|
||||
$functions{$name} = {
|
||||
rtype => $return,
|
||||
parms => $parms,
|
||||
};
|
||||
}
|
||||
}
|
||||
# reset function declaration
|
||||
@fnc = ();
|
||||
} elsif ($_ ne "" and $_ ne "None") {
|
||||
# if not eof, add line to function declaration
|
||||
push @fnc, $_
|
||||
}
|
||||
},
|
||||
|
||||
"New Tokens" => sub {
|
||||
if (/$regex{token}/)
|
||||
{
|
||||
my ($name, $value) = ($1, $2);
|
||||
# prefix with "GL_" if prefix not present
|
||||
$name =~ s/^/GL_/ unless $name =~ /$regex{tprefix}/;
|
||||
# Add (name, value) pair to tokens hash, unless it's taboo
|
||||
$tokens{$name} = $value unless exists $taboo_tokens{$name};
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
# Some people can't read, the template clearly says "Name String_s_"
|
||||
$proc{"Name String"} = $proc{"Name Strings"};
|
||||
|
||||
# Open spec file
|
||||
open SPEC, "<$filename" or return;
|
||||
|
||||
# For each line of SPEC
|
||||
while(<SPEC>)
|
||||
{
|
||||
# Delete trailing newline character
|
||||
chomp;
|
||||
# Remove trailing white spaces
|
||||
s/\s+$//;
|
||||
# If starts with a capital letter, it must be a new section
|
||||
if (/^[A-Z]/)
|
||||
{
|
||||
# Match section name with one of the predefined names
|
||||
$section = /$regex{section}/o ? $1 : "default";
|
||||
} else {
|
||||
# Line is internal to a section
|
||||
# Remove leading whitespace
|
||||
s/^\s+//;
|
||||
# Call appropriate section processing function if it exists
|
||||
&{$proc{$section}} if exists $proc{$section};
|
||||
}
|
||||
}
|
||||
|
||||
close SPEC;
|
||||
|
||||
return ($extname, \@extnames, \%tokens, \%functions);
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------------------
|
||||
|
||||
my @speclist = ();
|
||||
my %extensions = ();
|
||||
|
||||
my $ext_dir = shift;
|
||||
my $reg_http = "http://www.opengl.org/registry/specs/";
|
||||
#my $reg_http = "http://oss.sgi.com/projects/ogl-sample/";
|
||||
|
||||
# Take command line arguments or read list from file
|
||||
if (@ARGV)
|
||||
{
|
||||
@speclist = @ARGV;
|
||||
} else {
|
||||
local $/; #???
|
||||
@speclist = split "\n", (<>);
|
||||
}
|
||||
|
||||
foreach my $spec (sort @speclist)
|
||||
{
|
||||
my ($extname, $extnames, $tokens, $functions) = parse_spec($spec);
|
||||
|
||||
foreach my $ext (@{$extnames})
|
||||
{
|
||||
my $info = "$ext_dir/" . $ext;
|
||||
open EXT, ">$info";
|
||||
print EXT $ext . "\n"; # Extension name
|
||||
my $specname = $spec;
|
||||
$specname =~ s/registry\///;
|
||||
print EXT $reg_http . $specname . "\n"; # Extension info URL
|
||||
print EXT $ext . "\n"; # Extension string
|
||||
|
||||
my $prefix = $ext;
|
||||
$prefix =~ s/^(.+?)(_.+)$/$1/;
|
||||
foreach my $token (sort { hex ${$tokens}{$a} <=> hex ${$tokens}{$b} } keys %{$tokens})
|
||||
{
|
||||
if ($token =~ /^$prefix\_.*/i)
|
||||
{
|
||||
print EXT "\t" . $token . " " . ${\%{$tokens}}{$token} . "\n";
|
||||
}
|
||||
}
|
||||
foreach my $function (sort keys %{$functions})
|
||||
{
|
||||
if ($function =~ /^$prefix.*/i)
|
||||
{
|
||||
print EXT "\t" . ${$functions}{$function}{rtype} . " " . $function . " (" . ${$functions}{$function}{parms} . ")" . "\n";
|
||||
}
|
||||
}
|
||||
close EXT;
|
||||
}
|
||||
}
|
||||
-280
@@ -1,280 +0,0 @@
|
||||
#!/bin/bash
|
||||
##
|
||||
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
|
||||
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
|
||||
##
|
||||
## This program is distributed under the terms and conditions of the GNU
|
||||
## General Public License Version 2 as published by the Free Software
|
||||
## Foundation or, at your option, any later version.
|
||||
##
|
||||
## Parameters:
|
||||
##
|
||||
## $1: Extensions directory
|
||||
## $2: Registry directory
|
||||
## $3: The black list
|
||||
|
||||
set -e
|
||||
|
||||
if [ ! -d $1 ] ; then
|
||||
mkdir $1
|
||||
|
||||
# Parse each of the extensions in the registry
|
||||
find $2 -name doc -type d -prune -o -name \*.txt -print | \
|
||||
grep -v -f $3 | sort | bin/parse_spec.pl $1
|
||||
|
||||
# fix GL_NV_texture_compression_vtc
|
||||
grep -v EXT $1/GL_NV_texture_compression_vtc > tmp
|
||||
mv tmp $1/GL_NV_texture_compression_vtc
|
||||
|
||||
# remove duplicates from GL_ARB_vertex_program and GL_ARB_fragment_program
|
||||
grep -v -F -f $1/GL_ARB_vertex_program $1/GL_ARB_fragment_program > tmp
|
||||
mv tmp $1/GL_ARB_fragment_program
|
||||
|
||||
# remove duplicates from GLX_EXT_visual_rating and GLX_EXT_visual_info
|
||||
grep -v -F -f $1/GLX_EXT_visual_info $1/GLX_EXT_visual_rating > tmp
|
||||
mv tmp $1/GLX_EXT_visual_rating
|
||||
|
||||
# GL_EXT_draw_buffers2 and GL_EXT_transform_feedback both define glGetBooleanIndexedvEXT but with different parameter names
|
||||
grep -v glGetBooleanIndexedvEXT $1/GL_EXT_transform_feedback > tmp
|
||||
mv tmp $1/GL_EXT_transform_feedback
|
||||
|
||||
# GL_EXT_draw_buffers2 and GL_EXT_transform_feedback both define glGetIntegerIndexedvEXT but with different parameter names
|
||||
grep -v glGetIntegerIndexedvEXT $1/GL_EXT_transform_feedback > tmp
|
||||
mv tmp $1/GL_EXT_transform_feedback
|
||||
|
||||
# remove duplicates from GL_NV_present_video and GLX_NV_present_video
|
||||
grep -v -F -f $1/GLX_NV_present_video $1/GL_NV_present_video > tmp
|
||||
mv tmp $1/GL_NV_present_video
|
||||
|
||||
# fix WGL_NV_present_video
|
||||
cat >> $1/WGL_NV_present_video <<EOT
|
||||
DECLARE_HANDLE(HVIDEOOUTPUTDEVICENV);
|
||||
EOT
|
||||
|
||||
# fix WGL_NV_video_output
|
||||
cat >> $1/WGL_NV_video_output <<EOT
|
||||
DECLARE_HANDLE(HPVIDEODEV);
|
||||
EOT
|
||||
|
||||
# fix GL_NV_occlusion_query and GL_HP_occlusion_test
|
||||
grep -v '_HP' $1/GL_NV_occlusion_query > tmp
|
||||
mv tmp $1/GL_NV_occlusion_query
|
||||
perl -e's/OCCLUSION_TEST_HP.*/OCCLUSION_TEST_HP 0x8165/' -pi \
|
||||
$1/GL_HP_occlusion_test
|
||||
perl -e's/OCCLUSION_TEST_RESULT_HP.*/OCCLUSION_TEST_RESULT_HP 0x8166/' -pi \
|
||||
$1/GL_HP_occlusion_test
|
||||
|
||||
# fix GLvoid in GL_ARB_vertex_buffer_objects
|
||||
perl -e 's/ void\*/ GLvoid\*/g' -pi \
|
||||
$1/GL_ARB_vertex_buffer_object
|
||||
|
||||
# add deprecated constants to GL_ATI_fragment_shader
|
||||
cat >> $1/GL_ATI_fragment_shader <<EOT
|
||||
GL_NUM_FRAGMENT_REGISTERS_ATI 0x896E
|
||||
GL_NUM_FRAGMENT_CONSTANTS_ATI 0x896F
|
||||
GL_NUM_PASSES_ATI 0x8970
|
||||
GL_NUM_INSTRUCTIONS_PER_PASS_ATI 0x8971
|
||||
GL_NUM_INSTRUCTIONS_TOTAL_ATI 0x8972
|
||||
GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI 0x8973
|
||||
GL_NUM_LOOPBACK_COMPONENTS_ATI 0x8974
|
||||
GL_COLOR_ALPHA_PAIRING_ATI 0x8975
|
||||
GL_SWIZZLE_STRQ_ATI 0x897A
|
||||
GL_SWIZZLE_STRQ_DQ_ATI 0x897B
|
||||
EOT
|
||||
|
||||
# add deprecated constants to GL_NV_texture_shader
|
||||
cat >> $1/GL_NV_texture_shader <<EOT
|
||||
GL_OFFSET_TEXTURE_2D_MATRIX_NV 0x86E1
|
||||
GL_OFFSET_TEXTURE_2D_BIAS_NV 0x86E3
|
||||
GL_OFFSET_TEXTURE_2D_SCALE_NV 0x86E2
|
||||
EOT
|
||||
|
||||
# fix WGL_ATI_pixel_format_float
|
||||
cat >> $1/WGL_ATI_pixel_format_float <<EOT
|
||||
GL_RGBA_FLOAT_MODE_ATI 0x8820
|
||||
GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835
|
||||
EOT
|
||||
|
||||
# fix WGL_ARB_make_current_read
|
||||
cat >> $1/WGL_ARB_make_current_read <<EOT
|
||||
ERROR_INVALID_PIXEL_TYPE_ARB 0x2043
|
||||
ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB 0x2054
|
||||
EOT
|
||||
|
||||
# fix WGL_EXT_make_current_read
|
||||
cat >> $1/WGL_EXT_make_current_read <<EOT
|
||||
ERROR_INVALID_PIXEL_TYPE_EXT 0x2043
|
||||
EOT
|
||||
|
||||
# add typedefs to GL_ARB_vertex_buffer_object; (from personal communication
|
||||
# with Marco Fabbricatore).
|
||||
#
|
||||
# Rationale. The spec says:
|
||||
#
|
||||
# "Both types are defined as signed integers large enough to contain
|
||||
# any pointer value [...] The idea of making these types unsigned was
|
||||
# considered, but was ultimately rejected ..."
|
||||
cat >> $1/GL_ARB_vertex_buffer_object <<EOT
|
||||
typedef ptrdiff_t GLsizeiptrARB
|
||||
typedef ptrdiff_t GLintptrARB
|
||||
EOT
|
||||
|
||||
# add typedefs to GLX_EXT_import_context
|
||||
cat >> $1/GLX_EXT_import_context <<EOT
|
||||
typedef XID GLXContextID
|
||||
EOT
|
||||
|
||||
# add tokens to GLX_OML_swap_method
|
||||
cat >> $1/GLX_OML_swap_method <<EOT
|
||||
GLX_SWAP_EXCHANGE_OML 0x8061
|
||||
GLX_SWAP_COPY_OML 0x8062
|
||||
GLX_SWAP_UNDEFINED_OML 0x8063
|
||||
EOT
|
||||
|
||||
# add typedefs to GLX_SGIX_fbconfig
|
||||
cat >> $1/GLX_SGIX_fbconfig <<EOT
|
||||
typedef XID GLXFBConfigIDSGIX
|
||||
typedef struct __GLXFBConfigRec *GLXFBConfigSGIX
|
||||
EOT
|
||||
|
||||
# add typedefs to GLX_SGIX_pbuffer
|
||||
cat >> $1/GLX_SGIX_pbuffer <<EOT
|
||||
typedef XID GLXPbufferSGIX
|
||||
typedef struct { int type; unsigned long serial; Bool send_event; Display *display; GLXDrawable drawable; int event_type; int draw_type; unsigned int mask; int x, y; int width, height; int count; } GLXBufferClobberEventSGIX
|
||||
EOT
|
||||
|
||||
# add typedef to GL_NV_half_float
|
||||
cat >> $1/GL_NV_half_float <<EOT
|
||||
typedef unsigned short GLhalf
|
||||
EOT
|
||||
|
||||
# add handle to WGL_ARB_pbuffer
|
||||
cat >> $1/WGL_ARB_pbuffer <<EOT
|
||||
DECLARE_HANDLE(HPBUFFERARB);
|
||||
EOT
|
||||
|
||||
# add handle to WGL_EXT_pbuffer
|
||||
cat >> $1/WGL_EXT_pbuffer <<EOT
|
||||
DECLARE_HANDLE(HPBUFFEREXT);
|
||||
EOT
|
||||
|
||||
# get rid of GL_SUN_multi_draw_arrays
|
||||
rm -f $1/GL_SUN_multi_draw_arrays
|
||||
|
||||
# change variable names in GL_ARB_vertex_shader
|
||||
perl -e 's/v0/x/g' -pi $1/GL_ARB_vertex_shader
|
||||
perl -e 's/v1/y/g' -pi $1/GL_ARB_vertex_shader
|
||||
perl -e 's/v2/z/g' -pi $1/GL_ARB_vertex_shader
|
||||
perl -e 's/v3/w/g' -pi $1/GL_ARB_vertex_shader
|
||||
|
||||
# remove triplicates in GL_ARB_shader_objects, GL_ARB_fragment_shader,
|
||||
# and GL_ARB_vertex_shader
|
||||
grep -v -F -f $1/GL_ARB_shader_objects $1/GL_ARB_fragment_shader > tmp
|
||||
mv tmp $1/GL_ARB_fragment_shader
|
||||
grep -v -F -f $1/GL_ARB_shader_objects $1/GL_ARB_vertex_shader > tmp
|
||||
mv tmp $1/GL_ARB_vertex_shader
|
||||
|
||||
# remove duplicates in GL_ARB_vertex_program and GL_ARB_vertex_shader
|
||||
grep -v -F -f $1/GL_ARB_vertex_program $1/GL_ARB_vertex_shader > tmp
|
||||
mv tmp $1/GL_ARB_vertex_shader
|
||||
|
||||
# remove triplicates in GL_ARB_fragment_program, GL_ARB_fragment_shader,
|
||||
# and GL_ARB_vertex_shader
|
||||
grep -v -F -f $1/GL_ARB_fragment_program $1/GL_ARB_fragment_shader > tmp
|
||||
mv tmp $1/GL_ARB_fragment_shader
|
||||
grep -v -F -f $1/GL_ARB_fragment_program $1/GL_ARB_vertex_shader > tmp
|
||||
mv tmp $1/GL_ARB_vertex_shader
|
||||
|
||||
# remove duplicates in GL_EXT_direct_state_access
|
||||
grep -v "glGetBooleanIndexedvEXT" $1/GL_EXT_direct_state_access > tmp
|
||||
mv tmp $1/GL_EXT_direct_state_access
|
||||
grep -v "glGetIntegerIndexedvEXT" $1/GL_EXT_direct_state_access > tmp
|
||||
mv tmp $1/GL_EXT_direct_state_access
|
||||
grep -v "glDisableIndexedEXT" $1/GL_EXT_direct_state_access > tmp
|
||||
mv tmp $1/GL_EXT_direct_state_access
|
||||
grep -v "glEnableIndexedEXT" $1/GL_EXT_direct_state_access > tmp
|
||||
mv tmp $1/GL_EXT_direct_state_access
|
||||
grep -v "glIsEnabledIndexedEXT" $1/GL_EXT_direct_state_access > tmp
|
||||
mv tmp $1/GL_EXT_direct_state_access
|
||||
|
||||
# remove duplicates in GL_NV_explicit_multisample
|
||||
grep -v "glGetBooleanIndexedvEXT" $1/GL_NV_explicit_multisample > tmp
|
||||
mv tmp $1/GL_NV_explicit_multisample
|
||||
grep -v "glGetIntegerIndexedvEXT" $1/GL_NV_explicit_multisample > tmp
|
||||
mv tmp $1/GL_NV_explicit_multisample
|
||||
|
||||
# fix bugs in GL_ARB_vertex_shader
|
||||
grep -v "GL_FLOAT" $1/GL_ARB_vertex_shader > tmp
|
||||
mv tmp $1/GL_ARB_vertex_shader
|
||||
perl -e 's/handle /GLhandleARB /g' -pi $1/GL_ARB_vertex_shader
|
||||
|
||||
# fix bugs in GL_ARB_shader_objects
|
||||
grep -v "GL_FLOAT " $1/GL_ARB_shader_objects > tmp
|
||||
mv tmp $1/GL_ARB_shader_objects
|
||||
grep -v "GL_INT " $1/GL_ARB_shader_objects > tmp
|
||||
mv tmp $1/GL_ARB_shader_objects
|
||||
|
||||
# add typedefs to GL_ARB_shader_objects
|
||||
cat >> $1/GL_ARB_shader_objects <<EOT
|
||||
typedef char GLcharARB
|
||||
typedef unsigned int GLhandleARB
|
||||
EOT
|
||||
|
||||
# add missing functions to GL_ARB_transpose_matrix
|
||||
cat >> $1/GL_ARB_transpose_matrix <<EOT
|
||||
void glLoadTransposeMatrixfARB (GLfloat m[16])
|
||||
void glLoadTransposeMatrixdARB (GLdouble m[16])
|
||||
void glMultTransposeMatrixfARB (GLfloat m[16])
|
||||
void glMultTransposeMatrixdARB (GLdouble m[16])
|
||||
EOT
|
||||
|
||||
# add missing tokens to GL_EXT_framebuffer_multisample
|
||||
cat >> $1/GL_EXT_framebuffer_multisample <<EOT
|
||||
GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56
|
||||
GL_MAX_SAMPLES_EXT 0x8D57
|
||||
EOT
|
||||
|
||||
# Filter out GL_NV_gpu_program_fp64 enums and functions
|
||||
head -n3 $1/GL_NV_gpu_program_fp64 > tmp
|
||||
mv tmp $1/GL_NV_gpu_program_fp64
|
||||
|
||||
# Filter glGetUniformui64vNV from GL_NV_shader_buffer_load
|
||||
grep -v "glGetUniformui64vNV" $1/GL_NV_shader_buffer_load > tmp
|
||||
mv tmp $1/GL_NV_shader_buffer_load
|
||||
|
||||
# Filter out GL_ARB_gpu_shader_fp64 enums and functions
|
||||
head -n3 $1/GL_ARB_gpu_shader_fp64 > tmp
|
||||
mv tmp $1/GL_ARB_gpu_shader_fp64
|
||||
|
||||
# Filter out profile enumerations from GLX_ARB_create_context
|
||||
grep -v "_PROFILE_" $1/GLX_ARB_create_context > tmp
|
||||
mv tmp $1/GLX_ARB_create_context
|
||||
|
||||
# Filter only profile related enumerations for GLX_ARB_create_context_profile
|
||||
head -n3 $1/GLX_ARB_create_context_profile > tmp
|
||||
grep "_PROFILE_" $1/GLX_ARB_create_context_profile >> tmp
|
||||
mv tmp $1/GLX_ARB_create_context_profile
|
||||
|
||||
# Filter out profile enumerations from WGL_ARB_create_context
|
||||
grep -v "_PROFILE_" $1/WGL_ARB_create_context > tmp
|
||||
mv tmp $1/WGL_ARB_create_context
|
||||
|
||||
# Filter only profile related enumerations for WGL_ARB_create_context_profile
|
||||
head -n3 $1/WGL_ARB_create_context_profile > tmp
|
||||
grep "_PROFILE_" $1/WGL_ARB_create_context_profile >> tmp
|
||||
mv tmp $1/WGL_ARB_create_context_profile
|
||||
|
||||
# add missing function to GLX_NV_copy_image
|
||||
cat >> $1/GLX_NV_copy_image <<EOT
|
||||
void glXCopyImageSubDataNV (Display *dpy, GLXContext srcCtx, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLXContext dstCtx, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth)
|
||||
EOT
|
||||
|
||||
# add missing function to WGL_NV_copy_image
|
||||
cat >> $1/WGL_NV_copy_image <<EOT
|
||||
BOOL wglCopyImageSubDataNV (HGLRC hSrcRC, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, HGLRC hDstRC, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth)
|
||||
EOT
|
||||
|
||||
# clean up
|
||||
rm -f $1/*.bak
|
||||
|
||||
fi
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user