Reviewers: danno, Sven Panne,

Message:
This is a first baby-step towards platform cleanup, instead of trying to do
everything at once as I did last time. The OS_* defines are mostly compatible
with what Chromium uses, which will allow for easier sharing/copying w/o
breakage on our side (i.e. the atomicops* stuff). It will also allow us to get
rid of a lot of fragile #ifdef'ery in the long term.

Description:
Add (mostly Chromium-compatible) OS_* defines to v8.gyp.

Please review this at https://codereview.chromium.org/23283010/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files:
  M tools/gyp/v8.gyp


Index: tools/gyp/v8.gyp
diff --git a/tools/gyp/v8.gyp b/tools/gyp/v8.gyp
index 66376c17df51c844def32fa1f6c022d40c595db1..e07cb281781281b1fda7f047da6c32157f684c5d 100644
--- a/tools/gyp/v8.gyp
+++ b/tools/gyp/v8.gyp
@@ -687,6 +687,10 @@
                 }],
               ],
             },
+            'defines': [
+              'OS_LINUX=1',
+              'OS_POSIX=1'
+            ],
             'sources': [  ### gcmole(os:linux) ###
               '../../src/platform-linux.cc',
               '../../src/platform-posix.cc'
@@ -704,16 +708,29 @@
               ['host_os=="mac"', {
                 'target_conditions': [
                   ['_toolset=="host"', {
+                    'defines': [
+                      'OS_BSD=1',
+                      'OS_MACOSX=1',
+                      'OS_POSIX=1'
+                    ],
                     'sources': [
                       '../../src/platform-macos.cc'
                     ]
                   }, {
+                    'defines': [
+                      'OS_LINUX=1',
+                      'OS_POSIX=1'
+                    ],
                     'sources': [
                       '../../src/platform-linux.cc'
                     ]
                   }],
                 ],
               }, {
+                'defines': [
+                  'OS_LINUX=1',
+                  'OS_POSIX=1'
+                ],
                 'sources': [
                   '../../src/platform-linux.cc'
                 ]
@@ -722,6 +739,11 @@
           },
         ],
         ['OS=="freebsd"', {
+            'defines': [
+              'OS_BSD=1',
+              'OS_FREEBSD=1',
+              'OS_POSIX=1'
+            ],
             'link_settings': {
               'libraries': [
                 '-L/usr/local/lib -lexecinfo',
@@ -733,6 +755,11 @@
           }
         ],
         ['OS=="openbsd"', {
+            'defines': [
+              'OS_BSD=1',
+              'OS_OPENBSD=1',
+              'OS_POSIX=1'
+            ],
             'link_settings': {
               'libraries': [
                 '-L/usr/local/lib -lexecinfo',
@@ -744,6 +771,11 @@
           }
         ],
         ['OS=="netbsd"', {
+            'defines': [
+              'OS_BSD=1',
+              'OS_NETBSD=1',
+              'OS_POSIX=1'
+            ],
             'link_settings': {
               'libraries': [
                 '-L/usr/pkg/lib -Wl,-R/usr/pkg/lib -lexecinfo',
@@ -755,6 +787,11 @@
           }
         ],
         ['OS=="solaris"', {
+            'defines': [
+              'OS_BSD=1',
+              'OS_POSIX=1',
+              'OS_SOLARIS=1'
+            ],
             'link_settings': {
               'libraries': [
                 '-lsocket -lnsl',
@@ -766,6 +803,11 @@
           }
         ],
         ['OS=="mac"', {
+          'defines': [
+            'OS_BSD=1',
+            'OS_MACOSX=1',
+            'OS_POSIX=1'
+          ],
           'sources': [
             '../../src/platform-macos.cc',
             '../../src/platform-posix.cc'
@@ -782,11 +824,18 @@
               },
               'conditions': [
                 ['build_env=="Cygwin"', {
+                  'defines': [
+                    'OS_CYGWIN=1',
+                    'OS_POSIX=1'
+                  ],
                   'sources': [
                     '../../src/platform-cygwin.cc',
                     '../../src/platform-posix.cc',
                   ],
                 }, {
+                  'defines': [
+                    'OS_WIN=1'
+                  ],
                   'sources': [
                     '../../src/platform-win32.cc',
                     '../../src/win32-math.h',
@@ -798,6 +847,9 @@
                 'libraries': [ '-lwinmm', '-lws2_32' ],
               },
             }, {
+              'defines': [
+                'OS_WIN=1'
+              ],
               'sources': [
                 '../../src/platform-win32.cc',
                 '../../src/win32-math.h',


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to