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
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
25 elif [ -x ..
/configure
]; then
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
)
38 [ -z "$srcdir" ] && srcdir
=/tmp
39 srcdir
="$srcdir/$(whoami)/adg-wine"
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" \
52 --enable-introspection \
53 --disable-test-framework \
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
=