configure: add support for pkg-config detection of libidn
authorMark Brand <mabrand@mabrand.nl>
Fri, 25 Nov 2011 22:00:16 +0000 (23:00 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 25 Nov 2011 22:05:37 +0000 (23:05 +0100)
configure.ac

index 2ba6625..52158f1 100644 (file)
@@ -2377,6 +2377,15 @@ case "$LIBIDN" in
        fi
 
        if test "x$idn" != "xyes"; then
+         dnl check with pkg-config
+         PKG_CHECK_MODULES(LIBIDN_PC, libidn >= 0.0.0, [idn=yes], [idn=no])
+         if test "x$idn" = "xyes"; then
+            LIBS="$LIBS $LIBIDN_PC_LIBS"
+            CPPFLAGS="$CPPFLAGS $LIBIDN_PC_CFLAGS"
+         fi
+       fi
+
+       if test "x$idn" != "xyes"; then
           dnl check with default paths
           idn="yes"
           AC_CHECK_LIB(idn, idna_to_ascii_lz, ,