windows.config 2.9 KB
Newer Older
Xavi Artigas's avatar
Xavi Artigas committed
1
2
3
# 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.
4
5
# PLEASE, DO NOT EDIT THIS FILE

6
import os
7
8
from cerbero.config import Architecture, Platform

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

13
if platform == Platform.WINDOWS:
14
    separator = ';'
15
16
17
18
    if target_arch == Architecture.X86:
        build = 'i686-w64-mingw32'
    if target_arch == Architecture.X86_64:
        build = 'x86_64-w64-mingw32'
19
20
else:
    separator = ':'
21
22

if target_arch == Architecture.X86:
23
    buildname='windows_x86'
24
25
26
    host = 'i686-w64-mingw32'
    _path = 'w32'
else:
27
    buildname='windows_x86_64'
28
29
30
    host = 'x86_64-w64-mingw32'
    _path = 'w64'

31
32
target = host

33
if not toolchain_prefix:
34
    toolchain_prefix = os.path.join(home_dir, 'mingw', _path)
35
36
if not mingw_perl_prefix:
    mingw_perl_prefix = os.path.join(home_dir, 'mingw', 'perl')
37
38
39
40

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

41
# Default compiler flags
42
43
44
os.environ['CFLAGS'] = '-Wall -g -O2 '
os.environ['CXXFLAGS'] = '-Wall -g -O2 '
os.environ['OBJCFLAGS'] = '-Wall -g -O2 '
45

46
ccache = use_ccache and 'ccache ' or ''
47

48
# Toolchain environment
49
os.environ['CFLAGS'] += "-DWINVER=0x0501 -D_WIN32_WINNT=0x0501"
50
os.environ['LIBRARY_PATH'] = "{0}/lib{1}".format(prefix, lib_suffix)
51
os.environ['CXXFLAGS']=os.environ['CFLAGS']
52
53
os.environ['CC']= '%s%s' % (ccache, cmd('gcc'))
os.environ['CXX']= '%s%s' % (ccache, cmd('g++'))
54
55
56
57
58
59
60
61
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')
62
os.environ['RC']= cmd('windres')
63
os.environ['DLLTOOL']= cmd('dlltool')
64
os.environ['PERL'] = 'perl'
65
66
67
68
# 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'])
69
70
71

os.environ['ne_cv_libsfor_socket'] = '-lws2_32'
os.environ['ne_cv_libsfor_gethostbyname'] = '-lws2_32'
72
73
os.environ['ac_cv_func_malloc_0_nonnull'] ='yes'
os.environ['ac_cv_func_realloc_0_nonnull'] ='yes'
74
os.environ['lt_cv_deplibs_check_method'] = 'pass_all'
75
os.environ['ac_cv_lib_bz2_BZ2_bzlibVersion'] = 'yes'
76
os.environ['ac_cv_c_attribute_aligned'] = '64'
77
78

# DirectX and DirectSound
79
os.environ['DIRECTSOUND_CFLAGS'] = '-I%s/%s/include/directx' % (toolchain_prefix, host)
80
81
os.environ['DIRECSOUND_LDFLAGS'] = '-L%s/lib' % toolchain_prefix
os.environ['DIRECTX_CFLAGS']= '-I%s/include/DirectX' % toolchain_prefix
82
os.environ['DIRECTX_CFLAGS'] = '-I%s/%s/include/directx' % (toolchain_prefix, host)
83
os.environ['DIRECTX_LDFLAGS'] = '-L%s/lib' % toolchain_prefix
84
85
86

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