lib/replace/wscript: add replacement for IPV6_V6ONLY on linux systems with broken...
authorStefan Metzmacher <metze@samba.org>
Sat, 24 Apr 2010 17:28:48 +0000 (19:28 +0200)
committerStefan Metzmacher <metze@samba.org>
Sat, 24 Apr 2010 18:30:23 +0000 (20:30 +0200)
This is needed on SLES8.

metze

lib/replace/wscript

index 63acf26062164942502a88b98ee31186ea7cf9f4..9f51431e8c9e14f269229046fd6d5d08c244a166 100644 (file)
@@ -99,6 +99,25 @@ def configure(conf):
                         'socket nsl', checklibc=True,
                         headers='sys/socket.h netinet/in.h arpa/inet.h netdb.h')
 
+    # Some old Linux systems have broken header files and
+    # miss the IPV6_V6ONLY define in netinet/in.h,
+    # but have it in linux/in6.h.
+    # We can't include both files so we just check if the value
+    # if defined and do the replacement in system/network.h
+    if not conf.CHECK_VARIABLE('IPV6_V6ONLY',
+                               headers='sys/socket.h netdb.h netinet/in.h'):
+        conf.CHECK_CODE('''
+                        #include <linux/in6.h>
+                        #if (IPV6_V6ONLY != 26)
+                        #error no IPV6_V6ONLY support on linux
+                        #endif
+                        int main(void) { return IPV6_V6ONLY; }
+                        ''',
+                        define='HAVE_LINUX_IPV6_V6ONLY_26',
+                        addmain=False,
+                        msg='Checking for IPV6_V6ONLY in linux/in6.h',
+                        local_include=False)
+
     conf.CHECK_CODE('''
                        struct sockaddr_storage sa_store;
                        struct addrinfo *ai = NULL;