7 sys.path.insert(0, srcdir+"/buildtools/wafsamba")
8 import wafsamba, Options
11 opt.recurse('../lib/replace')
13 opt.recurse('../lib/nss_wrapper')
14 opt.recurse('../lib/socket_wrapper')
15 opt.recurse('../lib/uid_wrapper')
18 conf.define('PACKAGE_NAME', 'Samba')
19 conf.define('PACKAGE_STRING', 'Samba 3')
20 conf.define('PACKAGE_TARNAME', 'samba')
21 conf.define('PACKAGE_URL', '')
22 conf.define('PACKAGE_VERSION', '3')
23 conf.define('PACKAGE_BUGREPORT', 'samba-technical@samba.org')
25 conf.DEFINE('CONFIG_H_IS_FROM_SAMBA', 1)
26 conf.DEFINE('_SAMBA_BUILD_', 3, add_to_cflags=True)
27 conf.DEFINE('HAVE_CONFIG_H', 1, add_to_cflags=True)
28 if Options.options.developer:
29 conf.ADD_CFLAGS('-DDEVELOPER -DDEBUG_PASSWORD')
31 # set a limit on recursing in the waf preprocessor
32 conf.env.preprocessor_recursion_limit = 10
34 conf.ADD_EXTRA_INCLUDES('#source3 #source3/include #lib/replace #lib/talloc #lib/tevent #source3/libaddns #source3/librpc')
36 conf.sub_config('../lib/replace')
37 conf.sub_config('build')
38 conf.sub_config('../lib/tdb')
39 conf.sub_config('../lib/talloc')
40 conf.sub_config('../lib/tevent')
41 conf.sub_config('../lib/nss_wrapper')
42 conf.sub_config('../lib/socket_wrapper')
43 conf.sub_config('../lib/uid_wrapper')
45 conf.CHECK_HEADERS('execinfo.h libexc.h libunwind.h')
47 conf.CHECK_FUNCS('getcwd fchown chmod fchmod mknod mknod64')
48 conf.CHECK_FUNCS('strtol strchr strupr chflags')
49 conf.CHECK_FUNCS('getrlimit fsync fdatasync setpgid')
50 conf.CHECK_FUNCS('setsid glob strpbrk crypt16 getauthuid')
51 conf.CHECK_FUNCS('sigprocmask sigblock sigaction sigset innetgr setnetgrent getnetgrent endnetgrent')
52 conf.CHECK_FUNCS('initgroups select poll rdchk getgrnam getgrent pathconf')
53 conf.CHECK_FUNCS('setpriv setgidx setuidx setgroups sysconf stat64 fstat64')
54 conf.CHECK_FUNCS('lstat64 fopen64 atexit grantpt lseek64 ftruncate64 posix_fallocate posix_fallocate64')
55 conf.CHECK_FUNCS('fseek64 fseeko64 ftell64 ftello64 setluid')
56 conf.CHECK_FUNCS('getpwnam', headers='sys/types.h pwd.h')
57 conf.CHECK_FUNCS('opendir64 readdir64 seekdir64 telldir64 rewinddir64 closedir64')
58 conf.CHECK_FUNCS('getpwent_r getdents64 setenv strcasecmp fcvt fcvtl')
59 conf.CHECK_FUNCS('syslog vsyslog timegm setlocale nl_langinfo')
60 conf.CHECK_FUNCS_IN('nanosleep', 'rt')
61 conf.CHECK_FUNCS('lutimes futimes utimensat futimens')
62 conf.CHECK_FUNCS('mlock munlock mlockall munlockall')
63 conf.CHECK_FUNCS('memalign posix_memalign hstrerror')
64 conf.CHECK_FUNCS('shmget')
65 conf.CHECK_FUNCS_IN('shm_open', 'rt', checklibc=True)
66 conf.CHECK_FUNCS('gettext dgettext bindtextdomain textdomain')
68 # Check for inotify support
69 conf.CHECK_HEADERS('linux/inotify.h asm/unistd.h sys/inotify.h')
70 conf.CHECK_FUNCS('inotify_init')
71 if "HAVE_LINUX_INOTIFY_H" in conf.env and "HAVE_INOTIFY_INIT" in conf.env:
72 conf.DEFINE('HAVE_INOTIFY', 1)
74 # Check for kernel change notify support
80 exit(fcntl(open("/tmp", O_RDONLY), F_NOTIFY, 0) == -1 ? 1 : 0);
81 }''', 'HAVE_KERNEL_CHANGE_NOTIFY', addmain=False, execute=True,
82 headers='fcntl.h signal.h',
83 msg="Checking for kernel change notify support")
85 # Check for Linux kernel oplocks
87 #include <sys/types.h>
94 exit(fcntl(open("/tmp", O_RDONLY), F_NOTIFY, 0) == -1 ? 1 : 0);
95 }''', 'HAVE_KERNEL_OPLOCKS_LINUX', addmain=False, execute=True,
96 msg="Checking for Linux kernel oplocks")
98 # Check for IRIX kernel oplock types
99 conf.CHECK_CODE('oplock_stat_t t; t.os_state = OP_REVOKE; t.os_dev = 1; t.os_ino = 1;',
100 'HAVE_KERNEL_OPLOCKS_IRIX', headers='fcntl.h',
101 msg="Checking for IRIX kernel oplock types")
103 # Check for krenel share modes
105 #include <sys/types.h>
108 #include <sys/file.h>
114 exit(flock(open("/dev/null", O_RDWR), LOCK_MAND|LOCK_READ) != 0);
115 }''', 'HAVE_KERNEL_SHARE_MODES', addmain=False, execute=True,
116 msg="Checking for krenel share modes")
118 # Check for various members of the stat structure
119 conf.CHECK_TYPES('blksize_t blkcnt_t')
120 conf.CHECK_STRUCTURE_MEMBER('struct stat', 'st_blocks', define='HAVE_STAT_ST_BLOCKS',
121 headers='sys/stat.h')
122 conf.CHECK_STRUCTURE_MEMBER('struct stat', 'st_blksize', define='HAVE_STAT_ST_BLKSIZE',
123 headers='sys/stat.h')
125 # Check for POSIX capability support
126 if "HAVE_SYS_CAPABILITY_H" in conf.env:
127 conf.CHECK_FUNCS_IN('cap_get_proc', 'cap')
131 if (!(cap = cap_get_proc())) exit(1);
133 cap_set_flag(cap, CAP_INHERITABLE, 1, vals, CAP_CLEAR);
134 cap_set_proc(cap);''',
135 'HAVE_POSIX_CAPABILITIES', execute=True, lib="cap",
136 headers='sys/capability.h',
137 msg="Checking whether POSIX capabilities are available")
139 # Check for int16, uint16, int32 and uint32 in rpc/types.h included from
140 # rpc/rpc.h. This is *really* broken but some systems (DEC OSF1) do this.
142 if conf.CONFIG_SET("HAVE_RPC_RPC_H"):
143 conf.CHECK_TYPE('int16', headers='rpc/rpc.h',
144 define='HAVE_INT16_FROM_RPC_RPC_H',
145 msg="Checking for int16 typedef included by rpc/rpc.h")
146 conf.CHECK_CODE('uint16 testvar;', 'HAVE_INT16_FROM_RPC_RPC_H',
147 headers='sys/types.h rpc/rpc.h',
148 msg="Checking for uint16 typedef included by rpc/rpc.h")
149 conf.CHECK_CODE('int32 testvar;', 'HAVE_INT16_FROM_RPC_RPC_H',
150 headers='sys/types.h rpc/rpc.h',
151 msg="Checking for int32 typedef included by rpc/rpc.h")
152 conf.CHECK_CODE('uint32 testvar;', 'HAVE_INT16_FROM_RPC_RPC_H',
153 headers='sys/types.h rpc/rpc.h',
154 msg="Checking for uint32 typedef included by rpc/rpc.h")
156 # Check if the compiler will optimize out functions
159 this_function_does_not_exist();
162 }''', 'HAVE_COMPILER_WILL_OPTIMIZE_OUT_FNS',
163 msg="Checking if the compiler will optimize out functions")
166 conf.find_program('cups-config', var='CUPS_CONFIG')
167 if conf.env.CUPS_CONFIG:
168 conf.check_cfg(path="cups-config", args="--cflags --ldflags --libs", package="", uselib_store="CUPS")
169 conf.CHECK_HEADERS('cups/cups.h cups/language.h', lib='CUPS')
172 conf.CHECK_HEADERS('ldap.h lber.h')
173 conf.CHECK_TYPE('ber_tag_t', 'unsigned int', headers='ldap.h lber.h')
176 conf.find_program('krb5-config', var='KRB5_CONFIG')
177 if conf.env.KRB5_CONFIG:
178 conf.check_cfg(path="krb5-config", args="--cflags --libs",
179 package="gssapi", uselib_store="KRB5")
180 conf.CHECK_HEADERS('krb5.h krb5/locate_plugin.h', lib='KRB5')
181 conf.CHECK_HEADERS('gssapi.h gssapi/gssapi_generic.h gssapi/gssapi.h com_err.h', lib='KRB5')
184 _acl __acl add_proplist_entry atexit attr_getf attr_list attr_listf
185 attropen attr_remove attr_removef attr_set attr_setf backtrace_symbols
186 bindtextdomain _chdir __chdir chflags chmod _close __close _closedir
187 __closedir closedir64 creat64 crypt16 delproplist devnm dgettext dirfd
188 DNSServiceRegister _dup __dup _dup2 __dup2 endmntent endnetgrent execl
189 extattr_delete_fd extattr_delete_link extattr_get_fd extattr_get_file
190 extattr_get_link extattr_list_fd extattr_list_file extattr_list_link
191 extattr_set_fd extattr_set_file extattr_set_link _facl __facl _fchdir
192 __fchdir fchmod fchown _fcntl __fcntl fcvt fcvtl fdatasync
193 fdelproplist fgetea fgetproplist fgetxattr flistea flistxattr fopen64
194 _fork __fork fremoveea fremovexattr fseek64 fseeko64 fsetea
195 fsetproplist fsetxattr _fstat __fstat fstat64 _fstat64 __fstat64 fsync
196 ftell64 ftello64 ftruncate64 futimens futimes __fxstat getauthuid
197 getcwd _getcwd __getcwd getdents __getdents getdents64 getdirentries
198 getgrent getgrnam getgrouplist getmntent getnetgrent getpagesize
199 getproplist get_proplist_entry getpwanam getpwent_r getrlimit gettext
200 getutmpx getutxent glob grantpt hstrerror initgroups innetgr
201 inotify_init lgetea lgetxattr listea listxattr llistea llistxattr
202 llseek _llseek __llseek lremoveea lremovexattr _lseek __lseek lseek64
203 lsetea lsetxattr _lstat __lstat lstat64 _lstat64 __lstat64 lutimes
204 __lxstat memalign mknod mknod64 mlock mlockall munlock munlockall
205 nl_langinfo _open __open open64 _open64 __open64 _opendir __opendir
206 opendir64 pathconf poll posix_fallocate posix_fallocate64
207 posix_memalign prctl pread _pread __pread pread64 _pread64 __pread64
208 pututline pututxline pwrite _pwrite __pwrite pwrite64 _pwrite64
209 __pwrite64 rdchk _read __read _readdir __readdir readdir64 _readdir64
210 __readdir64 removeea removexattr rewinddir64 _seekdir __seekdir
211 seekdir64 select setea setenv setgidx setgroups setlocale setluid
212 setmntent setnetgrent setpgid setpriv setproplist setsid setuidx
213 setxattr shmget shm_open sigaction sigblock sigprocmask sigset
214 sizeof_proplist_entry _stat __stat stat64 _stat64 __stat64 statvfs
215 strcasecmp strchr strpbrk strsignal strtol strupr sysconf sysctlbyname
216 __sys_llseek syslog _telldir __telldir telldir64 textdomain timegm
217 updwtmp updwtmpx utimensat vsyslog _write __write __xstat
218 yp_get_default_domain
221 conf.CHECK_TYPE('struct timespec', headers='sys/time.h time.h')
223 conf.SAMBA_CONFIG_H('include/config.h')