[Dovecot] Compiling with SQL support
Hello all,
I am currently having a slight problem (ok well more likely me just not doing it right), with compiling Dovecot with MySQL support. The version is 1.0.8. I have tried running configure with --with-sql and --with-sql-drivers, but this however still does not compile MySQL support, I do no wish to install MySQL on this server, as I am using a network SQL server, but I do have the compiled source available on this server. I have tried running:
gcc -shared -fPIC -DHAVE_CONFIG_H -DBUILD_MYSQL
-I../.. -I../lib -I../lib-settings -I/data/mysql/include/mysql
driver-mysql.c -o driver_mysql.so -lmysqlclient
inside the /src/lib-sql, but this just returns an error that mysqlclient cannot be found.
I have tried running dovecot --build-options, but MySQL is not listed here, the operating system is FreeBSD 6.2.
The documentation does not seem to be giving any hints as to why this is not working, nor do How Tos.
Anyrhing remotely helpful would be appreciated.
Mark Smith
At 9:08 PM +1100 12/9/07, Mark Smith wrote:
Hello all,
I am currently having a slight problem (ok well more likely me just not doing it right), with compiling Dovecot with MySQL support. The version is 1.0.8. I have tried running configure with --with-sql and --with-sql-drivers, but this however still does not compile MySQL support, I do no wish to install MySQL on this server, as I am using a network SQL server, but I do have the compiled source available on this server. I have tried running:
gcc -shared -fPIC -DHAVE_CONFIG_H -DBUILD_MYSQL
-I../.. -I../lib -I../lib-settings -I/data/mysql/include/mysql
driver-mysql.c -o driver_mysql.so -lmysqlclientinside the /src/lib-sql, but this just returns an error that mysqlclient cannot be found.
This is really a gcc question that can be answered by reading the output from 'man gcc' which includes the following relevant info (I've added pointers for the crucial lines):
-llibrary
-l library
Search the library named library when linking. (The second alter-
native with the library as a separate argument is only for POSIX
compliance and is not recommended.)
It makes a difference where in the command you write this option;
the linker searches and processes libraries and object files in the
order they are specified. Thus, foo.o -lz bar.o searches library z
after file foo.o but before bar.o. If bar.o refers to functions in
z, those functions may not be loaded.
-------> The linker searches a standard list of directories for the library, -------> which is actually a file named liblibrary.a. The linker then uses -------> this file as if it had been specified precisely by name.
-------> The directories searched include several standard system directo- -------> ries plus any that you specify with -L.
Normally the files found this way are library files---archive files
whose members are object files. The linker handles an archive file
by scanning through it for members which define symbols that have
so far been referenced but not defined. But if the file that is
found is an ordinary object file, it is linked in the usual fash-
ion. The only difference between using an -l option and specifying
a file name is that -l surrounds library with lib and .a and
searches several directories.
--
Bill Cole
bill@scconsult.com
participants (2)
-
Bill Cole
-
Mark Smith