summaryrefslogtreecommitdiff
path: root/net/samba4/files/patch-source3__wscript
blob: 40d2350ff707680a6cf6da254b71cb0a096df70e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
--- ./source3/wscript.orig	2013-10-07 08:49:10.000000000 +0000
+++ ./source3/wscript	2013-11-18 22:45:12.808702339 +0000
@@ -35,6 +35,7 @@
     opt.SAMBA3_ADD_OPTION('utmp')
     opt.SAMBA3_ADD_OPTION('pthreadpool', with_name="enable", without_name="disable", default=True)
     opt.SAMBA3_ADD_OPTION('avahi', with_name="enable", without_name="disable")
+    opt.SAMBA3_ADD_OPTION('dnssd', with_name="enable", without_name="disable")
     opt.SAMBA3_ADD_OPTION('iconv')
     opt.SAMBA3_ADD_OPTION('acl-support')
     opt.SAMBA3_ADD_OPTION('dnsupdate')
@@ -312,7 +312,9 @@
 
     # Check if the compiler will optimize out functions
     conf.CHECK_CODE('''
-if (0) {
+char s = "string";
+int len = 6;
+if (sizeof(s) != len && sizeof(s) != sizeof(char *)) {
     this_function_does_not_exist();
 } else {
     return 1;
@@ -502,7 +504,7 @@
             conf.CHECK_CODE('struct aiocb a; return aio_return(&a);', 'HAVE_AIO_RETURN', msg='Checking for aio_return', headers='aio.h', lib='aio rt')
             conf.CHECK_CODE('struct aiocb a; return aio_error(&a);', 'HAVE_AIO_ERROR', msg='Checking for aio_error', headers='aio.h', lib='aio rt')
             conf.CHECK_CODE('struct aiocb a; return aio_cancel(1, &a);', 'HAVE_AIO_CANCEL', msg='Checking for aio_cancel', headers='aio.h', lib='aio rt')
-            conf.CHECK_CODE('struct aiocb a; struct timespec t; return aio_suspend(&a, 1, &t);', 'HAVE_AIO_SUSPEND', msg='Checking for aio_suspend', headers='aio.h', lib='aio rt')
+            conf.CHECK_CODE('const struct aiocb * const a[1]; struct timespec t; return aio_suspend(a, 1, &t);', 'HAVE_AIO_SUSPEND', msg='Checking for aio_suspend', headers='aio.h', lib='aio rt')
         if not conf.CONFIG_SET('HAVE_AIO'):
             conf.DEFINE('HAVE_NO_AIO', '1')
     else:
@@ -812,6 +813,17 @@
         conf.SET_TARGET_TYPE('avahi-common', 'EMPTY')
         conf.SET_TARGET_TYPE('avahi-client', 'EMPTY')
 
+    if Options.options.with_dnssd:
+        conf.env.with_dnssd = True
+        if not conf.CHECK_HEADERS('dns_sd.h'):
+            conf.env.with_dnssd = False
+        if not conf.CHECK_FUNCS_IN('DNSServiceRegister', 'dns_sd'):
+            conf.env.with_dnssd = False
+        if conf.env.with_dnssd:
+            conf.DEFINE('WITH_DNSSD_SUPPORT', 1)
+    else:
+        conf.SET_TARGET_TYPE('dns_sd', 'EMPTY')
+
     if Options.options.with_iconv:
         conf.env.with_iconv = True
         if not conf.CHECK_FUNCS_IN('iconv_open', 'iconv', headers='iconv.h'):
@@ -1670,26 +1670,8 @@
 
     if PTHREAD_LDFLAGS == 'error':
         if conf.CHECK_FUNCS_IN('pthread_attr_init', 'pthread'):
-            PTHREAD_CFLAGS='-D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS'
-            PTHREAD_LDFLAGS='-lpthread'
-    if PTHREAD_LDFLAGS == 'error':
-        if conf.CHECK_FUNCS_IN('pthread_attr_init', 'pthreads'):
-            PTHREAD_CFLAGS='-D_THREAD_SAFE'
-            PTHREAD_LDFLAGS='-lpthreads'
-    if PTHREAD_LDFLAGS == 'error':
-        if conf.CHECK_FUNCS_IN('pthread_attr_init', 'c_r'):
-            PTHREAD_CFLAGS='-D_THREAD_SAFE -pthread'
+            PTHREAD_CFLAGS='-pthread'
             PTHREAD_LDFLAGS='-pthread'
-    if PTHREAD_LDFLAGS == 'error':
-        if conf.CHECK_FUNCS('pthread_attr_init'):
-            PTHREAD_CFLAGS='-D_REENTRANT'
-            PTHREAD_LDFLAGS='-lpthread'
-    # especially for HP-UX, where the CHECK_FUNC macro fails to test for
-    # pthread_attr_init. On pthread_mutex_lock it works there...
-    if PTHREAD_LDFLAGS == 'error':
-        if conf.CHECK_FUNCS_IN('pthread_mutex_lock', 'pthread'):
-            PTHREAD_CFLAGS='-D_REENTRANT'
-            PTHREAD_LDFLAGS='-lpthread'
 
     if PTHREAD_CFLAGS != 'error' and PTHREAD_LDFLAGS != 'error':
         conf.ADD_CFLAGS(PTHREAD_CFLAGS)
@@ -1719,8 +1701,8 @@
                                       auth_script vfs_readahead vfs_xattr_tdb vfs_posix_eadb
                                       vfs_streams_xattr vfs_streams_depot vfs_acl_xattr vfs_acl_tdb
                                       vfs_smb_traffic_analyzer vfs_preopen vfs_catia vfs_scannedonly
-				      vfs_media_harmony
-				      vfs_commit
+                                      vfs_media_harmony
+                                      vfs_commit
                                       vfs_crossrename vfs_linux_xfs_sgid
                                       vfs_time_audit idmap_autorid idmap_tdb2
                                       idmap_rid idmap_hash'''))
@@ -1733,7 +1715,7 @@
 
     if Options.options.enable_selftest or Options.options.developer:
         default_shared_modules.extend(TO_LIST('vfs_fake_acls'))
-        
+
 
     if conf.CONFIG_SET('AD_DC_BUILD_IS_ENABLED'):
         default_static_modules.extend(TO_LIST('pdb_samba_dsdb auth_samba4 vfs_dfs_samba4'))
@@ -1766,7 +1748,7 @@
         default_static_modules.extend(TO_LIST('charset_macosxfs'))
 
     if conf.CONFIG_SET('HAVE_GPFS'):
-	default_shared_modules.extend(TO_LIST('vfs_gpfs'))
+        default_shared_modules.extend(TO_LIST('vfs_gpfs'))
 
     if conf.CONFIG_SET('SAMBA_FAM_LIBS'):
         default_shared_modules.extend(TO_LIST('vfs_notify_fam'))