adg: modernize geometry computation for radial dimensions
[adg.git] / build / build-win32
blobc0954f9643a7c6a9a436accac0acb8c93a84fb68
1 #!/bin/bash
3 # Builds a windows installer on a UNIX system. It depends
4 # on a lot of stuff such as wine, a proper MinGW toolchain
5 # and my GTK2/3 cross-compiled environment found at
6 # http://github.com/ntd/aur-fedora-mingw
8 # It supersedes the old configure scripts still distributed
9 # (build/configure-win32 and build/configure-win64) by
10 # properly cross-compiling the ADG project with
11 # gobject-introspection enabled.
13 # If this script has a trailing win64 (e.g. build-win64), set
14 # arch to x86_64-w64-mingw32, otherwise use i686-w64-mingw32
15 if [ "$0" = "${0%win64}" ]; then
16 arch=i686-w64-mingw32
17 else
18 arch=x86_64-w64-mingw32
21 # This script only works in the root dir or in a VPATH build
22 # one level under the root dir
23 if [ -x ./configure ]; then
24 tardir=.
25 elif [ -x ../configure ]; then
26 tardir=..
29 # Step 1: cross-build ADG for $arch
30 # Execute the scripts inside a subshell so there will be
31 # no visible environment changes from outside.
33 # The configure scripts provided by the aur-fedora-mingw
34 # found at http://github.com/ntd/aur-fedora-mingw are intended to
35 # be used from makepkg: let us adapt them for external usage
36 CHOST=$($tardir/build/config.guess)
37 srcdir="$TMPDIR"
38 [ -z "$srcdir" ] && srcdir=/tmp
39 srcdir="$srcdir/$(whoami)/adg-wine"
40 mkdir -p "$srcdir"
42 # Source the wrapper so the environment set by the configure script
43 # is retained for the next make call
44 MINGW_EXTRA_CFLAGS='-mwindows'
45 source /usr/bin/$arch-configure "$tardir" \
46 --prefix= \
47 --enable-shared \
48 --enable-static \
49 --enable-pango \
50 --disable-gtk-doc \
51 --with-gtk=gtk3 \
52 --enable-introspection \
53 --disable-test-framework \
54 "$@"
56 make -j
59 # Step 2: create the installer
60 # Force empty flags because the cached ones are intended for to be
61 # consumed by step 1 (cross-build), not by step 2 (straight build).
62 make -j installer CPPFLAGS= CFLAGS= LDFLAGS=