From 1fd8aea8806b6e2f3557c437b7249a211f5ea9a9 Mon Sep 17 00:00:00 2001 From: Oneric Date: Thu, 5 Nov 2020 23:29:05 +0100 Subject: configure: Explain iconv-check logic Commit 8bebabe4a62a6d54cdfecace59c382efa80a8e47 apparently added the libiconv_open check to support libraries like GNU libiconv defining their iconv-functions as a macro expanding to lib*. As this i not immediately obvious, add an explaining comment. Additionally AC_SEARCH_LIBS will first try to link the ptrogramm with only the current $LIBS and not add anything to $LIBS if that already succeeds, thus avoiding adding '-liconv' twice. --- configure.ac | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index e01a306..59a3d9c 100644 --- a/configure.ac +++ b/configure.ac @@ -46,6 +46,10 @@ AC_ARG_ENABLE([large-tiles], AS_HELP_STRING([--enable-large-tiles], OLDLIBS="$LIBS" LIBS= use_libiconv=false +## Some iconv libraries like GNU's libiconv define iconv_open as a macro to +## libiconv_open. As SEARCH_LIBS tests linking not compilation, check for +## libiconv_open first. SEARCH_LIBS is smart enough to not add -liconv a second +## time in case both versions are defined in the local libiconv. AC_SEARCH_LIBS([libiconv_open], [iconv], use_libiconv=true) AC_SEARCH_LIBS([iconv_open], [iconv], use_libiconv=true) AS_IF([test "x$use_libiconv" = xtrue], [ -- cgit v1.2.3