mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-21 11:37:14 +01:00
Allow full-length Unix pathnames.
Move bits of HAVE_OPENCL/HAVE_WX for OS X from SConstruct to header files. Use /usr/lib/libz on OS X now that we no longer have -L/opt/local/lib in the library path. It is still possible that we could pick up a libz in /usr/local/lib that would make the application non-redistributable, but the danger is much less than previously. Also bits of minor portability cleanup. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5868 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
379706b25a
commit
addb89fecc
8
Externals/Lua/SConscript
vendored
8
Externals/Lua/SConscript
vendored
@ -1,7 +1,13 @@
|
|||||||
# -*- python -*-
|
# -*- python -*-
|
||||||
|
|
||||||
|
import sys
|
||||||
Import('env')
|
Import('env')
|
||||||
|
|
||||||
|
luaenv = env.Clone()
|
||||||
|
|
||||||
|
if not sys.platform == 'win32':
|
||||||
|
luaenv['CPPDEFINES'].append('LUA_USE_LINUX') # Also works for OS X
|
||||||
|
|
||||||
files = [
|
files = [
|
||||||
'lapi.c',
|
'lapi.c',
|
||||||
'lauxlib.c',
|
'lauxlib.c',
|
||||||
@ -35,4 +41,4 @@ files = [
|
|||||||
'print.c',
|
'print.c',
|
||||||
]
|
]
|
||||||
|
|
||||||
env.StaticLibrary(env['local_libs'] + "lua", files)
|
luaenv.StaticLibrary(env['local_libs'] + "lua", files)
|
||||||
|
16
SConstruct
16
SConstruct
@ -204,7 +204,6 @@ env['CCFLAGS'] = compileFlags
|
|||||||
env['CPPDEFINES'] = cppDefines
|
env['CPPDEFINES'] = cppDefines
|
||||||
if not sys.platform == 'win32':
|
if not sys.platform == 'win32':
|
||||||
env['CXXFLAGS'] = ['-fvisibility-inlines-hidden']
|
env['CXXFLAGS'] = ['-fvisibility-inlines-hidden']
|
||||||
cppDefines.append('LUA_USE_LINUX')
|
|
||||||
|
|
||||||
# Configuration tests section
|
# Configuration tests section
|
||||||
tests = {'CheckWXConfig' : wxconfig.CheckWXConfig,
|
tests = {'CheckWXConfig' : wxconfig.CheckWXConfig,
|
||||||
@ -258,21 +257,16 @@ env['HAVE_WX'] = 0
|
|||||||
if sys.platform == 'darwin':
|
if sys.platform == 'darwin':
|
||||||
compileFlags.append('-mmacosx-version-min=10.5')
|
compileFlags.append('-mmacosx-version-min=10.5')
|
||||||
if not env['nowx']:
|
if not env['nowx']:
|
||||||
cppDefines.append('HAVE_WX=1')
|
|
||||||
conf = env.Configure(custom_tests = tests)
|
conf = env.Configure(custom_tests = tests)
|
||||||
# wxWidgets 2.9 has Cocoa support
|
|
||||||
env['HAVE_WX'] = conf.CheckWXConfig(2.9, wxmods, 0)
|
env['HAVE_WX'] = conf.CheckWXConfig(2.9, wxmods, 0)
|
||||||
wxconfig.ParseWXConfig(env)
|
wxconfig.ParseWXConfig(env)
|
||||||
# Make sure that the libraries claimed by wx-config are valid
|
|
||||||
if not conf.CheckLib('wx_baseu-2.9'):
|
|
||||||
print "WX libraries not found - see config.log"
|
|
||||||
Exit(1)
|
|
||||||
conf.Finish()
|
conf.Finish()
|
||||||
# wx-config wants us to link with the OS X QuickTime framework
|
# wx-config wants us to link with the OS X QuickTime framework
|
||||||
# which is not available for x86_64 and we don't use it anyway.
|
# which is not available for x86_64 and we don't use it anyway.
|
||||||
# Strip it out to silence some harmless linker warnings.
|
# Strip it out to silence some harmless linker warnings.
|
||||||
if env['FRAMEWORKS'].count('QuickTime'):
|
if env['CPPDEFINES'].count('WXUSINGDLL'):
|
||||||
env['FRAMEWORKS'].remove('QuickTime')
|
if env['FRAMEWORKS'].count('QuickTime'):
|
||||||
|
env['FRAMEWORKS'].remove('QuickTime')
|
||||||
env['CC'] = "gcc-4.2"
|
env['CC'] = "gcc-4.2"
|
||||||
env['CFLAGS'] = ['-x', 'objective-c']
|
env['CFLAGS'] = ['-x', 'objective-c']
|
||||||
env['CXX'] = "g++-4.2"
|
env['CXX'] = "g++-4.2"
|
||||||
@ -287,6 +281,7 @@ if sys.platform == 'darwin':
|
|||||||
env['HAVE_OPENCL'] = 1
|
env['HAVE_OPENCL'] = 1
|
||||||
env['LINKFLAGS'] += ['-weak_framework', 'OpenCL']
|
env['LINKFLAGS'] += ['-weak_framework', 'OpenCL']
|
||||||
env['FRAMEWORKS'] += ['Cg']
|
env['FRAMEWORKS'] += ['Cg']
|
||||||
|
shared['zlib'] = 1
|
||||||
|
|
||||||
if not sys.platform == 'win32' and not sys.platform == 'darwin':
|
if not sys.platform == 'win32' and not sys.platform == 'darwin':
|
||||||
conf = env.Configure(custom_tests = tests,
|
conf = env.Configure(custom_tests = tests,
|
||||||
@ -371,6 +366,7 @@ if not sys.platform == 'win32' and not sys.platform == 'darwin':
|
|||||||
|
|
||||||
if env['opencl']:
|
if env['opencl']:
|
||||||
env['HAVE_OPENCL'] = conf.CheckPKG('OpenCL')
|
env['HAVE_OPENCL'] = conf.CheckPKG('OpenCL')
|
||||||
|
conf.Define('HAVE_OPENCL', env['HAVE_OPENCL'])
|
||||||
|
|
||||||
conf.Define('USER_DIR', "\"" + env['userdir'] + "\"")
|
conf.Define('USER_DIR', "\"" + env['userdir'] + "\"")
|
||||||
if (env['install'] == 'global'):
|
if (env['install'] == 'global'):
|
||||||
@ -395,8 +391,6 @@ if not sys.platform == 'win32' and not sys.platform == 'darwin':
|
|||||||
else:
|
else:
|
||||||
print "Can't build prof without oprofile, disabling"
|
print "Can't build prof without oprofile, disabling"
|
||||||
|
|
||||||
conf.Define('HAVE_OPENCL', env['HAVE_OPENCL'])
|
|
||||||
|
|
||||||
# After all configuration tests are done
|
# After all configuration tests are done
|
||||||
conf.Finish()
|
conf.Finish()
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ else:
|
|||||||
files += [ 'AlsaSoundStream.cpp' ]
|
files += [ 'AlsaSoundStream.cpp' ]
|
||||||
if env['HAVE_AO']:
|
if env['HAVE_AO']:
|
||||||
files += [ 'AOSoundStream.cpp' ]
|
files += [ 'AOSoundStream.cpp' ]
|
||||||
if env['HAVE_OPENAL']:
|
if env['HAVE_OPENAL'] or sys.platform == 'win32':
|
||||||
files += [ 'OpenALStream.cpp', 'aldlist.cpp' ]
|
files += [ 'OpenALStream.cpp', 'aldlist.cpp' ]
|
||||||
if env['HAVE_PULSEAUDIO']:
|
if env['HAVE_PULSEAUDIO']:
|
||||||
files += [ 'PulseAudioStream.cpp' ]
|
files += [ 'PulseAudioStream.cpp' ]
|
||||||
|
@ -5,8 +5,6 @@
|
|||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#define PATH_MAX MAX_PATH
|
|
||||||
|
|
||||||
#elif __APPLE__
|
#elif __APPLE__
|
||||||
#include <paths.h>
|
#include <paths.h>
|
||||||
#include <Carbon/Carbon.h>
|
#include <Carbon/Carbon.h>
|
||||||
@ -14,10 +12,8 @@
|
|||||||
#include <IOKit/storage/IOCDMedia.h>
|
#include <IOKit/storage/IOCDMedia.h>
|
||||||
#include <IOKit/storage/IOMedia.h>
|
#include <IOKit/storage/IOMedia.h>
|
||||||
#include <IOKit/IOBSD.h>
|
#include <IOKit/IOBSD.h>
|
||||||
|
|
||||||
#elif __linux__
|
#elif __linux__
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <limits.h>
|
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#include <linux/cdrom.h>
|
#include <linux/cdrom.h>
|
||||||
@ -231,9 +227,9 @@ bool cdio_is_cdrom(std::string device)
|
|||||||
for (unsigned int i = 0; i < devices.size(); i++)
|
for (unsigned int i = 0; i < devices.size(); i++)
|
||||||
{
|
{
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
if (strncmp(devices[i].c_str(), devname, PATH_MAX) == 0)
|
if (strncmp(devices[i].c_str(), devname, MAX_PATH) == 0)
|
||||||
#else
|
#else
|
||||||
if (strncmp(devices[i].c_str(), device.c_str(), PATH_MAX) == 0)
|
if (strncmp(devices[i].c_str(), device.c_str(), MAX_PATH) == 0)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
res = true;
|
res = true;
|
||||||
|
@ -36,42 +36,45 @@ extern const char *netplay_dolphin_ver;
|
|||||||
#define LOGGING 1
|
#define LOGGING 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define STACKALIGN
|
||||||
|
|
||||||
|
// A macro to disallow the copy constructor and operator= functions
|
||||||
|
// This should be used in the private: declarations for a class
|
||||||
|
#define DISALLOW_COPY_AND_ASSIGN(TypeName) \
|
||||||
|
TypeName(const TypeName&); \
|
||||||
|
void operator=(const TypeName&)
|
||||||
|
|
||||||
#include "Log.h"
|
#include "Log.h"
|
||||||
#include "CommonTypes.h"
|
#include "CommonTypes.h"
|
||||||
#include "MsgHandler.h"
|
#include "MsgHandler.h"
|
||||||
#include "CommonPaths.h"
|
#include "CommonPaths.h"
|
||||||
#include "CommonFuncs.h"
|
#include "CommonFuncs.h"
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef __APPLE__
|
||||||
#define __strdup _strdup
|
// The Darwin ABI requires that stack frames be aligned to 16-byte boundaries.
|
||||||
#define __getcwd _getcwd
|
// This is only needed on i386 gcc - x86_64 already aligns to 16 bytes.
|
||||||
#define __chdir _chdir
|
#if defined __i386__ && defined __GNUC__
|
||||||
#else
|
#undef STACKALIGN
|
||||||
#define __strdup strdup
|
#define STACKALIGN __attribute__((__force_align_arg_pointer__))
|
||||||
#define __getcwd getcwd
|
#endif
|
||||||
#define __chdir chdir
|
// We use wxWidgets on OS X only if it is version 2.9+ with Cocoa support.
|
||||||
|
#ifdef __WXOSX_COCOA__
|
||||||
|
#define HAVE_WX 1
|
||||||
|
#define USE_WX 1 // Use wxGLCanvas
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Darwin ABI requires that stack frames be aligned to 16-byte boundaries.
|
#elif defined _WIN32
|
||||||
// This is only needed on i386 gcc - x86_64 already aligns to 16bytes
|
|
||||||
#if defined(__APPLE__) && defined(__i386__) && defined(__GNUC__)
|
|
||||||
#define STACKALIGN __attribute__((__force_align_arg_pointer__))
|
|
||||||
#else
|
|
||||||
#define STACKALIGN
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
// Check MSC ver
|
// Check MSC ver
|
||||||
#if !defined _MSC_VER || _MSC_VER <= 1000
|
#if !defined _MSC_VER || _MSC_VER <= 1000
|
||||||
#error needs at least version 1000 of MSC
|
#error needs at least version 1000 of MSC
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define NOMINMAX
|
||||||
|
|
||||||
// Memory leak checks
|
// Memory leak checks
|
||||||
#define CHECK_HEAP_INTEGRITY()
|
#define CHECK_HEAP_INTEGRITY()
|
||||||
|
|
||||||
#define POSIX 0
|
|
||||||
#define NOMINMAX
|
|
||||||
|
|
||||||
// Alignment
|
// Alignment
|
||||||
#define GC_ALIGNED16(x) __declspec(align(16)) x
|
#define GC_ALIGNED16(x) __declspec(align(16)) x
|
||||||
#define GC_ALIGNED32(x) __declspec(align(32)) x
|
#define GC_ALIGNED32(x) __declspec(align(32)) x
|
||||||
@ -83,8 +86,6 @@ extern const char *netplay_dolphin_ver;
|
|||||||
#define HAVE_WIIUSE 1
|
#define HAVE_WIIUSE 1
|
||||||
#define HAVE_WX 1
|
#define HAVE_WX 1
|
||||||
#define HAVE_OPENAL 1
|
#define HAVE_OPENAL 1
|
||||||
#define HAVE_ALSA 0
|
|
||||||
#define HAVE_PORTAUDIO 0
|
|
||||||
|
|
||||||
// it is VERY DANGEROUS to mix _SECURE_SCL=0 and _SECURE_SCL=1 compiled libraries.
|
// it is VERY DANGEROUS to mix _SECURE_SCL=0 and _SECURE_SCL=1 compiled libraries.
|
||||||
// You will get bizarre crash bugs whenever you use STL.
|
// You will get bizarre crash bugs whenever you use STL.
|
||||||
@ -109,42 +110,39 @@ extern const char *netplay_dolphin_ver;
|
|||||||
//CrtDebugBreak breakAt(614);
|
//CrtDebugBreak breakAt(614);
|
||||||
#endif // end DEBUG/FAST
|
#endif // end DEBUG/FAST
|
||||||
|
|
||||||
#else // Not windows
|
#else
|
||||||
|
|
||||||
#ifdef __APPLE__
|
|
||||||
#if defined HAVE_WX && HAVE_WX
|
|
||||||
#define MAP_32BIT 0 // MAP_32BIT is a Linux-specific mmap(2) flag
|
|
||||||
#define USE_WX 1 // Use wxGLCanvas
|
|
||||||
#endif // HAVE_WX
|
|
||||||
#else // __APPLE__
|
|
||||||
#include "Config.h" // SCons autoconfiguration defines
|
#include "Config.h" // SCons autoconfiguration defines
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// General defines
|
#ifndef __linux__
|
||||||
#define POSIX 1
|
#define MAP_32BIT 0 // MAP_32BIT is a Linux-specific mmap(2) flag
|
||||||
#define MAX_PATH 260
|
#endif
|
||||||
|
|
||||||
// Windows compatibility
|
// Windows compatibility
|
||||||
#define __forceinline inline __attribute__((always_inline))
|
#ifndef _WIN32
|
||||||
|
#include <limits.h>
|
||||||
|
#define MAX_PATH PATH_MAX
|
||||||
|
#ifdef _LP64
|
||||||
|
#define _M_X64 1
|
||||||
|
#else
|
||||||
|
#define _M_IX86 1
|
||||||
|
#endif
|
||||||
|
#define __forceinline inline __attribute__((always_inline))
|
||||||
|
#define GC_ALIGNED16(x) __attribute__((aligned(16))) x
|
||||||
|
#define GC_ALIGNED32(x) __attribute__((aligned(32))) x
|
||||||
|
#define GC_ALIGNED64(x) __attribute__((aligned(64))) x
|
||||||
|
#define GC_ALIGNED16_DECL(x) __attribute__((aligned(16))) x
|
||||||
|
#define GC_ALIGNED64_DECL(x) __attribute__((aligned(64))) x
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef _LP64
|
#ifdef _MSC_VER
|
||||||
#define _M_X64 1
|
#define __strdup _strdup
|
||||||
#else
|
#define __getcwd _getcwd
|
||||||
#define _M_IX86 1
|
#define __chdir _chdir
|
||||||
#endif
|
#else
|
||||||
// Alignment
|
#define __strdup strdup
|
||||||
#define GC_ALIGNED16(x) __attribute__((aligned(16))) x
|
#define __getcwd getcwd
|
||||||
#define GC_ALIGNED32(x) __attribute__((aligned(32))) x
|
#define __chdir chdir
|
||||||
#define GC_ALIGNED64(x) __attribute__((aligned(64))) x
|
#endif
|
||||||
#define GC_ALIGNED16_DECL(x) __attribute__((aligned(16))) x
|
|
||||||
#define GC_ALIGNED64_DECL(x) __attribute__((aligned(64))) x
|
|
||||||
|
|
||||||
#endif // WIN32
|
|
||||||
|
|
||||||
// A macro to disallow the copy constructor and operator= functions
|
|
||||||
// This should be used in the private: declarations for a class
|
|
||||||
#define DISALLOW_COPY_AND_ASSIGN(TypeName) \
|
|
||||||
TypeName(const TypeName&); \
|
|
||||||
void operator=(const TypeName&)
|
|
||||||
|
|
||||||
#endif // _COMMON_H_
|
#endif // _COMMON_H_
|
||||||
|
@ -19,19 +19,27 @@
|
|||||||
#define __OPENCL_H__
|
#define __OPENCL_H__
|
||||||
|
|
||||||
#include "Common.h"
|
#include "Common.h"
|
||||||
|
|
||||||
// OpenCL on Windows is linked through the CLRun library
|
// OpenCL on Windows is linked through the CLRun library
|
||||||
// It provides the headers and all the imports
|
// It provides the headers and all the imports
|
||||||
// It could be safe to use it for Linux too, but will require to edit the SCons first
|
|
||||||
// OpenCL is linked on OSX when possible, it shouldn't require CLRun for now
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#define HAVE_OPENCL 1
|
#define HAVE_OPENCL 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// The latest (last?) release of Xcode for Leopard does not include the 10.6
|
||||||
|
// SDK, so we can only build with OpenCL on a Snow Leopard system where we link
|
||||||
|
// the OpenCL framework weakly so that the application will also run on 10.5.
|
||||||
|
#ifdef __APPLE__
|
||||||
|
#import <Foundation/NSObjCRuntime.h>
|
||||||
|
#ifdef NSFoundationVersionNumber10_5 // First defined in the 10.6 SDK
|
||||||
|
#include <OpenCL/opencl.h>
|
||||||
|
#define HAVE_OPENCL 1
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(HAVE_OPENCL) && HAVE_OPENCL
|
#if defined(HAVE_OPENCL) && HAVE_OPENCL
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifndef __APPLE__
|
||||||
#include <OpenCL/opencl.h>
|
|
||||||
#else
|
|
||||||
#include <CL/cl.h>
|
#include <CL/cl.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#endif
|
#endif
|
||||||
|
#include "Common.h"
|
||||||
#include "CommonTypes.h"
|
#include "CommonTypes.h"
|
||||||
|
|
||||||
// Plugin communication. I place this here rather in Common.h to rebuild less if any of this is changed
|
// Plugin communication. I place this here rather in Common.h to rebuild less if any of this is changed
|
||||||
@ -90,11 +91,6 @@ typedef struct
|
|||||||
char Name[100]; // Name of the DLL
|
char Name[100]; // Name of the DLL
|
||||||
} PLUGIN_INFO;
|
} PLUGIN_INFO;
|
||||||
|
|
||||||
#ifndef MAX_PATH
|
|
||||||
// apparently a windows-ism.
|
|
||||||
#define MAX_PATH 260
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// TODO: Remove, or at least remove the void pointers and replace with data.
|
// TODO: Remove, or at least remove the void pointers and replace with data.
|
||||||
// This design is just wrong and ugly - the plugins shouldn't have this much access.
|
// This design is just wrong and ugly - the plugins shouldn't have this much access.
|
||||||
typedef struct
|
typedef struct
|
||||||
|
@ -49,12 +49,6 @@ rm -rf $temp_dir
|
|||||||
mkdir -p $temp_dir/Dolphin.app
|
mkdir -p $temp_dir/Dolphin.app
|
||||||
cp -r Darwin-i386/Dolphin.app $temp_dir
|
cp -r Darwin-i386/Dolphin.app $temp_dir
|
||||||
fix_shared_object_depends libwx
|
fix_shared_object_depends libwx
|
||||||
fix_shared_object_depends libSDL
|
|
||||||
fix_shared_object_depends libGLEW
|
|
||||||
fix_shared_object_depends libz
|
|
||||||
|
|
||||||
mkdir -p $temp_dir/Dolphin.app/Contents/Library/Frameworks/Cg.framework
|
|
||||||
cp /Library/Frameworks/Cg.framework/Cg $temp_dir/Dolphin.app/Contents/Library/Frameworks/Cg.framework/Cg
|
|
||||||
|
|
||||||
find $temp_dir -name .svn -exec rm -fr {} \; 2>/dev/null
|
find $temp_dir -name .svn -exec rm -fr {} \; 2>/dev/null
|
||||||
rm $temp_dir.dmg 2>/dev/null
|
rm $temp_dir.dmg 2>/dev/null
|
||||||
|
Loading…
x
Reference in New Issue
Block a user