From: Andrew Borodin Date: Fri, 19 Oct 2012 10:14:57 +0000 (+0300) Subject: Ticket #2918: cygwin test failure. X-Git-Tag: 4.8.7~20^2 X-Git-Url: https://repo.or.cz/w/midnight-commander.git/commitdiff_plain/42499480bd91b73ffe267aad84b80b4eaf10f56d Ticket #2918: cygwin test failure. In tests/lib/mcconfig/Makefile.am tests/lib/vfs/Makefile.am tests/src/filemanager/Makefile.am AM_LDFLAGS = -Wl,-z,muldefs is used, but on cygwin the linker does not accept the "-z" option and AM_LDFLAGS = -Wl,--allow-multiple-definition is required instead. Signed-off-by: Andrew Borodin --- diff --git a/m4.include/mc-tests.m4 b/m4.include/mc-tests.m4 index 6aedd4b6e..184f1ce4e 100644 --- a/m4.include/mc-tests.m4 +++ b/m4.include/mc-tests.m4 @@ -22,4 +22,16 @@ AC_DEFUN([MC_UNIT_TESTS],[ [AC_MSG_WARN(['Check' utility not found. Check your environment])]) fi AM_CONDITIONAL(HAVE_TESTS, test x"$have_check" = "xyes") + + # on cygwin, the linker does not accept the "-z" option + case $host_os in + cygwin*) + TESTS_LDFLAGS="-Wl,--allow-multiple-definition" + ;; + *) + TESTS_LDFLAGS="-Wl,-z,muldefs" + ;; + esac + + AC_SUBST(TESTS_LDFLAGS) ]) diff --git a/tests/lib/mcconfig/Makefile.am b/tests/lib/mcconfig/Makefile.am index a0fc8a0ef..0894abc5b 100644 --- a/tests/lib/mcconfig/Makefile.am +++ b/tests/lib/mcconfig/Makefile.am @@ -2,7 +2,7 @@ AM_CPPFLAGS = -DWORKDIR=\"$(abs_builddir)\" AM_CFLAGS = -I$(top_srcdir) $(GLIB_CFLAGS) @CHECK_CFLAGS@ -AM_LDFLAGS = -Wl,-z,muldefs +AM_LDFLAGS = @TESTS_LDFLAGS@ LIBS=@CHECK_LIBS@ $(top_builddir)/lib/libmc.la diff --git a/tests/lib/vfs/Makefile.am b/tests/lib/vfs/Makefile.am index d48b182c0..9dbe46c00 100644 --- a/tests/lib/vfs/Makefile.am +++ b/tests/lib/vfs/Makefile.am @@ -2,7 +2,7 @@ AM_CPPFLAGS = -DTEST_SHARE_DIR=\"$(abs_srcdir)\" AM_CFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib/vfs $(GLIB_CFLAGS) @CHECK_CFLAGS@ -AM_LDFLAGS = -Wl,-z,muldefs +AM_LDFLAGS = @TESTS_LDFLAGS@ EXTRA_DIST = mc.charsets diff --git a/tests/src/filemanager/Makefile.am b/tests/src/filemanager/Makefile.am index 7eb7533f4..4d754b298 100644 --- a/tests/src/filemanager/Makefile.am +++ b/tests/src/filemanager/Makefile.am @@ -1,6 +1,6 @@ AM_CFLAGS = -I$(top_srcdir)/lib/vfs $(GLIB_CFLAGS) -I$(top_srcdir) @CHECK_CFLAGS@ -AM_LDFLAGS = -Wl,-z,muldefs +AM_LDFLAGS = @TESTS_LDFLAGS@ LIBS=@CHECK_LIBS@ \ $(top_builddir)/src/libinternal.la \