--- SConstruct.orig 2010-09-09 15:18:44.331618166 +0200 +++ SConstruct 2010-09-09 15:43:39.579257085 +0200 @@ -29,9 +29,10 @@ f.close() env.CacheDir('/tmp/.zfs-fuse.scons') -env['CC'] = 'gcc' -env['LINKFLAGS'] = Split('-pipe -Wall') -env['CCFLAGS'] = Split('-pipe -Wall -std=c99 -Wno-switch -Wno-unused -Wno-missing-braces -Wno-parentheses -Wno-uninitialized -fno-strict-aliasing -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DTEXT_DOMAIN=\\"zfs-fuse\\" ') +env['CCFLAGS'] = Split('-Wall -std=c99 -Wno-switch -Wno-unused -Wno-missing-braces -Wno-parentheses -Wno-uninitialized -fno-strict-aliasing -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DTEXT_DOMAIN=\\"zfs-fuse\\" ') + +if 'CC' in os.environ: + env.Replace(CC = Split(os.environ['CC'])) if osname == "Linux": env.Append(CPPFLAGS = " -DLINUX_AIO") @@ -59,6 +60,13 @@ print "Misconfigured debug level: Neither DEBUG or NDEBUG appears to have been defined: %s" % env['CCFLAGS'] sys.exit(1) +if 'CFLAGS' in os.environ: + env.Append(CCFLAGS = Split(os.environ['CFLAGS'])) + env.Replace(CFLAGS = Split(os.environ['CFLAGS'])) + +if 'LDFLAGS' in os.environ: + env.Append(LINKFLAGS = Split(os.environ['LDFLAGS'])) + env['CPPPATH'] = [] f = os.popen('uname -m') --- lib/libumem/SConscript.orig 2010-09-09 15:18:44.498282736 +0200 +++ lib/libumem/SConscript 2010-09-09 15:14:59.000000000 +0200 @@ -1,7 +1,7 @@ import os Import('env') -Command("Makefile", [], ["cd lib/libumem && ./configure"]) +Command("Makefile", [], ['cd lib/libumem && LDFLAGS="%s" CC="%s" CFLAGS="%s" ./configure' % (' '.join(env['LINKFLAGS']),' '.join(env['CC']),' '.join(env['CFLAGS']))]) Command("libumem.a", [Glob('*.c'),'Makefile',Glob('*.h')], ["cd lib/libumem && make && rm -f libumem.a && ln -s .libs/libumem.a"]) if os.path.isfile("Makefile") and env.GetOption('clean'): Execute(Action(["make -C %s distclean" % (os.path.join(env.Dir("#").abspath, 'lib/libumem'))]))