Summary of WebKit errors during windows Compilation

Source: Internet
Author: User
Tags perl script

To analyze the browser kernel, I got the WebKit code a long time ago. I had never succeeded on Windows by following the compilation steps on its official website, but Google gave me a hand, appearance depending on the problems that occur during compilation are different, find a relatively reference value of blog (http://www.kpscards.com/blog /? P = 26), but my problem is also different from it. Finally, I adjusted the compiling environment a little bit based on the Compilation error information, and finally passed. The main reason is cygwin's path, vs2005's installation directory, environment variables, and xcopy.

Next we will summarize the problems in the compilation process according to the compilation process, hoping to inspire friends who are as confused as me.

First, describe my compilation environment:

1. Cygwin is installed on the F: disk (this cygwin is from the WebKit official website, and only this version has the least problems)

2. Install vs2005 in the F:/Program Files directory

3. Install QuickTime SDK in C:/Program Files

4. The master operating system Windows XP is installed on the C: disk.

5. The compiled PC is inside the LAN and accesses the Internet through the Proxy Server

6. The source code of WebKit is put in G:/webkitsrc.

7. The WebKit compilation output directory is G:/webkitbuild.

8. Put the WebKit third-party library code in G:/webkitlib

9. C:/Perl has installed Perl for Windows.

(Note: 7, 8 and 6 cannot be in the same directory. Otherwise, a copy failure error occurs during compilation. The reason is that I wrote the blog post I found, below I assume that the problem has been resolved based on the problem)

Why should I describe my compiling environment? Because the compilation steps on the official website assume that the software to be used is installed in the default installation directory of the system (such as C:/program files ), I am just because some software is not in the default path, causing some inexplicable errors and wasting a lot of investigation time.

The following lists the errors and solutions encountered during the compilation process.

Question 1. Run cygwin. The default shell is Bash. If you enter commands such as LS and Dir, the command cannot be found.

Solution: When I input echo $ path in bash, this path points to the path in windows, which does not contain the/bin:/sbin of cygwin: /usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin and other directories containing common command programs. Therefore, if you do not want to use export Path = $ path:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin: /usr/local/sbin: append the cygwin directory to the path. It should be noted that although this method can solve problem 1, it has laid the foundation for many strange problems in the future. It will be mentioned again later. Remember to execute WebKit every time you compile it.

Question 2. Running./update-WebKit always fails. Third-party libraries used for WebKit compilation cannot be updated.

Solution: After checking for a long time, I finally found that the update-WebKit script uses curl to download things, while my PC is in the LAN and needs to be accessed by a proxy server, therefore, you have to manually modify the 60 rows of the webkittools/scripts/update-WebKit-Auxiliary-libs file and add the proxy server settings to the curl, you can run curl -- help in cygwin to view the specific settings.

Question 3. A Perl script running error occurs when you run./build-WebKit.

Solution: see (http://www.kpscards.com/blog? P = 26) Because C:/Perl has been installed in my PC, the Perl program under its/bin directory is used in the cygwin environment, so now I will delete C:/perl from path through [my computer]-> [properties]-> [advanced]-> [environment variable. It should be noted that, although this method can solve problem 3, it is not the best solution and will be mentioned again later.

Question 4. Microsoft Visual Studio 8/common7/IDE/devenv.com cannot be found when you run./build-WebKit.

Solution: after a long investigation, manually modify the G:/webkitsrc/webkittools/scripts/webkitdirs script, put some print statements in it, and find that the entire compilation script is searching for C: /program files/Microsoft Visual Studio 8/common7/IDE/devenv.com. My vs2005 is installed on the F: disk. No wonder I can't find it. I have to manually modify the $ programfilespath variable in the webkitdirs script to point it to the F:/Program Files directory. In fact, there is a more convenient way. In cygwin, input echo $ ProgramFiles, which will display C:/program files. In this case, enter export ProgramFiles = F:/program files, but there is a problem. You need to set $ ProgramFiles every time you compile WebKit.

Question 5. It wasn't long before the build-WebKit was able to run, probably because htmlnames could not be found during webkitgenerated compilation. H and a series of xxxxnames. h file, Google, many people encounter such a problem, but there is no clear answer, some people say that cygwin lacks the gpref program. But it is obvious in my environment. After a little analysis, it was roughly set to an error when derivedsources. Make executed the make_names.pl script. But what is wrong. This problem plagued me for a long time and later found derivedsources. make used programs such as sort, uniq, and echo. I searched C:/Windows/system32 and/bin and found that there were sort programs in both directories. Now the problem is clear, when I set the path in question 1, set the path in windows to the front of the/bin directory. cygwin preferentially calls C when calling the sort command: sort in the/Windows/system32 directory. In Windows and Linux, the output format of the sort program must be different, resulting in derivedsources. make encountered an error in parsing the output of programs such as sort. Originally, xxxxxnames was automatically generated. the H file is not generated. This can only be blamed for your lack of experience. The solution to this problem is very simple. directly execute export Path =/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin: /usr/local/sbin: $ path. In contrast to question 1, we put/bin and other directories in front of the path of Win XP.

Question 6. Solution 5: Build-WebKit ran for a while, but finally stopped. This time, the compiler prompts that some source code contains Unicode characters and will warn you to handle the error. This problem is in (http://www.kpscards.com/blog? P = 26) as mentioned in the article, use vs2005 to open G:/webkitsrc/WebKit/win/WebKit. vcproj/WebKit. in the SLN file, change the option value of the "C ++" setting item in each project attribute to "no" (this is the approximate meaning, I have compiled it in vs2005 in Japanese version. Whether to make this statement in Chinese is to be confirmed ). After this change, some problems can be solved, but there are still several stubborn source code Display and Unicode characters. At this time directly on editplus, open the file to save when selecting UTF-8 encoding, then compile the problem no.

Question 7. After Problem 6 is solved, a webkitsysteminterface/webkitsysteminterface. h error cannot be found. It's annoying. In this case, the webkitsysteminterface directory, together with the files in the directory, is directly located in the G:/webkitsrc/webkitlibraries/win/include directory, the problem is solved.

Question 8. In fact, this is Question 7. I was so anxious that I only got an Include/webkitsysteminterface directory. The webkitsysteminterface. Lib library was not found during the Link (Note: when compiling the debug version, it was webkitsysteminterface_debug.lib ). In November, copy all the things under G:/webkitsrc/webkitlibraries/win/lib/webkitsysteminterface. lib to G:/webkitlib/lib, and continue compiling. In fact, issues 7 and 8 indicate that some files are missing when copying files from G:/webkitsrc/webkitlibraries to G:/webkitlib/L before the compilation starts, I did not investigate the cause. At least a few files or libraries of such errors are obviously easy to solve.

After these 8 levels, WebKit. dll was finally compiled during the long link process. Let's take a look at the size of G:/webkitbuild, which is about 2G. Large projects. WebKit. the debug version of DLL is nearly 30 mb. When installed with Apple's Safari browser, running debug-Safari can finally adapt to WebKit, but where to set breakpoints and track those variables is a big problem, google found a WebKit analysis report written by a houjong. I can get some information about the processing process from there. I will analyze it in subsequent articles.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.