This is an automated email from the git hooks/post-receive script. ecsv-guest pushed a commit to branch master in repository mupen64plus-video-z64.
commit 857f857fb6582fadc16bad3c8b3f2d3ec2dca8ac Author: Sven Eckelmann <[email protected]> Date: Fri Feb 8 09:47:54 2013 +0100 Imported Upstream version 1.99.5+18+7c782be6fc7c --- projects/unix/Makefile | 108 +++++++++++++++++++++++++++++++++++-------------- src/glshader.cpp | 14 ++++++- src/maingl.cpp | 2 +- src/rgl.cpp | 2 +- src/rgl.h | 8 +++- src/rgl_debugger.cpp | 2 +- src/rgl_geometry.cpp | 2 +- src/rgl_glut.cpp | 2 +- src/rgl_osdep.cpp | 2 +- src/rgl_rendermode.cpp | 2 +- src/rgl_tiles.cpp | 2 +- 11 files changed, 105 insertions(+), 41 deletions(-) diff --git a/projects/unix/Makefile b/projects/unix/Makefile index 105c07c..55eb43a 100644 --- a/projects/unix/Makefile +++ b/projects/unix/Makefile @@ -23,7 +23,7 @@ # Makefile for Z64 Video plugin in Mupen64Plus # detect operating system -UNAME = $(shell uname -s) +UNAME ?= $(shell uname -s) OS := NONE ifeq ("$(UNAME)","Linux") OS = LINUX @@ -61,6 +61,12 @@ ifneq ("$(filter GNU/kFreeBSD kfreebsd,$(UNAME))","") SO_EXTENSION = so SHARED = -shared endif +ifeq ("$(patsubst MINGW%,MINGW,$(UNAME))","MINGW") + OS = MINGW + SO_EXTENSION = dll + SHARED = -shared + PIC = 0 +endif ifeq ("$(OS)","NONE") $(error OS type "$(UNAME)" not supported. Please file bug report at 'http://code.google.com/p/mupen64plus/issues') endif @@ -114,10 +120,15 @@ endif # base CFLAGS, LDLIBS, and LDFLAGS OPTFLAGS ?= -O3 -CFLAGS += $(OPTFLAGS) -Wall -ffast-math -fno-strict-aliasing -fvisibility=hidden -I../../src +WARNFLAGS ?= -Wall +CFLAGS += $(OPTFLAGS) $(WARNFLAGS) -ffast-math -fno-strict-aliasing -fvisibility=hidden -I../../src CXXFLAGS += -fvisibility-inlines-hidden LDFLAGS += $(SHARED) +# default configuration programs +SDL_CONFIG = $(CROSS_COMPILE)sdl-config +PKG_CONFIG = $(CROSS_COMPILE)pkg-config + # Since we are building a shared library, we must compile with -fPIC on some architectures # On 32-bit x86 systems we do not want to use -fPIC because we don't have to and it has a big performance penalty on this arch ifeq ($(PIC), 1) @@ -147,14 +158,26 @@ ifeq ($(OS), LINUX) LDFLAGS += -Wl,-version-script,$(SRCDIR)/video_api_export.ver endif ifeq ($(OS), OSX) + # Select the proper SDK + # Also, SDKs are stored in a different location since XCode 4.3 + OSX_SDK ?= $(shell sw_vers -productVersion | cut -f1 -f2 -d .) + OSX_XCODEMAJ = $(shell xcodebuild -version | grep '[0-9]*\.[0-9]*' | cut -f2 -d ' ' | cut -f1 -d .) + OSX_XCODEMIN = $(shell xcodebuild -version | grep '[0-9]*\.[0-9]*' | cut -f2 -d ' ' | cut -f2 -d .) + OSX_XCODEGE43 = $(shell echo "`expr $(OSX_XCODEMAJ) \>= 4``expr $(OSX_XCODEMIN) \>= 3`") + ifeq ($(OSX_XCODEGE43), 11) + OSX_SYSROOT := /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs + else + OSX_SYSROOT := /Developer/SDKs + endif + ifeq ($(CPU), X86) ifeq ($(ARCH_DETECTED), 64BITS) - CFLAGS += -pipe -arch x86_64 -mmacosx-version-min=10.5 -isysroot /Developer/SDKs/MacOSX10.5.sdk - LDFLAGS += -bundle -framework OpenGL -arch x86_64 + CFLAGS += -pipe -arch x86_64 -mmacosx-version-min=$(OSX_SDK) -isysroot $(OSX_SYSROOT)/MacOSX$(OSX_SDK).sdk + LDFLAGS += -bundle -arch x86_64 LDLIBS += -ldl else - CFLAGS += -pipe -mmmx -msse -fomit-frame-pointer -arch i686 -mmacosx-version-min=10.5 -isysroot /Developer/SDKs/MacOSX10.5.sdk - LDFLAGS += -bundle -framework OpenGL -arch i686 + CFLAGS += -pipe -mmmx -msse -fomit-frame-pointer -arch i686 -mmacosx-version-min=$(OSX_SDK) -isysroot $(OSX_SYSROOT)/MacOSX$(OSX_SDK).sdk + LDFLAGS += -bundle -arch i686 LDLIBS += -ldl endif endif @@ -167,35 +190,53 @@ ifeq ($(OS), FREEBSD) endif # test for essential build dependencies -ifeq ($(shell which pkg-config 2>/dev/null),) - $(error pkg-config not found) -endif -ifeq ($(shell pkg-config --modversion gl 2>/dev/null),) - $(error No OpenGL development libraries found!) +ifeq ($(shell which $(PKG_CONFIG) 2>/dev/null),) + $(error $(PKG_CONFIG) not found) endif -ifeq ($(shell pkg-config --modversion glew 2>/dev/null),) +ifeq ($(shell $(PKG_CONFIG) --modversion glew 2>/dev/null),) $(error No GLEW development libraries found!) endif -CFLAGS += $(shell pkg-config --cflags gl glew) -LDLIBS += $(shell pkg-config --libs gl glew) +CFLAGS += $(shell $(PKG_CONFIG) --cflags glew) +LDLIBS += $(shell $(PKG_CONFIG) --libs glew) + +# search for OpenGL libraries +GL_LIBS= +ifeq ($(OS), OSX) + GL_LIBS = -framework OpenGL +endif +ifeq ($(OS), MINGW) + GL_LIBS = -lopengl32 +endif +ifeq ("$(GL_LIBS)", "") + ifeq ($(shell $(PKG_CONFIG) --modversion gl 2>/dev/null),) + $(error No OpenGL development libraries found!) + endif + CFLAGS += $(shell $(PKG_CONFIG) --cflags gl) + GL_LIBS = $(shell $(PKG_CONFIG) --libs gl) +endif +LDLIBS += $(GL_LIBS) # test for presence of SDL -ifeq ($(shell which sdl-config 2>/dev/null),) +ifeq ($(shell which $(SDL_CONFIG) 2>/dev/null),) $(error No SDL development libraries found!) endif ifeq ($(OS),FREEBSD) - CFLAGS += $(shell sdl-config --cflags) - LDLIBS += $(shell sdl-config --libs) + CFLAGS += $(shell $(SDL_CONFIG) --cflags) + LDLIBS += $(shell $(SDL_CONFIG) --libs) endif ifeq ($(OS),OSX) - CFLAGS += $(shell sdl-config --cflags) + CFLAGS += $(shell $(SDL_CONFIG) --cflags) # sdl-config on mac screws up when we're trying to build a library and not an executable # SDL 1.3 is supposed to fix that, if it's ever released LDLIBS += -L/usr/local/lib -lSDL -Wl,-framework,Cocoa endif ifeq ($(OS),LINUX) - CFLAGS += $(shell sdl-config --cflags) - LDLIBS += $(shell sdl-config --libs) + CFLAGS += $(shell $(SDL_CONFIG) --cflags) + LDLIBS += $(shell $(SDL_CONFIG) --libs) +endif +ifeq ($(OS), MINGW) + CFLAGS += $(shell $(SDL_CONFIG) --cflags) + LDLIBS += $(shell $(SDL_CONFIG) --libs) endif # set mupen64plus core API header path @@ -230,8 +271,8 @@ endif endif # set base program pointers and flags -CC ?= gcc -CXX ?= g++ +CC = $(CROSS_COMPILE)gcc +CXX = $(CROSS_COMPILE)g++ RM ?= rm -f INSTALL ?= install MKDIR ?= mkdir -p @@ -262,7 +303,7 @@ ifeq ($(PLUGINDIR),) endif SRCDIR = ../../src -OBJDIR = _obj +OBJDIR = _obj$(POSTFIX) # list of source files to compile SOURCE = \ @@ -276,8 +317,13 @@ SOURCE = \ $(SRCDIR)/rdp.cpp \ $(SRCDIR)/glshader.cpp \ $(SRCDIR)/disasm.cpp \ - $(SRCDIR)/maingl.cpp \ - $(SRCDIR)/osal_dynamiclib_unix.c + $(SRCDIR)/maingl.cpp + +ifeq ($(OS),MINGW) +SOURCE += $(SRCDIR)/osal_dynamiclib_win32.c +else +SOURCE += $(SRCDIR)/osal_dynamiclib_unix.c +endif # generate a list of object files build, make a temporary directory for them OBJECTS := $(patsubst $(SRCDIR)/%.c, $(OBJDIR)/%.o, $(filter %.c, $(SOURCE))) @@ -286,7 +332,7 @@ OBJDIRS = $(dir $(OBJECTS)) $(shell $(MKDIR) $(OBJDIRS)) # build targets -TARGET = mupen64plus-video-z64.$(SO_EXTENSION) +TARGET = mupen64plus-video-z64$(POSTFIX).$(SO_EXTENSION) targets: @echo "Mupen64plus-video-z64 N64 Graphics plugin makefile. " @@ -300,7 +346,9 @@ targets: @echo " BITS=32 == build 32-bit binaries on 64-bit machine" @echo " APIDIR=path == path to find Mupen64Plus Core headers" @echo " OPTFLAGS=flag == compiler optimization (default: -O3)" + @echo " WARNFLAGS=flag == compiler warning levels (default: -Wall)" @echo " PIC=(1|0) == Force enable/disable of position independent code" + @echo " POSTFIX=name == String added to the name of the the build (default: '')" @echo " Install Options:" @echo " PREFIX=path == install/uninstall prefix (default: /usr/local)" @echo " SHAREDIR=path == path to install shared data files (default: PREFIX/share/mupen64plus)" @@ -323,7 +371,7 @@ uninstall: $(RM) "$(DESTDIR)$(PLUGINDIR)/$(TARGET)" clean: - $(RM) -r ./_obj $(TARGET) + $(RM) -r $(OBJDIR) $(TARGET) rebuild: clean all @@ -333,9 +381,9 @@ CFLAGS += -MD CXXFLAGS += $(CFLAGS) ifeq ($(LTO), 1) - CFLAGS += -flto - CXXFLAGS += -flto - LDFLAGS += -fuse-linker-plugin $(CXXFLAGS) + CFLAGS += -flto -ffunction-sections -fdata-sections + CXXFLAGS += -flto -ffunction-sections -fdata-sections + LDFLAGS += -fuse-linker-plugin -Wl,--gc-sections $(CXXFLAGS) endif # standard build rules diff --git a/src/glshader.cpp b/src/glshader.cpp index 303ea8e..4729945 100644 --- a/src/glshader.cpp +++ b/src/glshader.cpp @@ -23,9 +23,19 @@ #include <stdio.h> #include <string.h> #include "rgl_assert.h" -#include <GL/glew.h> +#include <glew.h> +#if defined(__MACOSX__) +#include <OpenGL/gl.h> +#include <OpenGL/glext.h> +#elif defined(__MACOS__) +#include <gl.h> +#include <glext.h> +#else #include <GL/gl.h> -#include <GL/glext.h> +#ifndef WIN32 + #include <GL/glext.h> +#endif +#endif #include "glshader.h" static void printInfoLog(GLhandleARB obj, const char * src) diff --git a/src/maingl.cpp b/src/maingl.cpp index 8bccacb..b27e98d 100644 --- a/src/maingl.cpp +++ b/src/maingl.cpp @@ -22,7 +22,7 @@ #include "rdp.h" #include "rgl.h" #include "osal_dynamiclib.h" -#include <SDL/SDL.h> +#include <SDL.h> #define THREADED diff --git a/src/rgl.cpp b/src/rgl.cpp index c074457..83842c1 100644 --- a/src/rgl.cpp +++ b/src/rgl.cpp @@ -79,7 +79,7 @@ #include "rdp.h" #include "rgl.h" -#include <SDL/SDL.h> +#include <SDL.h> //#define NOFBO #define ZTEX diff --git a/src/rgl.h b/src/rgl.h index 6693fe9..c15f93f 100644 --- a/src/rgl.h +++ b/src/rgl.h @@ -26,8 +26,14 @@ #include "rgl_assert.h" #include "rdp.h" -#include <GL/glew.h> +#include <glew.h> +#if defined(__MACOSX__) +#include <OpenGL/gl.h> +#elif defined(__MACOS__) +#include <gl.h> +#else #include <GL/gl.h> +#endif #ifdef RDP_DEBUG //#include <IL/il.h> diff --git a/src/rgl_debugger.cpp b/src/rgl_debugger.cpp index 3a55ea2..740be9e 100644 --- a/src/rgl_debugger.cpp +++ b/src/rgl_debugger.cpp @@ -133,7 +133,7 @@ char * rglCombiner2String(rdpState_t & state) #ifdef RDP_DEBUG -#include <SDL/SDL.h> +#include <SDL.h> //#include <IL/il.h> #include <assert.h> diff --git a/src/rgl_geometry.cpp b/src/rgl_geometry.cpp index 4ffe43e..3d77856 100644 --- a/src/rgl_geometry.cpp +++ b/src/rgl_geometry.cpp @@ -22,7 +22,7 @@ #include "rdp.h" #include "rgl.h" -#include <SDL/SDL.h> +#include <SDL.h> inline float _zscale(uint16_t z) { diff --git a/src/rgl_glut.cpp b/src/rgl_glut.cpp index cac7fdd..0bee4fa 100644 --- a/src/rgl_glut.cpp +++ b/src/rgl_glut.cpp @@ -21,7 +21,7 @@ #include <string.h> -#include <SDL/SDL.h> +#include <SDL.h> #include "rgl_glut.h" diff --git a/src/rgl_osdep.cpp b/src/rgl_osdep.cpp index ad2dc1f..78cc7e1 100644 --- a/src/rgl_osdep.cpp +++ b/src/rgl_osdep.cpp @@ -22,7 +22,7 @@ #include "rdp.h" #include "rgl.h" -#include <SDL/SDL.h> +#include <SDL.h> SDL_Surface *sdl_Screen; int viewportOffset; diff --git a/src/rgl_rendermode.cpp b/src/rgl_rendermode.cpp index 1e190b0..c85a63c 100644 --- a/src/rgl_rendermode.cpp +++ b/src/rgl_rendermode.cpp @@ -22,7 +22,7 @@ #include "rdp.h" #include "rgl.h" -#include <SDL/SDL.h> +#include <SDL.h> void rglRenderMode(rglRenderChunk_t & chunk) { diff --git a/src/rgl_tiles.cpp b/src/rgl_tiles.cpp index 7d31bca..bca1554 100644 --- a/src/rgl_tiles.cpp +++ b/src/rgl_tiles.cpp @@ -22,7 +22,7 @@ #include "rdp.h" #include "rgl.h" -#include <SDL/SDL.h> +#include <SDL.h> rglTextureHead_t freeTextures; rglTextureHead_t texturesByCrc[256]; -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/mupen64plus-video-z64.git _______________________________________________ Pkg-games-commits mailing list [email protected] http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-games-commits

