configure: add a "--dest-os" option to force a gyp "flavor"
authorNathan Rajlich <nathan@tootallnate.net>
Sun, 9 Sep 2012 18:41:05 +0000 (11:41 -0700)
committerNathan Rajlich <nathan@tootallnate.net>
Sun, 9 Sep 2012 18:41:05 +0000 (11:41 -0700)
This makes cross-compiling easier. i.e. from my mac:

    ./configure --dest-cpu=arm --dest-os=linux

configure

index a801b657332733d7999e158b32125d87dfcc6be0..8a2b3d645f5cda987486877d8f9deeff8b2754f8 100755 (executable)
--- a/configure
+++ b/configure
@@ -159,6 +159,12 @@ parser.add_option("--dest-cpu",
     dest="dest_cpu",
     help="CPU architecture to build for. Valid values are: arm, ia32, x64")
 
+parser.add_option("--dest-os",
+    action="store",
+    dest="dest_os",
+    help="Operating system to build for. Valid values are: "
+         "win, mac, solaris, freebsd, linux")
+
 parser.add_option("--no-ifaddrs",
     action="store_true",
     dest="no_ifaddrs",
@@ -465,6 +471,8 @@ write('config.mk', "# Do not edit. Generated by the configure script.\n" +
 
 if os.name == 'nt':
   gyp_args = ['-f', 'msvs', '-G', 'msvs_version=2010']
+elif options.dest_os:
+  gyp_args = ['-f', 'make-' + options.dest_os]
 else:
   gyp_args = ['-f', 'make']