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
examples_client_LDADD = ${top_builddir}/libmoonshot/libmoonshot.la
tests_basic_SOURCES = tests/basic.c
-tests_basic_CPPFLAGS = $(libmoonshot_CFLAGS) $(AM_CPPFLAGS)
+tests_basic_CPPFLAGS = $(moonshot_CFLAGS) $(AM_CPPFLAGS)
tests_basic_LDADD = ${top_builddir}/libmoonshot/libmoonshot.la $(moonshot_LIBS)
(Alternately you can fetch the source for the w32api package from
www.sourceforge.net/projects/mingw and apply the patch yourself)
-You will need to compile and install the msrpc-mingw package.
+You will need to compile and install the msrpc-mingw package, which wraps
+MIDL.EXE and the RPC API to make it usable from gcc.
+
+ git clone git://github.com/ssssam/msrpc-mingw.git
+ cd msrpc-mingw
+ MIDL=/c/Program\ Files/Microsoft SDKs/Windows/v7.0/bin/MIDL.exe ./waf configure --prefix=c:/build
+ ./waf
+ ./waf install
You can then build moonshot from the MSYS shell:
case "$host" in
*-*-mingw*)
win32=yes
- IPC_MODULE="msrpc-glib2-1.0"
+ SERVER_IPC_MODULE="msrpc-glib2-1.0"
+ CLIENT_IPC_MODULE="msrpc-mingw-1.0"
;;
*)
win32=no
- IPC_MODULE="dbus-glib-1"
+ SERVER_IPC_MODULE="dbus-glib-1"
+ CLIENT_IPC_MODULE="dbus-glib-1"
;;
esac
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"])
+AM_CONDITIONAL([IPC_MSRPC], [test "$SERVER_IPC_MODULE" = "msrpc-glib2-1.0"])
+AM_CONDITIONAL([IPC_DBUS], [test "$SERVER_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
+if test "$SERVER_IPC_MODULE" = "msrpc-glib2-1.0"; then
# MS RPC utilities
AC_PATH_MSRPC_MINGW([0.1.0], :,
AC_MSG_ERROR([
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)
glib-2.0 >= 2.24
gobject-2.0 >= 2.24
gtk+-2.0 >= 2.20
- $IPC_MODULE
+ $SERVER_IPC_MODULE
])
PKG_CHECK_MODULES(libmoonshot,[
- $IPC_MODULE
+ $CLIENT_IPC_MODULE
])
# i18n stuff
#define MOONSHOT_ENDPOINT_NAME "/org/janet/Moonshot"
#define MOONSHOT_INSTALL_PATH_KEY "Software\\Moonshot"
+void *__RPC_USER MIDL_user_allocate (size_t size) {
+ return malloc (size);
+}
+
+void __RPC_USER MIDL_user_free (void *data) {
+ free (data);
+}
static MoonshotError *moonshot_error_new_from_status (MoonshotErrorCode code,
DWORD status)
--- /dev/null
+LIBRARY libmoonshot-0.dll
+EXPORTS
+ moonshot_error_free
+ moonshot_error_new
+ moonshot_get_default_identity
+ moonshot_get_identity
* @subject_name_constraint_out: Set if @ca_certificate is set, otherwise %NULL.
* @subject_alt_name_constraint_out: Set if @ca_certificate is set, otherwise
* %NULL.
- * @error: Return location for a #MoonshotError, or %NULL.
+ * @error: Return location for a #MoonshotError.
*
* This function calls the Moonshot server to request an ID card. The server
* will be activated if it is not already running. The user interface will be
* constraints will be returned.
*
* Error reporting is handled by a simple mechanism similar to #GError. If
- * an error occurs, a #MoonshotError object will be stored at *@error, with
- * a code and message string. This must be freed using moonshot_error_free().
+ * an error occurs, as well as returning %FALSE a #MoonshotError object will
+ * be stored at *@error, with a code and message string. This must be freed
+ * using moonshot_error_free().
*
* Return value: %TRUE if an identity was successfully selected, %FALSE on
* failure.
* @subject_name_constraint_out: Set if @ca_certificate is set, otherwise %NULL.
* @subject_alt_name_constraint_out: Set if @ca_certificate is set, otherwise
* %NULL.
- * @error: Return location for a #MoonshotError, or %NULL.
+ * @error: Return location for a #MoonshotError.
*
* This function calls the Moonshot server to request the default identity
* (the one most recently used). Its semantics are otherwise the same as
&subject_alt_name_constraint,
error);
- if (success)
- g_print ("Got id: %s %s\n", nai, password);
+ /*if (success)
+ g_print ("Got id: %s %s\n", nai, password);*/
return GINT_TO_POINTER (success);
}
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/basic/connect", test_connect);
- //g_test_add_func ("/basic/multithread", test_multithread);
+ g_test_add_func ("/basic/multithread", test_multithread);
g_test_run ();
}