summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco d'Itri <md@linux.it>2018-09-09 00:59:49 +0200
committerMarco d'Itri <md@linux.it>2018-09-12 02:26:55 +0200
commit5fc64b5eba57177aa5956bfd0ba274e4782f8078 (patch)
tree02d559b4d103200b81c7b40dc32913b507734831
parent71cf1ca7e10b9f015d441bd4521436f7db8242ea (diff)
downloadwhois-5fc64b5eba57177aa5956bfd0ba274e4782f8078.tar.gz
mkpasswd: support the new libxcrypt 4.x
-rw-r--r--Makefile6
1 files changed, 4 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 608184d..01ae5ce 100644
--- a/Makefile
+++ b/Makefile
@@ -51,10 +51,12 @@ whois_OBJECTS += simple_recode.o
DEFS += -DHAVE_ICONV
endif
-ifdef HAVE_XCRYPT
+ifeq ($(shell $(PKG_CONFIG) --exists 'libxcrypt >= 4.1' || echo NO),)
+DEFS += -DHAVE_LINUX_CRYPT_GENSALT $(shell $(PKG_CONFIG) --cflags libcrypt)
+mkpasswd_LDADD += $(shell $(PKG_CONFIG) --libs libcrypt)
+else ifdef HAVE_XCRYPT
mkpasswd_LDADD += -lxcrypt
DEFS += -DHAVE_XCRYPT -DHAVE_LINUX_CRYPT_GENSALT
-else
ifdef HAVE_LINUX_CRYPT_GENSALT
# owl and openSUSE have crypt_gensalt(3) in the libc's libcrypt
DEFS += -DHAVE_LINUX_CRYPT_GENSALT