This has come up a lot recently. I have several messages in my INBOX where people as asking for my secret recipe for properly building MySQL with LinuxThreads on FreeBSD.
I don't have much time right now to explain how I derived this, but here's the relevant piece of the build script I use at work when producing FreeBSD binaries from the MySQL source tree...
This assumes that you've installed the LinuxThreads package from the ports tree. Sorry for the poor formatting, but this should really be one big line:
CFLAGS='-O -pipe -march=pentiumpro -D__USE_UNIX98 \ -D_REENTRANT -D_THREAD_SAFE -DHAVE_BROKEN_REALPATH \ -I/usr/local/include/pthread/linuxthreads' CXX=cc \ CC=cc CXXFLAGS='-O -pipe -march=pentiumpro \ -D__USE_UNIX98 -D_REENTRANT -D_THREAD_SAFE \ -DHAVE_BROKEN_REALPATH -I/usr/local/include/pthread/linuxthreads \ -felide-constructors -fno-rtti -fno-exceptions' ./configure \ --with-mit-threads=no '--with-comment=Yahoo SMP' \ --enable-assembler --with-innodb \ '--with-named-thread-libs=-DHAVE_GLIBC2_STYLE_GETHOSTBYNAME_R \ -D_THREAD_SAFE -DHAVE_BROKEN_REALPATH \ -I/usr/local/include/pthread/linuxthreads -L/usr/local/lib \ -llthread -llgcc_r' --prefix=$PREFIX --enable-thread-safe-client \ --with-server-suffix='-Yahoo-SMP' --with-libwrap --with-raid \ --with-extra-charsets=complex
The HAVE_BROKEN_REALPATH probably isn't necessary anymore, since the configure script should catch that. But it can't hurt to leave in. That's probably true of several options above.
It's ugly, but It Works For Me(tm) on various versions of FreeBSD 4.x.
I do not have access to a FreeBSD 5.0 box yet, so don't ask me about that. I don't know. Really.
Posted by jzawodn at January 23, 2003 03:02 PM