rwrap: Fix ns_name_compress detection.
authorAndreas Schneider <asn@samba.org>
Tue, 13 Jan 2015 14:13:40 +0000 (15:13 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Tue, 13 Jan 2015 15:57:11 +0000 (16:57 +0100)
On some platforms it is a macro and not a function. So we need to
check if the macro exists.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
lib/resolv_wrapper/wscript

index 797e90ad1d4507da02778c9cda68f6e03276fa09..7d9e21ab17ad536f026eb805cb594e34a3813fed 100644 (file)
@@ -74,7 +74,9 @@ def configure(conf):
         conf.CHECK_FUNCS_IN('res_search __res_search', 'resolv', checklibc=True)
         conf.CHECK_FUNCS_IN('res_nsearch __res_nsearch', 'resolv', checklibc=True)
 
-        conf.CHECK_FUNCS_IN('ns_name_compress', 'resolv', checklibc=True)
+        conf.CHECK_DECLS('ns_name_compress', headers='sys/types.h arpa/nameser.h')
+        if (conf.CONFIG_SET("HAVE_DECL_NS_NAME_COMPRESS")):
+            conf.DEFINE("HAVE_NS_NAME_COMPRESS", 1)
 
         # Create full path to resolv_wrapper
         srcdir = os.path.realpath(conf.srcdir)