4 if Options
.options
.disable_fault_handling
:
5 conf
.DEFINE('HAVE_DISABLE_FAULT_HANDLING',1)
7 # backtrace could be in libexecinfo or in libc
8 conf
.CHECK_FUNCS_IN('backtrace backtrace_symbols', 'execinfo', checklibc
=True, headers
='execinfo.h')
10 conf
.CHECK_STRUCTURE_MEMBER('struct statvfs', 'f_frsize', define
='HAVE_FRSIZE', headers
='sys/statvfs.h')
12 # all the different ways of doing statfs
16 'struct statvfs fsd; exit(statvfs(0, &fsd))',
19 ( 'STAT_STATFS3_OSF1',
20 '3-argument statfs function (DEC OSF/1)',
21 'struct statfs fsd; fsd.f_fsize = 0; exit(statfs(".", &fsd, sizeof(struct statfs)))',
22 'sys/param.h sys/mount.h' ),
24 ( 'STAT_STATFS2_BSIZE',
25 'two-argument statfs with statfs.bsize',
26 'struct statfs fsd; fsd.f_bsize = 0; exit(statfs(".", &fsd))',
27 'sys/param.h sys/mount.h sys/vfs.h' ),
30 'four-argument statfs (AIX-3.2.5, SVR3)',
31 'struct statfs fsd; exit(statfs(".", &fsd, sizeof fsd, 0))',
34 ( 'STAT_STATFS2_FSIZE',
35 'two-argument statfs with statfs.fsize',
36 'struct statfs fsd; fsd.f_fsize = 0; exit(statfs(".", &fsd))',
37 'sys/param.h sys/mount.h' ),
39 ( 'STAT_STATFS2_FS_DATA',
40 'two-argument statfs with struct fs_data (Ultrix)',
41 'struct fs_data fsd; exit(statfs(".", &fsd) != 1)',
42 'sys/param.h sys/mount.h sys/fs_types.h' )
46 for (define
, msg
, code
, headers
) in statfs_types
:
47 if conf
.CHECK_CODE(code
,
50 msg
='Checking for %s' % msg
,
56 print("FATAL: Failed to find a statfs method")
59 conf
.CHECK_CODE("""struct statfs fsd;
62 return (statfs (".", &fsd));
64 headers
='sys/param.h sys/mount.h sys/vfs.h',
65 define
='BSD_STYLE_STATVFS',
66 msg
='Checking for *bsd style statfs with statfs.f_iosize',
70 conf
.CHECK_CODE('struct statvfs buf; buf.f_fsid = 0',
71 define
='HAVE_FSID_INT',
72 msg
='Checking if f_fsid is an integer',
75 headers
='sys/statvfs.h')
77 # fsusage.c assumes that statvfs has an f_frsize entry. Some weird
78 # systems use f_bsize.
79 conf
.CHECK_CODE('struct statvfs buf; buf.f_frsize = 0',
81 msg
='Checking that statvfs.f_frsize works',
82 headers
='sys/statvfs.h',
86 # Some systems use f_flag in struct statvfs while others use f_flags
87 conf
.CHECK_CODE('struct statvfs buf; buf.f_flag = 0',
88 define
='HAVE_STATVFS_F_FLAG',
89 msg
='Checking whether statvfs.f_flag exists',
90 headers
='sys/statvfs.h',
94 conf
.CHECK_CODE('struct statvfs buf; buf.f_flags = 0',
95 define
='HAVE_STATVFS_F_FLAGS',
96 msg
='Checking whether statvfs.f_flags exists',
97 headers
='sys/statvfs.h',
102 # systemd removed the libsystemd-daemon and libsystemd-journal libraries. In newer
103 # versions it is only libsystemd. As waf pkg-config handling does not provide
104 # targets which could be used as a dependency based on the package name we need
105 # to look for them on our own. This enabled one of the library targets based on
106 # which version we detect.
108 conf
.SET_TARGET_TYPE('systemd-daemon', 'EMPTY')
109 conf
.SET_TARGET_TYPE('systemd-journal', 'EMPTY')
110 conf
.SET_TARGET_TYPE('systemd', 'EMPTY')
112 if Options
.options
.enable_systemd
!= False:
113 r_daemon
= conf
.CHECK_CFG(package
='libsystemd-daemon', args
='--cflags --libs',
114 msg
='Checking for libsystemd-daemon')
115 r_journal
= conf
.CHECK_CFG(package
='libsystemd-journal', args
='--cflags --libs',
116 msg
='Checking for libsystemd-journal')
117 if r_daemon
is None and r_journal
is None:
118 conf
.CHECK_CFG(package
='libsystemd', args
='--cflags --libs',
119 msg
='Checking for libsystemd')
120 conf
.CHECK_LIB('systemd', shlib
=True)
122 conf
.CHECK_LIB('systemd-daemon', shlib
=True)
123 conf
.CHECK_LIB('systemd-journal', shlib
=True)
125 if Options
.options
.enable_lttng
!= False:
126 conf
.CHECK_CFG(package
='lttng-ust', args
='--cflags --libs',
127 msg
='Checking for lttng-ust', uselib_store
="LTTNG-UST")
128 conf
.CHECK_HEADERS('lttng/tracef.h', lib
='lttng-st')
129 conf
.CHECK_LIB('lttng-ust', shlib
=True)
131 if (conf
.CONFIG_SET('HAVE_LTTNG_TRACEF_H') and
132 conf
.CONFIG_SET('HAVE_LTTNG_UST')):
133 conf
.DEFINE('HAVE_LTTNG_TRACEF', '1')
134 conf
.env
['HAVE_LTTNG_TRACEF'] = True
136 conf
.SET_TARGET_TYPE('lttng-ust', 'EMPTY')
137 conf
.undefine('HAVE_LTTNG_TRACEF')
139 conf
.env
['CPPPATH_GPFS'] = Options
.options
.gpfs_headers_dir
140 if conf
.CHECK_HEADERS('gpfs.h', False, False, "gpfs"):
141 conf
.DEFINE('HAVE_GPFS', '1')