From e330f7dccaa67bf1e2ccd36a3fa0ba9efba75885 Mon Sep 17 00:00:00 2001 From: Sam Thursfield Date: Wed, 6 Jul 2011 14:34:33 +0100 Subject: [PATCH] windows: generate MSVC import lib when possible --- Makefile.am | 5 +++++ configure.ac | 35 ++++++++++++++++++++++++++++++++--- libmoonshot/libmoonshot.def | 6 ++++++ 3 files changed, 43 insertions(+), 3 deletions(-) create mode 100644 libmoonshot/libmoonshot.def diff --git a/Makefile.am b/Makefile.am index e5454a5..57ea154 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 diff --git a/configure.ac b/configure.ac index 9afbc11..9d31a97 100644 --- a/configure.ac +++ b/configure.ac @@ -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 index 0000000..0819d1b --- /dev/null +++ b/libmoonshot/libmoonshot.def @@ -0,0 +1,6 @@ +LIBRARY libmoonshot-0.dll +EXPORTS + moonshot_error_free + moonshot_error_new + moonshot_get_default_identity + moonshot_get_identity -- 2.1.4