Add OS X support to AMBuild and 10.9 support to amxxpc.

Former-commit-id: 91779cb941
This commit is contained in:
David Anderson 2014-02-08 15:25:57 -08:00
parent 90b2860fd2
commit bd586d37e6
3 changed files with 16 additions and 6 deletions

View File

@ -91,6 +91,7 @@ class AMXXConfig(object):
'-Wall', '-Wall',
'-Werror', '-Werror',
'-Wno-uninitialized', '-Wno-uninitialized',
'-Wno-invalid-offsetof',
'-Wno-unused', '-Wno-unused',
'-Wno-switch', '-Wno-switch',
'-m32', '-m32',

View File

@ -24,12 +24,19 @@ elif builder.target_platform == 'linux':
binary.Dep('JIT/helpers-x86.o'), binary.Dep('JIT/helpers-x86.o'),
] ]
binary.compiler.linkflags += jit_objects
if builder.target_platform == 'linux': if builder.target_platform == 'linux':
binary.compiler.postlink += [binary.Dep('zlib/libz.a')] binary.compiler.linkflags += [binary.Dep('zlib/libz.a')]
elif builder.target_platform == 'mac': elif builder.target_platform == 'mac':
binary.compiler.postlink += [binary.Dep('zlib/libz-darwin.a')] binary.compiler.linkflags += [binary.Dep('zlib/libz-darwin.a')]
elif builder.target_platform == 'windows': elif builder.target_platform == 'windows':
binary.compiler.postlink += [binary.Dep('zlib\\zlib.lib')] binary.compiler.linkflags += [binary.Dep('zlib\\zlib.lib')]
if builder.target_platform == 'mac':
binary.compiler.postlink += [
'-Wl,-read_only_relocs,suppress'
]
binary.sources = [ binary.sources = [
'meta_api.cpp', 'meta_api.cpp',
@ -79,6 +86,5 @@ binary.sources = [
'datastructs.cpp', 'datastructs.cpp',
'trie_natives.cpp', 'trie_natives.cpp',
] ]
binary.compiler.linkflags += jit_objects
AMXX.binaries += [builder.Add(binary)] AMXX.binaries += [builder.Add(binary)]

View File

@ -487,7 +487,9 @@ int pc_compile(int argc, char *argv[])
tname=NULL; tname=NULL;
sname=NULL; sname=NULL;
#else #else
tname=tempnam(NULL,"pawn"); char *buffer = strdup(P_tmpdir "/pawn.XXXXXX");
close(mkstemp(buffer));
tname=buffer;
#endif #endif
ftmp=(FILE*)pc_createsrc(tname); ftmp=(FILE*)pc_createsrc(tname);
for (fidx=0; (sname=get_sourcefile(fidx))!=NULL; fidx++) { for (fidx=0; (sname=get_sourcefile(fidx))!=NULL; fidx++) {
@ -1298,6 +1300,7 @@ static void setconfig(char *root)
insert_path(path); insert_path(path);
/* same for the codepage root */ /* same for the codepage root */
#if !defined NO_CODEPAGE #if !defined NO_CODEPAGE
if (ptr)
*ptr='\0'; *ptr='\0';
if (!cp_path(path,"codepage")) if (!cp_path(path,"codepage"))
error(109,path); /* codepage path */ error(109,path); /* codepage path */