From b5719b821a88705aa27b2bba18e6aa7df2aaa483 Mon Sep 17 00:00:00 2001 From: Oneric Date: Sat, 21 Nov 2020 21:33:33 +0100 Subject: configure: respect user-LIBS while locating system libs This allows to eg supply an alternative math library via LIBS="-lmymath" ./configure (in case the system has a seperate libm) This also means user-supplied LIBS now end up in our pc's Libs.private, which is probably correct for most cases. In case this assumptions turns out to be wrong and your reading this after bisecting some obscure error, well sorry about that. To exclude user-LIBS from pkg_libs again, eg save OLDLIBS="$LIBS" before and then set pkg_libs="${LIBS#$OLDLIBS}" after locating system libs. --- configure.ac | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 9639112..82ce401 100644 --- a/configure.ac +++ b/configure.ac @@ -40,9 +40,7 @@ AC_ARG_ENABLE([large-tiles], AS_HELP_STRING([--enable-large-tiles], [use larger tiles in the rasterizer (better performance, slightly worse quality) @<:@default=disabled@:>@])) # Checks for available libraries and define corresponding C Macros -# and add packages to pkg-config for static linking -OLDLIBS="$LIBS" -LIBS= +# Start with system libs, then check everything else via pkg-config AS_IF([test "x$ac_cv_header_iconv_h" = xyes], [ ## 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 @@ -67,7 +65,6 @@ AC_SEARCH_LIBS([lrint], [m], [ AC_MSG_ERROR([Unable to locate math functions!]) ]) pkg_libs="$LIBS" -LIBS="$OLDLIBS $LIBS" ## Check for libraries via pkg-config PKG_CHECK_MODULES([FREETYPE], [freetype2 >= 9.10.3], [ -- cgit v1.2.3