--DIPSEC_DIR=\"${ipsecdir}\" \
--DIPSEC_LIB_DIR=\"${ipseclibdir}\" \
--DPLUGINDIR=\"${plugindir}\" \
--DSTRONGSWAN_CONF=\"${strongswan_conf}\" \
-@COVERAGE_CFLAGS@
+ @COVERAGE_CFLAGS@
+
+AM_LDFLAGS = \
+ -no-undefined
+
+AM_YFLAGS = -v -d
+
+if USE_WINDOWS
+ libstrongswan_la_LIBADD += -lws2_32 -lpsapi
+ libstrongswan_la_SOURCES += \
+ threading/windows/thread.c \
+ threading/windows/thread_value.c \
+ threading/windows/mutex.c \
+ threading/windows/rwlock.c \
+ threading/windows/spinlock.c \
+ threading/windows/semaphore.c \
+ utils/compat/windows.c
+else
+ libstrongswan_la_LIBADD += $(PTHREADLIB)
+endif
+
+if USE_DBGHELP
+ libstrongswan_la_LIBADD += -ldbghelp
+ AM_CPPFLAGS += -DHAVE_DBGHELP
+endif