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 # It accepts an optional argument for specifying the target
14 # architecture. Use "win32" (or omit the argument altogether)
15 # for a 32 bit build, use "win64" for a 64 bit build.
24 arch
=x86_64-w64-mingw32
28 echo "Invalid argument"
29 echo "Usage: $0 [win32|win64]"
34 # This script only works in the root dir or in a VPATH build
35 # one level under the root dir
36 if [ -x .
/configure
]; then
38 elif [ -x ..
/configure
]; then
42 # Step 1: cross-build ADG for $arch
43 # Execute the scripts inside a subshell so there will be
44 # no visible environment changes from outside.
46 # The configure scripts provided by the aur-fedora-mingw
47 # found at http://github.com/ntd/aur-fedora-mingw are intended to
48 # be used from makepkg: let us adapt them for external usage
49 CHOST
=$
($tardir/build
/config.guess
)
51 [ -z "$srcdir" ] && srcdir
=/tmp
52 srcdir
="$srcdir/$(whoami)/adg-wine"
55 # Source the wrapper so the environment set by the configure script
56 # is retained for the next make call
57 MINGW_EXTRA_CFLAGS
='-mwindows'
58 source /usr
/bin
/$arch-configure "$tardir" \
65 --enable-introspection \
66 --disable-test-framework \
72 # Step 2: create the installer
73 # Force empty flags because the cached ones are intended for to be
74 # consumed by step 1 (cross-build), not by step 2 (straight build).
75 make -j installer CPPFLAGS
= CFLAGS
= LDFLAGS
=