[mupen64plus-video-arachnoid] 104/147: Imported Upstream version 1.99.5+17+d1dc3118f220

Sven Eckelmann ecsv-guest at moszumanska.debian.org
Thu Nov 26 06:09:54 UTC 2015


This is an automated email from the git hooks/post-receive script.

ecsv-guest pushed a commit to branch master
in repository mupen64plus-video-arachnoid.

commit fc04c36cd1b23392f9afda95c5b5b5f8e7ed7f60
Author: Sven Eckelmann <sven at narfation.org>
Date:   Fri Feb 8 09:37:10 2013 +0100

    Imported Upstream version 1.99.5+17+d1dc3118f220
---
 projects/unix/Makefile         | 86 +++++++++++++++++++++++++++++++-----------
 src/Assembler/assembler.h      |  2 +-
 src/OpenGL.h                   |  6 +++
 src/osal_dynamiclib_win32.cpp  |  2 +-
 src/utils/MemoryLeakDetector.h |  6 +--
 5 files changed, 74 insertions(+), 28 deletions(-)

diff --git a/projects/unix/Makefile b/projects/unix/Makefile
index d53763e..f624a9d 100755
--- a/projects/unix/Makefile
+++ b/projects/unix/Makefile
@@ -21,7 +21,7 @@
 # Makefile for mupen64plus-video-arachnoid
 
 # detect operation system
-UNAME = $(shell uname -s)
+UNAME ?= $(shell uname -s)
 ifeq ("$(UNAME)","Linux")
   OS = LINUX
   SO_EXTENSION = so
@@ -59,6 +59,15 @@ 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
 
 # detect system architecture
 HOST_CPU ?= $(shell uname -m)
@@ -101,36 +110,60 @@ endif
 
 # base CFLAGS, LDLIBS, and LDFLAGS
 OPTFLAGS ?= -O3
-CFLAGS += $(OPTFLAGS) -ffast-math -fno-strict-aliasing -fvisibility=hidden -I../../src \
+WARNFLAGS ?= -Wall
+CFLAGS += $(OPTFLAGS) $(WARNFLAGS) -ffast-math -fno-strict-aliasing -fvisibility=hidden -I../../src \
 		 -I../../src/hash -I../../src/ucodes -I../../src/GBI -I../../src/RDP -I../../src/utils \
 		 -I../../src/log -I../../src/RSP -I../../src/framebuffer -I../../src/math -I../../src/renderer \
 		 -I../../src/Assembler -I../../src/texture -I../../src/config -I../../src/Combiner 
 CXXFLAGS += -fvisibility-inlines-hidden
 LDFLAGS += $(SHARED)
 
+# default configuration programs
+PKG_CONFIG = $(CROSS_COMPILE)pkg-config
+
 # On OS X, add a few extra flags to elegantly support cross-compilation and backward
 # compatibility (and also the flags to link against OpenGL)
 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 += -arch x86_64 -mmacosx-version-min=10.5 -isysroot /Developer/SDKs/MacOSX10.5.sdk
-      LDFLAGS += -bundle -framework OpenGL -arch x86_64 -mmacosx-version-min=10.4 -isysroot /Developer/SDKs/MacOSX10.5.sdk
+      CFLAGS += -arch x86_64 -mmacosx-version-min=$(OSX_SDK) -isysroot $(OSX_SYSROOT)/MacOSX$(OSX_SDK).sdk
+      LDFLAGS += -bundle -framework OpenGL -arch x86_64 -mmacosx-version-min=$(OSX_SDK) -isysroot $(OSX_SYSROOT)/MacOSX$(OSX_SDK).sdk
     else
-      CFLAGS += -arch i686 -mmacosx-version-min=10.5 -isysroot /Developer/SDKs/MacOSX10.5.sdk
-      LDFLAGS += -bundle -framework OpenGL -arch i686 -mmacosx-version-min=10.4 -isysroot /Developer/SDKs/MacOSX10.5.sdk
+      CFLAGS += -arch i686 -mmacosx-version-min=$(OSX_SDK) -isysroot $(OSX_SYSROOT)/MacOSX$(OSX_SDK).sdk
+      LDFLAGS += -bundle -framework OpenGL -arch i686 -mmacosx-version-min=$(OSX_SDK) -isysroot $(OSX_SYSROOT)/MacOSX$(OSX_SDK).sdk
     endif
   endif
 else
-  # test for essential build dependencies
-  ifeq ($(shell which pkg-config 2>/dev/null),)
-    $(error pkg-config not found)
+  # search for OpenGL libraries
+  GL_LIBS=
+  ifeq ($(OS), MINGW)
+    GL_LIBS = -lopengl32
   endif
-  ifeq ($(shell pkg-config --modversion gl 2>/dev/null),)
-    $(error No OpenGL development libraries found!)
+  ifeq ("$(GL_LIBS)", "")
+    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!)
+    endif
+    CFLAGS += $(shell $(PKG_CONFIG) --cflags gl)
+    GL_LIBS = $(shell $(PKG_CONFIG) --libs gl)
   endif
 
-  CFLAGS += -pthread $(shell pkg-config --cflags gl)
-  LDLIBS += -pthread $(shell pkg-config --libs gl)
+  CFLAGS += -pthread
+  LDLIBS += -pthread $(GL_LIBS)
 endif
 ifeq ($(OS), LINUX)
   LDLIBS += -ldl 
@@ -203,8 +236,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
@@ -236,7 +269,7 @@ endif
 
 
 SRCDIR = ../../src
-OBJDIR = _obj
+OBJDIR = _obj$(POSTFIX)
 
 # list of source files to compile
 SOURCE = \
@@ -290,8 +323,13 @@ SOURCE = \
 	$(SRCDIR)/Combiner/CombinerCache.cpp \
 	$(SRCDIR)/RomDetector.cpp \
 	$(SRCDIR)/RDP/RDP.cpp \
-	$(SRCDIR)/RDP/RDPInstructions.cpp \
-	$(SRCDIR)/osal_dynamiclib_unix.cpp
+	$(SRCDIR)/RDP/RDPInstructions.cpp
+
+ifeq ($(OS),MINGW)
+SOURCE += $(SRCDIR)/osal_dynamiclib_win32.cpp
+else
+SOURCE += $(SRCDIR)/osal_dynamiclib_unix.cpp
+endif
 
 
 # generate a list of object files build, make a temporary directory for them
@@ -301,7 +339,7 @@ $(shell $(MKDIR) $(OBJDIRS))
 
 # build targets
 
-TARGET = mupen64plus-video-arachnoid.$(SO_EXTENSION)
+TARGET = mupen64plus-video-arachnoid$(POSTFIX).$(SO_EXTENSION)
 targets:
 	@echo "Mupen64plus-video-arachnoid N64 Graphics plugin makefile. "
 	@echo "  Targets:"
@@ -314,7 +352,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 "    LIBDIR=path   == library prefix (default: PREFIX/lib)"
@@ -336,7 +376,7 @@ uninstall:
 
 
 clean:
-	$(RM) -r ./_obj mupen64plus-video-arachnoid.$(SO_EXTENSION)
+	$(RM) -r $(OBJDIR) $(TARGET)
 
 # build dependency files
 CFLAGS += -MD
@@ -344,9 +384,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/Assembler/assembler.h b/src/Assembler/assembler.h
index fd7e586..783eb2c 100755
--- a/src/Assembler/assembler.h
+++ b/src/Assembler/assembler.h
@@ -114,7 +114,7 @@ Done:
     }
 #else
 
-    long beginOffset = (long)src & 3;
+    long long beginOffset = (long long)src & 3;
     char *readPtr = (char*)src - beginOffset;
     char *writePtr = (char*)dest;
     
diff --git a/src/OpenGL.h b/src/OpenGL.h
index d3d5e20..ca6fe87 100755
--- a/src/OpenGL.h
+++ b/src/OpenGL.h
@@ -24,7 +24,13 @@
 #ifndef WIN32
     #define GL_GLEXT_PROTOTYPES
 #endif
+#if defined(__MACOSX__)
+#include <OpenGL/gl.h>
+#elif defined(__MACOS__)
+#include <gl.h>
+#else
 #include <GL/gl.h>
+#endif
 #ifndef WIN32
     #include <GL/glext.h>
 #endif
diff --git a/src/osal_dynamiclib_win32.cpp b/src/osal_dynamiclib_win32.cpp
index 9e12d8a..46fa009 100755
--- a/src/osal_dynamiclib_win32.cpp
+++ b/src/osal_dynamiclib_win32.cpp
@@ -52,7 +52,7 @@ void * osal_dynlib_getproc(m64p_dynlib_handle LibHandle, const char *pccProcedur
     if (pccProcedureName == NULL)
         return NULL;
 
-    return GetProcAddress(LibHandle, pccProcedureName);
+    return (void *)GetProcAddress(LibHandle, pccProcedureName);
 }
 
 m64p_error osal_dynlib_close(m64p_dynlib_handle LibHandle)
diff --git a/src/utils/MemoryLeakDetector.h b/src/utils/MemoryLeakDetector.h
index f07bdf4..86fad4d 100755
--- a/src/utils/MemoryLeakDetector.h
+++ b/src/utils/MemoryLeakDetector.h
@@ -24,7 +24,7 @@
 
 #include "m64p.h"
 #include <cstdio>
-#ifdef WIN32
+#if defined(WIN32) && !defined(__MINGW32__)
 #include <crtdbg.h>
 #endif
 
@@ -39,7 +39,7 @@ public:
     //Constructor
     CMemoryLeakDetector() 
     { 
-#ifdef WIN32
+#if defined(WIN32) && !defined(__MINGW32__)
         ::OutputDebugString(">>> Memory leak detection enabled <<<\n"); 
 #endif
     }
@@ -47,7 +47,7 @@ public:
     //Destructor
     ~CMemoryLeakDetector()
     { 
-#ifdef WIN32
+#if defined(WIN32) && !defined(__MINGW32__)
         if ( !_CrtDumpMemoryLeaks() )
         {
             ::OutputDebugString(">>> No memory leak detected <<<\n"); 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/mupen64plus-video-arachnoid.git



More information about the Pkg-games-commits mailing list