I bought a new laptop, a MacBook running Mac OS X Tiger. I was captivated by the user interface, and I was willing to try this new experience, after a long and successful relationship with Linux (I gave up Windows many years ago). Everything went well, until the moment I tried to compile MySQL from source.
Using the default Xcode tools, I was able to compile the source packages provided with the GA release (5.0.x). But with 5.1 it was a different story. I was not even able to complete the compile part. something was breaking quite soon during the process.
After unsuccessfully trying all the tools made by the MySQL Build Department, I finally decided to take things into my own hands, and to create a reliable compiling environment.
I - Isolating the environmentI decided that the sanest course of action was to get the most recent build tools and then I checked whether I could get some of them via Fink or apt-get. Simply running "fink selfupdate" did most of the necessary work. After that I had a very recent version of gcc/g++.
The GNU tools for building were not available through the standard interface, and then I had to compile them from scratch. I was a bit reluctant, because I could disrupt some existing dependency, and hinder the functionality of the Mac OS X development tools. Thus, I set up a limited environment for building.
- create a directory $HOME/usr/local/bin
- change the PATH to include the new binary directory at the start.
Now whenever I start a build task, programs in the new path will take precedence over the built-in ones. This way I can still use the development tools to make Mac specific applications, and at the same time I can use the most recent tools for my job related purposes.
II - Making the building toolsOnce the path is set, it's time to build the tools.
- compile the new tools in the following order:
- autoconf-2.61 http://ftp.gnu.org/gnu/autoconf/autoconf-2.61.tar.gz
- libtool-1.5.22 http://ftp.gnu.org/gnu/libtool/libtool-1.5.22.tar.gz
- automake-1.10 http://ftp.gnu.org/gnu/automake/automake-1.10.tar.gz
- byacc-20050813 ftp://invisible-island.net/byacc/byacc.tar.gz
- bison-2.3 http://ftp.gnu.org/gnu/bison/bison-2.3.tar.gz
automake took almost 40 minutes (it has a huge regression test suite) but in the end, I managed to get all the tools in working shape. It's important to do the installation in the above order. Testing of automake fails if autoconf and libtool were not already compiled and installed. I know because I tried to build all of them in parallel and it failed.
./configure --prefix=$HOME/usr/local &&amp;amp;amp;amp;amp;amp;amp; make && make check && make install
III - Using themNow that I have the tools, I can do something practical.
And it works!
$ bk clone username@bk_repository/mysql-5.1 51
$ cd 51
$ make test
$ make dist
BTW, BUILD/compile-dist and make dist are the commands used by the MySQL build team to create a source distribution. You can do that as well from a development source tree.
CaveatThis material is my personal experience (which is quite limited with Mac OS X). The reason for installing so many packages from source is because the ones that are provided natively fail sooner or later during the task that I needed to perform.
If any Mac OS X expert has a better solution for this particular problem, I will listen.