Add support for Mac OS X 64bit builds with GYP
authorjkummerow@chromium.org <jkummerow@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 30 Mar 2012 15:01:11 +0000 (15:01 +0000)
committerjkummerow@chromium.org <jkummerow@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 30 Mar 2012 15:01:11 +0000 (15:01 +0000)
Note that in order to build for 64bits mode, you'll have
to specify the target architecture explicitely, the default
is still 32bits for Mac OS X.

Example with make and gcc:

$ export GYP_GENERATORS=make
$ make dependencies
$ make -j 8 library=shared x64.release

Example with make and clang:

$ export GYP_GENERATORS=make
$ export CC=/usr/bin/clang
$ export CXX=/usr/bin/clang++
$ export GYP_DEFINES="clang=1"
$ make dependencies
$ make -j 8 library=shared x64.release

Example with xcode:

$ export GYP_GENERATORS=xcode
$ build/gyp_v8 -Dtarget_arch=x64
$ xcodebuild -project build/all.xcodeproj -configuration Release

Contributed by Filipe David Manana <fdmanana@gmail.com>

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/9808065

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11199 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

AUTHORS
Makefile
build/common.gypi
build/gyp_v8
tools/gyp/v8.gyp

diff --git a/AUTHORS b/AUTHORS
index dfefad1..6e46b3d 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -23,6 +23,7 @@ Daniel James <dnljms@gmail.com>
 Dineel D Sule <dsule@codeaurora.org>
 Erich Ocean <erich.ocean@me.com>
 Fedor Indutny <fedor@indutny.com>
+Filipe David Manana <fdmanana@gmail.com>
 Ioseb Dzmanashvili <ioseb.dzmanashvili@gmail.com>
 Jan de Mooij <jandemooij@gmail.com>
 Jay Freeman <saurik@saurik.com>
index 72d08c4..da1d688 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -266,4 +266,4 @@ $(ENVFILE).new:
 # Dependencies.
 dependencies:
        svn checkout --force http://gyp.googlecode.com/svn/trunk build/gyp \
-           --revision 1026
+           --revision 1282
index 7647a79..3016d0c 100644 (file)
             ],
           }],
         ],
+      }, {  # Section for OS=="mac".
+        'conditions': [
+          ['target_arch=="ia32"', {
+            'xcode_settings': {
+              'ARCHS': ['i386'],
+            }
+          }],
+          ['target_arch=="x64"', {
+            'xcode_settings': {
+              'ARCHS': ['x86_64'],
+            }
+          }],
+        ],
       }],
       ['v8_use_liveobjectlist=="true"', {
         'defines': [
index 4293e76..0fe3403 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/python
 #
-# Copyright 2010 the V8 project authors. All rights reserved.
+# Copyright 2012 the V8 project authors. All rights reserved.
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions are
 # met:
@@ -156,7 +156,12 @@ if __name__ == '__main__':
 
   # Generate for the architectures supported on the given platform.
   gyp_args = list(args)
-  gyp_args.append('-Dtarget_arch=ia32')
+  target_arch = None
+  for p in gyp_args:
+    if p.find('-Dtarget_arch=') == 0:
+      target_arch = p
+  if target_arch is None:
+    gyp_args.append('-Dtarget_arch=ia32')
   if utils.GuessOS() == 'linux':
     gyp_args.append('-S-ia32')
   run_gyp(gyp_args)
index bb26f8a..46f85fe 100644 (file)
                 '../../src/v8dll-main.cc',
               ],
               'conditions': [
+                ['OS=="mac"', {
+                  'xcode_settings': {
+                    'OTHER_LDFLAGS': ['-dynamiclib', '-all_load']
+                  },
+                }],
                 ['OS=="win"', {
                   'defines': [
                     'BUILDING_V8_SHARED',