[How-to] How to compile MYSQL code?
Author: Wang Meng (HeartIcy@163.com)
Revision: Initial
Date: July 13, 2003
Description: This is not a paper is not a code reading guidance. The purpose of writing this article is just to tell friends how to compile MYSQL.
Code, maybe some people feel that the code from the Windows platform compiled mysql is a bit complicated, in fact. If you have any questions about the knowledge mentioned in this article, you can seek help through the 9CBS mysql board or MySQL @ CHINA support forum. There is no innovation mentioned in this article, just a summary of the mysql already documentation.
First, why should compile code?
When my mother, my mother told me that I have to have something to do, otherwise I can't do it, so I have to have a purpose. I don't know friends who read this article.
You will pay attention to the MySQL manual. MySQL Online Manual Recently presents a "transcendence" trend, the content described in the manual is in the development version to be found, I hope that I will get the experiment at the same time. At the same time, I also hate the software in the software as other friends, so I have to compile the code. Of course, my original intention is to get better performance with Intel C recompile MySQL code.
Second, how to prepare compiled code
This part contains the following points, please pay attention.
■ Compiler
■ Cygwin
■ Memory
■ Patience
Compiler, compile MySQL code can use GCC and VC6.0, VC7.1 under CygWin. If you use Intel C
If I suggest you use VC6.0. Reasons for using VC 7.0 are the bugs that they exist themselves (have been fixed, but not open.), If they are not patch, they will cause errors (About INLINE optimization can be temporarily resolved). VC6.0 Please install SP4 or SP5 and the corresponding processor support patches.
Most of Cygwin, Mysql is written in Linux, so many utility and configuration scripts are * NIX wind
So we need to use Cygwin's Unix analog environment. Please select AutoConf Automake GNU Make Libtool Bison Perl when installing. Another point, MySQL's development uses BK to manage, and BK's client also needs to run with Cygwin. If you just want to compile the official release of Windows code, you can not care about it.
Memory, compile MYSQL code very time time, at least I think so. I recommend there a machine that is large enough.
Otherwise you will make you a feeling that is not as good as death (exaggerated ing ...).
Patience
No one will succeed for the first time, suppose that even these small problems can solve the reading code? So, how much give yourself confidence, and how much is patient.
Third, get resources
I hope that the second year of reading is already prepared to have most things. In addition to the compiler, we need to be quiz.
With the BK client, you can go back to www.bitkeeper.com. If you don't know if the URL of Cygwin is now looking for www.cygwin.com.
When we are ready to properly, we visited mysql.bkbits.net, here we can see a table. Every table here
The project corresponds to a MySQL project, we care about the project called MySQL-4.1, which is currently the main work focus mysql 4.1.x version of the development tree.
Get the code:
Shell> BK Clone Bk: //mysql.bkbits.net/mysql-4.1 mysql-4.1 Update Code:
Shell> BK Pull Bk: //mysql.bkbits.net/mysql-4.1 mysql-4.1
Through the two commands, we can get and keep in synchronize mysql4.1.x code in the development, the first time downloaded, the whole process is very slow, about more than 100 m, then you need to download, then unzip and then synthesize code . Other items listed in mysql.bkbits.net are:
MySQL-4.0 mysql 4.0.x Development Tree Mysqldoc MySQL Document Mysqlodbc3 MySQL ODBC Drive MySQL-3.23 MySQL 3.23.x Development Tree, Yellow Flower Yesterday. Mysql-4.1 MySQL 4.1.x development tree, work focus. Mysql-5.0 mysql Next Generation MySQLCC MYSQL Control Center MyODBC-3.52 Initial Compatible with MySQL 4.1 ODBC Drive
We can use the same way to get and sync code at any time.
Fourth, generate Windows code
The code that is downloaded by the default is not suitable for direct use, put the code COPY to another directory, then use the build directory.
Utility Compile-Pentium-Max Configuration Code, use the utility of the Scripts directory with the utility when the configuration is completed, make_win_src_distribution generates a code suitable for Windows, this way the code is like the code provided by the official download, the final finished product is a Tar package . Execute these utilities, that is, the shell script needs to be at the top-level directory of the code tree.
V. Compile Code
When completing the above work, the compiled code should be the most easily, and open the project with VC 6.0 or VC.NET 2003.
The file is compiled. There is no need for other class libraries throughout the process, and it is difficult.
Related Website:
MySQL @ China www.help2u.org mysql ab www.mysql.com mysql mailing list lists.mysql.com MySQL defect track Bugs.mysql.com
Finally, I wish you all good luck. Also the most important. The mysql code obtained by this manner follows the GPL protocol, please check it out for details on the GPL.