OWB for Visual Studio 2005
Warning: this page is targetting rev [241] and does not apply (yet) to "Doduo" release.
There is a pending ticket about it: #230
This document enables you to compile 'Origyn Web Browser' with 'Microsoft Visual Studio 2005', and port it on Win32 platform.
I. Installation and requirements
a. Owb
Check out rev 241 and download the patch
b. Cygwin
You must install Cygwin in order to create some C++ files, you have a list of tools necessary for this tasks. Go to cygwin website cygwin and download a setup. At the packages selection, you must choose :
autoconf, automake, bison, cmake, curl & curl-devel, expat, flex, fontconfig, freetype, gcc, gperf, glib, libcurl, libexpat, libfontconfig-devel, libfontconfig1, libfreetype2-devel, libfreetype, libiconv, libxml, libxml-devel, libxslt, make, patch, perl, perl-error, perl-ext-Utils, perl-libwin32, pkg-config
WARNING :
Don't forget to add cygwin\bin path to your system variable.
c. Cmake
This application will prepare for you a MSVC project for compile owb. Go at this page cmake and choose win32 version.
d. other Tools
For help you, please read this table which references all packages needed for compile OWB with success.
| Tools | Where find it | Utility | To compile/prebuild |
| ICU | ICU | Internalisation gestion and configuration | To compile (choose source for Windows platform) |
| SDL | SDL | Graphics and events gestion | Prebuild (choose development libraries for Win32) |
| SDL_gfx | SDL_gfx | Graphics gestion | To compile (choose the latest version) |
| Zlib | zlib | Compression library | Prebuild (choose bin and devel package) |
| fontconfig | fontconfig | Fonts configuration | Prebuild (choose devel package) |
| GTK2runtime | sourceForge/GTKruntime | DLL needed during runtime | Prebuild |
| Pthread | sourceware/pthreads | Thread gestion | Prebuild (choose pthreads- win32-X-X- X.release.exe) |
| Freetype | freetype | Fonts gestion | Prebuild (choose setup versions) |
| Curl | curl | HTML request and connexion support | Prebuild (choose WIN32-msvc version) |
| iconv | iconv | Internalisation configuration | Prebuild (choose lib version) |
| XML/xslt | xml/xslt | XML parser | Prebuild |
WARNING :
For easier development, I advice you to put all headers file in a same directory but keep some subdirectory like curl, fontconfig, xml, xslt, icu etc ...
In fontconfig.h, don't forget to add a #ifndef MSVC #endif between #include <unistd.h>. Windows doesn't have this headers, so compilator cannot compile files include fontconfig.h.
After compilation of owb, Windows will ask you some dll that you could find in
PATH_TO_GTK2_runtime\lib.
II. Compilation
Now you are ready to prepare elements of your owb. You must compile ICU and SDL_gfx.
Don't worry, we will do it step by step.
a. ICU
Decompress it at the place of your choice. Go at icu4c-3_8_1-src\icu\source\allinone and launch Microsoft Visual Studio Solution allinone.sln. You just have to regenerate solution in Release or Debug configuration. Good ! The solution will create dynamics librairies but ...You will need static librairies during linking of owb. So recreate i18n but with .lib configuration. If you want test ICU, after building, add into your system path, the directory of ICU binaries. After compilation, move all lib into your LIBdirectory and headers file into your HEADERDirectory.
b. SDL_gfx
The package that you have contains a VC project, you will find it in SDL_gfx-2.0.16\SDL_gfx- 2.0.16\Other Builds and it is in the zip file VISUALC7.zip. Extract it in the directory with all c files. (Move now all headers files into your HEADERSDirectory). Open the project with Visual Studio, if you are on Visual Studio 8, it asks you to adapt it, don't worry. Before compilation, you have to add manually cpp files, add your SDL_HEADERS_DIRECTORY in project configuration. Then you must specify that you want build a static library. Finally, you must add into SDL_gfxPrimitives.c a definition. Windows Math.h headers files misses a function called lrint. So you must add at the top of the file : #define lrint(x) (floor(x+(x>0) ? 0.5 : -0.5)). You can generate the solution and take your library for OWB.
III. Patch Application
Now you are ready for apply my patch, it contains some modifications. Main modifications are simple #ifdef or function adaptation for Windows. For apply the patch, go to your OWB_PATH and enter :
patch -p1 < PATH_TO_THE_PATCH.patch
Now you are ready to prepare your MSVC solution with CMAKE.
IV. OWB
a. Building MSVC project
You must create a build directory into your OWB directory, then you can launch CMAKE. Select your owb and build directory and press Configure button. It asks you the version of MSVC that you will use for compilate owb. It will search automatically for some executable, if you meet an error search manually theses executable (into cygwin\bin directory). Check the Advanced Values option for see all options of project creation. I will give you configuration needed for a good compilation of OWB for Windows.
- BUILD_SHARE_LIBS OFF
- WEBKIT_USE_CC_PIC OFF
- WEBKIT_DEBUG DEBUG_GCC3.X
- DEEPSEE_ENABLE OFF
- VERBOSE & VERBOSE MAKEFILE Like you want ; )
- OWBAL_PLATFORM_WIN32PORT ON
You have some identical line like CMAKE_C_FLAGS with DEBUG, release, etc ... You have the choice. Verify that you have /MT and not /MD in each line, if you have an other thing that /MT, at the execution you will have an error. You have to suppress all Hsc/Hea and RTC1 flags, is the equivalent of no-exception flag of gcc, do the same for the flag GR that you must remplace by GR-.
This one is equivalent of no-rtti flags. You doesn't want warning message, change all /W3 by /W0. You must suppress all _DEBUG flags and remplace it by DEBUG (if you want DEBUG mode). When CMAKE asks you icu-config, to enter the binary makeconv in YOUR_PATH_ICU\bin. For other config executable, select in 'cygwin\bin' directory the correct one. When CMAKE_CROSSCOMPILING has appeared choose YES.
After configuration had been done, click on OK and CMAKE will generate all vcproject for OWB.
b. Verification
1. 'headers for external librairies' :: For the moment, Cmake considers that you have an 'only one possible' hierarchy of files like this :
C:\WinLib\include; C:\WinLib\include\SDL; C:\WinLib\include\fontconfig; C:\WinLib\include\freetype2; C:\WinLib\include\libxml; C:\WinLib\include\libxslt; C:\WinLib\include\unicode
If you want to change this hierarchy, you must edit the files 'CmakeLists.txt' in the directory root of owb. You can find it in the 'adding definition' section.
2. ' preprocessor flags':: You haven't got to change anything here.
3. 'librairies configuration' :: You must specify by hand in owb's parameters, directory of your librairies.
You must have :
fontconfig.lib, freetype.lib, icudt.lib, icuucd.lib, libcurl.lib, libiconv.lib, zlib.lib, libxml2.lib, libxslt.lib, SDL.lib, SDLmain.lib, sdlgfx.lib, WinMM.lib, ws2_32.lib
4. project configuration :: You just have to modify owb's parameters for code generation, choose multi- threaded DLL
c. Compilation
WARNING :
1. Don't forget to add the path to your_build_owb directory and copy into this directory dftables.exe wich was created first. 2. Please check that you have your path_cygwin\bin in your path system and user
During compilation of webcore-owb, there is a problems with the creation of Tokenizer.inl, this error is in the owb-trac post, you must create it manually with this command :
flex -t Path_to_your_OWB/WebCore/css/tokenizer.flex | perl.exe /Path_to_your_owb/WebCore/css/maketokenizer > Path_to_your_owb/build/generated_sources/WebCore/tokenizer.inl
Somes files created during compilation also create errors, theses files are XpathGrammar.h and CSSGrammar.h. You must commente the first two lines and last lines of these files.
Final error, you must add at the beginning of DocTypesString.cpp, #include <string.h>.
There are the only errors that remain after the application of patch.
===c. Execution ===
WARNING :
If you have an error in your DOS command box with Font config file, or if owb stop without any reasons, take fc-cache.exe and fc-list.exe wich is in your_GTK2runtime_path\bin and your_GTK2runtime_path\etc\fonts. Launch these 2 executables and owb will work.
