[Dovecot] 1.1beta9 'make' fails on osx/Tiger, but OK on osx/Leopard (multiple definitions of symbol _hash_create)
i'm building
dovecot 1.1.beta9
on both
osx 10.4.11
osx 10.5.1
using
Using built-in specs.
Target: powerpc-apple-darwin8
Configured with: /Builds/apple/gcc_42-5531/obj/src/configure
--disable-checking -enable-werror --prefix=/usr --mandir=/usr/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-gxx-include-dir=/usr/include/c++/4.0.0 --with-slibdir=/usr/lib --build=i686-apple-darwin8 --program-prefix= --host=powerpc-apple-darwin8 --target=powerpc-apple-darwin8 Thread model: posix gcc version 4.2.1 (Apple Inc. build 5531)
on both boxes.
configuring as
Install prefix ...................... : /usr/local/dovecot
File offsets ........................ : 64bit
I/O loop method ..................... : kqueue
File change notification method ..... : kqueue
Building with SSL support ........... : yes (OpenSSL)
Building with IPv6 support .......... : yes
Building with pop3 server ........... : yes
Building with mail delivery agent .. : yes
Building with GSSAPI support ........ : no
Building with user database modules . : static prefetch passwd
passwd-file checkpassword sql Building with password lookup modules : passwd passwd-file pam checkpassword sql Building with SQL drivers ............:mysql sqlite
is OK on both boxes.
on Leopard,
make
completes without error.
but, on Tiger, it fails @
make
...
make[3]: Nothing to be done for `all'.
Making all in master
/bin/sh ../../libtool --tag=CC --mode=link gcc -std=gnu99 -g -O2
-Wall -W -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wchar-subscripts -Wformat=2 -Wbad-function-cast -Wstrict-aliasing=2 -I/usr/local/ssl/include -L/usr/local/db46/lib -L/usr/local/sqlite/lib -lsqlite3 -L/usr/local/mysql/lib/mysql -L/usr/local/lib -liconv -o dovecot auth-process.o askpass.o capabilities-posix.o child-process.o dict-process.o dup2-array.o listener.o log.o login-process.o mail-process.o main.o master-settings.o syslog-util.o ssl-init.o ../lib-settings/libsettings.a ../lib/liblib.a gcc -std=gnu99 -g -O2 -Wall -W -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wchar-subscripts -Wformat=2 -Wbad-function-cast -Wstrict-aliasing=2 -I/usr/local/ssl/include -o dovecot auth-process.o askpass.o capabilities-posix.o child-process.o dict-process.o dup2-array.o listener.o log.o login-process.o mail-process.o main.o master-settings.o syslog-util.o ssl-init.o -L/usr/local/db46/lib -L/usr/local/sqlite/lib /usr/local/sqlite/lib/libsqlite3.dylib -L/usr/local/lib -lreadline -lncurses -lpthread -L/usr/local/mysql/lib/mysql /usr/local/lib/libiconv.dylib ../lib-settings/libsettings.a ../lib/liblib.a /usr/libexec/gcc/powerpc-apple-darwin8/4.2.1/ld: multiple definitions of symbol _hash_create /usr/lib/gcc/powerpc-apple-darwin8/4.2.1/../../../libpthread.dylib(strhash.So) definition of _hash_create ../lib/liblib.a(hash.o) definition of _hash_create in section (__TEXT,__text) /usr/libexec/gcc/powerpc-apple-darwin8/4.2.1/ld: multiple definitions of symbol _hash_destroy /usr/lib/gcc/powerpc-apple-darwin8/4.2.1/../../../libpthread.dylib(strhash.So) definition of _hash_destroy ../lib/liblib.a(hash.o) definition of _hash_destroy in section (__TEXT,__text) collect2: ld returned 1 exit status make[3]: *** [dovecot] Error 1 make[2]: *** [all-recursive] Error 1 make[1]: *** [all-recursive] Error 1 make: *** [all] Error 2
looks like problems with ot at all sure what in Tiger's causing this ...
hints/suggestions?
thanks!
On Tue, 2007-11-27 at 22:43 -0800, snowcrash wrote:
/usr/libexec/gcc/powerpc-apple-darwin8/4.2.1/ld: multiple definitions of symbol _hash_create /usr/lib/gcc/powerpc-apple-darwin8/4.2.1/../../../libpthread.dylib(strhash.So) definition of _hash_create
I'd report this as a bug to Apple. Standard libraries shouldn't export symbols with such a common name. This will probably fix it for now: diff -r 373beccc2468 src/lib/hash.h --- a/src/lib/hash.h Wed Nov 28 09:16:17 2007 +0200 +++ b/src/lib/hash.h Wed Nov 28 09:19:40 2007 +0200 @@ -1,5 +1,10 @@ #ifndef HASH_H #define HASH_H + +#ifdef __APPLE__ +# define hash_create hash_create_osx_leopard_pthreads_conflict_fix +# define hash_destroy hash_destroy_osx_leopard_pthreads_conflict_fix +#endif /* Returns hash code. */ typedef unsigned int hash_callback_t(const void *p);
On Wed, 2007-11-28 at 09:22 +0200, Timo Sirainen wrote:
On Tue, 2007-11-27 at 22:43 -0800, snowcrash wrote:
/usr/libexec/gcc/powerpc-apple-darwin8/4.2.1/ld: multiple definitions of symbol _hash_create /usr/lib/gcc/powerpc-apple-darwin8/4.2.1/../../../libpthread.dylib(strhash.So) definition of _hash_create
I'd report this as a bug to Apple. Standard libraries shouldn't export symbols with such a common name.
Looks like those hash_* functions are in Tiger too. Also libpthread.dylib is just a symlink to libSystem.dylib. So I guess there's no chance of getting this fixed. I'm not sure why it doesn't break with Tiger though.
hi timo,
patch applied to 1.1.beta9 source
now,
configure make make check
are OK, now, on *both* Tiger/Leopard.
just to be clear -- minor mixup in your comment above ...
it's _not_ broken on Leopard, it was "broken" on Tiger
works for now!
Why is it linking any of -lreadline -lncurses -lpthread anyway? What line do they exist in Makefile? Does config.log say something about them?
nothing in ...
egrep "readline|ncurses|pthread" {Makefile,config.log}
(empty)
coming along from sqlite3, i believe ...
otool -L /usr/local/sqlite/lib/libsqlite3.dylib
/usr/local/sqlite/lib/libsqlite3.0.dylib (compatibility version
9.0.0, current version 9.6.0) /usr/local/lib/libreadline.5.2.dylib (compatibility version 5.0.0, current version 5.2.0) /usr/local/lib/libncurses.5.6.dylib (compatibility version 5.6.0, current version 5.6.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.0.0) /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
where
ls -al /usr/local/dovecot/libexec/dovecot/deliver
-rwxr-xr-x 1 root wheel 926480 Nov 27 23:52
/usr/local/DarkMatter/dovecot/libexec/dovecot/deliver
otool -L /usr/local/dovecot/libexec/dovecot/deliver
/usr/local/DarkMatter/sqlite/lib/libsqlite3.0.dylib (compatibility
version 9.0.0, current version 9.6.0) /usr/local/lib/libreadline.5.2.dylib (compatibility version 5.0.0, current version 5.2.0) /usr/local/lib/libncurses.5.6.dylib (compatibility version 5.6.0, current version 5.6.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.1.10) /usr/local/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0) /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
hth!
On Tue, 2007-11-27 at 23:51 -0800, snowcrash wrote:
just to be clear -- minor mixup in your comment above ...
it's _not_ broken on Leopard, it was "broken" on Tiger
Oh, interesting. I guess I won't add this workaround to Dovecot sources then. People have been building Dovecot on OSX for a long time and no-one's complained about this before.
Why is it linking any of -lreadline -lncurses -lpthread anyway? What line do they exist in Makefile? Does config.log say something about them? .. coming along from sqlite3, i believe ...
So, the next question: Why is sqlite3 linked to anything else than dovecot-auth? :)
hi timo,
it's _not_ broken on Leopard, it was "broken" on Tiger
Oh, interesting. I guess I won't add this workaround to Dovecot sources then. People have been building Dovecot on OSX for a long time and no-one's complained about this before.
so have i ...
but, i'd gather they've _not_ been using 1.1.b9 & 'new' gcc 4.2.1 ... especially on Tiger. v421 is a different beast, with more rigorous checking, and some different option support ... i'd bet it's related. but not sure atm :-|
Why is it linking any of -lreadline -lncurses -lpthread anyway? What line do they exist in Makefile? Does config.log say something about them? .. coming along from sqlite3, i believe ...
So, the next question: Why is sqlite3 linked to anything else than dovecot-auth? :)
probably a pickup from LDFLAGS, as i config/build as:
patch -p1 < /usr/ports/dovecot/patch-hash-dovecot.txt
# find libmysqlclient_r perl -pi -e 's/AC_CHECK_LIB\(mysqlclient,/AC_CHECK_LIB\(mysqlclient_r,/g' configure.in perl -pi -e 's/mysql_lib=\"\-lmysqlclient \-lz \-lm"/mysql_lib=\"\-lmysqlclient_r \-lz \-lm\"/g' configure.in
setenv LDFLAGS "-L/usr/local/db46/lib -L/usr/local/sqlite/lib -lsqlite3 -L/usr/local/mysql/lib/mysql -L/usr/local/lib -liconv"
setenv CPPFLAGS "-I/usr/local/db46/include -I/usr/local/sqlite/include -I/usr/local/mysql/include/mysql -I/usr/local/include"
./configure
--config-cache
--prefix=/usr/local/dovecot
--with-moduledir=/usr/local/dovecot-plugins
--with-libiconv-prefix=/usr/local
--with-ssl=openssl
--with-ssldir=/var/CERTS
--enable-maintainer-mode
--disable-debug
--enable-ipv6
--disable-static --enable-shared
--with-ioloop=best
--with-db
--with-mysql
--with-sqlite
--with-sql-drivers=mysql,sqlite
--with-deliver
--with-pop3d
--with-storages=maildir,mbox,dbox,cydir,raw
iirc, the "--with-sqlite" config option does not take a DIR arg. so to tell it where, LDFLAGS are req'd.
i might suggest DIR options for spec'n of non-standard install loc'ns for each opt. no?
hth.
On Wed, 2007-11-28 at 06:18 -0800, snowcrash wrote:
perl -pi -e 's/AC_CHECK_LIB\(mysqlclient,/AC_CHECK_LIB\(mysqlclient_r,/g' configure.in perl -pi -e 's/mysql_lib=\"\-lmysqlclient \-lz \-lm"/mysql_lib=\"\-lmysqlclient_r \-lz \-lm\"/g' configure.in
Doesn't it have -lmysqlclient at all? Should I just add another -lmysqlclient_r check and use it if -lmysqlclient isn't found?
setenv LDFLAGS "-L/usr/local/db46/lib -L/usr/local/sqlite/lib -lsqlite3 -L/usr/local/mysql/lib/mysql -L/usr/local/lib -liconv" .. iirc, the "--with-sqlite" config option does not take a DIR arg. so to tell it where, LDFLAGS are req'd.
The -L parameters are good enough in there, but isn't -lsqlite3 added automatically? If not, put it to SQL_LIBS instead if LDFLAGS.
i might suggest DIR options for spec'n of non-standard install loc'ns for each opt. no?
I just wrote about this privately to another guy, here's some copy&pasting:
Also I think those --with-package=/path parameters' functionality could be misundertood easily. They don't really specify that the given package is used from /path. They just modify the generic CPPFLAGS/LDFLAGS environment and let the compiler/linker find the packages wherever they happen to be first in the path.
Also I could never figure out when compiling other systems what I should use as the package path. Does the configure script use the given path as base path for <path>/include and <path>/lib, or does it assume that both the include and lib files are there or something else? What if I have the include and lib files in completely different locations?
I've never liked those parameters either as a user or as a developer, so I doubt I'll ever add them to Dovecot.
Doesn't it have -lmysqlclient at all?
on this box, yes, it does:
ls /usr/local/mysql/lib/mysql/libmysqlclient*
/usr/local/mysql/lib/mysql/libmysqlclient.15.0.0.dylib
/usr/local/mysql/lib/mysql/libmysqlclient.15.dylib
/usr/local/mysql/lib/mysql/libmysqlclient.a
/usr/local/mysql/lib/mysql/libmysqlclient.dylib
/usr/local/mysql/lib/mysql/libmysqlclient.la
/usr/local/mysql/lib/mysql/libmysqlclient_r.15.0.0.dylib
/usr/local/mysql/lib/mysql/libmysqlclient_r.15.dylib
/usr/local/mysql/lib/mysql/libmysqlclient_r.a
/usr/local/mysql/lib/mysql/libmysqlclient_r.dylib
/usr/local/mysql/lib/mysql/libmysqlclient_r.la
Should I just add another -lmysqlclient_r check and use it if -lmysqlclient isn't found?
you can add a conditional ... but, imho, you need the option to _specify_ using the threaded libs,not just fallback to them.
setenv LDFLAGS "-L/usr/local/db46/lib -L/usr/local/sqlite/lib -lsqlite3 -L/usr/local/mysql/lib/mysql -L/usr/local/lib -liconv" .. iirc, the "--with-sqlite" config option does not take a DIR arg. so to tell it where, LDFLAGS are req'd.
The -L parameters are good enough in there, but isn't -lsqlite3 added automatically? If not, put it to SQL_LIBS instead if LDFLAGS.
aha -- SQL_LIBS.
you might wish to add mention of that to:
./configure --help | grep -i SQL
--with-sql=yes|plugin Build with generic SQL support
--with-pgsql Build with PostgreSQL driver support
--with-mysql Build with MySQL driver support
--with-sqlite Build with SQLite3 driver support
--with-sql-drivers Build with specified SQL drivers (all)
i might suggest DIR options for spec'n of non-standard install loc'ns for each opt. no?
I just wrote about this privately to another guy, here's some copy&pasting:
Also I think those --with-package=/path parameters' functionality could be misundertood easily. They don't really specify that the given package is used from /path. They just modify the generic CPPFLAGS/LDFLAGS environment and let the compiler/linker find the packages wherever they happen to be first in the path.
Also I could never figure out when compiling other systems what I should use as the package path. Does the configure script use the given path as base path for <path>/include and <path>/lib, or does it assume that both the include and lib files are there or something else? What if I have the include and lib files in completely different locations?
I've never liked those parameters either as a user or as a developer, so I doubt I'll ever add them to Dovecot.
that's, of course, your call ... but, honestly, all of it's easily -- and frequently -- dealt with. you simply say what you mean. when clearly stated, there's no room for misunderstanding; and that explanation is completely in your hands.
e.g., either just provide
--with-mysql=DIR DIR is the install prefix
or 'all three'
--with-mysql=DIR DIR is the install prefix --with-mysql-libs=DIR overrides the DIR where libmysqlclient(_r).* is --with-mysql-includes=DIR overrides the DIR where mysql.h is
or some such.
They just modify the generic CPPFLAGS/LDFLAGS
only if you defined it that way. one can readily defined --with-mysql=$var, then assign DOVECOT_MYSQL_LIBS=$/var/mysql/libs (e.g), and use it specifically, rather than the generic/global LDFLAGS
personally, i find it a lot LESS confusing than having to dig for / guess if an env var SQLITE3_LIBS exists ...
just my $0.02!
cheers.
On Wed, 2007-11-28 at 07:04 -0800, snowcrash wrote:
Doesn't it have -lmysqlclient at all?
on this box, yes, it does: ..
Should I just add another -lmysqlclient_r check and use it if -lmysqlclient isn't found?
you can add a conditional ... but, imho, you need the option to _specify_ using the threaded libs,not just fallback to them.
Since Dovecot doesn't use threads, why do you want to link with mysqlclient_r then?
setenv LDFLAGS "-L/usr/local/db46/lib -L/usr/local/sqlite/lib -lsqlite3 -L/usr/local/mysql/lib/mysql -L/usr/local/lib -liconv" .. iirc, the "--with-sqlite" config option does not take a DIR arg. so to tell it where, LDFLAGS are req'd.
The -L parameters are good enough in there, but isn't -lsqlite3 added automatically? If not, put it to SQL_LIBS instead if LDFLAGS.
aha -- SQL_LIBS.
you might wish to add mention of that to: ... personally, i find it a lot LESS confusing than having to dig for / guess if an env var SQLITE3_LIBS exists ...
You don't have to use SQL_LIBS for anything else except -lsqlite3, if you really want to add that. --with-sqlite=/path wouldn't go adding -lsqlite3 anywhere either, so it wouldn't help.
I think as a user it's a lot easier to use and understand if you're just instructed to say:
CPPFLAGS=-I/usr/local/include LDFLAGS=-I/usr/local/lib ./configure
instead of:
./configure --with-mysql=/usr/local --with-sqlite=/usr/local --with-pgsql=/usr/local --with-ten-other-packages=/usr/local
And then you'll have 13 -I/usr/local/include and -L/usr/local/lib parameters, unless of course I add more code to remove those.
--with-mysql=DIR DIR is the install prefix
Binary packages sometimes install things to different locations than a standard installation. Like the header might not be in /usr/include/, but in /usr/include/package/. For that case this doesn't really work.
or 'all three'
--with-mysql=DIR DIR is the install prefix --with-mysql-libs=DIR overrides the DIR where libmysqlclient(_r).* is --with-mysql-includes=DIR overrides the DIR where mysql.h is
And lots of bloat to both configure code and ./configure --help..
or some such.
They just modify the generic CPPFLAGS/LDFLAGS
only if you defined it that way. one can readily defined --with-mysql=$var, then assign DOVECOT_MYSQL_LIBS=$/var/mysql/libs (e.g), and use it specifically, rather than the generic/global LDFLAGS
-I and -L don't really matter if they're in global CPPFLAGS/LDFLAGS.
I think as a user it's a lot easier to use and understand if you're just instructed to say:
CPPFLAGS=-I/usr/local/include LDFLAGS=-I/usr/local/lib ./configure
instead of:
./configure --with-mysql=/usr/local --with-sqlite=/usr/local --with-pgsql=/usr/local --with-ten-other-packages=/usr/local
again, i don't agree. LDFLAGS, CPPFLAGS, etc are _global_ var instances ... used by autofoo across the entier install. often end up with stuff linked-in where you don't necessarily need/want it.
also, lots of other apps seem to provide the option. i suppose they do it for a reason ...
but it's simply personal preference -- and, like i said, ultimately your call! :-)
Binary packages sometimes install things to different locations than a standard installation. Like the header might not be in /usr/include/, but in /usr/include/package/. For that case this doesn't really work.
well, first, i don't *use* binary packages ... i build from source.
but, anyway, it works just fine -- if you define/ues the vars properly. i do it all the time with other apps.
And lots of bloat to both configure code and ./configure --help..
some say bloat, some say flexibility. again, just opinion. if lean-as-possible is the goal, then you're absolutely right.
if, however, you want to allow folks to built dovecot on *their* system layout -- not just distros' -- then some flexibility needs to be there.
-I and -L don't really matter if they're in global CPPFLAGS/LDFLAGS.
hm? items def'd in LDFLAGS don't matter? then why your question about why -lsqlite is linked in? it's _only_ coming from LDFLAGS ... apparently not as you expected, no?
anyway, i can simply workaround lack of flexibility if/as needed. no changes to 'required'.
cheers.
On Wed, 2007-11-28 at 07:49 -0800, snowcrash wrote:
I think as a user it's a lot easier to use and understand if you're just instructed to say:
CPPFLAGS=-I/usr/local/include LDFLAGS=-I/usr/local/lib ./configure
instead of:
./configure --with-mysql=/usr/local --with-sqlite=/usr/local --with-pgsql=/usr/local --with-ten-other-packages=/usr/local
again, i don't agree. LDFLAGS, CPPFLAGS, etc are _global_ var instances ... used by autofoo across the entier install. often end up with stuff linked-in where you don't necessarily need/want it.
That's why libraries shouldn't be added to them, only linker flags.
-I and -L don't really matter if they're in global CPPFLAGS/LDFLAGS.
hm? items def'd in LDFLAGS don't matter? then why your question about why -lsqlite is linked in? it's _only_ coming from LDFLAGS ... apparently not as you expected, no?
You showed that you added it to LDFLAGS yourself. Dovecot should be adding it automatically where needed.
it was not. now that _you've_ mentioned it, i'll try it and see.
fyi ... this looks better, now.
setenv LDFLAGS "-L/usr/local/db46/lib -L/usr/local/sqlite/lib -L/usr/local/mysql/lib/mysql -L/usr/local/lib" setenv LIBS "-liconv" setenv SQL_LIBS "-lsqlite3" setenv CPPFLAGS "-I/usr/local/db46/include -I/usr/local/sqlite/include -I/usr/local/mysql/include/mysql -I/usr/local/include"
./configure
--config-cache
--prefix=/usr/local/dovecot
--with-moduledir=/usr/local/dovecot-plugins
--with-libiconv-prefix=/usr/local
--with-ssl=openssl
--with-ssldir=/var/CERTS
--enable-maintainer-mode
--disable-debug
--enable-ipv6
--disable-static --enable-shared
--with-db
--with-mysql
--with-sqlite
--with-ioloop=best
--with-sql-drivers=mysql,sqlite
--with-deliver
--with-pop3d
--with-storages=maildir,mbox,dbox,cydir,raw
otool -L sbin/dovecot sbin/dovecotpw libexec/dovecot/dovecot-auth
sbin/dovecot: /usr/local/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0) /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.0.0)
sbin/dovecotpw: /usr/lib/libpam.1.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/local/mysql/lib/mysql/libmysqlclient_r.15.dylib (compatibility version 16.0.0, current version 16.0.0) /usr/local/ssl/lib/libssl.0.9.8.dylib (compatibility version 0.9.8, current version 0.9.8) /usr/local/ssl/lib/libcrypto.0.9.8.dylib (compatibility version 0.9.8, current version 0.9.8) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.0.0) /usr/local/sqlite/lib/libsqlite3.0.dylib (compatibility version 9.0.0, current version 9.6.0) /usr/local/lib/libreadline.5.2.dylib (compatibility version 5.0.0, current version 5.2.0) /usr/local/lib/libncurses.5.6.dylib (compatibility version 5.6.0, current version 5.6.0) /usr/local/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.3) /usr/local/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0) /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
libexec/dovecot/dovecot-auth: /usr/lib/libpam.1.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/local/mysql/lib/mysql/libmysqlclient_r.15.dylib (compatibility version 16.0.0, current version 16.0.0) /usr/local/ssl/lib/libssl.0.9.8.dylib (compatibility version 0.9.8, current version 0.9.8) /usr/local/ssl/lib/libcrypto.0.9.8.dylib (compatibility version 0.9.8, current version 0.9.8) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.0.0) /usr/local/sqlite/lib/libsqlite3.0.dylib (compatibility version 9.0.0, current version 9.6.0) /usr/local/lib/libreadline.5.2.dylib (compatibility version 5.0.0, current version 5.2.0) /usr/local/lib/libncurses.5.6.dylib (compatibility version 5.6.0, current version 5.6.0) /usr/local/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.3) /usr/local/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0) /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
(*should* there be any links to -ldb in there?)
cheers!
(agh! bounced ...)
Doesn't it have -lmysqlclient at all?
on this box, yes, it does:
ls /usr/local/mysql/lib/mysql/libmysqlclient*
/usr/local/mysql/lib/mysql/libmysqlclient.15.0.0.dylib
/usr/local/mysql/lib/mysql/libmysqlclient.15.dylib
/usr/local/mysql/lib/mysql/libmysqlclient.a
/usr/local/mysql/lib/mysql/libmysqlclient.dylib
/usr/local/mysql/lib/mysql/libmysqlclient.la
/usr/local/mysql/lib/mysql/libmysqlclient_r.15.0.0.dylib
/usr/local/mysql/lib/mysql/libmysqlclient_r.15.dylib
/usr/local/mysql/lib/mysql/libmysqlclient_r.a
/usr/local/mysql/lib/mysql/libmysqlclient_r.dylib
/usr/local/mysql/lib/mysql/libmysqlclient_r.la
Should I just add another -lmysqlclient_r check and use it if -lmysqlclient isn't found?
you can add a conditional ... but, imho, you need the option to _specify_ using the threaded libs,not just fallback to them.
setenv LDFLAGS "-L/usr/local/db46/lib -L/usr/local/sqlite/lib -lsqlite3 -L/usr/local/mysql/lib/mysql -L/usr/local/lib -liconv" .. iirc, the "--with-sqlite" config option does not take a DIR arg. so to tell it where, LDFLAGS are req'd.
The -L parameters are good enough in there, but isn't -lsqlite3 added automatically? If not, put it to SQL_LIBS instead if LDFLAGS.
aha -- SQL_LIBS.
you might wish to add mention of that to:
./configure --help | grep -i SQL
--with-sql=yes|plugin Build with generic SQL support
--with-pgsql Build with PostgreSQL driver support
--with-mysql Build with MySQL driver support
--with-sqlite Build with SQLite3 driver support
--with-sql-drivers Build with specified SQL drivers (all)
i might suggest DIR options for spec'n of non-standard install loc'ns for each opt. no?
I just wrote about this privately to another guy, here's some copy&pasting:
Also I think those --with-package=/path parameters' functionality could be misundertood easily. They don't really specify that the given package is used from /path. They just modify the generic CPPFLAGS/LDFLAGS environment and let the compiler/linker find the packages wherever they happen to be first in the path.
Also I could never figure out when compiling other systems what I should use as the package path. Does the configure script use the given path as base path for <path>/include and <path>/lib, or does it assume that both the include and lib files are there or something else? What if I have the include and lib files in completely different locations?
I've never liked those parameters either as a user or as a developer, so I doubt I'll ever add them to Dovecot.
that's, of course, your call ... but, honestly, all of it's easily -- and frequently -- dealt with. you simply say what you mean. when clearly stated, there's no room for misunderstanding; and that explanation is completely in your hands.
e.g., either just provide
--with-mysql=DIR DIR is the install prefix
or 'all three'
--with-mysql=DIR DIR is the install prefix --with-mysql-libs=DIR overrides the DIR where libmysqlclient(_r).* is --with-mysql-includes=DIR overrides the DIR where mysql.h is
or some such.
They just modify the generic CPPFLAGS/LDFLAGS
only if you defined it that way. one can readily defined --with-mysql=$var, then assign DOVECOT_MYSQL_LIBS=$/var/mysql/libs (e.g), and use it specifically, rather than the generic/global LDFLAGS
personally, i find it a lot LESS confusing than having to dig for / guess if an env var SQLITE3_LIBS exists ...
just my $0.02!
cheers.
On Tue, 2007-11-27 at 22:43 -0800, snowcrash wrote:
gcc -std=gnu99 -g -O2 -Wall -W -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wchar-subscripts -Wformat=2 -Wbad-function-cast -Wstrict-aliasing=2 -I/usr/local/ssl/include -o dovecot auth-process.o askpass.o capabilities-posix.o child-process.o dict-process.o dup2-array.o listener.o log.o login-process.o mail-process.o main.o master-settings.o syslog-util.o ssl-init.o -L/usr/local/db46/lib -L/usr/local/sqlite/lib /usr/local/sqlite/lib/libsqlite3.dylib -L/usr/local/lib -lreadline -lncurses -lpthread
Why is it linking any of -lreadline -lncurses -lpthread anyway? What line do they exist in Makefile? Does config.log say something about them?
participants (3)
-
snowcrash
-
snowcrash
-
Timo Sirainen