]> git.sven.stormbind.net Git - sven/exfat-utils.git/blobdiff - SConstruct
Imported Upstream version 0.9.8
[sven/exfat-utils.git] / SConstruct
index 14bd10e8fbcfbd6e31e38af4b3faf62a9e984250..3206c545abf656197954233c619887994dd95431 100644 (file)
@@ -2,7 +2,7 @@
 #      SConstruct (10.09.09)
 #      SConscript for all components.
 #
 #      SConstruct (10.09.09)
 #      SConscript for all components.
 #
-#      Copyright (C) 2009, 2010  Andrew Nayenko
+#      Copyright (C) 2010-2012  Andrew Nayenko
 #
 #      This program is free software: you can redistribute it and/or modify
 #      it under the terms of the GNU General Public License as published by
 #
 #      This program is free software: you can redistribute it and/or modify
 #      it under the terms of the GNU General Public License as published by
@@ -36,16 +36,23 @@ if 'CCFLAGS' in os.environ:
 # Set default CCFLAGS for known compilers
 if not conf.env['CCFLAGS']:
        if conf.env['CC'] == 'gcc':
 # Set default CCFLAGS for known compilers
 if not conf.env['CCFLAGS']:
        if conf.env['CC'] == 'gcc':
-               conf.env.Replace(CCFLAGS = '-Wall -O2 -ggdb')
+               conf.env.Replace(CCFLAGS = '-Wall -O2 -ggdb -std=c99')
        elif conf.env['CC'] == 'clang':
        elif conf.env['CC'] == 'clang':
-               conf.env.Replace(CCFLAGS = '-Wall -O2 -g')
-conf.env.Append(CPPDEFINES = {'FUSE_USE_VERSION': 26})
+               conf.env.Replace(CCFLAGS = '-Wall -O2 -g -std=c99')
+if 'CPPFLAGS' in os.environ:
+       conf.env.Replace(CPPFLAGS = os.environ['CPPFLAGS'])
 conf.env.Append(CPPDEFINES = {'_FILE_OFFSET_BITS' : 64})
 conf.env.Append(CPPPATH = ['libexfat'])
 if 'LDFLAGS' in os.environ:
        conf.env.Append(LINKFLAGS = os.environ['LDFLAGS'])
 conf.env.Append(LIBPATH = ['libexfat'])
 
 conf.env.Append(CPPDEFINES = {'_FILE_OFFSET_BITS' : 64})
 conf.env.Append(CPPPATH = ['libexfat'])
 if 'LDFLAGS' in os.environ:
        conf.env.Append(LINKFLAGS = os.environ['LDFLAGS'])
 conf.env.Append(LIBPATH = ['libexfat'])
 
+# GNU/Linux requires _BSD_SOURCE define for vsyslog(), _XOPEN_SOURCE >= 500 for
+# pread(), pwrite(), snprintf(), strdup(), etc. Everything needed is enabled by
+# _GNU_SOURCE.
+if platform.system() == 'Linux':
+       conf.env.Append(CPPDEFINES = '_GNU_SOURCE');
+
 # __DARWIN_64_BIT_INO_T=0 define is needed because since Snow Leopard inode
 # numbers are 64-bit by default, but libfuse operates 32-bit ones. This define
 # forces 32-bit inode declaration in system headers, but it's also possible to
 # __DARWIN_64_BIT_INO_T=0 define is needed because since Snow Leopard inode
 # numbers are 64-bit by default, but libfuse operates 32-bit ones. This define
 # forces 32-bit inode declaration in system headers, but it's also possible to