~mshinke/nvdajp/betterBraille

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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
###
#This file is a part of the NVDA project.
#URL: http://www.nvda-project.org/
#Copyright 2006-2010 NVDA contributers.
#This program is free software: you can redistribute it and/or modify
#it under the terms of the GNU General Public License version 2.0, as published by
#the Free Software Foundation.
#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#This license can be found at:
#http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
###

import os
import shutil

Import(
	'env',
	'sourceDir',
	'sourceTypelibDir',
	'libInstallDir',
	'clientInstallDir',
)

TARGET_ARCH=env['TARGET_ARCH']
debug=env['nvdaHelperDebugFlags']

#Some defines and includes for the environment
env.Append(CPPDEFINES=['UNICODE','_CRT_SECURE_NO_DEPRECATE',('LOGLEVEL','${nvdaHelperLogLevel}'),('_WIN32_WINNT','_WIN32_WINNT_WINXP')])
env.Append(CXXFLAGS=['/EHsc','/W3','/WX'])
env.Append(CPPPATH=['#/include',Dir('.').abspath])
env.Append(LINKFLAGS='/incremental:no')
env.Append(LINKFLAGS='/release') #We always want a checksum in the header
env.Append(MIDLFLAGS='/x64' if TARGET_ARCH=='x86_64' else '/win32')

if 'noOptimize' in debug:
	env.Append(CCFLAGS=['/Od'])
else:
	env.Append(CCFLAGS=['/O2','/GL'])
	env.Append(LINKFLAGS=['/LTCG'])

if 'debugCRT' in debug:
	env.Append(CCFLAGS=['/MTd'])
else:
	env.Append(CCFLAGS=['/MT'])
	env.Append(CPPDEFINES=['NDEBUG'])

if 'RTC' in debug:
	env.Append(CCFLAGS=['/RTCsu'])

if 'symbols' in debug:
	env.Append(PDB='${TARGET}.pdb')
	env.Append(LINKFLAGS='/OPT:REF') #having symbols usually turns this off but we have no need for unused symbols

Export('env')

acrobatAccessRPCStubs=env.SConscript('acrobatAccess_sconscript')
Export('acrobatAccessRPCStubs')
if TARGET_ARCH=='x86':
	env.Install(sourceTypelibDir,acrobatAccessRPCStubs[0]) #typelib

ia2RPCStubs=env.SConscript('ia2_sconscript')
Export('ia2RPCStubs')
env.Install(libInstallDir,ia2RPCStubs[0]) #proxy dll
if TARGET_ARCH=='x86':
	env.Install(sourceTypelibDir,ia2RPCStubs[1]) #typelib

if TARGET_ARCH=='x86':
	localLib=env.SConscript('local/sconscript')
	Export('localLib')
	env.Install(libInstallDir,localLib)

clientLib=env.SConscript('client/sconscript')
Export('clientLib')
env.Install(clientInstallDir,clientLib)

minHookLib=env.SConscript('minHook/sconscript')
Export('minHookLib')
env.Install(libInstallDir,minHookLib)

remoteLib=env.SConscript('remote/sconscript')
Export('remoteLib')
env.Install(libInstallDir,remoteLib)

if TARGET_ARCH=='x86_64':
	remoteLoaderProgram=env.SConscript('remoteLoader/sconscript')
	env.Install(libInstallDir,remoteLoaderProgram)

vbufBaseStaticLib=env.SConscript('vbufBase/sconscript')
Export('vbufBaseStaticLib')

adobeAcrobatVBufBackend=env.SConscript('vbufBackends/adobeAcrobat/sconscript')
env.Install(libInstallDir,adobeAcrobatVBufBackend)

adobeFlashVBufBackend=env.SConscript('vbufBackends/adobeFlash/sconscript')
env.Install(libInstallDir,adobeFlashVBufBackend)

geckoVBufBackend=env.SConscript('vbufBackends/gecko_ia2/sconscript')
env.Install(libInstallDir,geckoVBufBackend)

mshtmlVBufBackend=env.SConscript('vbufBackends/mshtml/sconscript')
env.Install(libInstallDir,mshtmlVBufBackend)

if TARGET_ARCH=='x86' and os.path.isdir(Dir('#include/espeak').abspath):
	env.SConscript('espeak/sconscript')

nvdajpime=env.SConscript('nvdajpime/sconscript')		# Masataka Shinke
Export('nvdajpime')										# Masataka Shinke
env.Install(clientInstallDir,nvdajpime)					# Masataka Shinke
env.Install(libInstallDir,nvdajpime)					# Masataka.Shinke

nvdajpimeRPC=env.SConscript('nvdajpimeRPC/sconscript')	# Masataka Shinke
Export('nvdajpimeRPC')									# Masataka Shinke
env.Install(clientInstallDir,nvdajpimeRPC)				# Masataka Shinke
env.Install(libInstallDir,nvdajpimeRPC)					# Masataka.Shinke

if TARGET_ARCH=='x86_64':
	nvdajpimeLoaderProgram=env.SConscript('nvdajpimeLoader/sconscript')
	env.Install(libInstallDir,nvdajpimeLoaderProgram)

if TARGET_ARCH=='x86' and os.path.isdir(Dir('#include/jtalk/libopenjtalk').abspath):
	nvdajptextLib=env.SConscript('nvdajptext/sconscript')
	Export('nvdajptextLib')
	env.Install(libInstallDir,nvdajptextLib)