|
1 | 1 | Windows building readme |
2 | 2 | ====================================== |
3 | 3 |
|
4 | | -----------------IMPORTANT---------------------------- |
5 | | -This readme outlines the instructions for building |
6 | | -MySQL for Windows staring from version 5.1. |
7 | | -This readme does not apply to MySQL versions 5.0 |
8 | | -or ealier. |
9 | | ------------------------------------------------------ |
10 | | - |
11 | 4 | The Windows build system uses a tool named CMake to generate build files for |
12 | 5 | a variety of project systems. This tool is combined with a set of jscript |
13 | 6 | files to enable building of MySQL for Windows directly out of a bzr clone. |
14 | | -For relevant information, please refer to http://forge.mysql.com/wiki/CMake |
15 | | -The steps required are below. |
16 | | - |
17 | | -Step 1: |
18 | | -------- |
19 | | - |
20 | | -Install a Windows C++ compiler. If you don't have one, you can use |
21 | | -the free compiler "Visual C++ 2005 express edition", which from Cmake |
22 | | -point of view is same as Visual studio 8: |
23 | | -http://msdn.microsoft.com/vstudio/express/ |
24 | | - |
25 | | -Step 2 |
26 | | ------- |
27 | | -Download and install CMake. It can be downloaded from http://www.cmake.org. |
28 | | -Once it is installed, modify your path to make sure you can execute |
29 | | -the cmake binary. |
30 | | - |
31 | | -Step 3 |
32 | | ------- |
33 | | -Download and install bison for Windows. It can be downloaded from |
34 | | -http://gnuwin32.sourceforge.net/packages/bison.htm. Please download using |
35 | | -the link named "Complete package, excluding sources". This includes an |
36 | | -installer that will install bison. After the installer finishes, modify |
37 | | -your path so that you can execute bison. |
38 | | - |
39 | | -(As an alternative you can take the sql_yacc.yy and sql_yacc.h files from a |
40 | | -matching mysql tar distribution and drop them into the sql directory just |
41 | | -before you start the build) |
42 | | - |
43 | | -Step 4 |
44 | | ------- |
45 | | -One of the nice CMake features is "out-of-source" build support, which |
46 | | -means not building in the source directory, but in dedicated build |
47 | | -directory. This keeps the source directory clean and allows for more than |
48 | | -single build tree for the same source tree (e.g debug and release, 32 and |
49 | | -64 bit etc). We'll create subdirectory "bld" in the source directory for |
50 | | -this purpose. Clone your bzr tree to any location you like. |
51 | | - |
52 | | -Step 5 |
53 | | ------- |
54 | | -From the root of your installation directory use cmake . -L to see the |
55 | | -various configuration parameters. |
56 | | - |
57 | | -So the command line could look like: |
58 | | - |
59 | | -cmake .. -G "target" -DWITH_INNOBASE_STORAGE_ENGINE=1 |
60 | | - |
61 | | -The recommended way of configuring would be to use -DBUILD_CONFIG=mysql_release |
62 | | -to build binaries exactly the same as the official MySQL releases. |
63 | | - |
64 | | -Step 6 |
65 | | ------- |
66 | | - |
67 | | -From the root of your installation directory/bzr clone, you can |
68 | | -use cmake to compile the sources. Use cmake --help when necessary. |
69 | | -Before you start building the sources, please remove the old build area |
70 | | -created from an earlier run and start afresh. |
71 | | - |
72 | | -C:\> del bld |
73 | | -C:\> md bld |
74 | | -C:\> cd bld |
75 | | -C:\> cmake .. -G "target name" -DBUILD_CONFIG=mysql_release |
76 | | - |
77 | | - |
78 | | -For Example: |
79 | | -To generate the Win64 project files using Visual Studio 9, you would run |
80 | | -cmake .. -G "Visual Studio 9 2008 Win64" |
81 | | - |
82 | | -Other target names supported using CMake 2.6 patch 4 are: |
83 | | - |
84 | | - Visual Studio 7 "Visual Studio 7 .NET 2003" |
85 | | - Visual Studio 8 "Visual Studio 8 2005" |
86 | | - Visual Studio 8 (64 bit) "Visual Studio 8 2005 Win64" |
87 | | - Visual Studio 9 "Visual Studio 9 2008" |
88 | | - Visual Studio 9 (64 bit) "Visual Studio 9 2008 Win64" |
89 | | - |
90 | | -For generating project files using Visual Studio 10, you need CMake 2.8 |
91 | | -or higher and corresponding target names are |
92 | | - Visual Studio 10 "Visual Studio 10" |
93 | | - Visual Studio 10 (64 bit) "Visual Studio 10 Win64" |
94 | | - |
95 | | -Step 7 |
96 | | ------- |
97 | | -From the root of your bzr clone, start your build. |
98 | | - |
99 | | -For Visual Studio, execute mysql.sln. This will start the IDE |
100 | | -and you can click the build solution menu option. |
101 | | - |
102 | | -Alternatively, you could start the build from command line as follows |
103 | | - |
104 | | -devenv mysql.sln /build relwithdebinfo |
105 | | - |
106 | | -Current issues |
107 | | --------------- |
108 | | -1. After changing configuration (eg. adding or removing a storage engine), it |
109 | | -may be necessary to clean the build tree to remove any stale objects. |
110 | | - |
111 | | -2. To use Visual C++ Express Edition you also need to install the Platform SDK. |
112 | | -Please see this link: http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/ |
113 | | -At step 5 you only need to add the libraries advapi32.lib and user32.lib to |
114 | | -the file "corewin_express.vsprops" in order to avoid link errors. |
| 7 | +For relevant information and/or for building binaries from source distribution, |
| 8 | +please refer to http://forge.mysql.com/wiki/CMake |
0 commit comments