From 4b6a81eb4fd79198ceef813418aaa938190624ba Mon Sep 17 00:00:00 2001 From: Oleg Oshmyan Date: Wed, 14 Oct 2015 21:45:31 +0300 Subject: configure: don't add unnecessary libraries to PKG_LIBS_PRIVATE Library checks can succeed if the needed functions exist in libc and don't need any extra linker flags. Avoid adding unnecessary flags (which break static linking against libass) in this case. --- configure.ac | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 6bd96b6..8a2c7a8 100644 --- a/configure.ac +++ b/configure.ac @@ -22,10 +22,15 @@ AC_CHECK_HEADERS([stdint.h iconv.h]) AC_CHECK_FUNCS([strdup strndup]) # Checks for libraries. +# Add them to pkg-config for static linking. +OLDLIBS="$LIBS" +LIBS= use_libiconv=false AC_SEARCH_LIBS([libiconv_open], [iconv], use_libiconv=true) AC_SEARCH_LIBS([iconv_open], [iconv], use_libiconv=true) AC_CHECK_LIB([m], [fabs]) +pkg_libs="$LIBS" +LIBS="$OLDLIBS $LIBS" # Check for libraries via pkg-config AC_ARG_ENABLE([test], AS_HELP_STRING([--enable-test], @@ -219,11 +224,9 @@ AM_CONDITIONAL([HAVE_LIBPNG], [test x$libpng = xtrue]) AM_CONDITIONAL([ENABLE_PROFILE], [test x$enable_profile = xyes]) -# add libraries/packages to pkg-config for static linking -pkg_libs="-lm" +# add packages to pkg-config for static linking if test "$use_libiconv" = true; then AC_DEFINE(CONFIG_ICONV, 1, [use iconv]) - pkg_libs="${pkg_libs} -liconv" fi pkg_requires="freetype2 >= 9.10.3" pkg_requires="fribidi >= 0.19.0, ${pkg_requires}" -- cgit v1.2.3