Use configure to find win32-specific tools
authorSam Thursfield <samthursfield@codethink.co.uk>
Mon, 23 May 2011 11:01:01 +0000 (12:01 +0100)
committerSam Thursfield <samthursfield@codethink.co.uk>
Mon, 23 May 2011 11:01:01 +0000 (12:01 +0100)
Makefile.am
configure.ac

index 21852f0..726c7fe 100644 (file)
@@ -99,18 +99,20 @@ if OS_WIN32
 icons:
        mkdir -p share/icons
        cp c:/build/share/icons/gnome/48x48/status/avatar-default.png share/icons
-       c:/tools/ImageMagick/convert.exe -background none c:/build/share/icons/gnome/scalable/actions/edit-clear-symbolic.svg -size 13x13 share/icons/edit-clear-symbolic.png
-       c:/tools/ImageMagick/convert.exe -background none c:/build/share/icons/gnome/scalable/actions/edit-find-symbolic.svg -size 13x13 share/icons/edit-find-symbolic.png
+       "${IMAGEMAGICK_CONVERT}" -background none c:/build/share/icons/gnome/scalable/actions/edit-clear-symbolic.svg -size 13x13 share/icons/edit-clear-symbolic.png
+       "${IMAGEMAGICK_CONVERT}" -background none c:/build/share/icons/gnome/scalable/actions/edit-find-symbolic.svg -size 13x13 share/icons/edit-find-symbolic.png
 
 
 ## 2. Installer. You must have the Windows Installer XML toolkit version 3.5
 ##    installed in its default path. Note that this requires at least .NET
-##    runtime with service packs 1 and 2.
+##    runtime with service packs 1 and 2. The installer picks up files from
+##    the build prefix and mingw dir; you must change these if you have them
+##    in different locations I'm afraid.
 
 installer: moonshot.msi
 
 moonshot.msi: windows/app.wxs
-       candle $<
-       light -b c:/build -b c:/tools/mingw -o moonshot.msi app.wixobj
+       "${WIX_CANDLE}" $<
+       "${WIX_LIGHT}" -b c:/build -b c:/tools/mingw -o moonshot.msi app.wixobj
 
 endif
index dde83cf..606cc23 100644 (file)
@@ -13,56 +13,78 @@ AM_INIT_AUTOMAKE([1.11 -Wall foreign subdir-objects tar-pax no-dist-gzip dist-xz
 AM_SILENT_RULES([yes])
 AM_MAINTAINER_MODE([enable])
 
-# Checks for programs.
-AC_PROG_CC
-AM_PROG_CC_C_O
-AM_PROG_VALAC([0.9])
-
-# Dependencies
-PKG_CHECK_MODULES(moonshot,[
-        atk >= 1.20
-        glib-2.0 >= 2.24
-        gobject-2.0 >= 2.24
-        gtk+-2.0 >= 2.20
-        $IPC
-])
-
-# Platform-specific checks
+# Platform checks
 AC_CANONICAL_HOST
 
 case "$host" in
   *-*-mingw*)
-    AC_PATH_MSRPC_MINGW([0.1.0], :,
-      AC_MSG_ERROR([
-*** msrpc-mingw 0.1.0 or better is required.]))
-
-    AC_PATH_PROG([MIDL], [midl], no, [$PATH$PATH_SEPARATOR/c/Program\ Files/Microsoft\ SDKs/Windows/v7.0/Bin])
-    if test "$MIDL" = "no"; then
-       AC_MSG_ERROR([
-*** Could not find the Microsoft interface compiler MIDL.EXE.
-*** This program is available as part of the MS Windows SDK, in
-*** the Win32 Development Tools package. If it is not in the PATH
-*** or its default location you may set the 'MIDL' environment
-*** variable to point to its location and rerun configure.])
-    fi
-
     win32=yes
     IPC_MODULE="msrpc-glib2-1.0"
-    PKG_CHECK_MODULES(IPC, [msrpc-glib2-1.0])
     ;;
   *)
     win32=no
     IPC_MODULE="dbus-glib-1"
-    PKG_CHECK_MODULES(IPC, [dbus-glib-1])
     ;;
 esac
 
-AC_SUBST(MIDL)
-
 AM_CONDITIONAL([OS_WIN32], [test "$win32" = "yes"])
 AM_CONDITIONAL([IPC_MSRPC], [test "$IPC_MODULE" = "msrpc-glib2-1.0"])
 AM_CONDITIONAL([IPC_DBUS], [test "$IPC_MODULE" = "dbus-glib-1"])
 
+# Checks for programs.
+AC_PROG_CC
+AM_PROG_CC_C_O
+AM_PROG_VALAC([0.9])
+
+if test "$IPC_MODULE" = "msrpc-glib2-1.0"; then
+  # MS RPC utilities
+  AC_PATH_MSRPC_MINGW([0.1.0], :,
+    AC_MSG_ERROR([
+*** msrpc-mingw 0.1.0 or better is required.]))
+
+  AC_PATH_PROG([MIDL], [midl], no,
+               [/c/Program\ Files/Microsoft\ SDKs/Windows/v7.0/Bin$PATH_SEPARATOR$PATH])
+  if test "$MIDL" = "no"; then
+     AC_MSG_ERROR([
+*** Could not find the Microsoft interface compiler MIDL.EXE.
+*** This program is available as part of the MS Windows SDK, in
+*** the Win32 Development Tools package. If it is not in the PATH
+*** or its default location you may set the 'MIDL' environment
+*** variable to point to its location and rerun configure.])
+  fi
+fi
+
+if test "$win32" = "yes"; then
+  # Other Windows-specific tools
+
+  # ImageMagick for the 'make icons' target. Watch that it doesn't pick up
+  # c:/windows/system32/convert.exe, which is nothing to do with ImageMagick
+  AC_PATH_PROG([IMAGEMAGICK_CONVERT], [convert], ,
+               [/c/Program\ Files/ImageMagick$PATH_SEPARATOR$PATH])
+
+  # Windows Installer XML tools
+  AC_PATH_PROG([WIX_CANDLE], [candle], ,
+               [/c/Program\ Files/Windows\ Installer\ XML\ v3.5/bin$PATH_SEPARATOR$PATH])
+  AC_PATH_PROG([WIX_LIGHT], [light], ,
+               [/c/Program\ Files/Windows\ Installer\ XML\ v3.5/bin$PATH_SEPARATOR$PATH])
+fi
+
+AC_SUBST(MIDL)
+AC_SUBST(IMAGEMAGICK_CONVERT)
+AC_SUBST(WIX_CANDLE)
+AC_SUBST(WIX_LIGHT)
+
+# Dependencies
+PKG_CHECK_MODULES(moonshot,[
+        atk >= 1.20
+        glib-2.0 >= 2.24
+        gobject-2.0 >= 2.24
+        gtk+-2.0 >= 2.20
+        $IPC
+])
+
+PKG_CHECK_MODULES(IPC, $IPC_MODULE)
+
 moonshot_CFLAGS="$moonshot_CFLAGS $IPC_CFLAGS"
 moonshot_LIBS="$moonshot_LIBS $IPC_LIBS"