windows: generate MSVC import lib when possible
authorSam Thursfield <samthursfield@codethink.co.uk>
Wed, 6 Jul 2011 13:34:33 +0000 (14:34 +0100)
committerSam Thursfield <samthursfield@codethink.co.uk>
Wed, 6 Jul 2011 13:34:33 +0000 (14:34 +0100)
Makefile.am
configure.ac
libmoonshot/libmoonshot.def [new file with mode: 0644]

index e5454a5..57ea154 100644 (file)
@@ -59,6 +59,11 @@ src_moonshot_CFLAGS = -mwindows
 AM_CPPFLAGS += -DOS_WIN32
 AM_VALAFLAGS += --define=OS_WIN32
 
+noinst_DATA = libmoonshot/libmoonshot.lib
+
+libmoonshot/libmoonshot.lib: libmoonshot/libmoonshot.def
+       "${MSVC_LIB}" -def:$< -out:$@ -machine:x86
+
 endif
 
 
index 9afbc11..9d31a97 100644 (file)
@@ -62,19 +62,48 @@ fi
 if test "$win32" = "yes"; then
   # Other Windows-specific tools
 
+  # LIB.EXE from MSVC to build an MSVC-compatible import library.
+  AC_PATH_PROG([MSVC_LIB], [lib], no)
+
+  if test "$MSVC_LIB" = "no"; then
+     AC_MSG_WARN([
+*** Could not find the Microsoft 'LIB.EXE' program. This is required
+*** to build the Visual C import library for libmoonshot. Use the
+*** MSVC_LIB environment variable to pass its location if this is
+*** outside the PATH.])
+  fi
+
+
   # 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], ,
+  AC_PATH_PROG([IMAGEMAGICK_CONVERT], [convert], no,
                [/c/Program\ Files/ImageMagick$PATH_SEPARATOR$PATH])
 
+  if test "$IMAGEMAGICK_CONVERT" = "no"; then
+     AC_MSG_WARN([
+*** Could not find ImageMagick convert.exe. This is required for the
+*** 'make icons' target. Use the IMAGEMAGICK_CONVERT environment
+*** variable to pass its location if this is outside the PATH.])
+  fi
+
+
   # Windows Installer XML tools
-  AC_PATH_PROG([WIX_CANDLE], [candle], ,
+  AC_PATH_PROG([WIX_CANDLE], [candle], no,
                [/c/Program\ Files/Windows\ Installer\ XML\ v3.5/bin$PATH_SEPARATOR$PATH])
-  AC_PATH_PROG([WIX_LIGHT], [light], ,
+  AC_PATH_PROG([WIX_LIGHT], [light], no,
                [/c/Program\ Files/Windows\ Installer\ XML\ v3.5/bin$PATH_SEPARATOR$PATH])
+
+  if test "$WIX_CANDLE" = "no" || test "$WIX_LIGHT" = "no"; then
+     AC_MSG_WARN([
+*** Could not find the Windows Installer XML tools. These are required
+*** for the 'make installer' target. Use the WIX_CANDLE and WIX_LIGHT
+*** environment variables to pass their locations if they are outside
+*** the PATH.])
+  fi
 fi
 
 AC_SUBST(MIDL)
+AC_SUBST(MSVC_LIB)
 AC_SUBST(IMAGEMAGICK_CONVERT)
 AC_SUBST(WIX_CANDLE)
 AC_SUBST(WIX_LIGHT)
diff --git a/libmoonshot/libmoonshot.def b/libmoonshot/libmoonshot.def
new file mode 100644 (file)
index 0000000..0819d1b
--- /dev/null
@@ -0,0 +1,6 @@
+LIBRARY libmoonshot-0.dll
+EXPORTS
+    moonshot_error_free
+    moonshot_error_new
+    moonshot_get_default_identity
+    moonshot_get_identity