Commit ca1b78c6 by Konstantin Käfer

merge in springmeyer's build script fixes

parent c3e5f78f
#!/usr/bin/env python
import os import os
import sys import sys
import Options
from Configure import ConfigurationError
from os.path import exists from os.path import exists
from os import unlink
from shutil import copy2 as copy, rmtree from shutil import copy2 as copy, rmtree
# node-wafadmin # node-wafadmin
import Options import Options
import Utils import Utils
from Configure import ConfigurationError
TARGET = 'sqlite3_bindings' TARGET = 'sqlite3_bindings'
...@@ -21,7 +20,6 @@ BUNDLED_SQLITE3 = 'sqlite-autoconf-%s' % BUNDLED_SQLITE3_VERSION ...@@ -21,7 +20,6 @@ BUNDLED_SQLITE3 = 'sqlite-autoconf-%s' % BUNDLED_SQLITE3_VERSION
BUNDLED_SQLITE3_TAR = 'sqlite-autoconf-%s.tar.gz' % BUNDLED_SQLITE3_VERSION BUNDLED_SQLITE3_TAR = 'sqlite-autoconf-%s.tar.gz' % BUNDLED_SQLITE3_VERSION
SQLITE3_TARGET = 'deps/%s' % BUNDLED_SQLITE3 SQLITE3_TARGET = 'deps/%s' % BUNDLED_SQLITE3
sqlite3_test_program = ''' sqlite3_test_program = '''
#include "stdio.h" #include "stdio.h"
#ifdef __cplusplus #ifdef __cplusplus
...@@ -126,28 +124,23 @@ def clean_internal_sqlite3(): ...@@ -126,28 +124,23 @@ def clean_internal_sqlite3():
if os.path.exists(SQLITE3_TARGET): if os.path.exists(SQLITE3_TARGET):
rmtree(SQLITE3_TARGET) rmtree(SQLITE3_TARGET)
def build(ctx): def build(bld):
build_internal_sqlite3() obj = bld.new_task_gen("cxx", "shlib", "node_addon")
t = ctx.new_task_gen('cxx', 'shlib', 'node_addon') build_internal_sqlite3(bld)
t.cxxflags = ["-g", "-D_FILE_OFFSET_BITS=64", "-D_LARGEFILE_SOURCE", obj.cxxflags = ["-g", "-D_FILE_OFFSET_BITS=64", "-D_LARGEFILE_SOURCE",
"-DSQLITE_ENABLE_RTREE=1", "-pthread", "-Wall"] "-DSQLITE_ENABLE_RTREE=1", "-pthread", "-Wall"]
# uncomment the next line to remove '-undefined -dynamic_lookup' # uncomment the next line to remove '-undefined dynamic_lookup'
# in order to review linker errors (v8, libev/eio references can be ignored) # in order to review linker errors (v8, libev/eio references can be ignored)
# t.env['LINKFLAGS_MACBUNDLE'] = ['-bundle'] #obj.env['LINKFLAGS_MACBUNDLE'] = ['-bundle']
t.target = TARGET obj.target = TARGET
t.source = "src/database.cc src/statement.cc src/sqlite3.cc" obj.source = "src/sqlite3.cc src/database.cc src/statement.cc"
# t.uselib = "SQLITE3" obj.uselib = "SQLITE3"
def clean(ctx):
if exists("build"):
rmtree("build")
if exists(dest):
unlink(dest)
clean_internal_sqlite3()
def shutdown(): def shutdown():
if not Options.commands['clean'] and exists(built): if Options.commands['clean']:
if exists(TARGET_FILE):
unlink(TARGET_FILE)
clean_internal_sqlite3()
else:
if exists(built):
copy(built, dest) copy(built, dest)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment