root/lang/cplusplus/fcgi-v8/trunk/Sconstruct @ 19321

Revision 19321, 1.3 kB (checked in by tokuhirom, 6 years ago)

urlfetch is ext libs

Line 
1import platform
2
3env = Environment()
4conf = Configure(env)
5
6SOURCES = [
7  "llv8call.cc",
8  "util.cc",
9  "core.cc",
10  "file.cc",
11  "dir.cc",
12  "sqlite3-amalgamination.c",
13  "sqlite3.cc",
14]
15include = ['../v8/include/']
16
17def GuessOS():
18  id = platform.system()
19  if id == 'Linux':
20    return 'linux'
21  elif id == 'Darwin':
22    return 'macos'
23  elif id == 'Windows':
24    return 'win32'
25  else:
26    return None
27
28OS_GUESS = GuessOS()
29
30libs=['v8', 'pthread']
31
32if OS_GUESS == 'win32':
33  libs.append('iconv')
34  env.Append(CCFLAGS = ['-DHAVE_DIR'])
35  SOURCES.append('platform-win32.cc')
36elif OS_GUESS == 'macos':
37  libs.append('iconv')
38  env.Append(CCFLAGS = ['-DHAVE_DIR'])
39  SOURCES.append('platform-posix.cc')
40else:
41  env.Append(CCFLAGS = ['-DHAVE_DIR'])
42  SOURCES.append('platform-posix.cc')
43
44if conf.CheckLib('readline'):
45    print "have readline"
46    libs.append('readline')
47    env.Append(CCFLAGS = ['-DHAVE_READLINE'])
48    if OS_GUESS == 'win32':
49        env.Append(CCFLAGS = ['-DREADLINE_STATIC'])
50
51if conf.CheckLib('fcgi'):
52    print "have libfcgi"
53    libs.append('fcgi')
54    env.Append(CCFLAGS = ['-DHAVE_FCGI'])
55    SOURCES.append('fcgi.cc')
56
57env.Append(CCFLAGS = ['-g'])
58
59env.Program(
60    "llv8call",
61    ["src/" + x for x in SOURCES],
62    LIBS=libs,
63    CPPPATH=include,
64    LIBPATH=['../v8/'],
65)
66
Note: See TracBrowser for help on using the browser.