From 7353c8777856a6a2b6235cfe4854faa33e6a7636 Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Sat, 31 Oct 2020 14:35:50 +0200 Subject: [PATCH] mu: avoid some linker errors on MacOS --- configure.ac | 33 +++++++++++++++++++++------------ guile/mu-guile-message.c | 4 +++- guile/mu-guile-message.h | 3 +-- 3 files changed, 25 insertions(+), 15 deletions(-) diff --git a/configure.ac b/configure.ac index cc43f43d..83992b0f 100644 --- a/configure.ac +++ b/configure.ac @@ -53,6 +53,12 @@ AX_CXX_COMPILE_STDCXX_14 m4_ifdef([AX_COMPILER_FLAGS],[AX_COMPILER_FLAGS(,,[yes],${extra_flags})]) AX_VALGRIND_CHECK +# i.e,., do we hgave -z muldefs?, if not (MacOS), we can't +# build the guile backend +AX_CHECK_LINK_FLAG([-allow-multiple-definition])dnl +AM_CONDITIONAL([LD_ALLOW_MULTIPLE_DEFINITION], + [test "x$ax_cv_check_ldflags___allow_multiple_definition" = xyes])dnl + LT_INIT AX_CODE_COVERAGE @@ -214,18 +220,21 @@ AM_CONDITIONAL(BUILD_GUI,[test "x$have_webkit" = "xyes" -a "x$have_gtk" = "xyes" ############################################################################### # build with guile 3.0/2.2 when available and not disabled. AC_ARG_ENABLE([guile], AS_HELP_STRING([--disable-guile],[Disable guile])) -AS_IF([test "x$enable_guile" != "xno"],[ - PKG_CHECK_MODULES(GUILE, [guile-3.0], [have_guile=yes],[ - PKG_CHECK_MODULES(GUILE, [guile-2.2], [have_guile=yes], [have_guile=no])]) - AS_IF([test "x$have_guile" = "xyes"],[ - GUILE_PKG([3.0 2.2]) - GUILE_PROGS - GUILE_FLAGS - AC_DEFINE_UNQUOTED([GUILE_BINARY],"$GUILE",[guile binary]) - AC_DEFINE(BUILD_GUILE,[1], [Do we support Guile?]) - AC_SUBST(GUILE_SNARF, [guile-snarf]) - guile_version=$($PKG_CONFIG guile-$GUILE_EFFECTIVE_VERSION --modversion) - ]) +AM_COND_IF([LD_ALLOW_MULTIPLE_DEFINITION],[ + AS_IF([test "x$enable_guile" != "xno"],[ + PKG_CHECK_MODULES(GUILE, [guile-3.0], [have_guile=yes],[ + PKG_CHECK_MODULES(GUILE, [guile-2.2], [have_guile=yes], [have_guile=no])]) + AS_IF([test "x$have_guile" = "xyes"],[ + GUILE_PKG([3.0 2.2]) + GUILE_PROGS + GUILE_FLAGS + AC_DEFINE_UNQUOTED([GUILE_BINARY],"$GUILE",[guile binary]) + AC_DEFINE(BUILD_GUILE,[1], [Do we support Guile?]) + AC_SUBST(GUILE_SNARF, [guile-snarf]) + guile_version=$($PKG_CONFIG guile-$GUILE_EFFECTIVE_VERSION --modversion) + ]) + ])],[ + AM_MSG_NOTICE(["no guile: need muldef support"]) ]) AM_CONDITIONAL(BUILD_GUILE,[test "x$have_guile" = "xyes"]) ############################################################################### diff --git a/guile/mu-guile-message.c b/guile/mu-guile-message.c index 04a16694..c081f33f 100644 --- a/guile/mu-guile-message.c +++ b/guile/mu-guile-message.c @@ -1,5 +1,5 @@ /* -** Copyright (C) 2011-2013 Dirk-Jan C. Binnema +** Copyright (C) 2011-2020 Dirk-Jan C. Binnema ** ** This program is free software; you can redistribute it and/or modify it ** under the terms of the GNU General Public License as published by the @@ -21,6 +21,8 @@ #include #endif /*HAVE_CONFIG_H*/ +#include "mu-guile-message.h" + #include #include diff --git a/guile/mu-guile-message.h b/guile/mu-guile-message.h index 411644ea..bde81293 100644 --- a/guile/mu-guile-message.h +++ b/guile/mu-guile-message.h @@ -1,5 +1,5 @@ /* -** Copyright (C) 2011-2013 Dirk-Jan C. Binnema +** Copyright (C) 2011-2020 Dirk-Jan C. Binnema ** ** This program is free software; you can redistribute it and/or modify it ** under the terms of the GNU General Public License as published by the @@ -33,7 +33,6 @@ G_BEGIN_DECLS */ void* mu_guile_message_init (void *data); - G_END_DECLS #endif /*__MU_GUILE_MESSAGE_H__*/