Merge pull request #190 from wtfbbqhax/OSX_64bit_builds

Fix Makefile for OSX
This commit is contained in:
Zachary J. Slater 2016-06-12 11:54:23 -10:00 committed by GitHub
commit 360ec03238
22 changed files with 39 additions and 49 deletions

View file

@ -3,18 +3,12 @@
# #
# GNU Make required # GNU Make required
# #
COMPILE_PLATFORM=$(shell uname | sed -e 's/_.*//' | tr '[:upper:]' '[:lower:]' | sed -e 's/\//_/g')
COMPILE_PLATFORM=$(shell uname|sed -e s/_.*//|tr '[:upper:]' '[:lower:]'|sed -e 's/\//_/g') COMPILE_ARCH=$(shell uname -m | sed -e 's/i.86/x86/' | sed -e 's/^arm.*/arm/')
COMPILE_ARCH=$(shell uname -m | sed -e s/i.86/x86/ | sed -e 's/^arm.*/arm/')
ifeq ($(COMPILE_PLATFORM),sunos) ifeq ($(COMPILE_PLATFORM),sunos)
# Solaris uname and GNU uname differ # Solaris uname and GNU uname differ
COMPILE_ARCH=$(shell uname -p | sed -e s/i.86/x86/) COMPILE_ARCH=$(shell uname -p | sed -e 's/i.86/x86/')
endif
ifeq ($(COMPILE_PLATFORM),darwin)
# Apple does some things a little differently...
COMPILE_ARCH=$(shell uname -p | sed -e s/i.86/x86/)
endif endif
ifndef BUILD_STANDALONE ifndef BUILD_STANDALONE
@ -231,7 +225,7 @@ USE_RENDERER_DLOPEN=1
endif endif
ifndef DEBUG_CFLAGS ifndef DEBUG_CFLAGS
DEBUG_CFLAGS=-g -O0 DEBUG_CFLAGS=-ggdb -O0
endif endif
############################################################################# #############################################################################
@ -408,8 +402,7 @@ ifeq ($(PLATFORM),darwin)
RENDERER_LIBS= RENDERER_LIBS=
OPTIMIZEVM= OPTIMIZEVM=
BASE_CFLAGS = -Wall -Wimplicit -Wstrict-prototypes -mmacosx-version-min=10.5 \ BASE_CFLAGS += -mmacosx-version-min=10.7 -DMAC_OS_X_VERSION_MIN_REQUIRED=1070
-DMAC_OS_X_VERSION_MIN_REQUIRED=1050
ifeq ($(ARCH),ppc) ifeq ($(ARCH),ppc)
BASE_CFLAGS += -arch ppc -faltivec BASE_CFLAGS += -arch ppc -faltivec
@ -447,11 +440,9 @@ ifeq ($(PLATFORM),darwin)
$(error Architecture $(ARCH) is not supported when cross compiling) $(error Architecture $(ARCH) is not supported when cross compiling)
endif endif
endif endif
else
TOOLS_CFLAGS += -DMACOS_X
endif endif
BASE_CFLAGS += -fno-strict-aliasing -DMACOS_X -fno-common -pipe BASE_CFLAGS += -fno-strict-aliasing -fno-common -pipe
ifeq ($(USE_OPENAL),1) ifeq ($(USE_OPENAL),1)
ifneq ($(USE_OPENAL_DLOPEN),1) ifneq ($(USE_OPENAL_DLOPEN),1)
@ -468,6 +459,9 @@ ifeq ($(PLATFORM),darwin)
BASE_CFLAGS += -D_THREAD_SAFE=1 BASE_CFLAGS += -D_THREAD_SAFE=1
# FIXME: It is not possible to build using system SDL2 framework
# 1. IF you try, this Makefile will still drop libSDL-2.0.0.dylib into the builddir
# 2. Debugger warns that you have 2- which one will be used is undefined
ifeq ($(USE_LOCAL_HEADERS),1) ifeq ($(USE_LOCAL_HEADERS),1)
BASE_CFLAGS += -I$(SDLHDIR)/include BASE_CFLAGS += -I$(SDLHDIR)/include
endif endif

View file

@ -37,7 +37,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#ifdef WIN32 #ifdef WIN32
#define DEFAULT_CURL_LIB "libcurl-4.dll" #define DEFAULT_CURL_LIB "libcurl-4.dll"
#define ALTERNATE_CURL_LIB "libcurl-3.dll" #define ALTERNATE_CURL_LIB "libcurl-3.dll"
#elif defined(MACOS_X) #elif defined(__APPLE__)
#define DEFAULT_CURL_LIB "libcurl.dylib" #define DEFAULT_CURL_LIB "libcurl.dylib"
#else #else
#define DEFAULT_CURL_LIB "libcurl.so.4" #define DEFAULT_CURL_LIB "libcurl.so.4"

View file

@ -3554,7 +3554,7 @@ void CL_Init( void ) {
#endif #endif
cl_conXOffset = Cvar_Get ("cl_conXOffset", "0", 0); cl_conXOffset = Cvar_Get ("cl_conXOffset", "0", 0);
#ifdef MACOS_X #ifdef __APPLE__
// In game video is REALLY slow in Mac OS X right now due to driver slowness // In game video is REALLY slow in Mac OS X right now due to driver slowness
cl_inGameVideo = Cvar_Get ("r_inGameVideo", "0", CVAR_ARCHIVE); cl_inGameVideo = Cvar_Get ("r_inGameVideo", "0", CVAR_ARCHIVE);
#else #else
@ -3571,7 +3571,7 @@ void CL_Init( void ) {
m_yaw = Cvar_Get ("m_yaw", "0.022", CVAR_ARCHIVE); m_yaw = Cvar_Get ("m_yaw", "0.022", CVAR_ARCHIVE);
m_forward = Cvar_Get ("m_forward", "0.25", CVAR_ARCHIVE); m_forward = Cvar_Get ("m_forward", "0.25", CVAR_ARCHIVE);
m_side = Cvar_Get ("m_side", "0.25", CVAR_ARCHIVE); m_side = Cvar_Get ("m_side", "0.25", CVAR_ARCHIVE);
#ifdef MACOS_X #ifdef __APPLE__
// Input is jittery on OS X w/o this // Input is jittery on OS X w/o this
m_filter = Cvar_Get ("m_filter", "1", CVAR_ARCHIVE); m_filter = Cvar_Get ("m_filter", "1", CVAR_ARCHIVE);
#else #else

View file

@ -37,8 +37,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "../AL/al.h" #include "../AL/al.h"
#include "../AL/alc.h" #include "../AL/alc.h"
#else #else
#ifdef _MSC_VER #if defined(_MSC_VER) || defined(__APPLE__)
// MSVC users must install the OpenAL SDK which doesn't use the AL/*.h scheme. // MSVC users must install the OpenAL SDK which doesn't use the AL/*.h scheme.
// OSX framework also needs this
#include <al.h> #include <al.h>
#include <alc.h> #include <alc.h>
#else #else

View file

@ -23,7 +23,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "client.h" #include "client.h"
#include "snd_local.h" #include "snd_local.h"
#if idppc_altivec && !defined(MACOS_X) #if idppc_altivec && !defined(__APPLE__)
#include <altivec.h> #include <altivec.h>
#endif #endif

View file

@ -582,7 +582,7 @@ typedef struct src_s
qboolean local; // Is this local (relative to the cam) qboolean local; // Is this local (relative to the cam)
} src_t; } src_t;
#ifdef MACOS_X #ifdef __APPLE__
#define MAX_SRC 64 #define MAX_SRC 64
#else #else
#define MAX_SRC 128 #define MAX_SRC 128
@ -2208,7 +2208,7 @@ static cvar_t *s_alCapture;
#ifdef _WIN32 #ifdef _WIN32
#define ALDRIVER_DEFAULT "OpenAL32.dll" #define ALDRIVER_DEFAULT "OpenAL32.dll"
#elif defined(MACOS_X) #elif defined(__APPLE__)
#define ALDRIVER_DEFAULT "/System/Library/Frameworks/OpenAL.framework/OpenAL" #define ALDRIVER_DEFAULT "/System/Library/Frameworks/OpenAL.framework/OpenAL"
#elif defined(__OpenBSD__) #elif defined(__OpenBSD__)
#define ALDRIVER_DEFAULT "libopenal.so" #define ALDRIVER_DEFAULT "libopenal.so"
@ -2642,7 +2642,7 @@ qboolean S_AL_Init( soundInterface_t *si )
#endif #endif
else else
{ {
#ifdef MACOS_X #ifdef __APPLE__
// !!! FIXME: Apple has a 1.1-compliant OpenAL, which includes // !!! FIXME: Apple has a 1.1-compliant OpenAL, which includes
// !!! FIXME: capture support, but they don't list it in the // !!! FIXME: capture support, but they don't list it in the
// !!! FIXME: extension string. We need to check the version string, // !!! FIXME: extension string. We need to check the version string,

View file

@ -246,7 +246,7 @@ static char fs_gamedir[MAX_OSPATH]; // this will be a single file name with no
static cvar_t *fs_debug; static cvar_t *fs_debug;
static cvar_t *fs_homepath; static cvar_t *fs_homepath;
#ifdef MACOS_X #ifdef __APPLE__
// Also search the .app bundle for .pk3 files // Also search the .app bundle for .pk3 files
static cvar_t *fs_apppath; static cvar_t *fs_apppath;
#endif #endif
@ -3319,7 +3319,7 @@ static void FS_Startup( const char *gameName )
} }
// fs_homepath is somewhat particular to *nix systems, only add if relevant // fs_homepath is somewhat particular to *nix systems, only add if relevant
#ifdef MACOS_X #ifdef __APPLE__
fs_apppath = Cvar_Get ("fs_apppath", Sys_DefaultAppPath(), CVAR_INIT|CVAR_PROTECTED ); fs_apppath = Cvar_Get ("fs_apppath", Sys_DefaultAppPath(), CVAR_INIT|CVAR_PROTECTED );
// Make MacOSX also include the base path included with the .app bundle // Make MacOSX also include the base path included with the .app bundle
if (fs_apppath->string[0]) if (fs_apppath->string[0])

View file

@ -1268,7 +1268,7 @@ static void NET_AddLocalAddress(char *ifname, struct sockaddr *addr, struct sock
} }
} }
#if defined(__linux__) || defined(MACOSX) || defined(__BSD__) #if defined(__linux__) || defined(__APPLE__) || defined(__BSD__)
static void NET_GetLocalAddress(void) static void NET_GetLocalAddress(void)
{ {
struct ifaddrs *ifap, *search; struct ifaddrs *ifap, *search;

View file

@ -46,7 +46,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#define idppc 1 #define idppc 1
#if defined(__VEC__) #if defined(__VEC__)
#define idppc_altivec 1 #define idppc_altivec 1
#ifdef MACOS_X // Apple's GCC does this differently than the FSF. #ifdef __APPLE__ // Apple's GCC does this differently than the FSF.
#define VECCONST_UINT8(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) \ #define VECCONST_UINT8(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) \
(vector unsigned char) (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) (vector unsigned char) (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p)
#else #else
@ -139,12 +139,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//============================================================== MAC OS X === //============================================================== MAC OS X ===
#if defined(MACOS_X) || defined(__APPLE_CC__) #if defined(__APPLE__) || defined(__APPLE_CC__)
// make sure this is defined, just for sanity's sake...
#ifndef MACOS_X
#define MACOS_X
#endif
#define OS_STRING "macosx" #define OS_STRING "macosx"
#define ID_INLINE inline #define ID_INLINE inline

View file

@ -1108,7 +1108,7 @@ void Sys_SetDefaultInstallPath(const char *path);
char *Sys_DefaultInstallPath(void); char *Sys_DefaultInstallPath(void);
char *Sys_SteamPath(void); char *Sys_SteamPath(void);
#ifdef MACOS_X #ifdef __APPLE__
char *Sys_DefaultAppPath(void); char *Sys_DefaultAppPath(void);
#endif #endif

View file

@ -22,7 +22,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
// tr_shade.c // tr_shade.c
#include "tr_local.h" #include "tr_local.h"
#if idppc_altivec && !defined(MACOS_X) #if idppc_altivec && !defined(__APPLE__)
#include <altivec.h> #include <altivec.h>
#endif #endif

View file

@ -22,7 +22,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
// tr_shade_calc.c // tr_shade_calc.c
#include "tr_local.h" #include "tr_local.h"
#if idppc_altivec && !defined(MACOS_X) #if idppc_altivec && !defined(__APPLE__)
#include <altivec.h> #include <altivec.h>
#endif #endif

View file

@ -21,7 +21,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
// tr_surf.c // tr_surf.c
#include "tr_local.h" #include "tr_local.h"
#if idppc_altivec && !defined(MACOS_X) #if idppc_altivec && !defined(__APPLE__)
#include <altivec.h> #include <altivec.h>
#endif #endif

View file

@ -22,7 +22,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
// tr_shade.c // tr_shade.c
#include "tr_local.h" #include "tr_local.h"
#if idppc_altivec && !defined(MACOS_X) #if idppc_altivec && !defined(__APPLE__)
#include <altivec.h> #include <altivec.h>
#endif #endif

View file

@ -22,7 +22,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
// tr_shade_calc.c // tr_shade_calc.c
#include "tr_local.h" #include "tr_local.h"
#if idppc_altivec && !defined(MACOS_X) #if idppc_altivec && !defined(__APPLE__)
#include <altivec.h> #include <altivec.h>
#endif #endif

View file

@ -21,7 +21,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
// tr_surf.c // tr_surf.c
#include "tr_local.h" #include "tr_local.h"
#if idppc_altivec && !defined(MACOS_X) #if idppc_altivec && !defined(__APPLE__)
#include <altivec.h> #include <altivec.h>
#endif #endif

View file

@ -247,7 +247,7 @@ static keyNum_t IN_TranslateSDLToQ3Key( SDL_Keysym *keysym, qboolean down )
case SDLK_LCTRL: case SDLK_LCTRL:
case SDLK_RCTRL: key = K_CTRL; break; case SDLK_RCTRL: key = K_CTRL; break;
#ifdef MACOS_X #ifdef __APPLE__
case SDLK_RGUI: case SDLK_RGUI:
case SDLK_LGUI: key = K_COMMAND; break; case SDLK_LGUI: key = K_COMMAND; break;
#else #else

View file

@ -44,7 +44,7 @@ unsigned int CON_LogSize( void );
unsigned int CON_LogWrite( const char *in ); unsigned int CON_LogWrite( const char *in );
unsigned int CON_LogRead( char *out, unsigned int outSize ); unsigned int CON_LogRead( char *out, unsigned int outSize );
#ifdef MACOS_X #ifdef __APPLE__
char *Sys_StripAppBundle( char *pwd ); char *Sys_StripAppBundle( char *pwd );
#endif #endif

View file

@ -565,7 +565,7 @@ void Sys_ParseArgs( int argc, char **argv )
} }
#ifndef DEFAULT_BASEDIR #ifndef DEFAULT_BASEDIR
# ifdef MACOS_X # ifdef __APPLE__
# define DEFAULT_BASEDIR Sys_StripAppBundle(Sys_BinaryPath()) # define DEFAULT_BASEDIR Sys_StripAppBundle(Sys_BinaryPath())
# else # else
# define DEFAULT_BASEDIR Sys_BinaryPath() # define DEFAULT_BASEDIR Sys_BinaryPath()
@ -646,7 +646,7 @@ int main( int argc, char **argv )
// Set the initial time base // Set the initial time base
Sys_Milliseconds( ); Sys_Milliseconds( );
#ifdef MACOS_X #ifdef __APPLE__
// This is passed if we are launched by double-clicking // This is passed if we are launched by double-clicking
if ( argc >= 2 && Q_strncmp ( argv[1], "-psn", 4 ) == 0 ) if ( argc >= 2 && Q_strncmp ( argv[1], "-psn", 4 ) == 0 )
argc = 1; argc = 1;

View file

@ -20,7 +20,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
=========================================================================== ===========================================================================
*/ */
#ifndef MACOS_X #ifndef __APPLE__
#error This file is for Mac OS X only. You probably should not compile it. #error This file is for Mac OS X only. You probably should not compile it.
#endif #endif

View file

@ -61,7 +61,7 @@ char *Sys_DefaultHomePath(void)
if( ( p = getenv( "HOME" ) ) != NULL ) if( ( p = getenv( "HOME" ) ) != NULL )
{ {
Com_sprintf(homePath, sizeof(homePath), "%s%c", p, PATH_SEP); Com_sprintf(homePath, sizeof(homePath), "%s%c", p, PATH_SEP);
#ifdef MACOS_X #ifdef __APPLE__
Q_strcat(homePath, sizeof(homePath), Q_strcat(homePath, sizeof(homePath),
"Library/Application Support/"); "Library/Application Support/");
@ -94,7 +94,7 @@ char *Sys_SteamPath( void )
if( ( p = getenv( "HOME" ) ) != NULL ) if( ( p = getenv( "HOME" ) ) != NULL )
{ {
#ifdef MACOS_X #ifdef __APPLE__
char *steamPathEnd = "/Library/Application Support/Steam/SteamApps/common/" STEAMPATH_NAME; char *steamPathEnd = "/Library/Application Support/Steam/SteamApps/common/" STEAMPATH_NAME;
#else #else
char *steamPathEnd = "/.steam/steam/SteamApps/common/" STEAMPATH_NAME; char *steamPathEnd = "/.steam/steam/SteamApps/common/" STEAMPATH_NAME;
@ -577,7 +577,7 @@ void Sys_ErrorDialog( const char *error )
close( f ); close( f );
} }
#ifndef MACOS_X #ifndef __APPLE__
static char execBuffer[ 1024 ]; static char execBuffer[ 1024 ];
static char *execBufferPointer; static char *execBufferPointer;
static char *execArgv[ 16 ]; static char *execArgv[ 16 ];

View file

@ -106,7 +106,7 @@ char *basepath( char *fname )
all and others do a terrible job (like calling malloc) */ all and others do a terrible job (like calling malloc) */
// -- ouch, that hurts -- ln // -- ouch, that hurts -- ln
/* always use the system memmove() on Mac OS X. --ryan. */ /* always use the system memmove() on Mac OS X. --ryan. */
#if !defined(MACOS_X) && !defined(_MSC_VER) #if !defined(__APPLE__) && !defined(_MSC_VER)
#ifdef memmove #ifdef memmove
#undef memmove #undef memmove
#endif #endif