| Index: platform_tools/android/bin/android_framework_gyp.py
|
| diff --git a/platform_tools/android/bin/android_framework_gyp.py b/platform_tools/android/bin/android_framework_gyp.py
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..ac1d598efa67265dd0de77edec6951c517d9d6ac
|
| --- /dev/null
|
| +++ b/platform_tools/android/bin/android_framework_gyp.py
|
| @@ -0,0 +1,61 @@
|
| +#!/usr/bin/python
|
| +
|
| +# Copyright 2014 Google Inc.
|
| +#
|
| +# Use of this source code is governed by a BSD-style license that can be
|
| +# found in the LICENSE file.
|
| +
|
| +"""
|
| +Modified version of gyp_skia, used by gyp_to_android.py to generate Android.mk
|
| +"""
|
| +
|
| +import os
|
| +import sys
|
| +
|
| +script_dir = os.path.dirname(__file__)
|
| +
|
| +# Unlike gyp_skia, this file is nested deep inside Skia. Move to Skia trunk.
|
| +# This line depends on the fact that the script is three levels deep
|
| +# (specifically, it is in platform_tools/android/bin).
|
| +skia_dir = os.path.normpath(os.path.join(script_dir, os.pardir, os.pardir,
|
| + os.pardir))
|
| +dir_contents = os.listdir(skia_dir)
|
| +assert 'third_party' in dir_contents and 'gyp' in dir_contents
|
| +
|
| +# Directory within which we can find the gyp source.
|
| +gyp_source_dir = os.path.join(skia_dir, 'third_party', 'externals', 'gyp')
|
| +
|
| +# Directory within which we can find most of Skia's gyp configuration files.
|
| +gyp_config_dir = os.path.join(skia_dir, 'gyp')
|
| +
|
| +# Ensure we import our current gyp source's module, not any version
|
| +# pre-installed in your PYTHONPATH.
|
| +sys.path.insert(0, os.path.join(gyp_source_dir, 'pylib'))
|
| +
|
| +import gyp
|
| +
|
| +def main(skia_arch_type, have_neon):
|
| + # Set GYP_DEFINES for building for the android framework.
|
| + gyp_defines = ('skia_android_framework=1 OS=android skia_arch_type=%s '
|
| + % skia_arch_type)
|
| + if skia_arch_type == 'arm':
|
| + # Always use thumb and version 7 for arm
|
| + gyp_defines = gyp_defines + 'arm_thumb=1 arm_version=7 '
|
| + if have_neon:
|
| + gyp_defines = gyp_defines + 'arm_neon=1 '
|
| + else:
|
| + gyp_defines = gyp_defines + 'arm_neon=0 '
|
| +
|
| + os.environ['GYP_DEFINES'] = gyp_defines
|
| +
|
| + args = []
|
| + args.extend(['--depth', '.'])
|
| + # Use the android_framework_lib file instead of skia.gyp
|
| + args.extend([os.path.join(gyp_config_dir, 'android_framework_lib.gyp')])
|
| + # Common conditions
|
| + args.extend(['-I', 'gyp/common.gypi'])
|
| + # Use the debugging format. We'll use these to create one master make file.
|
| + args.extend(['-f', 'gypd'])
|
| +
|
| + # Off we go...
|
| + return gyp.main(args)
|
|
|