summaryrefslogtreecommitdiff
path: root/config/windows.config
blob: e4b29ed0c9a6965fa82abc9dfd31ad1c968f2e1c (plain)
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# This file contains the default configuration to compile for Windows
# platforms. It contains sensitive enviroment configuration that
# shouldn't be modified unless you now what you are doing.
# PLEASE, DO NOT EDIT THIS FILE

import os
from cerbero.config import Architecture, Platform

# We don't want anything from mingw or msys detected in configure and
# used later.
allow_system_libs=False

if platform == Platform.WINDOWS:
    separator = ';'
    if target_arch == Architecture.X86:
        build = 'i686-w64-mingw32'
    if target_arch == Architecture.X86_64:
        build = 'x86_64-w64-mingw32'
else:
    separator = ':'

if target_arch == Architecture.X86:
    buildname='windows_x86'
    host = 'i686-w64-mingw32'
    _path = 'w32'
else:
    buildname='windows_x86_64'
    host = 'x86_64-w64-mingw32'
    _path = 'w64'

target = host

py_prefix = 'lib/python2.7'

if not toolchain_prefix:
    toolchain_prefix = os.path.join(home_dir, 'mingw', _path)

def cmd(command):
    return '%s-%s' % (host, command)

# Default compiler flags
os.environ['CFLAGS'] = '-Wall -g -O2 '
os.environ['CXXFLAGS'] = '-Wall -g -O2 '
os.environ['OBJCFLAGS'] = '-Wall -g -O2 '

ccache = use_ccache and 'ccache ' or ''

# Toolchain environment
os.environ['CFLAGS'] += "-DWINVER=0x0501 -D_WIN32_WINNT=0x0501"
os.environ['LIBRARY_PATH'] = "{0}/lib{1}".format(prefix, lib_suffix)
os.environ['CXXFLAGS']=os.environ['CFLAGS']
os.environ['CC']= '%s%s' % (ccache, cmd('gcc'))
os.environ['CXX']= '%s%s' % (ccache, cmd('g++'))
os.environ['LD']= cmd('ld')
os.environ['CPP']= cmd('cpp')
os.environ['RANLIB']= cmd('ranlib')
os.environ['AR']= cmd('ar')
os.environ['AS']= cmd('as')
os.environ['NM']= cmd('nm')
os.environ['STRIP']= cmd('strip')
os.environ['WINDRES']= cmd('windres')
os.environ['RC']= cmd('windres')
os.environ['DLLTOOL']= cmd('dlltool')
# PATH
if platform == Platform.WINDOWS:
    toolchainhostbin = os.path.join(toolchain_prefix, host, 'bin')
    if os.path.isdir(toolchainhostbin) and not toolchainhostbin in os.environ['PATH']:
        os.environ['PATH'] = '%s%s%s' % (toolchainhostbin, separator, os.environ['PATH'])
toolchainbin = os.path.join(toolchain_prefix, 'bin')
if os.path.isdir(toolchainbin) and not toolchainbin in os.environ['PATH']:
    os.environ['PATH'] = '%s%s%s' % (toolchainbin, separator, os.environ['PATH'])

os.environ['ne_cv_libsfor_socket'] = '-lws2_32'
os.environ['ne_cv_libsfor_gethostbyname'] = '-lws2_32'
os.environ['ac_cv_func_malloc_0_nonnull'] ='yes'
os.environ['ac_cv_func_realloc_0_nonnull'] ='yes'
os.environ['lt_cv_deplibs_check_method'] = 'pass_all'
os.environ['ac_cv_lib_bz2_BZ2_bzlibVersion'] = 'yes'
os.environ['ac_cv_c_attribute_aligned'] = '64'

# Python
os.environ['am_cv_python_version'] = '2.7'
os.environ['am_cv_python_platform'] = 'win32'
os.environ['am_cv_python_pyexecdir'] = '%s/%s/site-packages' % (prefix, py_prefix)
os.environ['am_cv_python_pythondir'] = '%s/%s/site-packages' % (prefix, py_prefix)
os.environ['PYTHON_INCLUDES'] = '-I%s/include/Python2.7 -I%s/include/Python2.7' % (toolchain_prefix, toolchain_prefix)
os.environ['PYTHON_LIBS'] = '-lpython27 -shrext .pyd'

# DirectX and DirectSound
os.environ['DIRECTSOUND_CFLAGS'] = '-I%s/%s/include/directx' % (toolchain_prefix, host)
os.environ['DIRECSOUND_LDFLAGS'] = '-L%s/lib' % toolchain_prefix
os.environ['DIRECTX_CFLAGS']= '-I%s/include/DirectX' % toolchain_prefix
os.environ['DIRECTX_CFLAGS'] = '-I%s/%s/include/directx' % (toolchain_prefix, host)
os.environ['DIRECTX_LDFLAGS'] = '-L%s/lib' % toolchain_prefix

if platform == Platform.WINDOWS:
    os.environ['ACLOCAL'] = 'aclocal-1.11'