编译Chromium 源码
来源:互联网 发布:知乎 印度 编辑:程序博客网 时间:2024/06/11 08:28
Linux
Overview
Due mostly to its history and its complexity, Chromium uses a nonstandard set of custom tools to check out and build. Here's an overview of the steps you'll run:
- gclient. A checkout involves pulling nearly 100 different SVN repositories of code. This process is managed with a tool called gclient.
- gyp. The cross-platform build configuration system is called gyp, and on Linux it generates Makefiles. Running gyp is analogous to the./configure step seen in most other software.
- make. The actual build itself uses GNU make.
- We don't provide any sort of "install" step.
Getting a checkout
- Prerequisites: what you need before you build
- Get the Code: check out the source code
Linux users often prefer to use Git. We have a page on how to check out the main tree with Git, but note that you still will need to understand and run all of gclient and gyp anyway.
First Time Build Bootstrap
- Make sure your dependencies are up to date by running the install-build-deps.sh script:
.../chromium/src $ ./build/install-build-deps.sh
Configuring
After gclient sync finishes, it will run gyp automatically to generate the Makefiles. You can re-run gyp yourself as build/gyp_chromium.
gyp supports a minimal amount of build configuration via the -D flag.
./build/gyp_chromium -Dflag1=value1 -Dflag2=value2
- gcc warnings. By default we fail to build if there are any compiler warnings. If you're getting warnings, can't build because of that, but just want to get things done, you can specify -Dwerror= to turn that off.
- ChromeOS. -Dchromeos=1 builds the ChromeOS version of Chrome. This is not all of ChromeOS (see the ChromiumOS page for full build instructions), this is just the slightly tweaked version of the browser that runs on that system. Its not designed to be run outside of ChromeOS and some features won't work, but compiling on your Linux desktop can be useful for certain types of development and testing.
Compilation
The weird "src/" directory is an artifact of gclient. Start with:
$ cd src
Build just chrome
$ make chrome
Faster builds
To do a parallel build, add -jX where X is the number of make processes to start up. This is useful for multiple-core machines or machines using distcc.
Build every tests
$ make
The above builds all libraries and tests in all components. It will take hours.
Specifying other target names to restrict the build to just what you're interested in. To build just the simplest unit test:
$ make base_unittests
Or you can specify the explicit file you want to build:
$ make out/Debug/chrome
GCC 4.6 is not supported yet. You may run into some build errors (and patches are welcome to fix them). Please see http://crbug.com/80071before you proceed.
Clang builds
Information about building with Clang can be found here.
Output
Executables are written in src/out/Debug/ for Debug builds, and src/out/Release/ for Release builds.
Release mode
Add BUILDTYPE=Release to the make invocation:
$ make BUILDTYPE=Release
Seeing the commands
If you want to see the actual commands that make is invoking, add V=1 to the make invocation.
$ make V=1
This is useful if, for example, you are debugging gyp changes, or otherwise need to see what make is actually doing.
Clean builds
All built files are put into the out/ directory, so to start over with a clean build, just:
rm -rf out
Troubleshooting
If you see make: *** No targets specified and no makefile found. Stop., you probably need to run gyp again. See the "Configuring" steps above.
Linker Crashes
If, during the final link stage:
LINK(target) out/Debug/chrome
You get an error like:
collect2: ld terminated with signal 6 Aborted terminate called after throwing an instance of 'std::bad_alloc'collect2: ld terminated with signal 11 [Segmentation fault], core dumped
you are probably running out of memory when linking. Try one of:
- Use the gold linker
- Build on a 64-bit computer
- Build in Release mode (debugging symbols require a lot of memory)
- Build as shared libraries (note: this build is for developers only, and may have broken functionality)
Advanced Features
- Building frequently? See LinuxFasterBuilds.
- Cross-compiling for ARM? See LinuxChromiumArm.
- Want to use Eclipse as your IDE? See LinuxEclipseDev.
Next Steps
If you want to contribute to the effort toward a Chromium-based browser for Linux, please check out the Linux Development page for more information.
- 编译Chromium 源码
- chromium 源码编译
- chromium源码下载并编译
- Chromium的源码下载和编译
- Chromium for android 2 源码编译
- Ubuntu下Chromium源码的编译
- windows7 64位 编译 chromium源码
- Linux chromium 源码下载及编译
- windows7 64位 编译 chromium源码
- Ubuntu上从源码编译chromium浏览器
- 如何快速获取Chromium源码和编译
- mac 版本下载编译chromium最新源码
- windows chromium源码获取和编译
- Chromium 编译
- chromium编译
- chromium编译
- chromium编译
- Chromium 源码
- HTTP RFC中所用到的规则
- 《诗意的边缘》问题解答
- WINCE6.0操作系统---内核(kernel)学习
- Java程序员从笨鸟到菜鸟之(五)java开发常用类(包装,数字处理集合等)(下)
- Ubuntu 10.04下安装OpenCV 2.2记录
- 编译Chromium 源码
- think in java之构造器的真正调用顺序
- WINCE---内核(kernel)---内存架构(memory archtitecture)学习
- web server 容器 tomcat和jetty的奇怪联系
- Java堆内存的10个要点
- 爸爸妈妈你们离婚吧
- Ubuntu下Banshee播放器乱码问题解决
- 面向对象与设计模式之我见
- Android Service---在清单中声明一个服务