From 4fc9d0566099930175a47a36891ca91ea7186fb4 Mon Sep 17 00:00:00 2001 From: Damien Stuart Date: Sun, 17 Jan 2016 13:09:15 -0500 Subject: [PATCH] Tweaks for MINGW builds --- common/Makefile.am | 5 +++++ configure.ac | 6 +++++- lib/Makefile.am | 6 ------ 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/common/Makefile.am b/common/Makefile.am index b1e5ffce..ae1e02bc 100644 --- a/common/Makefile.am +++ b/common/Makefile.am @@ -10,6 +10,11 @@ endif libfko_util_a_SOURCES = $(libfko_util_source_files) +if USE_MINGW +EXTRA_libfko_util_a_SOURCES = ../win32/getlogin.c ../win32/getlogin.h +libfko_util_a_LDFLAGS = -lwsock32 -lws2_32 +endif + AM_CPPFLAGS = $(GPGME_CFLAGS) -I $(top_srcdir)/common -I $(top_srcdir)/lib EXTRA_DIST = common.h netinet_common.h cunit_common.h cunit_common.c diff --git a/configure.ac b/configure.ac index 145929bf..4f84bda8 100644 --- a/configure.ac +++ b/configure.ac @@ -405,6 +405,8 @@ AC_SEARCH_LIBS([inet_addr], [nsl]) AM_CONDITIONAL(MINGW, false) +use_mingw=no + case "$host" in *-*-linux*) ;; @@ -413,10 +415,12 @@ case "$host" in ;; *-mingw32*) AC_DEFINE_UNQUOTED(MINGW,1,[This is a MinGW system]) - AM_CONDITIONAL(MINGW, true) + use_mingw=yes ;; esac +AM_CONDITIONAL(USE_MINGW, [test x$use_mingw = xyes]) + dnl Decide whether or not to build the client dnl want_client=yes diff --git a/lib/Makefile.am b/lib/Makefile.am index 16ce7161..54cb0cec 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -10,12 +10,6 @@ libfko_source_files = \ sha1.h sha2.c sha2.h sha3.c sha3.h fko_context.h fko_state.h \ gpgme_funcs.c gpgme_funcs.h -if MINGW -libfko_source_files += ./common/common.h ../common/fko_util.c ../common/fko_util.h \ - ../common/strlcat.c ../common/strlcpy.c ../win32/getlogin.c ../common/netinet_common.h \ - ../win32/getlogin.h -endif - if WANT_C_UNIT_TESTS libfko_la_LIBADD = $(top_builddir)/common/cunit_common.o noinst_PROGRAMS = fko_utests