2 # SConstruct (10.09.09)
3 # SConscript for all components.
5 # Copyright (C) 2009, 2010 Andrew Nayenko
7 # This program is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation, either version 3 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
24 # Define __DARWIN_64_BIT_INO_T=0 is needed for Snow Leopard support because
25 # in it's headers inode numbers are 64-bit by default, but libfuse operates
26 # 32-bit inode numbers. It's also possible to link against libfuse_ino64
28 cflags = '-Wall -O2 -ggdb -D_FILE_OFFSET_BITS=64 -D__DARWIN_64_BIT_INO_T=0 -Ilibexfat'
31 Library('libexfat/exfat', Glob('libexfat/*.c'), CFLAGS = cflags, LINKFLAGS = ldflags)
32 fsck = Program('fsck/exfatck', Glob('fsck/*.c'), CFLAGS = cflags, LINKFLAGS = ldflags, LIBS = ['exfat'], LIBPATH = 'libexfat')
33 mount = Program('fuse/mount.exfat-fuse', Glob('fuse/*.c'), CFLAGS = cflags + ' -DFUSE_USE_VERSION=26', LINKFLAGS = ldflags, LIBS = ['exfat', 'fuse'], LIBPATH = 'libexfat')
37 destdir = os.environ['DESTDIR']
42 def make_symlink((dir)):
46 os.remove('mount.exfat')
49 os.symlink('mount.exfat-fuse', 'mount.exfat')
52 symlink = SCons.Action.ActionFactory(make_symlink,
53 lambda dir: 'make_symlink("%s")' % dir)
55 Install(dir = get_destdir(), source = mount),
56 symlink(dir = get_destdir()))
58 Default([mount, fsck])