MySQL Forums
Forum List  »  Source, Builds, Binaries

Re: libmysqlclient for Mac-intel (how to compile it)
Posted by: Andreas Fink
Date: October 26, 2006 05:50PM

I did run into the same problem. My solution was to compile it always from source for intel and for powerpc separately and then merging all the things together with lipo which is a painful task as there arent just one file to lipo. There are libraries and some tools you dont want to lipo because they are shell scripts etc.

Since my last try with MySQL 5.0.26 things to a bit better. Not perfect though.
I can compile the whole bunch in one go for all 4 architectures in ONCE. the good news is that all the libraries are build 4 architecture wise. The bad news is that the tools (mysql, mysqld) arent. For me as a developer I want to make sure my app ships with proper client libs but the server I only need for testing so thats fine for now.

Here is how I do this (XCode 2.4 installed):

# some GNU world tools dont find themselves otherwise and no we dont want to use "fink" or "ports" here.
export PATH="/usr/X11R6/bin:/usr/bin:/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin"

# often libz and libiconv are not foun by ./configure and then their own compatibility versions are built leading to linking errors and other weid things

export LDFLAGS="-lz -liconv"

# this is the master magic for compiling for all architectures
# if your app does GUI or uses a non 64bit ready lib, you wan to skip ppc64 and x86_64

# the syslibroot stuff tells it to look for stuff in there instead of /usr/include or /usr/lib. this makes sure it will work on any system with MacOS 10.4, not just yours

export CFLAGS="-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os -Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk"
export CPPFLAGS=""

# and the master configure line with all the crap I want.
./configure --prefix=/usr/local/mysql --disable-dependency-tracking --enable-thread-safe-client --enable-local-infile --enable-largefile --with-extra-charsets=complex --with-innodb --with-berkeley-db --with-big-tables --with-unix-socket-path=/tmp/mysql.sock --with-ndb-shm --with-ndb-port --with-ndb-port-base --with-comment --with-gnu-ld --disable-shared


#and then of course
make
# drink some coffee here
make install

Options: ReplyQuote


Subject
Views
Written By
Posted
5097
January 05, 2006 09:30AM
Re: libmysqlclient for Mac-intel (how to compile it)
5840
October 26, 2006 05:50PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.