summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon TURNEY <jon.turney@dronecode.org.uk>2015-03-18 11:50:00 +0000
committerJon TURNEY <jon.turney@dronecode.org.uk>2015-03-18 18:30:31 +0000
commita3cca4130aa9bc12f27444b84c314b24181fec9f (patch)
tree7d10c9d919cff78b99fb995053096095219090d0
parentd035c0e523051dc689c797059196e088ddd97ecf (diff)
Rework jhbuildrc to put common stuff into jhbuildrc.include
jhbuildrc.include now includes all the knowledge about what and how to build for various windows targets jhbuildrc builds an appropriate native build jhbuildrc.<target> builds an appropriate cross build for the given host
-rw-r--r--jhbuildrc141
-rw-r--r--jhbuildrc.i686-pc-cygwin10
-rw-r--r--jhbuildrc.i686-pc-mingw3290
-rw-r--r--jhbuildrc.i686-w64-mingw32116
-rw-r--r--jhbuildrc.include289
-rw-r--r--jhbuildrc.x86_64-pc-cygwin123
-rw-r--r--jhbuildrc.x86_64-w64-mingw3210
7 files changed, 328 insertions, 451 deletions
diff --git a/jhbuildrc b/jhbuildrc
index 2782dac..1bc698e 100644
--- a/jhbuildrc
+++ b/jhbuildrc
@@ -1,140 +1,7 @@
#
-# jhbuildrc for building for cygwin
+# jhbuildrc
+# native build (HOST = BUILD = native)
#
-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 building all drivers apart from xf86-video-dummy and xf86-video-nested
-skip = [ 'applewmproto', 'libAppleWM',
- 'videoproto', 'xf86dgaproto', 'xf86driproto', 'xf86vidmodeproto', 'dri2proto', 'dri3proto',
- 'libXv', 'libXvMC', 'libXxf86dga', 'libXxf86dga', 'libXxf86vm', 'libxshmfence', 'libxkbui',
- 'libevdev', 'libpciaccess',
- 'mesa-drm',
- 'app-xdriinfo', 'app-xgamma', 'app-xfs', 'app-xvidtune', 'app-xvinfo',
- 'glamor',
- 'xf86-input-acecad',
- 'xf86-input-aiptek',
- 'xf86-input-evdev',
- 'xf86-input-joystick',
- 'xf86-input-keyboard',
- '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' ]
-
-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 build takes place here
-buildroot = '/jhbuild/build'
-
-# All installed stuff will be here
-prefix = '/jhbuild/install'
-
-os.environ['ACLOCAL'] = 'aclocal -I ' + os.path.join(prefix, 'share', 'aclocal')
-os.environ['PKG_CONFIG_PATH'] = os.path.join(prefix, 'lib', 'pkgconfig') + ':' + os.path.join(prefix, 'share', 'pkgconfig')
-os.environ['CC'] = 'ccache gcc'
-os.environ['CXX'] = 'ccache g++'
-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'
-#os.environ['LDFLAGS'] = '-Wl,-Map=mapfile'
-
-#
-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
-
-autogenargs = '--cache-file=/jhbuild/configure-cache --enable-silent-rules'
-
-module_autogenargs['xserver'] = ' --enable-xvfb --enable-xnest --enable-dmx --enable-kdrive --enable-xephyr --enable-xfake --disable-xfbdev --enable-xorg --enable-xwin --disable-glx-tls --enable-xf86bigfont'
-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['xserver'] = module_autogenargs['xserver'] + ' CFLAGS="-Wno-error=implicit-function-declaration ' + os.environ['CFLAGS'] + '"'
-# we can only build the Xwin DDX when rootless is enabled, as it turns on horrible ROOTLESS hacks in DIX
-# --enable-dmx --enable-xephyr --enable-xfake
-
-module_autogenargs['xkeyboard-config'] = autogenargs + ' --with-xkb-rules-symlink=xorg'
-
-module_autogenargs['libXfont'] = autogenargs + ' --disable-static'
-
-# build xlib-based libGL
-#module_autogenargs['mesa-mesa'] = autogenargs + ' --with-gallium-drivers=swrast --disable-dri --enable-osmesa --enable-xlib-glx'
-# build libGL which supports both direct swrast and indirect
-module_autogenargs['mesa-mesa'] = autogenargs + ' --disable-xa --with-gallium-drivers=swrast --disable-dri3 --enable-egl --enable-osmesa --enable-shared --disable-static --enable-driglx-direct'
-
-# pixman tests fail otherwise, I'm assuming this is a toolchain bug...
-#module_autogenargs['pixman'] = autogenargs + ' --disable-openmp'
-# pixman tests run slower when OpenMP is allowed to use multiple threads...
-os.environ['OMP_NUM_THREADS'] = '1'
-
-# xf86-video-dummy config check needs fixing to default to auto, not yes
-module_autogenargs['xf86-video-dummy'] = autogenargs + ' --disable-dga'
-
-# harfbuzz currently needs help to configure correctly
-module_autogenargs['harfbuzz'] = autogenargs + ' ac_cv_header_usp10_h=no ac_cv_header_windows_h=no ac_cv_func__setmode=no'
-
-# do not start xvfb for any testmodules
-noxvfb = True
-
-# always run 'make check'
-if 'TINDERBOX' in os.environ:
- makecheck = True
+# and include common stuff
+execfile('jhbuildrc.include')
diff --git a/jhbuildrc.i686-pc-cygwin b/jhbuildrc.i686-pc-cygwin
new file mode 100644
index 0000000..e008f1b
--- /dev/null
+++ b/jhbuildrc.i686-pc-cygwin
@@ -0,0 +1,10 @@
+#
+# jhbuildrc
+# cross build to i686-w64-mingw32 (Cygwin 32bit)
+#
+
+cross_target = "cross to CYGWIN i686"
+os.environ['HOST'] = 'i686-pc-cygwin'
+
+# and include common stuff
+execfile('jhbuildrc.include')
diff --git a/jhbuildrc.i686-pc-mingw32 b/jhbuildrc.i686-pc-mingw32
index 3319bda..7b947ae 100644
--- a/jhbuildrc.i686-pc-mingw32
+++ b/jhbuildrc.i686-pc-mingw32
@@ -1,90 +1,10 @@
#
-# jhbuildrc for building for mingw
+# jhbuildrc
+# cross build to i686-pc-mingw32 (MinGW.org 32bit)
#
-cross_target = "cross to MINGW i686"
-
-moduleset = '/jhbuild/xorg.modules'
-modules = [ 'xwin', 'xorg' ]
-
-# skip building stuff which isn't appropriate for target
-skip = [ 'applewmproto', 'libAppleWM',
- 'videoproto', 'xf86dgaproto', 'xf86driproto', 'xf86vidmodeproto', 'dri2proto',
- 'libXv', 'libXvMC', 'libXxf86dga', 'libXxf86dga', 'libXxf86vm', 'libxcwm',
- 'libxkbui', 'libdrm', 'libpciaccess',
- 'xvinfo', 'xdriinfo', 'xgamma',
- 'xorg-drivers',
- 'libGL', 'mesa-demos',
- 'libFS',
- 'luit', 'sessreg', 'smproxy', 'xkbevd', 'xinit', 'xpr',
- 'ico', 'rendercheck', 'twm', 'transset', 'x11perf', 'xwininfo'
- ]
-# libGL is not easily cross-compilable
-# some modules don't make much sense to build for mingw
-# some modules are provided with xming, so can be ported with some work...
-
-build_policy = 'updated-deps'
-if 'TINDERBOX' in os.environ:
- nopoison = True
- quiet_mode = True
-
-os.environ['BUILD'] = 'i686-pc-cygwin'
+cross_target = "cross to MINGW i686"
os.environ['HOST'] = 'i686-pc-mingw32'
-# source checkout, build and install directories
-checkoutroot = '/jhbuild/checkout'
-buildroot = os.path.join('/jhbuild', os.environ['HOST'], 'build')
-prefix = os.path.join('/jhbuild', os.environ['HOST'], 'install')
-
-# configuration
-os.environ['ACLOCAL'] = 'aclocal -I ' + os.path.join(prefix, 'share', 'aclocal')
-os.environ['PKG_CONFIG_PATH'] = os.path.join(prefix, 'lib', 'pkgconfig') + ':' + os.path.join(prefix, 'share', 'pkgconfig')
-# do not search in the host pkgconfig libdir
-os.environ['PKG_CONFIG_LIBDIR'] = '/usr/i686-pc-mingw32/sys-root/mingw/lib/pkgconfig'
-
-os.environ['CC'] = 'ccache i686-pc-mingw32-gcc'
-os.environ['CXX'] = 'ccache i686-pc-mingw32-g++'
-os.environ['INSTALL'] = '/usr/local/bin/install-check'
-os.environ['CC_FOR_BUILD'] = 'ccache gcc'
-os.environ['CFLAGS'] = '-g -O0 -fdiagnostics-show-option'
-#os.environ['V'] = '1'
-#os.environ['PKG_CONFIG_DEBUG_SPEW'] = '1'
-
-# env vars to help some tests find things...
-os.environ['JHBUILD_CHECKOUTROOT'] = checkoutroot
-os.environ['JHBUILD_BUILDROOT'] = buildroot
-os.environ['JHBUILD_PREFIX'] = prefix
-
-autogenargs = '--cache-file=' + os.path.join('/jhbuild', os.environ['HOST'], 'configure-cache')
-autogenargs += ' --build='+os.environ['BUILD']
-autogenargs += ' --host='+os.environ['HOST']
-
-# ipv6
-# need to compile with WINVER of at least XP for getaddrinfo(), freeaddrinfo()
-#autogenargs += ' --enable-ipv6'
-#os.environ['CFLAGS'] += ' -DWINVER=0x0501'
-
-module_autogenargs['xserver'] = autogenargs + ' -disable-glx'
-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'
-
-# doesn't make much sense to build libxcb-shm for MinGW
-module_autogenargs['libxcb'] = autogenargs + ' --disable-shm'
-
-# must put pthread into LIBS when building pthread-stubs, as weak cleverness won't work...
-os.environ['LIBS'] = '-lpthread'
-
-# do not start xvfb for any testmodules
-noxvfb = True
-
-# can't run 'make check' when cross-compiling
-makecheck = False
-
-# AC_FUNC_STRNLEN guesses 'yes' when cross-compiling
-os.environ['ac_cv_func_strnlen_working'] = 'no'
-# AC_SEARCH_LIBS can't find sqrtf() beacuse of stdcall linkage
-#os.environ['ac_cv_search_sqrtf'] = 'none required'
-# AC_CHECK_FUNC can't find strncasecmp() because of stdcall linkage
-os.environ['ac_cv_func_strncasecmp'] = 'yes'
+# and include common stuff
+execfile('jhbuildrc.include')
diff --git a/jhbuildrc.i686-w64-mingw32 b/jhbuildrc.i686-w64-mingw32
index 5cbb0e5..8f0a62a 100644
--- a/jhbuildrc.i686-w64-mingw32
+++ b/jhbuildrc.i686-w64-mingw32
@@ -1,116 +1,10 @@
#
-# jhbuildrc for building for mingw64
+# jhbuildrc
+# cross build to i686-w64-mingw32 (MinGW-w64 32bit)
#
-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',
- 'app-xvinfo', 'app-xdriinfo', 'app-xgamma',
- 'The X Video Drivers', 'The X Input Drivers',
- 'mesa-drm', 'mesa-mesa', 'mesa-demos', 'mesa-glut', 'mesa-glu',
- '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-xvidtune',
- 'app-xvinfo',
- 'app-xwininfo',
- ]
-# libGL was not easily cross-compilable, can probably be removed from this list now
-# some modules don't make much sense to build for mingw64
-# some modules are provided with xming, so can be ported with some work...
-
-build_policy = 'updated-deps'
-if 'TINDERBOX' in os.environ:
- nopoison = True
- quiet_mode = True
-
-#
-os.environ['BUILD'] = 'x86_64-pc-cygwin'
+cross_target = "cross to MINGW64 i686"
os.environ['HOST'] = 'i686-w64-mingw32'
-# All source modules will be here after the checkout
-checkoutroot = '/jhbuild/checkout'
-
-# All build 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')
-
-os.environ['ACLOCAL'] = 'aclocal -I ' + os.path.join(prefix, 'share', 'aclocal')
-os.environ['PKG_CONFIG_PATH'] = os.path.join(prefix, 'lib', 'pkgconfig') + ':' + os.path.join(prefix, 'share', 'pkgconfig')
-# do not search in the host pkgconfig libdir
-os.environ['PKG_CONFIG_LIBDIR'] = '/usr/i686-w64-mingw32/sys-root/mingw/lib/pkgconfig'
-#os.environ['PKG_CONFIG_DEBUG_SPEW'] = '1'
-os.environ['CC'] = 'ccache i686-w64-mingw32-gcc'
-os.environ['CXX'] = 'ccache i686-w64-mingw32-g++'
-os.environ['CC_FOR_BUILD'] = 'ccache gcc'
-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 vars to help some tests find things...
-os.environ['JHBUILD_CHECKOUTROOT'] = checkoutroot
-os.environ['JHBUILD_BUILDROOT'] = buildroot
-os.environ['JHBUILD_PREFIX'] = prefix
-
-autogenargs = '--cache-file=' + os.path.join('/jhbuild', os.environ['HOST'], 'configure-cache')
-autogenargs += ' --build='+os.environ['BUILD']
-autogenargs += ' --host='+os.environ['HOST']
-
-# ipv6
-# need to compile with WINVER of at least XP for getaddrinfo(), freeaddrinfo()
-#autogenargs += ' --enable-ipv6'
-#os.environ['CFLAGS'] += ' -DWINVER=0x0501'
-
-module_autogenargs['xserver'] = autogenargs + ' -disable-glx'
-module_autogenargs['xserver'] = module_autogenargs['xserver'] + ' --with-builderstring="Tag: `cd ' + checkoutroot + '/xorg/xserver ; git describe | tr -d \\n`"'
-module_autogenargs['xserver'] = module_autogenargs['xserver'] + ' CFLAGS="-Wno-error=implicit-function-declaration ' + os.environ['CFLAGS'] + '"'
-
-module_autogenargs['xkeyboard-config'] = autogenargs + ' --with-xkb-rules-symlink=xorg'
-module_autogenargs['fontconfig'] = autogenargs + ' --enable-libxml2'
-
-# must put pthread into LIBS when building pthread-stubs, as weak cleverness won't work...
-os.environ['LIBS'] = '-lpthread'
-
-# do not start xvfb for any testmodules
-noxvfb = True
-
-# can't run 'make check' when cross-compiling
-makecheck = False
-
-# 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'
+# and include common stuff
+execfile('jhbuildrc.include')
diff --git a/jhbuildrc.include b/jhbuildrc.include
new file mode 100644
index 0000000..ee60579
--- /dev/null
+++ b/jhbuildrc.include
@@ -0,0 +1,289 @@
+#
+# 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',
+ '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-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:
+ 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
+
+# must put pthread into LIBS when building pthread-stubs, as weak cleverness won't work...
+#if 'mingw' in os.environ['HOST']:
+# os.environ['LIBS'] = '-lpthread'
+
+# 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'
+
+#
+# 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-xfake --disable-xfbdev --enable-xorg --enable-xwin --disable-glx-tls --enable-xf86bigfont'
+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['xserver'] = module_autogenargs['xserver'] + ' CFLAGS="-Wno-error=implicit-function-declaration ' + os.environ['CFLAGS'] + '"'
+
+module_autogenargs['xkeyboard-config'] = autogenargs + ' --with-xkb-rules-symlink=xorg'
+
+module_autogenargs['fontconfig'] = autogenargs + ' --enable-libxml2'
+
+module_autogenargs['libXfont'] = autogenargs + ' --disable-static'
+
+# build xlib-based libGL
+#module_autogenargs['mesa-mesa'] = autogenargs + ' --with-gallium-drivers=swrast --disable-dri --enable-osmesa --enable-xlib-glx'
+# build libGL which supports both direct swrast and indirect
+module_autogenargs['mesa-mesa'] = autogenargs + ' --disable-xa --with-gallium-drivers=swrast --disable-dri3 --enable-egl --enable-osmesa --enable-shared --disable-static --enable-driglx-direct'
+
+# xf86-video-dummy config check needs fixing to default to auto, not yes
+module_autogenargs['xf86-video-dummy'] = autogenargs + ' --disable-dga'
+
+#
+#
+#
+
+# 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
diff --git a/jhbuildrc.x86_64-pc-cygwin b/jhbuildrc.x86_64-pc-cygwin
index d666cbf..ed3553a 100644
--- a/jhbuildrc.x86_64-pc-cygwin
+++ b/jhbuildrc.x86_64-pc-cygwin
@@ -1,123 +1,10 @@
#
-# jhbuildrc for building on cygwin64
+# jhbuildrc
+# cross build to x86_64-w64-mingw32 (Cygwin 64bit)
#
-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
-# all drivers apart from xf86-video-dummy and xf86-video-nested
-skip = [ 'applewmproto', 'libAppleWM',
- 'videoproto', 'xf86dgaproto', 'xf86driproto', 'xf86vidmodeproto', 'dri2proto', 'dri3proto',
- 'libXv', 'libXvMC', 'libXxf86dga', 'libXxf86dga', 'libXxf86vm', 'libxshmfence', 'libxkbui',
- 'libevdev', 'libpciaccess',
- 'mesa-drm',
- 'app-xdriinfo', 'app-xgamma', 'app-xfs', 'app-xvidtune', 'app-xvinfo',
- 'glamor',
- 'xf86-input-acecad',
- 'xf86-input-aiptek',
- 'xf86-input-evdev',
- 'xf86-input-joystick',
- 'xf86-input-keyboard',
- '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' ]
-
-build_policy = 'updated-deps'
-
-os.environ['BUILD'] = 'i686-pc-cygwin'
+cross_target = "cross to CYGWIN x86_64"
os.environ['HOST'] = 'x86_64-pc-cygwin'
-# source checkout, build and install directories
-checkoutroot = '/jhbuild/checkout'
-buildroot = os.path.join('/jhbuild', os.environ['HOST'], 'build')
-prefix = os.path.join('/jhbuild', os.environ['HOST'], 'install')
-
-os.environ['CC'] = 'ccache x86_64-pc-cygwin-gcc'
-os.environ['CXX'] = 'ccache x86_64-pc-cygwin-g++'
-os.environ['CC_FOR_BUILD'] = 'ccache gcc'
-
-#configuration
-os.environ['ACLOCAL'] = 'aclocal -I ' + os.path.join(prefix, 'share', 'aclocal')
-# should search in /usr/share/pkgconfig ???
-os.environ['PKG_CONFIG_PATH'] = os.path.join(prefix, 'lib', 'pkgconfig') + ':' + os.path.join(prefix, 'share', 'pkgconfig')
-# do not search in the host pkgconfig libdir
-os.environ['PKG_CONFIG_LIBDIR'] = '/usr/x86_64-pc-cygwin/sys-root/usr/lib/pkgconfig'
-os.environ['INSTALL'] = '/usr/local/bin/install-check'
-os.environ['CFLAGS'] = '-g -O0 -fdiagnostics-show-option'
-os.environ['JHBUILD_CHECKOUTROOT'] = checkoutroot
-os.environ['JHBUILD_BUILDROOT'] = buildroot
-os.environ['JHBUILD_PREFIX'] = prefix
-# don't use host icu_config
-os.environ['ICU_CONFIG'] = 'no'
-# don't use host llvm_config
-os.environ['LLVM_CONFIG'] = 'no'
-
-autogenargs = '--cache-file=' + os.path.join('/jhbuild', os.environ['HOST'], 'configure-cache')
-autogenargs += ' --build='+os.environ['BUILD']
-autogenargs += ' --host='+os.environ['HOST']
-
-module_autogenargs['xserver'] = autogenargs + ' --disable-unit-tests' + ' --disable-xvfb --disable-xnest --disable-dmx --enable-kdrive --disable-xephyr --disable-xfake --disable-xfbdev --disable-xorg --enable-xwin --disable-glx --enable-windowswm=auto'
-module_autogenargs['xserver'] = module_autogenargs['xserver'] + ' --with-khronos-spec-dir=/usr/share/opengl/spec'
-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['libXfont'] = autogenargs + ' --disable-fc'
-
-# want to test xlib based libGL
-module_autogenargs['libGL'] = autogenargs + ' --with-gallium-drivers=swrast --disable-dri -enable-osmesa --enable-xlib-glx ac_cv_path_LLVM_CONFIG=no'
-
-module_autogenargs['xf86-video-dummy'] = autogenargs + ' --disable-dga'
-
-#
-module_autogenargs['harfbuzz'] = autogenargs + ' ac_cv_header_usp10_h=no ac_cv_header_windows_h=no ac_cv_func__setmode=no'
-
-# cross-compiling autoconf tests
-os.environ['xorg_cv_malloc0_returns_null'] = 'no'
+# and include common stuff
+execfile('jhbuildrc.include')
diff --git a/jhbuildrc.x86_64-w64-mingw32 b/jhbuildrc.x86_64-w64-mingw32
new file mode 100644
index 0000000..97f8daf
--- /dev/null
+++ b/jhbuildrc.x86_64-w64-mingw32
@@ -0,0 +1,10 @@
+#
+# jhbuildrc
+# cross build to x86_64-w64-mingw32 (MinGW-w64 64bit)
+#
+
+cross_target = "cross to MINGW64 x86_64"
+os.environ['HOST'] = 'x86_64-w64-mingw32'
+
+# and include common stuff
+execfile('jhbuildrc.include')