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

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

libmemcached support should be extension libs.

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