summaryrefslogtreecommitdiff
path: root/jhbuildrc.include
blob: 81576682f10d1aa8cc9d751d2e47369e010ec61a (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
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
#
# jhbuildrc.include
# common jhbuildrc settings for Windows targets#
#
# XXX: Note this assumes you will be working in /jhbuild
#

import subprocess

#
# Discover BUILD, HOST and set CC, CXX appropriately
#

# discover the build machine system name
os.environ['BUILD'] = subprocess.check_output(['gcc','-dumpmachine']).strip()

# set compiler name ...
if not 'HOST' in os.environ:
        # not cross-compiling
        os.environ['HOST'] = os.environ['BUILD']
        os.environ['CC'] = 'gcc'
        os.environ['CXX'] = 'g++'
        cross_target = None
else:
        # cross-compiling
        os.environ['CC'] = os.environ['HOST'] + '-gcc'
        os.environ['CXX'] = os.environ['HOST'] + '-g++'
        if not cross_target:
                print "You must set cross_target!"
                exit

os.environ['CC_FOR_BUILD'] = 'gcc'

# if ccache is available, use it
if subprocess.call('ccache --version >/dev/null 2>&1', shell=True) == 0:
    os.environ['CC'] = 'ccache ' + os.environ['CC']
    os.environ['CXX'] = 'ccache ' + os.environ['CXX']
    os.environ['CC_FOR_BUILD'] = 'ccache ' + os.environ['CC_FOR_BUILD']

#
# determine modules to build
#

moduleset = '/jhbuild/xorg.modules'
if 'TINDERBOX' in os.environ:
        modules = [ 'xwin', 'The X Window System', 'extras', 'tests' ]
else:
        modules = [ 'xwin', 'The X Window System' ]

# skip building stuff which isn't appropriate for Windows target
skip = [ 'applewmproto',
         'libAppleWM',
         'videoproto',
         'xf86dgaproto',
         'xf86driproto',
         'xf86vidmodeproto',
         'dri2proto',
         'dri3proto',
         'libXv',
         'libXvMC',
         'libXxf86dga',
         'libXxf86dga',
         'libXxf86vm',
         'libxshmfence',
         'libxkbui',
         'libevdev',
         'libpciaccess',
         'mesa-drm',
         'mtdev',
         'app-xdriinfo',
         'app-xgamma',
         'app-xfs',
         'app-xvidtune',
         'app-xvinfo' ]

# skip building all drivers apart from xf86-video-dummy and xf86-video-nested
skip += [
         'glamor',
         'xf86-input-acecad',
         'xf86-input-aiptek',
         'xf86-input-evdev',
         'xf86-input-joystick',
         'xf86-input-keyboard',
         'xf86-input-libinput',
         'xf86-input-mouse',
         'xf86-input-synaptics',
         'xf86-input-vmmouse',
         'xf86-input-void',
         'xf86-video-apm',
         'xf86-video-ark',
         'xf86-video-ast',
         'xf86-video-ati',
         'xf86-video-chips',
         'xf86-video-cirrus',
         'xf86-video-fbdev',
         'xf86-video-geode',
         'xf86-video-glint',
         'xf86-video-i128',
         'xf86-video-i740',
         'xf86-video-intel',
         'xf86-video-mach64',
         'xf86-video-mga',
         'xf86-video-modesetting',
         'xf86-video-neomagic',
         'xf86-video-nouveau',
         'xf86-video-nv',
         'xf86-video-openchrome',
         'xf86-video-r128',
         'xf86-video-rendition',
         'xf86-video-s3',
         'xf86-video-s3virge',
         'xf86-video-savage',
         'xf86-video-siliconmotion',
         'xf86-video-sis',
         'xf86-video-sisusb',
         'xf86-video-suncg14',
         'xf86-video-suncg3',
         'xf86-video-suncg6',
         'xf86-video-sunffb',
         'xf86-video-sunleo',
         'xf86-video-suntcx',
         'xf86-video-tdfx',
         'xf86-video-tga',
         'xf86-video-trident',
         'xf86-video-tseng',
         'xf86-video-v4l',
         'xf86-video-vesa',
         'xf86-video-vmware',
         'xf86-video-wsfb',
         'xf86-video-voodoo',
         'xf86-video-xgixp' ]

if 'mingw' in os.environ['HOST']:
        # skip building all drivers for MinGW, useless since we can't build Xorg server
        skip += [
                'The X Video Drivers',
                'The X Input Drivers' ]

        # Leave libGL till later...
        skip += [
                'mesa-drm',
                'mesa-mesa',
                'mesa-demos',
                'mesa-glut',
                'mesa-glu' ]

        # Some of these don't make much sense to build for MinGW
        # But some of these are provided with Xming, so clearly can be ported with some work...
        skip += [
                'libFS',
                'app-ico',
                'app-luit',
                'app-rendercheck',
                'app-rstart',
                'app-sessreg',
                'app-smproxy',
                'app-transset',
                'app-twm',
                'app-x11perf',
                'app-xconsole',
                'app-xdm',
                'app-xfs',
                'app-xfsinfo',
                'app-xinit',
                'app-xkbevd',
                'app-xman',
                'app-xsm',
                'app-xwininfo' ]

build_policy = 'updated-deps'
if 'TINDERBOX' in os.environ:
        nopoison = True
        quiet_mode = True

# All source modules will be here after the checkout
checkoutroot = '/jhbuild/checkout'

# All building takes place here
buildroot = os.path.join('/jhbuild', os.environ['HOST'], 'build')

# All installed stuff will be here
prefix = os.path.join('/jhbuild', os.environ['HOST'], 'install')

#
# set misc environment variables
#

os.environ['ACLOCAL'] = 'aclocal -I ' + os.path.join(prefix, 'share', 'aclocal')
if cross_target or not 'PKG_CONFIG_PATH' in os.environ:
        os.environ['PKG_CONFIG_PATH'] = os.path.join(prefix, 'lib', 'pkgconfig') + ':' + os.path.join(prefix, 'share', 'pkgconfig')
else:
        # if not cross compiling, just augment rather than replace PKG_CONFIG_PATH
        os.environ['PKG_CONFIG_PATH'] = os.path.join(prefix, 'lib', 'pkgconfig') + ':' + os.path.join(prefix, 'share', 'pkgconfig') + ':' + os.environ['PKG_CONFIG_PATH']
#os.environ['PKG_CONFIG_DEBUG_SPEW'] = '1'
os.environ['INSTALL'] = '/usr/local/bin/install-check'
os.environ['CFLAGS'] = '-g -O0 -fdiagnostics-show-option'
os.environ['CXXFLAGS'] = '-g -O0 -fdiagnostics-show-option'
os.environ['AUTOMAKE'] = 'automake --force-missing --copy'
#os.environ['V'] = '1'

# env var to help GLEW install itself properly
os.environ['GLEW_DEST'] = prefix

# env vars to help some tests find things...
os.environ['JHBUILD_CHECKOUTROOT'] = checkoutroot
os.environ['JHBUILD_BUILDROOT'] = buildroot
os.environ['JHBUILD_PREFIX'] = prefix
os.environ['PREFIX'] = prefix

# pixman tests run slower when OpenMP is allowed to use multiple threads...
# I'm assuming this is a toolchain bug...
os.environ['OMP_NUM_THREADS'] = '1'

#
# global ./configure options
#

autogenargs = '--cache-file=' + os.path.join('/jhbuild', os.environ['HOST'], 'configure-cache')
autogenargs = autogenargs + ' --enable-silent-rules'
if cross_target:
        autogenargs += ' --build=' + os.environ['BUILD']
        autogenargs += ' --host=' + os.environ['HOST']

# ipv6
# MinGW targets need to compile with WINVER of at least XP for getaddrinfo(), freeaddrinfo()
#autogenargs += ' --enable-ipv6'
#os.environ['CFLAGS'] += ' -DWINVER=0x0501'
mesonargs = ''

#
# per module ./configure options
#

if 'mingw' in os.environ['HOST']:
        module_autogenargs['xserver'] = autogenargs + ' --disable-glx'
else:
        module_autogenargs['xserver'] = autogenargs + ' --enable-xvfb --enable-xnest --enable-dmx --enable-kdrive --enable-xephyr --enable-xorg --enable-xwin --enable-xf86bigfont --disable-glamor'
module_autogenargs['xserver'] = module_autogenargs['xserver'] + ' --enable-debug'
module_autogenargs['xserver'] = module_autogenargs['xserver'] + ' --with-builderstring="Tag: `cd ' + checkoutroot + '/xorg/xserver ; git describe | tr -d \\n`"'

module_autogenargs['xkeyboard-config'] = autogenargs + ' --with-xkb-rules-symlink=xorg'

module_autogenargs['fontconfig'] = autogenargs + ' --enable-libxml2'

module_autogenargs['libXfont'] = autogenargs + ' --disable-static'

module_mesonargs['mesa-mesa'] = mesonargs + ' -Degl=false'

# xf86-video-dummy config check needs fixing to default to auto, not yes
module_autogenargs['xf86-video-dummy'] = autogenargs + ' --disable-dga'

# xts can't be built with shared libraries on Windows
module_autogenargs['xts'] = autogenargs + ' --disable-shared'

#
#
#

# do not start xvfb for any testmodules
noxvfb = True

# always run 'make check' in tinderbox
if 'TINDERBOX' in os.environ:
        makecheck = True

# if cross-compiling, some autoconf tests cannot be run
if cross_target:
        # AC_FUNC_STRNLEN guesses 'yes' when cross-compiling
        os.environ['ac_cv_func_strnlen_working'] = 'no'
        # AC_CHECK_FUNC can't find strncasecmp() because of stdcall linkage
        os.environ['ac_cv_func_strncasecmp'] = 'yes'
        # --enable-malloc0returnsnull
        os.environ['xorg_cv_malloc0_returns_null'] = 'yes'
        # AC_CHECK_FUNC finds unprototyped getpagesize in libgcc.a
        os.environ['ac_cv_func_getpagesize'] = 'no'
        # AC_CHECK_FUNC finds unprototyped usleep
        os.environ['ac_cv_func_usleep'] = 'no'

        # also, do not search in the BUILD pkgconfig libdir
        os.environ['PKG_CONFIG_LIBDIR'] = '/usr/' + os.environ['HOST'] + '/sys-root/mingw/lib/pkgconfig'

#
# some tourist information
#
if not 'TINDERBOX' in os.environ:
        for e in ['CC', 'CXX', 'CC_FOR_BUILD', 'BUILD', 'HOST']:
                print e, '=', os.environ[e]
        del e