On Thu, 2007-01-11 at 12:54 -0800, Bob wrote:
I suggest that the conifgure script for dovecot offer a --with-mysql[=DIR] option so that it would be possible to provide the base location of the mysql installation as --with-mysql=/opt in the same manner that it is done for php.
I'd rather not do that, since then people ask it for every single library that Dovecot supports. It should be possible to do all this with environment variables just as well. Also then you'll start seeing things like:
./configure --with-mysql=/usr/local --with-postgres=/usr/local
Which causes multiple identical -I and -L options, unless I add more code to remove the duplicates.
All in all, I think it just requires adding a lot more code to configure without giving all that much benefits.
CFLAGS="-O3 -m64 -mcpu=ultrasparc -L/opt/lib/sparcv9 -L/opt/lib/sparcv9/mysql -R/opt/lib/sparcv9 -R/opt/lib/sparcv9/mysql"
CXXFLAGS="-O3 -m64 -mcpu=ultrasparc -L/opt/lib/sparcv9 -L/opt/lib/sparcv9/mysql -R/opt/lib/sparcv9 -R/opt/lib/sparcv9/mysql"
LDFLAGS="-O3 -m64 -mcpu=ultrasparc -L/opt/lib/sparcv9 -L/opt/lib/sparcv9/mysql -R/opt/lib/sparcv9 -R/opt/lib/sparcv9/mysql" \
I think you should rather do something like:
CPPFLAGS=-I/opt/mysql/include
CFLAGS="-O3 -m64 -mcpu=ultrasparc"
CXXFLAGS="-O3 -m64 -mcpu=ultrasparc"
LDFLAGS="-L/opt/lib/sparcv9 -L/opt/lib/sparcv9/mysql -R/opt/lib/sparcv9 -R/opt/lib/sparcv9/mysql"
./configure
What is odd about the above is that the input to libtool is completely correct but the resulting gcc command converted -lmysqlclient to an absolute path of /opt/lib/mysql/libmysqlclient.so which is wrong for a 64 bit build - hence the link failure. Why this happened is a mystery to me? If it had been left alone as -lmysqlclient the link would have been successful because the correct 64 bit library would have been found automatically.
Maybe libtool found libmysqlclient.la, which contained path to /opt/lib/mysql/libmysqlclient.so? Anyway, this is a libtool issue..