summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNils Gillmann <ng0@n0.is>2018-10-21 17:48:50 +0000
committerChristian Grothoff <christian@grothoff.org>2018-10-25 12:01:28 +0200
commit0a97ba60f4f09558b0c2a4b8d2c09e6ff7bfd112 (patch)
treece9503de2771a0a41016c870014ff2ac108e8e7b /src
parent70b9b7a3845340c2ea67c115fd81215dee59e870 (diff)
libidn + libidn2 support, as proposed by WJ Liu / multiSnow in a github gist.
Signed-off-by: Nils Gillmann <ng0@n0.is>
Diffstat (limited to 'src')
-rw-r--r--src/util/Makefile.am12
-rw-r--r--src/util/dnsparser.c6
2 files changed, 16 insertions, 2 deletions
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 <idn2.h>
+#elif defined(HAVE_LIBIDN)
#include <idna.h>
+#endif
#if WINDOWS
#include <idn-free.h>
#endif