conf.ADD_LDFLAGS("-Wl,--export-dynamic", testflags=True)
conf.CHECK_HEADERS('execinfo.h libexc.h libunwind.h netdb.h')
- conf.CHECK_HEADERS('linux/falloc.h')
+ conf.CHECK_HEADERS('linux/falloc.h linux/ioctl.h')
conf.CHECK_FUNCS('getcwd fchown chmod fchmod mknod')
conf.CHECK_FUNCS('strtol strchr strupr chflags')
conf.DEFINE('HAVE_NO_AIO', '1')
if host_os.rfind('linux') > -1:
+ conf.CHECK_FUNCS('eventfd')
conf.CHECK_FUNCS_IN('io_submit', 'aio')
conf.CHECK_CODE('''
struct io_event ioev;
conf.DEFINE('WITH_QUOTAS', '1')
#
- # checking for clustering extensions (CTDB)
+ # cluster support (CTDB)
#
- if Options.options.with_cluster_support == False:
- # configure is called with --without-cluster-support,
- # so don't check for and build w/o ctdb support.
- have_cluster_support = False
-
+ if not Options.options.with_cluster_support:
+ Logs.info("building without cluster support (--without-cluster-support)")
+ conf.env.with_ctdb = False
else:
-
- have_cluster_support = True
- ctdb_broken = ""
- CTDB_CFLAGS = ""
-
- srcdir = os.path.realpath(conf.srcdir)
- if 'EXTRA_INCLUDES' in conf.env:
- includes = ' '.join(conf.env['EXTRA_INCLUDES']).replace('#', srcdir + '/')
- else:
- includes = ''
-
- CTDB_INCLUDE = conf.srcdir + '/ctdb/include'
- includes = includes + ' ' + CTDB_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'
-
- ok = conf.CHECK_CODE('''
- #define NO_CONFIG_H
- #include "replace.h"
- #include "system/wait.h"
- #include "system/network.h"
- #define private #error __USED_RESERVED_WORD_private__
- #include <talloc.h>
- #include <tdb.h>
- #include <ctdb.h>
-
- int main(void)
- {
- return 0;
- }
- ''',
- 'HAVE_CTDB_CHECK_CODE',
- addmain=False,
- includes=includes,
- msg='Checking for header 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:
- ok = conf.CHECK_CODE('''
- #define NO_CONFIG_H
- #include "replace.h"
- #include "system/wait.h"
- #include "system/network.h"
- #define private #error __USED_RESERVED_WORD_private__
- #include <talloc.h>
- #include <tdb.h>
- #include <ctdb.h>
- #include <ctdb_private.h>
-
- int main(void)
- {
- return 0;
- }
- ''',
- 'HAVE_CTDB_CHECK_CODE',
- addmain=False,
- includes=includes,
- msg='Checking for header 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:
- ok = conf.CHECK_CODE('''
- #define NO_CONFIG_H
- #include "replace.h"
- #include "system/wait.h"
- #include "system/network.h"
- #define private #error __USED_RESERVED_WORD_private__
- #include <talloc.h>
- #include <tdb.h>
- #include <ctdb.h>
- #include <ctdb_protocol.h>
-
- int main(void)
- {
- return 0;
- }
- ''',
- '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')
- conf.undefine('HAVE_CTDB_CHECK_CODE')
- if have_cluster_support:
Logs.info("building with cluster support")
- conf.env['CTDB_CFLAGS'] = CTDB_CFLAGS
- conf.env['CTDB_INCLUDE'] = CTDB_INCLUDE
- else:
- if Options.options.with_cluster_support == False:
- Logs.info("building without cluster support (--without-cluster-support)")
- elif Options.options.with_cluster_support == True:
- Logs.error("Cluster support not available: " + ctdb_broken)
- conf.fatal("Cluster support not found, but --with-cluster-support was specified")
- else:
- Logs.info("building without cluster support: " + ctdb_broken)
- conf.env['CTDB_CFLAGS'] = ''
-
+ conf.env['CTDB_CFLAGS'] = '-DCLUSTER_SUPPORT=1'
+ conf.env['CTDB_INCLUDE'] = conf.srcdir + '/ctdb/include'
+ conf.env.with_ctdb = True
conf.CHECK_CODE('__attribute__((destructor)) static void cleanup(void) { }',
'HAVE_FUNCTION_ATTRIBUTE_DESTRUCTOR',