|
Revision 19319, 1.3 kB
(checked in by tokuhirom, 5 years ago)
|
|
libmemcached support should be extension libs.
|
| Line | |
|---|
| 1 | import platform |
|---|
| 2 | |
|---|
| 3 | env = Environment() |
|---|
| 4 | conf = Configure(env) |
|---|
| 5 | |
|---|
| 6 | SOURCES = [ |
|---|
| 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 | ] |
|---|
| 16 | include = ['../v8/include/'] |
|---|
| 17 | |
|---|
| 18 | def 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 | |
|---|
| 29 | OS_GUESS = GuessOS() |
|---|
| 30 | |
|---|
| 31 | libs=['v8', 'pthread', 'curl'] |
|---|
| 32 | |
|---|
| 33 | if OS_GUESS == 'win32': |
|---|
| 34 | libs.append('iconv') |
|---|
| 35 | env.Append(CCFLAGS = ['-DHAVE_DIR']) |
|---|
| 36 | SOURCES.append('platform-win32.cc') |
|---|
| 37 | elif OS_GUESS == 'macos': |
|---|
| 38 | libs.append('iconv') |
|---|
| 39 | env.Append(CCFLAGS = ['-DHAVE_DIR']) |
|---|
| 40 | SOURCES.append('platform-posix.cc') |
|---|
| 41 | else: |
|---|
| 42 | env.Append(CCFLAGS = ['-DHAVE_DIR']) |
|---|
| 43 | SOURCES.append('platform-posix.cc') |
|---|
| 44 | |
|---|
| 45 | if 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 | |
|---|
| 52 | if conf.CheckLib('fcgi'): |
|---|
| 53 | print "have libfcgi" |
|---|
| 54 | libs.append('fcgi') |
|---|
| 55 | env.Append(CCFLAGS = ['-DHAVE_FCGI']) |
|---|
| 56 | SOURCES.append('fcgi.cc') |
|---|
| 57 | |
|---|
| 58 | env.Append(CCFLAGS = ['-g']) |
|---|
| 59 | |
|---|
| 60 | env.Program( |
|---|
| 61 | "llv8call", |
|---|
| 62 | ["src/" + x for x in SOURCES], |
|---|
| 63 | LIBS=libs, |
|---|
| 64 | CPPPATH=include, |
|---|
| 65 | LIBPATH=['../v8/'], |
|---|
| 66 | ) |
|---|
| 67 | |
|---|