>From d9faa4de57573be3bc3465c4a4c967185674b4b6 Mon Sep 17 00:00:00 2001 From: Darshit Shah Date: Tue, 5 May 2020 09:50:19 +0200 Subject: [PATCH 1/2] m4: Prevent adding -ltextstyle to LIBS by default 2020-05-05 Darshit Shah * m4/libtextstyle-hyperlink.m4: Use an action-if-true to prevent adding it to LIBS AC_SEARCH_LIBS will add the library to LIBS if action-if-true is empty. We prevent that by adding an action-if-true, and manually including LTLIBTEXTSTYLE in the libraries for Poke. This allows libpoke.so to be build without linking against libtextstle. --- ChangeLog | 8 ++++++++ m4/libtextstyle-hyperlink.m4 | 12 ++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index b9a5364..76ccedb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2020-05-05 Darshit Shah + + * m4/libtextstyle-hyperlink.m4: Use an action-if-true to prevent adding it to LIBS + AC_SEARCH_LIBS will add the library to LIBS if action-if-true is empty. + We prevent that by adding an action-if-true, and manually including + LTLIBTEXTSTYLE in the libraries for Poke. This allows libpoke.so to be + build without linking against libtextstle. + 2020-05-04 Jose E. Marchesi * libpoke/libpoke.c (complete_struct): Fix completion of normal diff --git a/m4/libtextstyle-hyperlink.m4 b/m4/libtextstyle-hyperlink.m4 index ae830dd..f6034e3 100644 --- a/m4/libtextstyle-hyperlink.m4 +++ b/m4/libtextstyle-hyperlink.m4 @@ -16,17 +16,17 @@ AC_DEFUN([AX_LIBTEXTSTYLE_HYPERLINK], [ AC_REQUIRE([gl_LIBTEXTSTYLE_OPTIONAL]) if test $HAVE_LIBTEXTSTYLE = yes; then - AC_CHECK_LIB([textstyle], [styled_ostream_set_hyperlink]) + AC_CHECK_LIB([textstyle], [styled_ostream_set_hyperlink], [ + AC_DEFINE([HAVE_TEXTSTYLE_HYPERLINK_SUPPORT], 1, + [Defined if libtextstyle has support for terminal hyperlinks]) + ]) has_hyper_support=${ac_cv_lib_textstyle_styled_ostream_set_hyperlink} else dnl If HAVE_LIBTEXTSTYLE is no, then we assume that the gnulib stubs of dnl textstyle are available. Those stubs implement the dummy functions dnl required and hence we can assume that hyperlink support is available has_hyper_support=yes - fi - - if test $has_hyper_support = yes; then - AC_DEFINE([HAVE_TEXTSTYLE_HYPERLINK_SUPPORT], 1, - [Defined if libtextstyle has support for terminal hyperlinks]) + AC_DEFINE([HAVE_TEXTSTYLE_HYPERLINK_SUPPORT], 2, + [Defined if libtextstyle has support for terminal hyperlinks]) fi ]) -- 1.8.3.1