diff options
author | piman@google.com <piman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-11 01:59:36 +0000 |
---|---|---|
committer | piman@google.com <piman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-11 01:59:36 +0000 |
commit | 1f4dd6d26bc1a1548a270c0ad94b58321637e7a0 (patch) | |
tree | 4e5e62973fcb0e667e72b433c17681d7105adb23 | |
parent | 38b48a844731cd10d69d8e99d476e3dac9e81980 (diff) | |
download | chromium_src-1f4dd6d26bc1a1548a270c0ad94b58321637e7a0.zip chromium_src-1f4dd6d26bc1a1548a270c0ad94b58321637e7a0.tar.gz chromium_src-1f4dd6d26bc1a1548a270c0ad94b58321637e7a0.tar.bz2 |
linux: 64-bit
This CL enables a 64-bit of linux. Set target_arch='x64' in the gyp defines to enable.
- fixes a few 64-bit issues
- fixes some linux build issues on scons vs make
- add rules to build 64-bit version
Review URL: http://codereview.chromium.org/371078
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31642 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | o3d/DEPS | 4 | ||||
-rw-r--r-- | o3d/build/common_global.gypi | 25 | ||||
-rwxr-xr-x | o3d/build/gyp_o3d | 2 | ||||
-rw-r--r-- | o3d/build/libs.gyp | 56 | ||||
-rw-r--r-- | o3d/core/cross/ddsurfacedesc.h | 2 | ||||
-rw-r--r-- | o3d/core/cross/gl/effect_gl.cc | 3 | ||||
-rw-r--r-- | o3d/core/cross/gl/renderer_gl.cc | 6 | ||||
-rw-r--r-- | o3d/core/cross/gl/sampler_gl.cc | 3 | ||||
-rw-r--r-- | o3d/core/cross/pointer_utils.h | 4 | ||||
-rw-r--r-- | o3d/samples/samples_gen.py | 9 |
10 files changed, 86 insertions, 28 deletions
@@ -2,9 +2,9 @@ vars = { "chromium_trunk": "http://src.chromium.org/svn/trunk", "nixysa_rev": "61", "chromium_rev": "28829", - "o3d_code_rev": "161", + "o3d_code_rev": "166", "skia_rev": "376", - "gyp_rev": "725", + "gyp_rev": "749", "gtest_rev": "329", "gflags_rev": "30", "breakpad_rev": "391", diff --git a/o3d/build/common_global.gypi b/o3d/build/common_global.gypi new file mode 100644 index 0000000..e3b5429 --- /dev/null +++ b/o3d/build/common_global.gypi @@ -0,0 +1,25 @@ +# Copyright (c) 2009 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# This file contains flags that are specific to o3d, but affect the build as a +# whole (e.g. build flags that change the ABI). +# For example, on linux amd64, all the libraries that will be linked into the +# plugin (skia, v8, ...) need to be compiled with -fPIC but we don't want to do +# that generally in Chrome (so it can't be lumped into the top-level +# build/common.gypi). +{ + 'target_defaults': { + 'conditions': [ + [ 'OS == "linux" and target_arch=="x64"', { + 'cflags': [ + '-m64', + '-fPIC', + ], + 'ldflags': [ + '-m64', + ], + }], + ], + }, +} diff --git a/o3d/build/gyp_o3d b/o3d/build/gyp_o3d index 598dd70..229b4bc 100755 --- a/o3d/build/gyp_o3d +++ b/o3d/build/gyp_o3d @@ -11,6 +11,7 @@ import os import sys chrome_src = os.path.join(os.path.dirname(sys.argv[0]), os.pardir, os.pardir) +o3d_src = os.path.join(os.path.dirname(sys.argv[0]), os.pardir) try: import gyp @@ -24,6 +25,7 @@ if __name__ == '__main__': # Always include common.gypi args += ['--depth', '.', '-I', os.path.join(chrome_src, 'build', 'common.gypi'), + '-I', os.path.join(o3d_src, 'build', 'common_global.gypi'), '-D', 'mac_deployment_target=10.4'] # Off we go... diff --git a/o3d/build/libs.gyp b/o3d/build/libs.gyp index 122c6d6..a4492dd 100644 --- a/o3d/build/libs.gyp +++ b/o3d/build/libs.gyp @@ -27,11 +27,9 @@ 'defines': [ 'GL_GLEXT_PROTOTYPES', ], - 'scons_variable_settings': { - 'LIBPATH': [ - '../../<(glewdir)/lib', - ], - }, + 'ldflags': [ + '-L<(PRODUCT_DIR)', + ], 'libraries': [ '-lGL', '-lGLEW', @@ -82,11 +80,9 @@ [ 'OS=="linux"', { 'all_dependent_settings': { - 'scons_variable_settings': { - 'LIBPATH': [ - '<(PRODUCT_DIR)', - ], - }, + 'ldflags': [ + '-L<(PRODUCT_DIR)', + ], 'libraries': [ "-lCg", "-lCgGL", @@ -125,9 +121,21 @@ [ 'OS=="linux"', { 'destination': '<(PRODUCT_DIR)', + 'conditions': [ + [ 'target_arch=="x64"', + { + 'variables': { 'libdir': 'lib64' } + }, { + 'variables': { 'libdir': 'lib' } + } + ], + ], 'files': [ - "../../<(cgdir)/lib/libCg.so", - "../../<(cgdir)/lib/libCgGL.so", + '../../<(glewdir)/<(libdir)/libGLEW.so', + '../../<(glewdir)/<(libdir)/libGLEW.so.1.5', + '../../<(glewdir)/<(libdir)/libGLEW.so.1.5.1', + "../../<(cgdir)/<(libdir)/libCg.so", + "../../<(cgdir)/<(libdir)/libCgGL.so", "../../<(cgdir)/bin/cgc", ], }, @@ -154,6 +162,30 @@ ], ], }, + { + 'conditions' : [ + [ 'OS=="linux"', + { + 'destination': '<(SHARED_LIB_DIR)', + 'files': [ + '<(PRODUCT_DIR)/libGLEW.so', + '<(PRODUCT_DIR)/libGLEW.so.1.5', + '<(PRODUCT_DIR)/libGLEW.so.1.5.1', + "<(PRODUCT_DIR)/libCg.so", + "<(PRODUCT_DIR)/libCgGL.so", + ], + }, + ], + [ 'OS=="mac"', + { + # Dummy copy, because the xcode generator in gyp fails when it + # has an empty copy entry. + 'destination': 'dummy', + 'files': [], + } + ], + ] + } ], }, ], diff --git a/o3d/core/cross/ddsurfacedesc.h b/o3d/core/cross/ddsurfacedesc.h index 1742c16..adc8ffd 100644 --- a/o3d/core/cross/ddsurfacedesc.h +++ b/o3d/core/cross/ddsurfacedesc.h @@ -210,7 +210,7 @@ struct DDSURFACEDESC2 { }; DWORD dwAlphaBitDepth; // depth of alpha buffer requested DWORD dwReserved; // reserved - LPVOID lpSurface; // pointer to the associated surface memory + DWORD lpSurface; // pointer to the associated surface memory union { DDCOLORKEY ddckCKDestOverlay; // color key for destination overlay DWORD dwEmptyFaceColor; // color for empty cubemap faces diff --git a/o3d/core/cross/gl/effect_gl.cc b/o3d/core/cross/gl/effect_gl.cc index 4a61e37..b8eabcc 100644 --- a/o3d/core/cross/gl/effect_gl.cc +++ b/o3d/core/cross/gl/effect_gl.cc @@ -561,7 +561,8 @@ void EffectGL::SetTexturesFromEffect(ParamCacheGL* param_cache_gl) { if (param != NULL) { Texture *t = param->value(); if (t) { - GLuint handle = reinterpret_cast<GLuint>(t->GetTextureHandle()); + GLuint handle = static_cast<GLuint>(reinterpret_cast<intptr_t>( + t->GetTextureHandle())); cgGLSetTextureParameter(cg_param, handle); cgGLEnableTextureParameter(cg_param); } diff --git a/o3d/core/cross/gl/renderer_gl.cc b/o3d/core/cross/gl/renderer_gl.cc index 8568de1..e4de52f 100644 --- a/o3d/core/cross/gl/renderer_gl.cc +++ b/o3d/core/cross/gl/renderer_gl.cc @@ -202,19 +202,21 @@ bool InstallFramebufferObjects(const RenderSurface* surface, const RenderSurfaceGL *gl_surface = down_cast<const RenderSurfaceGL*>(surface); Texture *texture = gl_surface->texture(); + GLuint handle = static_cast<GLuint>(reinterpret_cast<intptr_t>( + texture->GetTextureHandle())); if (texture->IsA(Texture2D::GetApparentClass())) { ::glFramebufferTexture2DEXT( GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, - reinterpret_cast<GLuint>(texture->GetTextureHandle()), + handle, gl_surface->mip_level()); } else if (texture->IsA(TextureCUBE::GetApparentClass())) { ::glFramebufferTexture2DEXT( GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, gl_surface->cube_face(), - reinterpret_cast<GLuint>(texture->GetTextureHandle()), + handle, gl_surface->mip_level()); } } diff --git a/o3d/core/cross/gl/sampler_gl.cc b/o3d/core/cross/gl/sampler_gl.cc index 5dacf0b..0dc3ab7 100644 --- a/o3d/core/cross/gl/sampler_gl.cc +++ b/o3d/core/cross/gl/sampler_gl.cc @@ -144,7 +144,8 @@ void SamplerGL::SetTextureAndStates(CGparameter cg_param) { } } - GLuint handle = reinterpret_cast<GLuint>(texture_object->GetTextureHandle()); + GLuint handle = static_cast<GLuint>(reinterpret_cast<intptr_t>( + texture_object->GetTextureHandle())); if (handle) { cgGLSetTextureParameter(cg_param, handle); cgGLEnableTextureParameter(cg_param); diff --git a/o3d/core/cross/pointer_utils.h b/o3d/core/cross/pointer_utils.h index b16ed5c..e246deb 100644 --- a/o3d/core/cross/pointer_utils.h +++ b/o3d/core/cross/pointer_utils.h @@ -41,14 +41,14 @@ namespace o3d { // Adds an arbitrary byte offset to a typed pointer.
template <typename T>
-T AddPointerOffset(T pointer, unsigned offset) {
+T AddPointerOffset(T pointer, int offset) {
return reinterpret_cast<T>(
const_cast<uint8*>(reinterpret_cast<const uint8*>(pointer) + offset));
}
// Creates a typed pointer from a void pointer and an offset.
template <typename T>
-T PointerFromVoidPointer(const void* pointer, unsigned offset) {
+T PointerFromVoidPointer(const void* pointer, int offset) {
return reinterpret_cast<T>(
const_cast<uint8*>(reinterpret_cast<const uint8*>(pointer) + offset));
}
diff --git a/o3d/samples/samples_gen.py b/o3d/samples/samples_gen.py index cb999c1..94ca89d 100644 --- a/o3d/samples/samples_gen.py +++ b/o3d/samples/samples_gen.py @@ -99,6 +99,7 @@ for asset in assets: output_file.write(" {\n") output_file.write(" 'action_name': '%s',\n" % name) output_file.write(" 'inputs': [\n") + output_file.write(" '<(PRODUCT_DIR)/o3dConverter',\n") output_file.write(" '../o3d_assets/samples/%s',\n" % asset['path']) output_file.write(" ],\n") output_file.write(" 'outputs': [\n") @@ -112,16 +113,10 @@ for asset in assets: output_file.write(" '../samples/%s',\n" % output) output_file.write(" ],\n") output_file.write(" 'action': [\n") - if sys.platform[:5] == 'linux': - output_file.write(" 'LD_LIBRARY_PATH=<(PRODUCT_DIR):" - ":<(PRODUCT_DIR)/lib" - ":../../<(glewdir)/lib" - ":../../<<(PRODUCT_DIR)/lib" - "',\n") output_file.write(" '<(PRODUCT_DIR)/o3dConverter',\n") output_file.write(" '--no-condition',\n") output_file.write(" '--up-axis=%s',\n" % asset['up']) - output_file.write(" '<(_inputs)',\n") + output_file.write(" '../o3d_assets/samples/%s',\n" % asset['path']) output_file.write(" '<(_outputs)',\n") output_file.write(" ],\n") output_file.write(" },\n") |