From 0a97ba60f4f09558b0c2a4b8d2c09e6ff7bfd112 Mon Sep 17 00:00:00 2001 From: Nils Gillmann Date: Sun, 21 Oct 2018 17:48:50 +0000 Subject: libidn + libidn2 support, as proposed by WJ Liu / multiSnow in a github gist. Signed-off-by: Nils Gillmann --- src/util/Makefile.am | 12 +++++++++++- src/util/dnsparser.c | 6 +++++- 2 files changed, 16 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/util/Makefile.am b/src/util/Makefile.am index b0f45b1da..165d41d01 100644 --- a/src/util/Makefile.am +++ b/src/util/Makefile.am @@ -122,12 +122,22 @@ libgnunetutil_la_SOURCES = \ tun.c \ speedup.c speedup.h +if HAVE_LIBIDN + LIBIDN= -lidn +else + LIBIDN= + +if HAVE_LIBIDN2 + LIBIDN2= -lidn2 +else + LIBIDN2= + libgnunetutil_la_LIBADD = \ $(GCLIBADD) $(WINLIB) \ $(LIBGCRYPT_LIBS) \ $(LTLIBICONV) \ $(LTLIBINTL) \ - -lltdl -lidn $(Z_LIBS) -lunistring $(XLIB) $(PTHREAD) + -lltdl $(LIBIDN) $(LIBIDN2) $(Z_LIBS) -lunistring $(XLIB) $(PTHREAD) libgnunetutil_la_LDFLAGS = \ $(GN_LIB_LDFLAGS) \ diff --git a/src/util/dnsparser.c b/src/util/dnsparser.c index 24f1b18cf..79d723f12 100644 --- a/src/util/dnsparser.c +++ b/src/util/dnsparser.c @@ -17,13 +17,17 @@ */ /** - * @file dns/dnsparser.c + * @file util/dnsparser.c * @brief helper library to parse DNS packets. * @author Philipp Toelke * @author Christian Grothoff */ #include "platform.h" +#if defined(HAVE_LIBIDN2) +#include +#elif defined(HAVE_LIBIDN) #include +#endif #if WINDOWS #include #endif -- cgit v1.2.3