forked from facebookarchive/phpembed
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SConstruct
51 lines (41 loc) · 1.57 KB
/
SConstruct
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#
# DIRECTORY VARIABLES
# to keep code maximally portable, keep ALL directory references here
#
src = '#src/'
examples = '#examples/'
phpd = '/usr/local/php/include/php/'
phpdirs = [phpd, phpd+'Zend/', phpd+'TSRM/', phpd+'main/', phpd+'sapi/embed/']
#
# DEFINE BUILD ENVIRONMENT
# universal setting used for all programs for compilation
#
env = Environment(CPPFLAGS='-Wall -g',
CPPPATH=phpdirs + [src],
LINKFLAGS='`php-config --includes` `php-config --ldflags` `php-config --libs`')
libtarget = "phpembed"
libsources = [src + 'php_cxx.cpp', src + 'php_arr.cpp',
src + 'php_stl.cpp', src + 'php_tok.cpp']
env.StaticLibrary(target = libtarget, source = libsources)
#
# BUILD EXECUTABLES
# go to all children and execute their SConscripts
#
test = env.Program(target = 'test',
source = [examples + 'test.cpp',
'libphpembed.a',
'/usr/local/php/lib/libphp5.a'],
LIBS = '',
LIBPATH = '')
example = env.Program(target = 'example',
source = [examples + 'example.cpp',
'libphpembed.a',
'/usr/local/php/lib/libphp5.a'],
LIBS = '',
LIBPATH = '')
usage = env.Program(target = 'usage',
source = [examples + 'usage.cpp',
'libphpembed.a',
'/usr/local/php/lib/libphp5.a'],
LIBS = '',
LIBPATH = '')