From 94d855c5160d021cafd480b098e3d1a527c23667 Mon Sep 17 00:00:00 2001 From: "Meredith L. Patterson" Date: Sun, 17 Nov 2013 17:57:43 -0600 Subject: [PATCH] scons builds the SWIG PHP bindings that can create parsers but not parse any input yet --- src/bindings/php/SConscript | 12 ++++++++++++ src/bindings/swig/hammer.i | 3 +++ 2 files changed, 15 insertions(+) create mode 100644 src/bindings/php/SConscript diff --git a/src/bindings/php/SConscript b/src/bindings/php/SConscript new file mode 100644 index 0000000..9962264 --- /dev/null +++ b/src/bindings/php/SConscript @@ -0,0 +1,12 @@ +# -*- python -*- +Import('env') + +phpenv = env.Clone() + +phpenv.Append(CPPPATH = ['../../', '/usr/include/php5', '/usr/include/php5/main', '/usr/include/php5/Zend', '/usr/include/php5/TSRM']) +phpenv.Append(CCFLAGS = ['-fpic', '-DSWIG', '-Wno-unused-variable', '-Wno-unused-label', '-Wno-unused-function', '-Wno-missing-field-initializers']) +phpenv.Append(SWIGFLAGS = '-DHAMMER_INTERNAL__NO_STDARG_H -Isrc/ -php') + +swig = ['../swig/hammer.i'] + +libhammer_php = phpenv.SharedLibrary('hammer', swig) \ No newline at end of file diff --git a/src/bindings/swig/hammer.i b/src/bindings/swig/hammer.i index 13c30a4..971b37f 100644 --- a/src/bindings/swig/hammer.i +++ b/src/bindings/swig/hammer.i @@ -131,6 +131,7 @@ #warning no uint8_t* typemaps defined #endif +//%include "typemaps.i" // All the include paths are relative to the build, i.e., ../../. If you need to build these manually (i.e., not with scons), keep that in mind. %{ #include "allocator.h" @@ -344,3 +345,5 @@ def int64(): return _h_int64() %} #endif +//%apply const char* { const uint8_t* } +