-
Notifications
You must be signed in to change notification settings - Fork 4
/
SConstruct
58 lines (47 loc) · 1.52 KB
/
SConstruct
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
import os
from SConsUtil import *
# Parallel build
SetOption('num_jobs', os.sysconf('SC_NPROCESSORS_ONLN'))
opt = os.environ.get('OPT', '-O0')
env = Environment(
LINKFLAGS = '-g',
CPPFLAGS = '-Wall -g %s' % opt,
ENV = { 'PATH' : os.environ['PATH'] })
env.Append(CPPFLAGS = ' ' + os.environ.get('CPPFLAGS', ''))
conf = Configure(env, help = True, config_h = 'config.h',
custom_tests = { 'CheckPkg': CheckPkg, 'CheckMac': CheckMac })
if not FindCXX(conf):
print('No compiler found.')
Exit(1)
if not FindTR1(conf):
print('No unordered_map implementation found.')
Exit(1)
if not FindFUSE(conf):
print('FUSE not found.')
Exit(1)
compression_libs = [
('LZO', 'lzo2', 'lzo/lzo1x.h', 'HAVE_LZO'),
('LZMA', 'lzma', 'lzma.h', 'HAVE_LZMA'),
('zlib', 'z', 'zlib.h', 'HAVE_ZLIB'),
('bipz2', 'bz2', 'bzlib.h', 'HAVE_BZIP2'),
('zstd', 'zstd', 'zstd.h', 'HAVE_ZSTD'),
]
compression_found = False
for name, lib, header, define in compression_libs:
if FindLib(conf, lib, header):
conf.env.Append(CPPDEFINES = define)
compression_found = True
else:
print('%s not found, skipping' % name)
if not compression_found:
print('No compression library found.')
Exit(1)
if not FindLib(conf, 'pthread', 'pthread.h'):
print('pthreads not found.')
Exit(1)
if not conf.CheckHeader('libkern/OSByteOrder.h'):
if not conf.CheckHeader('endian.h'):
print('No endianness header found.')
Exit(1)
env = conf.Finish()
env.Program('lzopfs', Glob('*.cc'))