Revert "Unify configure scripts"
authorRyan Dahl <ry@tinyclouds.org>
Tue, 9 Aug 2011 17:19:48 +0000 (10:19 -0700)
committerRyan Dahl <ry@tinyclouds.org>
Tue, 9 Aug 2011 17:19:48 +0000 (10:19 -0700)
This reverts commit 71435ede815ee2c73b09f7071ee1b6d10945d409.

configure
configure-gyp [new file with mode: 0755]

index 840782327ec31708d51c2725f80cfacf6ce91f75..de002e39b26902259b428f6e9ef47953c95aabc3 100755 (executable)
--- a/configure
+++ b/configure
-#!/usr/bin/env python
+#! /bin/sh
 
-import optparse
-import os
-import sys
-import json
+# v8 doesn't like ccache
+if [ ! -z "`echo $CC | grep ccache`" ]; then
+  echo "Error: V8 doesn't like cache. Please set your CC env var to 'gcc'"
+  echo "  (ba)sh: export CC=gcc"
+  exit 1
+fi
 
-root_dir = os.path.dirname(__file__)
-os.chdir(root_dir)
+CUR_DIR=$PWD
 
-use_gyp = False
+#possible relative path
+WORKINGDIR=`dirname $0`
+cd "$WORKINGDIR"
+#abs path
+WORKINGDIR=`pwd`
+cd "$CUR_DIR"
 
-for a in sys.argv:
-  if a == '--use-gyp':
-    use_gyp = True
-    break
-
-# Default to the old WAF system
-if not use_gyp:
-  r = os.system("./tools/waf-light --jobs=1 configure " + ' '.join(sys.argv[1:]))
-  exit(r)
-
-# GYP specific configure script
-
-# parse our options
-parser = optparse.OptionParser()
-
-parser.add_option("--use-gyp", action="store_true", help="placeholder")
-
-parser.add_option("--debug", action="store_true", dest="debug",
-    default=False, help="Also build debug build")
-
-parser.add_option("--prefix", action="store", dest="prefix",
-    help="Select the install prefix (defaults to /usr/local)")
-
-# TODO options to support for backwards compatibility
-#
-#  --without-snapshot
-#    Build without snapshotting V8 libraries. You might want to set this for
-#    cross-compiling.  [Default: False]
-#
-#  --without-ssl
-#    Build without SSL
-#
-#  --shared-v8
-#    Link to a shared V8 DLL instead of static linking
-#
-#  --shared-v8-includes=SHARED_V8_INCLUDES
-#    Directory containing V8 header files
-#
-#  --shared-v8-libpath=SHARED_V8_LIBPATH
-#    A directory to search for the shared V8 DLL
-#
-#  --shared-v8-libname=SHARED_V8_LIBNAME
-#    Alternative lib name to link to (default: 'v8')
-#
-#  --openssl-includes=OPENSSL_INCLUDES
-#    A directory to search for the OpenSSL includes
-#
-#  --openssl-libpath=OPENSSL_LIBPATH
-#    A directory to search for the OpenSSL libraries
-#
-#  --no-ssl2
-#    Disable OpenSSL v2
-#
-#  --gdb
-#    add gdb support
-#
-#  --shared-cares
-#    Link to a shared C-Ares DLL instead of static linking
-#
-#  --shared-cares-includes=SHARED_CARES_INCLUDES
-#    Directory containing C-Ares header files
-#
-#  --shared-cares-libpath=SHARED_CARES_LIBPATH
-#    A directory to search for the shared C-Ares DLL
-#
-#  --with-dtrace
-#    Build with DTrace (experimental)
-#
-#  --dest-cpu=DEST_CPU
-#    CPU architecture to build for. Valid values are: arm, ia32, x64
-
-
-(options, args) = parser.parse_args()
-
-print "configure options:", options
-
-output = {
-  'variables': {
-    'node_debug': 'true' if options.debug else 'false',
-    'node_prefix': options.prefix if options.prefix else ''
-  }
-}
-
-fn = os.path.join(root_dir, 'options.gypi')
-print "creating ", fn
-
-f = open(fn, 'w+')
-f.write("# Do not edit. Generated by the configure script.\n")
-json.dump(output, f, indent=2, skipkeys=True)
-f.write("\n")
-f.close()
+"${WORKINGDIR}/tools/waf-light" --jobs=1 configure $*
 
+exit $?
diff --git a/configure-gyp b/configure-gyp
new file mode 100755 (executable)
index 0000000..d1b27e5
--- /dev/null
@@ -0,0 +1,86 @@
+#!/usr/bin/env python
+
+import optparse
+import os
+import json
+
+root_dir = os.path.dirname(__file__)
+
+# parse our options
+parser = optparse.OptionParser()
+
+parser.add_option("--debug", action="store_true", dest="debug",
+    default=False, help="Also build debug build")
+
+parser.add_option("--prefix", action="store", dest="prefix",
+    help="Select the install prefix (defaults to /usr/local)")
+
+# TODO options to support for backwards compatibility
+#
+#  --without-snapshot
+#    Build without snapshotting V8 libraries. You might want to set this for
+#    cross-compiling.  [Default: False]
+#
+#  --without-ssl
+#    Build without SSL
+#
+#  --shared-v8
+#    Link to a shared V8 DLL instead of static linking
+#
+#  --shared-v8-includes=SHARED_V8_INCLUDES
+#    Directory containing V8 header files
+#
+#  --shared-v8-libpath=SHARED_V8_LIBPATH
+#    A directory to search for the shared V8 DLL
+#
+#  --shared-v8-libname=SHARED_V8_LIBNAME
+#    Alternative lib name to link to (default: 'v8')
+#
+#  --openssl-includes=OPENSSL_INCLUDES
+#    A directory to search for the OpenSSL includes
+#
+#  --openssl-libpath=OPENSSL_LIBPATH
+#    A directory to search for the OpenSSL libraries
+#
+#  --no-ssl2
+#    Disable OpenSSL v2
+#
+#  --gdb
+#    add gdb support
+#
+#  --shared-cares
+#    Link to a shared C-Ares DLL instead of static linking
+#
+#  --shared-cares-includes=SHARED_CARES_INCLUDES
+#    Directory containing C-Ares header files
+#
+#  --shared-cares-libpath=SHARED_CARES_LIBPATH
+#    A directory to search for the shared C-Ares DLL
+#
+#  --with-dtrace
+#    Build with DTrace (experimental)
+#
+#  --dest-cpu=DEST_CPU
+#    CPU architecture to build for. Valid values are: arm, ia32, x64
+
+
+(options, args) = parser.parse_args()
+
+print "configure options:", options
+
+output = {
+  'variables': {
+    'node_debug': 'true' if options.debug else 'false',
+    'node_prefix': options.prefix if options.prefix else ''
+  }
+}
+
+fn = os.path.join(root_dir, 'options.gypi')
+print "creating ", fn
+
+f = open(fn, 'w+')
+f.write("# Do not edit. Generated by the configure script.\n")
+json.dump(output, f, indent=2, skipkeys=True)
+f.write("\n")
+f.close()
+