[Dovecot] Unable to compile --with-mysql on Solaris

Jesse Reynolds jessedreynolds at gmail.com
Sun Jun 12 17:27:46 EEST 2011


Hello

I'm hoping someone can give me a pointer as to how to compile Dovecot with
MySQL support on Solaris.

I am trying to compile dovecot 2.0.13 (also tried 2.0.9) on Solaris
(OpenSolaris 2009-06, snv_111b) with the OpenSolaris provided MySQL 5.1.30
under /usr/mysql. The server is a Sun X2100 M2, which has a dual core AMD
Opteron processor (amd64).

Running "./configure --with-mysql" stops here:

...
checking for mysql_config... mysql_config
checking for mysql_init in -lmysqlclient... no
configure: error: Can't build with MySQL support: libmysqlclient not found

the libmysqlclient.so is to be found here:

/usr/mysql/5.1/lib/mysql/

or for the amd64 version:

/usr/mysql/5.1/lib/amd64/mysql/

And include is at:

/usr/mysql/5.1/include/

I have tried various combinations of things in CFLAGS, CPPFLAGS and LDFLAGS,
but it doesn't change the configure error above at all. Eg:

export CPPFLAGS="-I/usr/mysql/5.1/include/mysql"
export CFLAGS="-I/usr/mysql/5.1/include/mysql"
export LDFLAGS="-R/usr/mysql/5.1/lib/amd64/mysql
-L/usr/mysql/5.1/lib/amd64/mysql"
./configure --prefix=/opt/dovecot --with-ldap --with-mysql

Looking at config.log this section seems relevant:

configure:22993: checking for mysql_config
configure:23009: found /usr/mysql/bin/mysql_config
configure:23021: result: mysql_config
configure:23055: checking for mysql_init in -lmysqlclient
configure:23080: gcc -o conftest -std=gnu99 -I/usr/mysql/5.1/include/mysql
-Wall -W -Wmissing-prototypes -Wmissin
g-declarations -Wpointer-arith -Wchar-subscripts -Wformat=2
-Wbad-function-cast -I/usr/mysql/5.1/include/mysql -R
/usr/mysql/5.1/lib/amd64/mysql -L/usr/mysql/5.1/lib/amd64/mysql conftest.c
-lmysqlclient  -lnsl -lsocket  -lrt -l
sendfile -L/opt/SUNWspro/lib -lCrun -lrt -L/usr/mysql/5.1/lib/mysql
-R/usr/mysql/5.1/lib/mysql -lmysqlclient -lz
-lgen -lsocket -lnsl -lm -lz -lm >&5
ld: fatal: library -lCrun: not found
ld: fatal: file processing errors. No output written to conftest
collect2: ld returned 1 exit status
configure:23080: $? = 1
configure: failed program was:
| /* confdefs.h */
...snip...
configure:23089: result: no
configure:23198: error: Can't build with MySQL support: libmysqlclient not
found


Note, I have not installed the Sun C compiler, so am compiling with gcc
(/usr/bin/gcc 3.4.3). gmake is at /usr/bin/gmake and sun make is at
/usr/bin/make. Perhaps I would more more luck with Sun's C compiler?

Thank you
Jesse


-- 

  Jesse Reynolds
  Carbon Planet Limited - http://www.carbonplanet.com/
  Virtual Artists Pty Ltd - http://www.va.com.au/


More information about the dovecot mailing list