From 5881989879e8bc9819c14c4ea8bd05b4d159be58 Mon Sep 17 00:00:00 2001 From: JP Ikaheimonen Date: Mon, 8 Jul 2013 09:48:24 -0400 Subject: [PATCH] Add MinGW32 libraries to executables Make configure.ac aware of MinGW, and set up a variable we can use in make files. Under MinGW, add platform specific libraries to all link commands. Signed-off-by: Mathieu Desnoyers --- configure.ac | 9 +++++++++ converter/Makefile.am | 5 +++++ formats/ctf/metadata/Makefile.am | 3 +++ 3 files changed, 17 insertions(+) diff --git a/configure.ac b/configure.ac index b21aa7ef..8a636075 100644 --- a/configure.ac +++ b/configure.ac @@ -37,6 +37,15 @@ AC_FUNC_MALLOC AC_FUNC_MMAP AC_CHECK_FUNCS([bzero gettimeofday munmap strtoul]) +# Check for MinGW32. +MINGW32=no +case $host in + *-*-mingw*) + MINGW32=yes;; +esac + +AM_CONDITIONAL([BABELTRACE_BUILD_WITH_MINGW], [test "x$MINGW32" = "xyes"]) + # Check for libuuid AC_CHECK_LIB([uuid], [uuid_generate], [ diff --git a/converter/Makefile.am b/converter/Makefile.am index de70313e..8ef71a23 100644 --- a/converter/Makefile.am +++ b/converter/Makefile.am @@ -29,3 +29,8 @@ endif if BABELTRACE_BUILD_WITH_LIBC_UUID babeltrace_log_LDADD += -lc endif + +if BABELTRACE_BUILD_WITH_MINGW +babeltrace_log_LDADD += -lrpcrt4 -lintl -liconv -lole32 -lpopt -lpthread +babeltrace_LDADD += -lrpcrt4 -lintl -liconv -lole32 -lpopt -lpthread +endif diff --git a/formats/ctf/metadata/Makefile.am b/formats/ctf/metadata/Makefile.am index b33ce553..69f71275 100644 --- a/formats/ctf/metadata/Makefile.am +++ b/formats/ctf/metadata/Makefile.am @@ -27,6 +27,9 @@ endif if BABELTRACE_BUILD_WITH_LIBC_UUID libctf_ast_la_LIBADD += -lc endif +if BABELTRACE_BUILD_WITH_MINGW +libctf_ast_la_LIBADD += -lrpcrt4 -lintl -liconv -lole32 -lpopt +endif noinst_PROGRAMS = ctf-parser-test ctf_parser_test_SOURCES = ctf-parser-test.c -- 2.34.1