diff --git a/SConstruct b/SConstruct index 2d67046a8956dc695b6b294f9166f787636ee27c..8a9946d9c1dd8ee9b4536e8e3015a7a5dbdf02b4 100644 --- a/SConstruct +++ b/SConstruct @@ -7,10 +7,13 @@ import sys vars = Variables(None, ARGUMENTS) vars.Add(PathVariable('DESTDIR', "Root directory to install in (useful for packaging scripts)", None, PathVariable.PathIsDirCreate)) vars.Add(PathVariable('prefix', "Where to install in the FHS", "/usr/local", PathVariable.PathAccept)) -vars.Add(ListVariable('BINDINGS', 'Language bindings to build', 0, ['php'])) +vars.Add(ListVariable('bindings', 'Language bindings to build', 'none', ['php'])) env = Environment(ENV = {'PATH' : os.environ['PATH']}, variables = vars, tools=['default', 'scanreplace'], toolpath=['tools']) +if not 'bindings' in env: + env['bindings'] = [] + def calcInstallPath(*elements): path = os.path.abspath(os.path.join(*map(env.subst, elements))) if 'DESTDIR' in env: diff --git a/src/SConscript b/src/SConscript index 98ce6c4787bf2f922b05ab357f957cb248156890..216c04d3f0517303c014a965e1417225f0615365 100644 --- a/src/SConscript +++ b/src/SConscript @@ -71,6 +71,5 @@ testenv.Program('test_suite', tests + ['test_suite.c']) Export("libhammer_static libhammer_shared") -if 'BINDINGS' in env: - for b in env['BINDINGS']: - env.SConscript(["bindings/%s/SConscript" % b]) +for b in env['bindings']: + env.SConscript(["bindings/%s/SConscript" % b]) diff --git a/src/bindings/php/SConscript b/src/bindings/php/SConscript index b165f2058118762c73d8a1251dcb222884db6d57..f779979665401399cb4b4f99aaade0e2c00d822b 100644 --- a/src/bindings/php/SConscript +++ b/src/bindings/php/SConscript @@ -8,17 +8,17 @@ phpenv.Append(CPPPATH = ['../../', '/usr/include/php5', '/usr/include/php5/main' phpenv.Append(CCFLAGS = ['-fpic', '-DSWIG', '-Wno-all', '-Wno-extra', '-Wno-error']) phpenv.Append(LIBS = ['hammer']) phpenv.Append(LIBPATH = ['../../']) -phpenv.Append(SWIGFLAGS = ['-DHAMMER_INTERNAL__NO_STDARG_H', '-Isrc/', '-php']) +#phpenv.Append(SWIGFLAGS = ['-DHAMMER_INTERNAL__NO_STDARG_H', '-Isrc/', '-php']) phpenv.Command("hammer.i", "../swig/hammer.i", Copy("$TARGET", "$SOURCE")) +phpenv.Command(['hammer.php', 'hammer_wrap.c', 'php_hammer.h'], 'hammer.i', 'swig -php -DHAMMER_INTERNAL__NO_STDARG_H -Isrc/ $SOURCE') -swig = ['hammer.i'] - -libhammer_php = phpenv.SharedLibrary('hammer', swig) +#swig = ['hammer.i'] +#libhammer_php = phpenv.SharedLibrary('hammer', swig) #phptestenv = phpenv.Clone() #phptestenv['ENV']['LD_LIBRARY_PATH'] = os.path.dirname(str(libhammer_shared[0])) #tests = phptestenv.Dir('Tests/') #phptestenv.Command(tests, [libhammer_php], "phpunit -v --include-path "+os.getcwd()+" $TARGET") -Clean('.', ['hammer.php']) +Clean('.', ['hammer.php', 'php_hammer.h'])