Chrome for android 編譯

來源:互聯網
上載者:User

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

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.