Skip to content
This repository
Browse code

sketch out configure support

  • Loading branch information...
commit f57d70d3c9aae692585478e3817dae512b526adc 1 parent 13d685b
ry ry authored

Showing 3 changed files with 89 additions and 16 deletions. Show diff stats Hide diff stats

  1. +2 0  .gitignore
  2. +81 16 configure
  3. +6 0 tools/gyp_node
2  .gitignore
@@ -34,3 +34,5 @@ _UpgradeReport_Files/
34 34 ipch/
35 35 *.sdf
36 36 *.opensdf
  37 +
  38 +/options.gypi
97 configure
... ... @@ -1,21 +1,86 @@
1   -#! /bin/sh
  1 +#!/usr/bin/env python
2 2
3   -# v8 doesn't like ccache
4   -if [ ! -z "`echo $CC | grep ccache`" ]; then
5   - echo "Error: V8 doesn't like cache. Please set your CC env var to 'gcc'"
6   - echo " (ba)sh: export CC=gcc"
7   - exit 1
8   -fi
  3 +import optparse
  4 +import os
  5 +import json
9 6
10   -CUR_DIR=$PWD
  7 +root_dir = os.path.dirname(__file__)
11 8
12   -#possible relative path
13   -WORKINGDIR=`dirname $0`
14   -cd "$WORKINGDIR"
15   -#abs path
16   -WORKINGDIR=`pwd`
17   -cd "$CUR_DIR"
  9 +# parse our options
  10 +parser = optparse.OptionParser()
18 11
19   -"${WORKINGDIR}/tools/waf-light" --jobs=1 configure $*
  12 +parser.add_option("--debug", action="store_true", dest="debug",
  13 + default=False, help="Also build debug build")
  14 +
  15 +parser.add_option("--prefix", action="store", dest="prefix",
  16 + help="Select the install prefix (defaults to /usr/local)")
  17 +
  18 +# TODO options to support for backwards compatibility
  19 +#
  20 +# --without-snapshot
  21 +# Build without snapshotting V8 libraries. You might want to set this for
  22 +# cross-compiling. [Default: False]
  23 +#
  24 +# --without-ssl
  25 +# Build without SSL
  26 +#
  27 +# --shared-v8
  28 +# Link to a shared V8 DLL instead of static linking
  29 +#
  30 +# --shared-v8-includes=SHARED_V8_INCLUDES
  31 +# Directory containing V8 header files
  32 +#
  33 +# --shared-v8-libpath=SHARED_V8_LIBPATH
  34 +# A directory to search for the shared V8 DLL
  35 +#
  36 +# --shared-v8-libname=SHARED_V8_LIBNAME
  37 +# Alternative lib name to link to (default: 'v8')
  38 +#
  39 +# --openssl-includes=OPENSSL_INCLUDES
  40 +# A directory to search for the OpenSSL includes
  41 +#
  42 +# --openssl-libpath=OPENSSL_LIBPATH
  43 +# A directory to search for the OpenSSL libraries
  44 +#
  45 +# --no-ssl2
  46 +# Disable OpenSSL v2
  47 +#
  48 +# --gdb
  49 +# add gdb support
  50 +#
  51 +# --shared-cares
  52 +# Link to a shared C-Ares DLL instead of static linking
  53 +#
  54 +# --shared-cares-includes=SHARED_CARES_INCLUDES
  55 +# Directory containing C-Ares header files
  56 +#
  57 +# --shared-cares-libpath=SHARED_CARES_LIBPATH
  58 +# A directory to search for the shared C-Ares DLL
  59 +#
  60 +# --with-dtrace
  61 +# Build with DTrace (experimental)
  62 +#
  63 +# --dest-cpu=DEST_CPU
  64 +# CPU architecture to build for. Valid values are: arm, ia32, x64
  65 +
  66 +
  67 +(options, args) = parser.parse_args()
  68 +
  69 +print "configure options:", options
  70 +
  71 +output = {
  72 + 'variables': {
  73 + 'node_debug': 'true' if options.debug else 'false',
  74 + 'node_prefix': options.prefix if options.prefix else ''
  75 + }
  76 +}
  77 +
  78 +fn = os.path.join(root_dir, 'options.gypi')
  79 +print "creating ", fn
  80 +
  81 +f = open(fn, 'w+')
  82 +f.write("# Do not edit. Generated by the configure script.\n")
  83 +json.dump(output, f, indent=2, skipkeys=True)
  84 +f.write("\n")
  85 +f.close()
20 86
21   -exit $?
6 tools/gyp_node
@@ -23,6 +23,11 @@ def run_gyp(args):
23 23 if __name__ == '__main__':
24 24 args = sys.argv[1:]
25 25 args.append(os.path.join(script_dir, 'all.gyp'))
  26 +
  27 + options_fn = os.path.abspath(os.path.join(node_root, 'options.gypi'))
  28 + if os.path.exists(options_fn):
  29 + args.extend(['-I', options_fn])
  30 +
26 31 args.append('--depth=' + node_root)
27 32
28 33 if sys.platform != 'win32':
@@ -36,4 +41,5 @@ if __name__ == '__main__':
36 41 args.append('-Dcomponent=static_library')
37 42 args.append('-Dlibrary=static_library')
38 43 gyp_args = list(args)
  44 + print gyp_args
39 45 run_gyp(gyp_args)

0 comments on commit f57d70d

Please sign in to comment.
Something went wrong with that request. Please try again.