1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
import os
from cerbero.config import Architecture
if target_arch == Architecture.X86_64:
build='x86_64-apple-darwinx'
else:
build='i386-apple-darwinx'
osx_sdk_version='10.6'
sdk_root = '/Developer/SDKs/MacOSX%s.sdk' % osx_sdk_version
sdk='-mmacosx-version-min=%s -isysroot %s' % (osx_sdk_version, sdk_root)
for f in ['CFLAGS', 'CCASFLAGS', 'CXXFLAGS', 'LDFLAGS']:
os.environ[f] = os.environ.get(f, '')
os.environ['CFLAGS'] = '-g -O2'
if target_arch == Architecture.X86_64:
os.environ['CFLAGS'] += ' -arch x86_64 -m64'
os.environ['LDFLAGS'] += ' -arch x86_64 -m64'
os.environ['CCASFLAGS'] += ' -arch x86_64 -m64'
else:
os.environ['CFLAGS'] += ' -arch i386 -m32'
os.environ['LDFLAGS'] += ' -arch i386 -m32'
os.environ['CCASFLAGS'] += ' -arch i386 -m32'
os.environ['CFLAGS'] += ' -I%s -I%s' % (os.path.join(prefix, 'include'), os.path.join(sdk_root, 'usr', 'X11', 'include'))
os.environ['CXXFLAGS'] += os.environ['CFLAGS']
os.environ['LDFLAGS'] += ' %s -L%s ' % (sdk, os.path.join(sdk_root, 'usr', 'X11', 'lib'))
|