| Line | Revision | Contents |
| 1 | 16 | # Process this file with http://www.scons.org to build FSPCLIENT |
| 2 | 12 | |
| 3 | 74 | # init SCons framework |
| 4 | 94 | EnsureSConsVersion(1,1) |
| 5 | 64 | EnsurePythonVersion(2,2) |
| 6 | 74 | |
| 7 | 64 | # set defaults |
| 8 | 12 | PREFIX='/usr/local' |
| 9 | PACKAGE='fspclient' | |
| 10 | 109 | VERSION='0.93.0' |
| 11 | 12 | |
| 12 | 74 | # create environment |
| 13 | 12 | env = Environment(CPPPATH='#/include') |
| 14 | 74 | |
| 15 | # configure globals | |
| 16 | env.Append(CPPFLAGS = "-DPACKAGE_VERSION=\\\""+VERSION+"\\\"") | |
| 17 | ||
| 18 | 64 | # Import GZip builder |
| 19 | import gzipBuilder | |
| 20 | env['BUILDERS']['GZip']=Builder(action=gzipBuilder.GZip) | |
| 21 | 16 | |
| 22 | 74 | # import environment |
| 23 | 68 | from importer import importEnvironment,importVariable |
| 24 | importEnvironment(env,'HOME') | |
| 25 | importVariable(env,'CC') | |
| 26 | 79 | importVariable(env,'CFLAGS','CCFLAGS') |
| 27 | 68 | importEnvironment(env,prefix='DISTCC_') |
| 28 | importEnvironment(env,prefix='CCACHE_') | |
| 29 | 95 | importEnvironment(env,'PATH') |
| 30 | 64 | |
| 31 | 85 | # Turn CPPFLAGS to list, so we can add values to it |
| 32 | 84 | env.Append(CPPFLAGS = []) |
| 33 | ||
| 34 | 14 | # Get CC from commandline |
| 35 | if ARGUMENTS.get('CC', 0): | |
| 36 | 70 | env.Replace(CC = ARGUMENTS.get('CC')) |
| 37 | 80 | if ARGUMENTS.get('CFLAGS',0): |
| 38 | env.Replace(CCFLAGS = ARGUMENTS.get('CFLAGS')) | |
| 39 | if ARGUMENTS.get('CCFLAGS',0): | |
| 40 | env.Replace(CCFLAGS = ARGUMENTS.get('CCFLAGS')) | |
| 41 | 12 | |
| 42 | 86 | # Convert CCFLAGS into list |
| 43 | env.Replace(CCFLAGS = str(env['CCFLAGS']).split(' ')) | |
| 44 | 64 | |
| 45 | 13 | ############ Start configuration ############## |
| 46 | 70 | |
| 47 | from compilertest import checkForCCOption | |
| 48 | from clangtest import checkForVariable | |
| 49 | 71 | from maintainer import checkForMaintainerMode |
| 50 | 72 | from prefix import checkForUserPrefix |
| 51 | 112 | from mandir import checkForUserMandir |
| 52 | from mandir import autodetectMandir | |
| 53 | 76 | from lockprefix import checkForLockPrefix |
| 54 | 77 | from locktype import checkForLockingType |
| 55 | 70 | |
| 56 | conf = Configure(env,{'checkForCCOption':checkForCCOption, | |
| 57 | 12 | 'MAINTAINER_MODE':checkForMaintainerMode, |
| 58 | 'checkForLockPrefix':checkForLockPrefix, | |
| 59 | 13 | 'checkPrefix':checkForUserPrefix, |
| 60 | 77 | 'haveVar':checkForVariable, |
| 61 | 112 | 'checkForUserMandir':checkForUserMandir, |
| 62 | 'autodetectMandir':autodetectMandir, | |
| 63 | 77 | 'checkForLockingType':checkForLockingType |
| 64 | 12 | }) |
| 65 | 94 | if not conf.CheckCC(): Exit(1) |
| 66 | 74 | # check for CC options |
| 67 | 12 | for option in Split(""" |
| 68 | -Wall -W -Wstrict-prototypes -Wmissing-prototypes -Wshadow | |
| 69 | -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings | |
| 70 | -Waggregate-return -Wmissing-declarations | |
| 71 | -Wmissing-format-attribute -Wnested-externs | |
| 72 | -ggdb -fno-common -Wchar-subscripts -Wcomment | |
| 73 | -Wimplicit -Wsequence-point -Wreturn-type | |
| 74 | -Wfloat-equal -Wno-system-headers -Wredundant-decls | |
| 75 | -Wmissing-noreturn -pedantic | |
| 76 | -Wlong-long -Wundef -Winline | |
| 77 | -Wpointer-arith -Wno-unused-parameter | |
| 78 | -Wunreachable-code | |
| 79 | """): | |
| 80 | 70 | conf.checkForCCOption(option) |
| 81 | 74 | |
| 82 | # portability build time config | |
| 83 | 33 | if conf.haveVar('optreset','#include <unistd.h>'): |
| 84 | 13 | conf.env.Append(CPPFLAGS = '-DHAVE_OPTRESET') |
| 85 | if conf.CheckFunc('srandomdev'): | |
| 86 | conf.env.Append(CPPFLAGS = '-DHAVE_SRANDOMDEV') | |
| 87 | 12 | if not conf.CheckType("union semun", "#include <sys/types.h>\n#include <sys/ipc.h>\n#include <sys/sem.h>",'c'): |
| 88 | conf.env.Append(CPPFLAGS = "-D_SEM_SEMUN_UNDEFINED=1") | |
| 89 | 77 | |
| 90 | conf.checkForLockingType(conf) | |
| 91 | 12 | conf.checkForLockPrefix() |
| 92 | 72 | PREFIX=conf.checkPrefix(PREFIX) |
| 93 | 112 | MANDIR=conf.autodetectMandir(PREFIX) |
| 94 | MANDIR=conf.checkForUserMandir(MANDIR) | |
| 95 | 12 | conf.MAINTAINER_MODE() |
| 96 | conf.Finish() | |
| 97 | ||
| 98 | # process build rules | |
| 99 | 112 | Export( Split("env PREFIX PACKAGE VERSION MANDIR")) |
| 100 | 49 | env.SConscript(dirs=Split('. bsd common client man')) |
Loggerhead is a web-based interface for Bazaar branches