summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
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