diff --git a/Makefile b/Makefile index 74ccb00..c52bf06 100644 --- a/Makefile +++ b/Makefile @@ -32,14 +32,12 @@ ifdef LOCALEDIR DEFS += -DLOCALEDIR=\"$(BASEDIR)$(prefix)/share/locale\" endif -ifdef HAVE_LIBIDN2 -whois_LDADD += -lidn2 -DEFS += -DHAVE_LIBIDN2 -else -ifdef HAVE_LIBIDN -whois_LDADD += -lidn -DEFS += -DHAVE_LIBIDN -endif +ifeq ($(shell pkg-config --exists 'libidn2 >= 2.0.3' || echo NO),) +whois_LDADD += $(shell pkg-config --libs libidn2) +DEFS += -DHAVE_LIBIDN2 $(shell pkg-config --cflags libidn2) +else ifeq ($(shell pkg-config --exists 'libidn' || echo NO),) +whois_LDADD += $(shell pkg-config --libs libidn) +DEFS += -DHAVE_LIBIDN $(shell pkg-config --cflags libidn) endif ifdef HAVE_ICONV diff --git a/debian/rules b/debian/rules index 179a446..fa9c899 100755 --- a/debian/rules +++ b/debian/rules @@ -16,7 +16,7 @@ D := $(CURDIR)/debian/whois build: dh_testdir - $(MAKE) CONFIG_FILE="/etc/whois.conf" HAVE_LIBIDN=1 HAVE_ICONV=1 + $(MAKE) CONFIG_FILE="/etc/whois.conf" HAVE_ICONV=1 touch $@ clean: