Add log level and callback functions to the python bindings
[deb_shairplay.git] / SConstruct
CommitLineData
112f0c66
JVH
1
2AddOption('--force-mingw32',
3 action='store_true', dest='mingw32', default=False,
4 help='Cross compile using MinGW for Windows')
5
6AddOption('--force-mingw64',
7 action='store_true', dest='mingw64', default=False,
8 help='Cross compile using MinGW for Windows 64-bit')
9
10AddOption('--force-32bit',
11 action='store_true', dest='gcc32', default=False,
12 help='Always compile using 32-bit compiler flags')
13
14AddOption('--force-64bit',
15 action='store_true', dest='gcc64', default=False,
16 help='Always compile using 64-bit compiler flags')
17
18AddOption('--build-universal',
19 action='store_true', dest='universal', default=False,
20 help='Create Mac 32-bit and 64-bit universal binaries')
21
22VariantDir('build', 'src')
23env = Environment()
24
25if env['PLATFORM'] == 'win32' or GetOption('mingw32') or GetOption('mingw64'):
26 env.Append(CPPDEFINES = ['WINVER=0x0501'])
27
28if GetOption('mingw32'):
29 env.Tool('crossmingw', toolpath = ['scons-tools'])
30
31if GetOption('mingw64'):
32 env.Tool('crossmingw64', toolpath = ['scons-tools'])
33
34if GetOption('gcc32'):
35 env.Append(CFLAGS = ['-m32'])
36 env.Append(CPPFLAGS = ['-m32'])
37 env.Append(CXXFLAGS = ['-m32'])
38 env.Append(LINKFLAGS = ['-m32'])
39
40if GetOption('gcc64'):
41 env.Append(CFLAGS = ['-m64'])
42 env.Append(CPPFLAGS = ['-m64'])
43 env.Append(CXXFLAGS = ['-m64'])
44 env.Append(LINKFLAGS = ['-m64'])
45
46env.Append(CFLAGS = ['-Wall', '-Werror', '-O2'])
47
48conf = Configure(env)
49conf.CheckLib('socket')
50if conf.CheckFunc('getaddrinfo'):
51 env.Append(CPPDEFINES = ['HAVE_GETADDRINFO'])
52else:
53 if conf.CheckLibWithHeader('ws2_32', 'ws2tcpip.h','c','getaddrinfo(0,0,0,0);'):
54 env.Append(CPPDEFINES = ['HAVE_GETADDRINFO'])
55 else:
56 if conf.CheckLib('ws2_32'):
57 # We have windows socket lib without getaddrinfo, disable IPv6
58 env.Append(CPPDEFINES = ['DISABLE_IPV6'])
2af1cc02 59conf.CheckLib('winmm')
112f0c66
JVH
60env = conf.Finish()
61
62env.SConscript('build/SConscript', exports='env')
63