'configure --enable-gnutls' does not stop if gnutls headers are not available. When explicitly enabling a configure option, I would expect configure to fail if it cannot be built in. Samba 4.0 and 4.1 are affected.
Could be converted like e.g. in commit 431eeef9 (build: fix --with-regedit to properly honour the yes/no/auto scheme).
# ./configure --enable-gnutls Checking for program krb5-config.heimdal : not found Checking for program krb5-config : /usr/bin/krb5-config Checking for gnutls >= 3.4.7 : not found Checking for gnutls >= 3.0.0s : not found Checking for gnutls >= 1.4.0 and broken versions : not found /root/samba-4.7.1/source4/lib/tls/wscript:51: error: Building the AD DC requires GnuTLS (eg libgnutls-dev, gnutls-devel) for ldaps:// support and for the BackupKey protocol Looks fixed in samba-4.7.1. Can you please check.
Fixed in master with a1f1db277a2c452b63b9fe2d67cabfe0df60223d for Samba 4.3 and backported into 4.2.0 as b39c15564554b3c7defc71ec900c6837593cec2b.