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.
Good luck.
Posted by jzawodn at January 23, 2003 03:02 PM
We tried compile mysql on FreeBSD 4.8 as described here
but for both versions - 3.23 and 4.0 of mysql compilation end with same results:
mysqld.o: In function `main:
mysqld.o(.text+0x1b1c): undefined reference to `my_pthread_setprio
sql_parse.o: In function `dispatch_command(enum_server_command, THD *, char *, unsigned int):
sql_parse.o(.text+0x1808): undefined reference to `my_pthread_setprio
sql_parse.o(.text+0x1861): undefined reference to `my_pthread_setprio
../innobase/os/libos.a(os0thread.o): In function `os_thread_create:
os0thread.o(.text+0xc2): undefined reference to `my_pthread_setprio
*** Error code 1
Function my_pthread_setprio is not included in linux thread library
so I donot know how to compile mysql.