-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmeson.build
76 lines (67 loc) · 2.4 KB
/
meson.build
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# pyisam build file for meson
project(
'pyisam', 'c',
version : '0.10',
)
# Get the compiler
cc = meson.get_compiler('c')
# Determine the list of compiler arguments
cflags = cc.get_supported_arguments([
'-O',
'-finline-functions',
'-fomit-frame-pointer',
'-fsigned-char',
'-Wall',
'-Wwrite-strings',
'-Wmissing-prototypes',
'-Wno-format-y2k',
])
# Create the configuration to store settings in
conf = configuration_data()
# Create the configuration for the pyisam package
pyisam_conf = configuration_data()
# Select whether to compile vbisam or ifisam support
use_vbisam = get_option('vbisam')
if use_vbisam
add_project_arguments(['-imacros', meson.project_build_root() / 'config.h'], language: 'c')
pyisam_conf.set('PYISAM_ISAMLIB', 'vbisam', description: 'Default backend to be used')
conf.set10('ISAMMODE', get_option('extended'), description: 'Set to 1 if compiling in extended mode')
conf.set10('HAVE_LFS64', true, description: 'Set if the system supports 64-bit I/O')
conf.set10('VBDEBUG', false, description: 'Enable internal debug of vbisam')
cflags += ['-DNEED_COUNT_ROWS=1', '-DNEED_IFISAM_COMPAT=1', '-DISOPEN_SET_ISRECLEN=1']
std_hdrs = ['fcntl.h', 'unistd.h']
req_func = []
else
pyisam_conf.set('PYISAM_ISAMLIB', 'ifisam', description: 'Default backend to be used')
std_hdrs = []
req_func = []
endif
pyisam_conf.set('PYISAM_BACKEND', 'cffi', description: 'Set the default backend')
# Check for the required headers
foreach hdr: std_hdrs
conf.set10('HAVE_' + hdr.underscorify().to_upper(),
cc.has_header(hdr),
description: 'Define if have the @hdr@ header')
endforeach
foreach fun: req_func
conf.set10('HAVE_' + fun.underscorify().to_upper(),
cc.has_function(fun),
description: 'Define if have the @fun@ function')
endforeach
# Check if the fcntl.h header defines struct flock64
conf.set10('HAVE_STRUCT_FLOCK64', cc.has_header_symbol('fcntl.h', 'flock64'), description: 'Define if you use the flock64 structure')
# Create the config.h file for compilations
conf_h = configure_file(configuration: conf, output: 'config.h')
pyisam_conf = configure_file(
configuration: pyisam_conf,
output: 'conf.py',
input: meson.project_source_root() / 'pyisam' / 'backend' / 'conf.py.in'
)
# Include the library source being compiled
if use_vbisam
# Include the libvbisam support
subdir('libvbisam')
else
# Include the libifisam/libifisamx support
subdir('libifisam')
endif