build: tweak SIZEOF utmp->ut_line
[garming/samba-autobuild/.git] / source3 / wscript
index 5a3805fc15170e9b9dac444699df7ca03eeee375..47839277e7308be52007a1754040aa8533f47798 100644 (file)
@@ -23,8 +23,7 @@ def set_options(opt):
                    action="store", dest='shared_modules', default=None)
 
     opt.SAMBA3_ADD_OPTION('winbind')
-    opt.SAMBA3_ADD_OPTION('swat')
-    opt.SAMBA3_ADD_OPTION('ads', default=None) # None means autodetection
+    opt.SAMBA3_ADD_OPTION('ads')
     opt.SAMBA3_ADD_OPTION('ldap')
     opt.SAMBA3_ADD_OPTION('cups', with_name="enable", without_name="disable")
     opt.SAMBA3_ADD_OPTION('iprint', with_name="enable", without_name="disable")
@@ -44,6 +43,7 @@ def set_options(opt):
     opt.SAMBA3_ADD_OPTION('dmapi', default=None) # None means autodetection
     opt.SAMBA3_ADD_OPTION('fam', default=None) # None means autodetection
     opt.SAMBA3_ADD_OPTION('profiling-data', default=False)
+    opt.SAMBA3_ADD_OPTION('libarchive', default=None)
 
     opt.SAMBA3_ADD_OPTION('cluster-support', default=None)
 
@@ -60,6 +60,7 @@ def set_options(opt):
                    help=("Directory under which libcephfs is installed"),
                    action="store", dest='libcephfs_dir', default=None)
 
+    opt.SAMBA3_ADD_OPTION('glusterfs', with_name="enable", without_name="disable", default=True)
 
 
 def configure(conf):
@@ -72,9 +73,6 @@ def configure(conf):
         conf.ADD_CFLAGS('-DDEVELOPER -DDEBUG_PASSWORD')
         conf.env.developer = True
 
-    if Options.options.with_swat:
-        conf.env['build_swat'] = True
-
     if sys.platform != 'openbsd5':
         conf.ADD_LDFLAGS("-Wl,--export-dynamic", testflags=True)
 
@@ -92,6 +90,7 @@ def configure(conf):
     conf.CHECK_FUNCS('fseeko setluid')
     conf.CHECK_FUNCS('getpwnam', headers='sys/types.h pwd.h')
     conf.CHECK_FUNCS('fdopendir')
+    conf.CHECK_FUNCS('fstatat')
     conf.CHECK_FUNCS('getpwent_r setenv strcasecmp fcvt fcvtl')
     conf.CHECK_FUNCS('syslog vsyslog timegm setlocale')
     conf.CHECK_FUNCS_IN('nanosleep', 'rt')
@@ -100,7 +99,6 @@ def configure(conf):
     conf.CHECK_FUNCS('memalign posix_memalign hstrerror')
     conf.CHECK_FUNCS('shmget')
     conf.CHECK_FUNCS_IN('shm_open', 'rt', checklibc=True)
-    conf.CHECK_FUNCS('gettext dgettext bindtextdomain textdomain bind_textdomain_codeset')
     #FIXME: for some reason this one still fails
     conf.CHECK_FUNCS_IN('yp_get_default_domain', 'nsl')
     conf.CHECK_FUNCS_IN('dn_expand _dn_expand __dn_expand', 'resolv')
@@ -196,6 +194,17 @@ main() {
         elif check_for_fam:
             Logs.warn('no suitable FAM library found')
 
+    # check for libarchive (tar command in smbclient)
+    # None means autodetect, True/False means enable/disable
+    conf.env['archive_lib'] = ''
+    if Options.options.with_libarchive is not False:
+        libarchive_mandatory = Options.options.with_libarchive == True
+        Logs.info("Checking for libarchive existence")
+        if conf.CHECK_BUNDLED_SYSTEM('libarchive', minversion='3.1.2'):
+            conf.env['archive_lib'] = 'libarchive'
+        elif libarchive_mandatory:
+            conf.fatal('libarchive support requested, but no suitable pkgconfig found')
+
     # check for DMAPI libs
     Logs.info("Checking for DMAPI library existence")
     conf.env['dmapi_lib'] = ''
@@ -333,8 +342,8 @@ if (0) {
 
     conf.CHECK_FUNCS('''
 _acl __acl atexit 
-bindtextdomain _chdir __chdir chflags chmod _close __close _closedir
-__closedir crypt16 devnm dgettext dirfd
+ _chdir __chdir chflags chmod _close __close _closedir
+__closedir crypt16 devnm dirfd
 DNSServiceRegister _dup __dup _dup2 __dup2 endmntent execl
 _facl __facl _fchdir
 __fchdir fchmod fchown _fcntl __fcntl fcvt fcvtl fdatasync
@@ -343,7 +352,7 @@ fsetxattr _fstat __fstat fsync
 futimens futimes __fxstat getauthuid
 getcwd _getcwd __getcwd getdents __getdents getdirentries
 getgrent getgrnam getgrouplist getgrset getmntent getpagesize
-getpwanam getpwent_r getrlimit gettext
+getpwanam getpwent_r getrlimit
 glob grantpt hstrerror initgroups innetgr
 llseek _llseek __llseek _lseek __lseek
 _lstat __lstat lutimes
@@ -359,7 +368,7 @@ setmntent setpgid setpriv setsid setuidx
 shmget shm_open sigaction sigblock sigprocmask sigset
 _stat __stat statvfs
 strcasecmp strchr strpbrk strsignal strtol strupr sysconf sysctl sysctlbyname
-__sys_llseek syslog _telldir __telldir textdomain timegm
+__sys_llseek syslog _telldir __telldir timegm
 utimensat vsyslog _write __write __xstat
 ''')
 
@@ -389,7 +398,7 @@ utimensat vsyslog _write __write __xstat
         conf.DEFINE('FREEBSD', 1)
         if conf.CHECK_HEADERS('sunacl.h'):
             conf.DEFINE('HAVE_FREEBSD_SUNACL_H', '1')
-            conf.CHECK_FUNCS_IN('acl', 'sunacl')
+            conf.CHECK_FUNCS_IN(['acl'], 'sunacl')
         conf.DEFINE('STAT_ST_BLOCKSIZE', '512')
     elif (host_os.rfind('irix') > -1):
         conf.DEFINE('IRIX', 1)
@@ -409,15 +418,7 @@ utimensat vsyslog _write __write __xstat
         conf.DEFINE('STAT_ST_BLOCKSIZE', '512')
 
     if Options.options.with_acl_support:
-       if (host_os.rfind('sysv5') > -1) and conf.CHECK_FUNCS_IN('sec', 'facl', checklibc=True):
-               Logs.info('Using UnixWare ACLs')
-                conf.DEFINE('HAVE_UNIXWARE_ACLS',1)
-                default_static_modules.extend(TO_LIST('vfs_solarisacl'))
-       elif (host_os.rfind('solaris') > -1) and conf.CHECK_FUNCS_IN('sec', 'facl'):
-               Logs.info('Using solaris ACLs')
-                conf.DEFINE('HAVE_SOLARIS_ACLS',1)
-                default_static_modules.extend(TO_LIST('vfs_solarisacl'))
-       elif (host_os.rfind('hpux') > -1):
+        if (host_os.rfind('hpux') > -1):
                Logs.info('Using HPUX ACLs')
                 conf.DEFINE('HAVE_HPUX_ACLS',1)
                 conf.DEFINE('POSIX_ACL_NEEDS_MASK',1)
@@ -425,15 +426,16 @@ utimensat vsyslog _write __write __xstat
        elif (host_os.rfind('aix') > -1):
                Logs.info('Using AIX ACLs')
                 conf.DEFINE('HAVE_AIX_ACLS',1)
-                default_static_modules.extend(TO_LIST('vfs_aixacl'))
-       elif (host_os.rfind('osf') > -1) and conf.CHECK_FUNCS_IN('pacl', 'acl_get_fd'):
-               Logs.info('Using Tru64 ACLs')
-                conf.DEFINE('HAVE_TRU64_ACLS',1)
-                default_static_modules.extend(TO_LIST('vfs_tru64acl'))
+                default_static_modules.extend(TO_LIST('vfs_aixacl vfs_aixacl2'))
         elif (host_os.rfind('darwin') > -1):
-            Logs.warn('ACLs on Dwarwin currently not supported')
+            Logs.warn('ACLs on Darwin currently not supported')
+            conf.fatal("ACL support not available on Darwin/MacOS. "
+                       "Use --without-acl-support for building without "
+                       "ACL support. "
+                       "ACL support is required to change permissions "
+                       "from Windows clients.")
         else:
-            conf.CHECK_FUNCS_IN('acl_get_file', 'acl')
+            conf.CHECK_FUNCS_IN(['acl_get_file'], 'acl')
             if conf.CHECK_CODE('''
 acl_t acl;
 int entry_id;
@@ -452,14 +454,28 @@ return acl_get_perm_np(permset_d, perm);
                         headers='sys/types.h sys/acl.h', link=True,
                         msg="Checking whether acl_get_perm_np() is available")
                 default_static_modules.extend(TO_LIST('vfs_posixacl'))
-
+            elif conf.CHECK_FUNCS_IN(['facl'], 'sec'):
+                Logs.info('Using solaris or UnixWare ACLs')
+                conf.DEFINE('HAVE_SOLARIS_UNIXWARE_ACLS',1)
+                default_static_modules.extend(TO_LIST('vfs_solarisacl'))
+            elif conf.CHECK_FUNCS_IN(['acl_get_fd'], 'pacl'):
+                Logs.info('Using Tru64 ACLs')
+                conf.DEFINE('HAVE_TRU64_ACLS',1)
+                default_static_modules.extend(TO_LIST('vfs_tru64acl'))
+            else:
+                conf.fatal("ACL support not found. Try installing libacl1-dev "
+                           "or libacl-devel.  "
+                           "Otherwise, use --without-acl-support to build "
+                           "without ACL support. "
+                           "ACL support is required to change permissions from "
+                           "Windows clients.")
 
     if conf.CHECK_FUNCS('dirfd'):
         conf.DEFINE('HAVE_DIRFD_DECL', 1)
 
     conf.CHECK_CODE('struct statfs fsd; fsid_t fsid = fsd.f_fsid; return statfs(".", &fsd);',
                     'HAVE_STATFS_F_FSID',
-                    msg="vfs_fileid: checking for statfs() and struct statfs.f_fsid",
+                    msg="vfs_fileid checking for statfs() and struct statfs.f_fsid",
                     headers='sys/types.h sys/statfs.h',
                     execute=True)
 
@@ -651,6 +667,15 @@ msg.msg_acctrightslen = sizeof(fd);
             if conf.CONFIG_SET('HAVE_BER_SOCKBUF_ADD_IO') and \
                     conf.CONFIG_SET('HAVE_LDAP_OPT_SOCKBUF'):
                 conf.DEFINE('HAVE_LDAP_SASL_WRAPPING', '1')
+        else:
+            conf.fatal("LDAP support not found. "
+                       "Try installing libldap2-dev or openldap-devel. "
+                       "Otherwise, use --without-ldap to build without "
+                       "LDAP support. "
+                       "LDAP support is required for the LDAP passdb backend, "
+                       "LDAP idmap backends and ADS. "
+                       "ADS support improves communication with "
+                       "Active Directory domain controllers.")
     else:
         conf.SET_TARGET_TYPE('ldap', 'EMPTY')
         conf.SET_TARGET_TYPE('lber', 'EMPTY')
@@ -749,9 +774,12 @@ msg.msg_acctrightslen = sizeof(fd);
         if not use_ads_krb5:
             Logs.warn("Active Directory support not available: krb5 libs don't have all required features")
         if not use_ads_ldap:
-            Logs.warn("Active Directory support not available: LDAP support ist not available.")
+            Logs.warn("Active Directory support not available: LDAP support is not available.")
         if Options.options.with_ads:
-            conf.fatal("Active Directory support not found. Use --without-ads for building without Active Directory support.")
+            conf.fatal("Active Directory support not found. Use --without-ads "
+                       "for building without Active Directory support. "
+                       "ADS support improves communication with "
+                       "Active Directory domain controllers.")
         else:
             # this is the auto-mode case
             Logs.warn("Building without Active Directory support.")
@@ -785,7 +813,7 @@ msg.msg_acctrightslen = sizeof(fd);
                         'PUTUTLINE_RETURNS_UTMP', headers='utmp.h',
                         msg="Checking whether pututline returns pointer")
         conf.CHECK_SIZEOF(['((struct utmp *)NULL)->ut_line'], headers='utmp.h',
-                          define='SIZEOF_UTMP_UT_LINE')
+                          define='SIZEOF_UTMP_UT_LINE', critical=False)
         if not conf.CONFIG_SET('SIZEOF_UTMP_UT_LINE'):
             conf.env.with_utmp = False
         elif int(conf.env.SIZEOF_UTMP_UT_LINE) < 15:
@@ -1410,8 +1438,9 @@ main() {
 
     else:
 
-        if Options.options.ctdb_dir:
-            conf.ADD_EXTRA_INCLUDES(Options.options.ctdb_dir + '/include')
+        have_cluster_support = True
+        ctdb_broken = ""
+        CTDB_CFLAGS = ""
 
         srcdir = os.path.realpath(conf.srcdir)
         if 'EXTRA_INCLUDES' in conf.env:
@@ -1419,16 +1448,17 @@ main() {
         else:
             includes = ''
 
+        if Options.options.ctdb_dir:
+            CTDB_CFLAGS = '-I' + Options.options.ctdb_dir + '/include'
+            includes = includes + ' ' + Options.options.ctdb_dir + '/include'
+
         if not conf.env.USING_SYSTEM_TDB:
             includes = includes + ' ' + srcdir + '/lib/tdb/include'
 
         if not conf.env.USING_SYSTEM_TALLOC:
             includes = includes + ' ' + srcdir + '/lib/talloc'
 
-        have_cluster_support = True
-        ctdb_broken = ""
-
-        conf.CHECK_CODE('''
+        ok = conf.CHECK_CODE('''
             #define NO_CONFIG_H
             #include "replace.h"
             #include "system/wait.h"
@@ -1443,17 +1473,19 @@ main() {
                 return 0;
             }
             ''',
-            'HAVE_CTDB_H',
+            'HAVE_CTDB_CHECK_CODE',
             addmain=False,
             includes=includes,
             msg='Checking for header ctdb.h')
-
-        if not conf.CONFIG_SET('HAVE_CTDB_H'):
+        if ok:
+            CTDB_CFLAGS += ' -DHAVE_CTDB_H=1'
+        else:
             have_cluster_support = False
             ctdb_broken = "ctdb.h is required for cluster support"
 
+        conf.CONFIG_RESET('HAVE_CTDB_CHECK_CODE')
         if have_cluster_support:
-            conf.CHECK_CODE('''
+            ok = conf.CHECK_CODE('''
                 #define NO_CONFIG_H
                 #include "replace.h"
                 #include "system/wait.h"
@@ -1469,17 +1501,19 @@ main() {
                     return 0;
                 }
                 ''',
-                'HAVE_CTDB_PRIVATE_H',
+                'HAVE_CTDB_CHECK_CODE',
                 addmain=False,
                 includes=includes,
                 msg='Checking for header ctdb_private.h')
-
-            if not conf.CONFIG_SET('HAVE_CTDB_PRIVATE_H'):
+            if ok:
+                CTDB_CFLAGS += ' -DHAVE_CTDB_PRIVATE_H=1'
+            else:
                 have_cluster_support = False
                 ctdb_broken = "ctdb_private.h is required for cluster support"
 
+        conf.CONFIG_RESET('HAVE_CTDB_CHECK_CODE')
         if have_cluster_support:
-            conf.CHECK_CODE('''
+            ok = conf.CHECK_CODE('''
                 #define NO_CONFIG_H
                 #include "replace.h"
                 #include "system/wait.h"
@@ -1495,13 +1529,16 @@ main() {
                     return 0;
                 }
                 ''',
-                'HAVE_CTDB_PROTOCOL_H',
+                'HAVE_CTDB_CHECK_CODE',
                 addmain=False,
                 includes=includes,
                 msg='Checking for header ctdb_protocol.h')
+            if ok:
+                CTDB_CFLAGS += ' -DHAVE_CTDB_PROTOCOL_H=1'
 
+        conf.CONFIG_RESET('HAVE_CTDB_CHECK_CODE')
         if have_cluster_support:
-            conf.CHECK_CODE('''
+            ok = conf.CHECK_CODE('''
                 #define NO_CONFIG_H
                 #include "replace.h"
                 #include "system/wait.h"
@@ -1517,17 +1554,19 @@ main() {
                    return 0;
                 }
                 ''',
-                'HAVE_CTDB_CONTROL_TRANS3_COMMIT_DECL',
+                'HAVE_CTDB_CHECK_CODE',
                 addmain=False,
                 includes=includes,
                 msg='Checking for transaction support (TRANS3_COMMIT control)')
-
-            if not conf.CONFIG_SET('HAVE_CTDB_CONTROL_TRANS3_COMMIT_DECL'):
+            if ok:
+                CTDB_CFLAGS += ' -DHAVE_CTDB_CONTROL_TRANS3_COMMIT_DECL=1'
+            else:
                 have_cluster_support = False
                 ctdb_broken = "ctdb transaction support missing or too old"
 
+        conf.CONFIG_RESET('HAVE_CTDB_CHECK_CODE')
         if have_cluster_support:
-            conf.CHECK_CODE('''
+            ok = conf.CHECK_CODE('''
                 #define NO_CONFIG_H
                 #include "replace.h"
                 #include "system/wait.h"
@@ -1543,20 +1582,52 @@ main() {
                     return 0;
                 }
                 ''',
-                'HAVE_CTDB_CONTROL_SCHEDULE_FOR_DELETION_DECL',
+                'HAVE_CTDB_CHECK_CODE',
                 addmain=False,
                 includes=includes,
                 msg='Checking for SCHEDULE_FOR_DELETION control')
-
-            if not conf.CONFIG_SET('HAVE_CTDB_CONTROL_SCHEDULE_FOR_DELETION_DECL'):
+            if ok:
+                CTDB_CFLAGS += ' -DHAVE_CTDB_CONTROL_SCHEDULE_FOR_DELETION_DECL=1'
+            else:
                 if not Options.options.enable_old_ctdb:
                     have_cluster_support = False
                     ctdb_broken = "SCHEDULE_FOR_DELETION control missing"
                 else:
                     Logs.warn("ignoring missing SCHEDULE_FOR_DELETION control (--enable-old-ctdb)")
 
+        conf.CONFIG_RESET('HAVE_CTDB_CHECK_CODE')
         if have_cluster_support:
-            conf.CHECK_CODE('''
+            ok = conf.CHECK_CODE('''
+               #define NO_CONFIG_H
+               #include "replace.h"
+               #include "system/wait.h"
+               #include "system/network.h"
+               #include <talloc.h>
+               #include <tdb.h>
+               #include <ctdb.h>
+
+               int main(void)
+               {
+                   int i = (int)CTDB_WANT_READONLY;
+                   return 0;
+               }
+               ''',
+               'HAVE_CTDB_CHECK_CODE',
+               addmain=False,
+               includes=includes,
+               msg='Checking for CTDB readonly records support')
+            if ok:
+                CTDB_CFLAGS += ' -DHAVE_CTDB_WANT_READONLY_DECL=1'
+            else:
+                if not Options.options.enable_old_ctdb:
+                    have_cluster_support = False
+                    ctdb_broken = "support for CTDB readonly records missing"
+                else:
+                    Logs.warn("ignoring missing READONLY support (--enable-old-ctdb)")
+
+        conf.CONFIG_RESET('HAVE_CTDB_CHECK_CODE')
+        if have_cluster_support:
+            ok = conf.CHECK_CODE('''
                 #define NO_CONFIG_H
                 #include "replace.h"
                 #include "system/wait.h"
@@ -1572,17 +1643,19 @@ main() {
                     return 0;
                 }
                 ''',
-                'HAVE_STRUCT_CTDB_CONTROL_TCP',
+                'HAVE_CTDB_CHECK_CODE',
                 addmain=False,
                 includes=includes,
                 msg='Checking for ctdb ipv4 support')
-
-            if not conf.CONFIG_SET('HAVE_STRUCT_CTDB_CONTROL_TCP'):
+            if ok:
+                CTDB_CFLAGS += ' -DHAVE_STRUCT_CTDB_CONTROL_TCP=1'
+            else:
                 have_cluster_support = False
                 ctdb_broken = "missing struct ctdb_control_tcp"
 
+        conf.CONFIG_RESET('HAVE_CTDB_CHECK_CODE')
         if have_cluster_support:
-            conf.CHECK_CODE('''
+            ok = conf.CHECK_CODE('''
                 #define NO_CONFIG_H
                 #include "replace.h"
                 #include "system/wait.h"
@@ -1598,13 +1671,16 @@ main() {
                     return 0;
                 }
                 ''',
-                'HAVE_STRUCT_CTDB_CONTROL_TCP_ADDR',
+                'HAVE_CTDB_CHECK_CODE',
                 addmain=False,
                 includes=includes,
                 msg='Checking for ctdb ipv6 support')
+            if ok:
+                CTDB_CFLAGS += ' -DHAVE_STRUCT_CTDB_CONTROL_TCP_ADDR=1'
 
+        conf.CONFIG_RESET('HAVE_CTDB_CHECK_CODE')
         if have_cluster_support:
-            conf.CHECK_CODE('''
+            ok = conf.CHECK_CODE('''
                 #define NO_CONFIG_H
                 #include "replace.h"
                 #include "system/wait.h"
@@ -1620,21 +1696,24 @@ main() {
                     return 0;
                 }
                 ''',
-                'HAVE_CTDB_CONTROL_CHECK_SRVIDS_DECL',
+                'HAVE_CTDB_CHECK_CODE',
                 addmain=False,
                 includes=includes,
                 msg='Checking for CHECK_SRVIDS control')
-
-            if not conf.CONFIG_SET('HAVE_CTDB_CONTROL_CHECK_SRVIDS_DECL'):
+            if ok:
+                CTDB_CFLAGS += ' -DHAVE_CTDB_CONTROL_CHECK_SRVIDS_DECL=1'
+            else:
                 if not Options.options.enable_old_ctdb:
                     have_cluster_support = False
                     ctdb_broken = "CHECK_SRVIDS control missing"
                 else:
                     Logs.warn("ignoring missing CHECK_SRVIDS control (--enable-old-ctdb)")
 
+    conf.CONFIG_RESET('HAVE_CTDB_CHECK_CODE')
+    conf.undefine('HAVE_CTDB_CHECK_CODE')
     if have_cluster_support:
         Logs.info("building with cluster support")
-        conf.DEFINE('CLUSTER_SUPPORT', 1);
+        conf.env['CTDB_CFLAGS'] = CTDB_CFLAGS
     else:
         if Options.options.with_cluster_support == False:
             Logs.info("building without cluster support (--without-cluster-support)")
@@ -1643,7 +1722,7 @@ main() {
             conf.fatal("Cluster support not found, but --with-cluster-support was specified")
         else:
             Logs.info("building without cluster support: " + ctdb_broken)
-        conf.undefine('CLUSTER_SUPPORT')
+        conf.env['CTDB_CFLAGS'] = ''
 
 
     conf.CHECK_CODE('__attribute__((destructor)) static void cleanup(void) { }',
@@ -1702,7 +1781,8 @@ main() {
     if conf.CHECK_HEADERS('gpfs_gpl.h'):
         conf.DEFINE('HAVE_GPFS', '1')
 
-    if conf.CHECK_HEADERS('linux/ioctl.h sys/ioctl.h'):
+    if (conf.CHECK_HEADERS('linux/ioctl.h sys/ioctl.h linux/fs.h') and
+       conf.CHECK_DECLS('FS_IOC_GETFLAGS FS_COMPR_FL', headers='linux/fs.h')):
            conf.DEFINE('HAVE_LINUX_IOCTL', '1')
 
     conf.env['CCFLAGS_CEPHFS'] = "-D_FILE_OFFSET_BITS=64"
@@ -1713,6 +1793,21 @@ main() {
     if conf.CHECK_HEADERS('cephfs/libcephfs.h', False, False, 'cephfs') and conf.CHECK_LIB('cephfs'):
         conf.DEFINE('HAVE_CEPH', '1')
 
+    if Options.options.with_glusterfs:
+        conf.check_cfg(package='glusterfs-api', args='"glusterfs-api >= 4" --cflags --libs',
+                       msg='Checking for glusterfs-api >= 4', uselib_store="GFAPI")
+        conf.CHECK_HEADERS('api/glfs.h', lib='gfapi')
+        conf.CHECK_LIB('gfapi', shlib=True)
+
+        if conf.CONFIG_SET('HAVE_API_GLFS_H'):
+            conf.DEFINE('HAVE_GLUSTERFS', '1')
+        else:
+            conf.SET_TARGET_TYPE('gfapi', 'EMPTY')
+            conf.undefine('HAVE_GLUSTERFS')
+    else:
+        conf.SET_TARGET_TYPE('gfapi', 'EMPTY')
+        conf.undefine('HAVE_GLUSTERFS')
+
     conf.env.build_regedit = False
     if not Options.options.with_regedit == False:
         conf.PROCESS_SEPARATE_RULE('system_ncurses')
@@ -1745,8 +1840,10 @@ main() {
                                       vfs_smb_traffic_analyzer vfs_preopen vfs_catia vfs_scannedonly
                                      vfs_media_harmony
                                      vfs_commit
+                                     vfs_worm
                                       vfs_crossrename vfs_linux_xfs_sgid
                                       vfs_time_audit idmap_autorid idmap_tdb2
+                                      idmap_ad
                                       idmap_rid idmap_hash idmap_rfc2307'''))
 
     if Options.options.developer:
@@ -1801,6 +1898,9 @@ main() {
     if conf.CONFIG_SET("HAVE_CEPH"):
         default_shared_modules.extend(TO_LIST('vfs_ceph'))
 
+    if conf.CONFIG_SET('HAVE_GLUSTERFS'):
+        default_shared_modules.extend(TO_LIST('vfs_glusterfs'))
+
     explicit_shared_modules = TO_LIST(Options.options.shared_modules, delimiter=',')
     explicit_static_modules = TO_LIST(Options.options.static_modules, delimiter=',')