import samba_utils
import samba3
+version = wafsamba.samba_version_file("./VERSION")
+
+VERSION=version.STRING
+
def set_options(opt):
opt.BUILTIN_DEFAULT('NONE')
opt.BUNDLED_EXTENSION_DEFAULT('s3')
opt.SAMBA3_ADD_OPTION('sendfile-support')
opt.SAMBA3_ADD_OPTION('utmp')
opt.SAMBA3_ADD_OPTION('pthreadpool', with_name="enable", without_name="disable")
+ opt.SAMBA3_ADD_OPTION('avahi', with_name="enable", without_name="disable")
def configure(conf):
from samba_utils import TO_LIST
- conf.define('PACKAGE_NAME', 'Samba')
- conf.define('PACKAGE_STRING', 'Samba 3')
- conf.define('PACKAGE_TARNAME', 'samba')
- conf.define('PACKAGE_URL', '')
- conf.define('PACKAGE_VERSION', '3')
- conf.define('PACKAGE_BUGREPORT', 'samba-technical@samba.org')
+ conf.DEFINE('PACKAGE_NAME', 'Samba', quote=True)
+ conf.DEFINE('PACKAGE_STRING', 'Samba %s' % version.MAJOR, quote=True)
+ conf.DEFINE('PACKAGE_TARNAME', 'samba', quote=True)
+ conf.DEFINE('PACKAGE_URL', "", quote=True)
+ conf.DEFINE('PACKAGE_VERSION', "%s" % version.MAJOR, quote=True)
+ conf.DEFINE('PACKAGE_BUGREPORT', 'samba-technical@samba.org', quote=True)
conf.DEFINE('CONFIG_H_IS_FROM_SAMBA', 1)
- conf.DEFINE('_SAMBA_BUILD_', 3, add_to_cflags=True)
+ conf.DEFINE('_SAMBA_BUILD_', version.MAJOR, add_to_cflags=True)
conf.DEFINE('HAVE_CONFIG_H', 1, add_to_cflags=True)
if Options.options.developer:
conf.ADD_CFLAGS('-DDEVELOPER -DDEBUG_PASSWORD')
- conv.env['developer'] = True
+ conf.env['developer'] = True
if Options.options.with_swat:
conf.env['build_swat'] = True
conf.CHECK_CODE('uint32 testvar;', 'HAVE_INT16_FROM_RPC_RPC_H',
headers='sys/types.h rpc/rpc.h',
msg="Checking for uint32 typedef included by rpc/rpc.h")
+ conf.CHECK_CODE('int i;', 'BROKEN_NISPLUS_INCLUDE_FILES',
+ headers='sys/types.h sys/acl.h rpcsvc/nis.h',
+ msg="Checking for broken nisplus include files")
# Check if the compiler will optimize out functions
conf.CHECK_CODE('''
}''', 'HAVE_COMPILER_WILL_OPTIMIZE_OUT_FNS',
msg="Checking if the compiler will optimize out functions")
+ # Check if the compiler supports the LL suffix on long long integers
+ # AIX needs this
+ conf.CHECK_CODE('long long i = 0x8000000000LL', 'COMPILER_SUPPORTS_LL',
+ headers='stdio.h',
+ msg="Checking for LL suffix on long long integers")
+
conf.CHECK_FUNCS('''
_acl __acl add_proplist_entry atexit attr_getf attr_list attr_listf
attropen attr_remove attr_removef attr_set attr_setf backtrace_symbols
getcwd _getcwd __getcwd getdents __getdents getdents64 getdirentries
getgrent getgrnam getgrouplist getmntent getnetgrent getpagesize
getproplist get_proplist_entry getpwanam getpwent_r getrlimit gettext
-getutmpx getutxent glob grantpt hstrerror initgroups innetgr
+glob grantpt hstrerror initgroups innetgr
inotify_init lgetea lgetxattr listea listxattr llistea llistxattr
llseek _llseek __llseek lremoveea lremovexattr _lseek __lseek lseek64
lsetea lsetxattr _lstat __lstat lstat64 _lstat64 __lstat64 lutimes
nl_langinfo _open __open open64 _open64 __open64 _opendir __opendir
opendir64 pathconf poll posix_fallocate posix_fallocate64
posix_memalign prctl pread _pread __pread pread64 _pread64 __pread64
-pututline pututxline pwrite _pwrite __pwrite pwrite64 _pwrite64
+pwrite _pwrite __pwrite pwrite64 _pwrite64
__pwrite64 rdchk _read __read _readdir __readdir readdir64 _readdir64
__readdir64 removeea removexattr rewinddir64 _seekdir __seekdir
seekdir64 select setea setenv setgidx setgroups setlocale setluid
sizeof_proplist_entry _stat __stat stat64 _stat64 __stat64 statvfs
strcasecmp strchr strpbrk strsignal strtol strupr sysconf sysctlbyname
__sys_llseek syslog _telldir __telldir telldir64 textdomain timegm
-updwtmp updwtmpx utimensat vsyslog _write __write __xstat
+utimensat vsyslog _write __write __xstat
''')
conf.CHECK_TYPE('struct timespec', headers='sys/time.h time.h')
msg="Checking whether xattr interface takes additional options",
headers='sys/types.h attr/xattr.h sys/xattr.h')
+ conf.CHECK_HEADERS('asm/types.h')
+
+ conf.CHECK_CODE('dev_t dev; int i = major(dev); return 0', "HAVE_DEVICE_MAJOR_FN",
+ headers='unistd.h sys/types.h',
+ msg="Checking for major macro")
+
+ conf.CHECK_CODE('dev_t dev; int i = minor(dev); return 0', "HAVE_DEVICE_MINOR_FN",
+ headers='unistd.h sys/types.h',
+ msg="Checking for minor macro")
+
+ conf.CHECK_STRUCTURE_MEMBER('struct dirent', 'd_off',
+ headers='unistd.h sys/types.h dirent.h',
+ define='HAVE_DIRENT_D_OFF')
+
#FIXME: Should just be set when krb5 and ldap requirements are fulfilled
if Options.options.with_ads:
conf.DEFINE('WITH_ADS', '1')
conf.CHECK_FUNCS_IN('crypto', 'des_set_key')
conf.CHECK_FUNCS_IN('copy_Authenticator', 'asn1')
conf.CHECK_FUNCS_IN('roken_getaddrinfo_hostspec', 'roken')
- conf.CHECK_FUNCS_IN('gss_display_status', 'gssapi gssapi_krb5')
+ if conf.CHECK_FUNCS_IN('gss_display_status', 'gssapi gssapi_krb5'):
+ conf.DEFINE('HAVE_GSSAPI', '1')
conf.CHECK_FUNCS_IN('krb5_mk_req_extended krb5_kt_compare', 'krb5')
conf.CHECK_FUNCS('''
krb5_set_real_time krb5_set_default_in_tkt_etypes krb5_set_default_tgs_enctypes
headers='krb5.h', lib='krb5',
msg="Checking whether krb5_princ_component is available")
+ conf.CHECK_CODE('''
+int main(void) {
+char buf[256];
+krb5_enctype_to_string(1, buf, 256);
+return 0;
+}''',
+ 'HAVE_KRB5_ENCTYPE_TO_STRING_WITH_SIZE_T_ARG',
+ headers='krb5.h', lib='krb5',
+ addmain=False, cflags='-Werror',
+ msg="Checking whether krb5_enctype_to_string takes size_t argument")
+
+ conf.CHECK_CODE('''
+int main(void) {
+krb5_context context = NULL;
+char *str = NULL;
+krb5_enctype_to_string(context, 1, &str);
+if (str) free (str);
+return 0;
+}''',
+ 'HAVE_KRB5_ENCTYPE_TO_STRING_WITH_KRB5_CONTEXT_ARG',
+ headers='krb5.h stdlib.h', lib='krb5',
+ addmain=False, cflags='-Werror',
+ msg="Checking whether krb5_enctype_to_string takes krb5_context argument")
+
else:
conf.SET_TARGET_TYPE('krb5', 'EMPTY')
conf.SET_TARGET_TYPE('gssapi', 'EMPTY')
conf.SET_TARGET_TYPE('gssapi_krb5', 'EMPTY')
+ if Options.options.with_utmp:
+ conf.CHECK_FUNCS('pututline pututxline updwtmp updwtmpx getutmpx getutxent')
+ conf.CHECK_STRUCTURE_MEMBER('struct utmp', 'ut_name', headers='utmp.h',
+ define='HAVE_UT_UT_NAME')
+ conf.CHECK_STRUCTURE_MEMBER('struct utmp', 'ut_user', headers='utmp.h',
+ define='HAVE_UT_UT_USER')
+ conf.CHECK_STRUCTURE_MEMBER('struct utmp', 'ut_id', headers='utmp.h',
+ define='HAVE_UT_UT_ID')
+ conf.CHECK_STRUCTURE_MEMBER('struct utmp', 'ut_host', headers='utmp.h',
+ define='HAVE_UT_UT_HOST')
+ conf.CHECK_STRUCTURE_MEMBER('struct utmp', 'ut_time', headers='utmp.h',
+ define='HAVE_UT_UT_TIME')
+ conf.CHECK_STRUCTURE_MEMBER('struct utmp', 'ut_tv', headers='utmp.h',
+ define='HAVE_UT_UT_TV')
+ conf.CHECK_STRUCTURE_MEMBER('struct utmp', 'ut_type', headers='utmp.h',
+ define='HAVE_UT_UT_TYPE')
+ conf.CHECK_STRUCTURE_MEMBER('struct utmp', 'ut_pid', headers='utmp.h',
+ define='HAVE_UT_UT_PID')
+ conf.CHECK_STRUCTURE_MEMBER('struct utmp', 'ut_exit.e_exit', headers='utmp.h',
+ define='HAVE_UT_UT_EXIT')
+ conf.CHECK_STRUCTURE_MEMBER('struct utmp', 'ut_addr_v6', headers='utmp.h',
+ define='HAVE_UT_UT_ADDR_V6')
+ conf.CHECK_STRUCTURE_MEMBER('struct utmp', 'ut_addr', headers='utmp.h',
+ define='HAVE_UT_UT_ADDR')
+ conf.CHECK_STRUCTURE_MEMBER('struct utmpx', 'ut_syslen', headers='utmpx.h',
+ define='HAVE_UX_UT_SYSLEN')
+ conf.CHECK_CODE('struct utmp utarg; struct utmp *utreturn; utreturn = pututline(&utarg);',
+ 'PUTUTLINE_RETURNS_UTMP', headers='utmp.h',
+ msg="Checking whether pututline returns pointer")
+ conf.DEFINE('WITH_UTMP', 1)
+
+ if Options.options.with_avahi:
+ conf.env.with_avahi = True
+ if not conf.CHECK_HEADERS('avahi-common/watch.h avahi-client/client.h'): conf.env.with_avahi = False
+ if not conf.CHECK_FUNCS_IN('avahi_client_new', 'avahi-client'): conf.env.with_avahi = False
+ if not conf.CHECK_FUNCS_IN('avahi_strerror', 'avahi-common'): conf.env.with_avahi = False
+ if conf.env.with_avahi:
+ conf.DEFINE('WITH_AVAHI_SUPPORT', 1)
+ else:
+ conf.SET_TARGET_TYPE('avahi-common', 'EMPTY')
+ conf.SET_TARGET_TYPE('avahi-client', 'EMPTY')
+
# FIXME: these should be tests for features, but the old build system just
# checks for OSes.
import sys
conf.DEFINE('QNX', '1')
conf.DEFINE('STAT_ST_BLOCKSIZE', '512')
elif (host_os.rfind('darwin') > -1):
+ conf.DEFINE('DARWINOS', 1)
conf.DEFINE('STAT_ST_BLOCKSIZE', '512')
+ conf.ADD_CFLAGS('-fno-common')
# FIXME: Add more checks here.
else:
print "Unknown host_os '%s', please report this to samba-technical@samba.org" % host_os