]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Refactor libidn2 detection code
authorMichał Kępień <michal@isc.org>
Tue, 24 Nov 2020 13:51:51 +0000 (14:51 +0100)
committerMichał Kępień <michal@isc.org>
Tue, 24 Nov 2020 13:51:51 +0000 (14:51 +0100)
Make the code block handling the --with-libidn2=/path/to/libidn2 form of
the --with-libidn2 build-time option behave more similarly to the
PKG_CHECK_MODULES() macro.

configure.ac

index 9d6f57a9ee7d0853cec6979c7e1af12f061b8bd8..625bc08b083a39887fbd713baada599b30934de6 100644 (file)
@@ -1305,7 +1305,6 @@ AC_SUBST(CURL)
 #
 
 LIBIDN2_CFLAGS=
-LIBIDN2_LDFLAGS=
 LIBIDN2_LIBS=
 
 # [pairwise: --with-libidn2=yes, --without-libidn2]
@@ -1318,20 +1317,18 @@ AS_CASE([$with_libidn2],
        [no],   [],
        [*],    [AX_SAVE_FLAGS([libidn2])
                 LIBIDN2_CFLAGS="-I$with_libidn2/include"
-                LIBIDN2_LDFLAGS="-L$with_libidn2/lib"
-                CFLAGS="$LIBIDN2_CFLAGS $CFLAGS"
-                CPPFLAGS="$LIBIDN2_CFLAGS $CPPFLAGS"
-                LDFLAGS="$LIBIDN2_LDFLAGS $LDFLAGS"
+                LIBIDN2_LIBS="-L$with_libidn2/lib"
+                CFLAGS="$CFLAGS $LIBIDN2_CFLAGS"
+                LIBS="$LIBS $LIBIDN2_LIBS"
                 AC_CHECK_HEADERS([idn2.h],
                                  [],
                                  [AC_MSG_ERROR([idn2.h not found])])
                 AC_SEARCH_LIBS([idn2_to_ascii_lz], [idn2],
-                               [LIBIDN2_LIBS="$ac_cv_search_idn2_to_ascii_lz"
+                               [LIBIDN2_LIBS="$LIBIDN2_LIBS $ac_cv_search_idn2_to_ascii_lz"
                                 AC_DEFINE([HAVE_LIBIDN2], [1], [Define if libidn2 was found])],
                                [AC_MSG_ERROR([libidn2 requested, but not found])])
                AX_RESTORE_FLAGS([libidn2])])
 AC_SUBST([LIBIDN2_CFLAGS])
-AC_SUBST([LIBIDN2_LDFLAGS])
 AC_SUBST([LIBIDN2_LIBS])
 
 #