您的位置:首页 > 移动开发 > Android开发

Chrome for android 编译

2013-06-12 19:28 337 查看
Step1: 获取源码 (http://dev.chromium.org/developers/how-tos/get-the-code#TOC-Windows

.gclient文件内容为:

solutions = [
{ "name"        : "src",
"url"         : "https://src.chromium.org/chrome/trunk/src",
"deps_file"   : "DEPS",
"managed"     : True,
"custom_deps" : {
"src/content/test/data/layout_tests/LayoutTests": None,
"src/chrome/tools/test/reference_build/chrome_win": None,
"src/chrome_frame/tools/test/reference_build/chrome_win": None,
"src/chrome/tools/test/reference_build/chrome_linux": None,
"src/chrome/tools/test/reference_build/chrome_mac": None,
"src/third_party/hunspell_dictionaries": None,
},
"safesync_url": "",
},
]
target_os = ['android']


Step2:首先要安装Android的编译环境。

Step3:编译 (https://code.google.com/p/chromium/wiki/AndroidBuildInstructions

编译的过程中可能会遇到如下的错误提示,请参考安装,我机子是(Ubuntu 12.04)

1) Package nss was not found in the pkg-config search path.

Perhaps you should add the directory containing `nss.pc'

to the PKG_CONFIG_PATH environment variable

No package 'nss' found

gyp: Call to 'pkg-config --cflags nss' returned exit status 1. while loading dependencies of /home/blwang/dev/src/base/base.gyp while loading dependencies of /home/blwang/dev/src/build/all.gyp while trying to load /home/blwang/dev/src/build/all.gyp

Error: Command /usr/bin/python src/build/gyp_chromium returned non-zero exit status 1 in /home/blwang/dev

解决方案:sudo apt-get install libnss3-dev libgconf2-dev

2)Updating projects from gyp files...

Package gtk+-2.0 was not found in the pkg-config search path.

Perhaps you should add the directory containing `gtk+-2.0.pc'

to the PKG_CONFIG_PATH environment variable

No package 'gtk+-2.0' found

解决方案:sudo apt-get install libgtk2.0-dev

3)Package libpci was not found in the pkg-config search path.

Perhaps you should add the directory containing `libpci.pc'

to the PKG_CONFIG_PATH environment variable

No package 'libpci' found

gyp: Call to 'pkg-config --cflags libpci' returned exit status 1. while loading dependencies of /home/blwang/dev/src/base/base.gyp while loading dependencies of /home/blwang/dev/src/build/all.gyp while trying to load /home/blwang/dev/src/build/all.gyp

解决方案:sudo apt-get install libpci-dev

4)/bin/sh: 1: libgcrypt-config: not found

gyp: Call to 'libgcrypt-config --cflags' returned exit status 127. while loading dependencies of /home/blwang/dev/src/base/base.gyp while loading dependencies of /home/blwang/dev/src/build/all.gyp while trying to load /home/blwang/dev/src/build/all.gyp

Error: Command /usr/bin/python src/build/gyp_chromium returned non-zero exit status 1 in /home/blwang/dev

解决方案:sudo apt-get install libgcrypt-dev

5)Package gnome-keyring-1 was not found in the pkg-config search path.

Perhaps you should add the directory containing `gnome-keyring-1.pc'

to the PKG_CONFIG_PATH environment variable

No package 'gnome-keyring-1' found

gyp: Call to 'pkg-config --cflags gnome-keyring-1' returned exit status 1. while loading dependencies of /home/blwang/dev/src/base/base.gyp while loading dependencies of /home/blwang/dev/src/build/all.gyp while trying to load /home/blwang/dev/src/build/all.gyp

Error: Command /usr/bin/python src/build/gyp_chromium returned non-zero exit status 1 in /home/blwang/dev

解决方案:sudo apt-get install libgnome-keyring-dev

6)Perhaps you should add the directory containing `libudev.pc'

to the PKG_CONFIG_PATH environment variable

No package 'libudev' found

gyp: Call to 'pkg-config --cflags libudev' returned exit status 1. while loading dependencies of /home/blwang/dev/src/base/base.gyp while loading dependencies of /home/blwang/dev/src/build/all.gyp while trying to load /home/blwang/dev/src/build/all.gyp

Error: Command /usr/bin/python src/build/gyp_chromium returned non-zero exit status 1 in /home/blwang/dev

解决方案:sudo apt-get install libudev-dev

7) Perhaps you should add the directory containing `libpulse.pc'

to the PKG_CONFIG_PATH environment variable

No package 'libpulse' found

gyp: Call to 'pkg-config --cflags libpulse' returned exit status 1. while loading dependencies of /home/blwang/dev/src/ui/surface/surface.gyp while loading dependencies of /home/blwang/dev/src/gpu/gpu.gyp while loading dependencies of /home/blwang/dev/src/third_party/WebKit/Source/core/core.gyp
while loading dependencies of /home/blwang/dev/src/third_party/WebKit/Source/WebKit/chromium/WebKit.gyp while loading dependencies of /home/blwang/dev/src/third_party/WebKit/public/blink.gyp while loading dependencies of /home/blwang/dev/src/webkit/support/webkit_support.gyp
while loading dependencies of /home/blwang/dev/src/chrome/chrome_resources.gyp while loading dependencies of /home/blwang/dev/src/chrome/chrome.gyp while loading dependencies of /home/blwang/dev/src/build/all.gyp while trying to load /home/blwang/dev/src/build/all.gyp

Error: Command /usr/bin/python src/build/gyp_chromium returned non-zero exit status 1 in /home/blwang/dev

解决方案:sudo apt-get install libpulse-dev

8) /bin/sh: 1: cups-config: not found

gyp: Call to 'cups-config --api-version' returned exit status 127. while loading dependencies of /home/blwang/dev/src/webkit/support/webkit_support.gyp while loading dependencies of /home/blwang/dev/src/chrome/chrome_resources.gyp while loading dependencies
of /home/blwang/dev/src/chrome/chrome.gyp while loading dependencies of /home/blwang/dev/src/build/all.gyp while trying to load /home/blwang/dev/src/build/all.gyp

Error: Command /usr/bin/python src/build/gyp_chromium returned non-zero exit status 1 in /home/blwang/dev

解决方案:sudo apt-get install libcupsys2-dev

9) Package gconf-2.0 was not found in the pkg-config search path.

Perhaps you should add the directory containing `gconf-2.0.pc'

to the PKG_CONFIG_PATH environment variable

No package 'gconf-2.0' found

gyp: Call to 'pkg-config --cflags gconf-2.0' returned exit status 1. while loading dependencies of /home/blwang/dev/chrome/src/base/base.gyp while loading dependencies of /home/blwang/dev/chrome/src/media/media.gyp while loading dependencies of /home/blwang/dev/chrome/src/content/content.gyp
while loading dependencies of /home/blwang/dev/chrome/src/build/all_android.gyp while trying to load /home/blwang/dev/chrome/src/build/all_android.gyp

Error: Command /usr/bin/python src/build/gyp_chromium returned non-zero exit status 1 in /home/blwang/dev/chrome

解决方法:sudo aptitude install gconf2 libgconf2-dev

10) /usr/include/features.h:324:26: fatal error: bits/predefs.h: No such file or directory

compilation terminated.

[338/9471] CXX obj.host/v8/src/v8_base.arm.typing.o

FAILED: /usr/bin/g++ -MMD -MF obj.host/v8/src/v8_base.arm.typing.o.d -D_FILE_OFFSET_BITS=64 -DUSE_LINUX_BREAKPAD -DNO_TCMALLOC -DDISABLE_NACL -DCHROMIUM_BUILD -DUSE_LIBJPEG_TURBO=1 -DENABLE_WEBRTC=1 -DUSE_PROPRIETARY_CODECS -DENABLE_GPU=1 -DUSE_OPENSSL=1 -DENABLE_EGLIMAGE=1
-DENABLE_AUTOFILL_DIALOG=1 -DENABLE_LANGUAGE_DETECTION=1 -DENABLE_DEBUGGER_SUPPORT -DV8_TARGET_ARCH_ARM -DCAN_USE_VFP_INSTRUCTIONS -DARM_TEST -DCAN_USE_ARMV7_INSTRUCTIONS=1 -DCAN_USE_VFP3_INSTRUCTIONS -DUSE_EABI_HARDFLOAT=0 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0
-I../../v8/src -fstack-protector --param=ssp-buffer-size=4 -pthread -fno-exceptions -fno-strict-aliasing -Wno-unused-parameter -Wno-missing-field-initializers -fvisibility=hidden -pipe -fPIC -Wno-format -m32 -fno-ident -fdata-sections -ffunction-sections -fomit-frame-pointer
-fdata-sections -ffunction-sections -O2 -fno-rtti -fno-threadsafe-statics -fvisibility-inlines-hidden -Wno-deprecated -c ../../v8/src/typing.cc -o obj.host/v8/src/v8_base.arm.typing.o

In file included from /usr/include/stdio.h:28:0,

from ../../v8/src/../include/v8stdint.h:34,

from ../../v8/src/../include/v8.h:41,

from ../../v8/src/v8.h:52,

from ../../v8/src/typing.h:31,

from ../../v8/src/typing.cc:28:

/usr/include/features.h:324:26: fatal error: bits/predefs.h: No such file or directory

compilation terminated.

[338/9471] CC obj/third_party/expat/files/lib/expat.xmlparse.o

ninja: build stopped: subcommand failed.

解决方案: sudo apt-get install libc6-dev:i386 build-essential gcc-multilib

11) chrome libstdc++ 4.6 incompatiable.

解决方案:sudo apt-get install g++-multilib
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: