From 11448c08dfb7d10da52a38d469c0aa2888959494 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Wed, 3 Dec 2014 13:19:41 +0100 Subject: made worker compile on Windows (with glib), doesn't work yet --- INSTALL | 4 ++++ src/NMakefile | 15 ++++++++++----- src/worker.c | 6 ++++-- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/INSTALL b/INSTALL index 0fd38f2..567d050 100644 --- a/INSTALL +++ b/INSTALL @@ -96,6 +96,10 @@ Building on Windows # build # copy *.h to Include\json-c directory # copy static *.lib from windows to lib + +* glib2 + + # Get the GTK+ 3.x all in one package * biruda diff --git a/src/NMakefile b/src/NMakefile index 8809f59..5da8fef 100644 --- a/src/NMakefile +++ b/src/NMakefile @@ -5,7 +5,7 @@ CONFUSE_DIR = C:\develop\confuse-2.7 PTHREADS_W32_DIR = C:\develop\pthreads-w32-2-9-1-release NANOMSG_DIR = C:\develop\nanomsg-0.4-beta JSON_C_DIR = C:\develop\json-c -GLIB2_DIR = C:\develop\glib-2.34.4-win32 +GTK3_BUNDLE_DIR = C:\develop\gtk+-bundle_3.6.4-20130921_win32 GENGETOPT = $(CYGWIN_DIR)\usr\local\bin\gengetopt.exe @@ -21,18 +21,19 @@ INCLUDE_DIRS = \ /I$(PTHREADS_W32_DIR) \ /I$(NANOMSG_DIR)\include \ /I$(JSON_C_DIR)\include \ - /I$(GLIB2_DIR)\include\glib-2.0 \ - /I$(GLIB2_DIR)\lib\glib-2.0\include + /I$(GTK3_BUNDLE_DIR)\include\glib-2.0 \ + /I$(GTK3_BUNDLE_DIR)\lib\glib-2.0\include LIB_DIRS = \ /LIBPATH:$(CONFUSE_DIR)\lib \ /LIBPATH:$(PTHREADS_W32_DIR) \ /LIBPATH:$(NANOMSG_DIR)\lib \ - /LIBPATH:$(JSON_C_DIR)\lib + /LIBPATH:$(JSON_C_DIR)\lib \ + /LIBPATH:$(GTK3_BUNDLE_DIR)\lib CLFLAGS = /TP /MDd /W2 /WX /nologo /O2 $(INCLUDE_DIRS) LINKFLAGS = /nologo $(LIB_DIRS) -LIBS = libConfuse.lib pthreadVC2d.lib nanomsg.lib json-c.lib Ws2_32.lib +LIBS = libConfuse.lib pthreadVC2d.lib nanomsg.lib json-c.lib Ws2_32.lib glib-2.0.lib .SUFFIXES: .c .obj .exe @@ -67,5 +68,9 @@ run: all @-copy $(CONFUSE_DIR)\bin\libConfuse.dll . @-copy $(PTHREADS_W32_DIR)\pthreadVC2d.dll . @-copy $(NANOMSG_DIR)\bin\nanomsg.dll . + @-copy "$(GTK3_BUNDLE_DIR)\bin\libglib-2.0-0.dll" . + @-copy "$(GTK3_BUNDLE_DIR)\bin\libintl-8.dll" . + @-copy "$(GTK3_BUNDLE_DIR)\bin\libiconv-2.dll" . + @-copy "$(GTK3_BUNDLE_DIR)\bin\pthreadGC2.dll" . @-biruda -c biruda.conf -p diff --git a/src/worker.c b/src/worker.c index 9f14dfa..adb3083 100644 --- a/src/worker.c +++ b/src/worker.c @@ -4,6 +4,8 @@ #include "port.h" +#include "pthread.h" + #include #include @@ -141,9 +143,9 @@ void worker_terminate( worker_t *worker ) direct_glib_execution_worker_data_t *wed = (direct_glib_execution_worker_data_t *)worker->execution_data; #ifndef _WIN32 - kill( wed->pid, SIGTERM ); + (void)kill( wed->pid, SIGTERM ); #else -#error TODO kill on Windows + (void)TerminateProcess( wed->pid, 0 ); #endif worker->state = WORKER_STATE_STOPPED; free( worker->execution_data ); -- cgit v1.2.3-54-g00ecf