[Dovecot] Re: Dovecot 1.0beta3 - make fails without sql
The problem seems to be in src/lib-sql/Makefile[.in]
When there are no sql drivers to build, the shell-script for making sql-drivers-register.c fails.
I've managed to get it to build by just having
#include "lib.h" #include "sql-api.h" void sql_drivers_register_all(void) { }
as sql-drivers-register.c
Best Wishes, Chris
P.S. I meant to send the message below to the whole list rather than just Timo. Sorry!
Chris Wakelin wrote:
I'm getting build errors with 1.0-beta3. It looks like something to with the dynamic SQL drivers; presumably needs equivalent of "-I../lib-sql" somewhere!
Configure line was "./configure --prefix=/opt/RDGdovect --with-ssl=openssl", Solaris make, gcc 3.3.2
Best Wishes, Chris
Undefined first referenced symbol in file sql_drivers_register_all main.o ld: fatal: Symbol referencing errors. No output written to dovecot-auth collect2: ld returned 1 exit status *** Error code 1 make: Fatal error: Command failed for target `dovecot-auth'
Timo Sirainen wrote:
- Added support for loading SQL drivers dynamically (see INSTALL file for how to build them)
-- --+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+- Christopher Wakelin, c.d.wakelin@reading.ac.uk IT Services Centre, The University of Reading, Tel: +44 (0)118 378 8439 Whiteknights, Reading, RG6 2AF, UK Fax: +44 (0)118 975 3094
On Wed, 2006-02-08 at 16:09 +0000, Chris Wakelin wrote:
The problem seems to be in src/lib-sql/Makefile[.in]
When there are no sql drivers to build, the shell-script for making sql-drivers-register.c fails.
Thanks, fixed. It's only a problem with Solaris's /bin/sh though. bash and zsh can handle it.
Timo Sirainen wrote:
On Wed, 2006-02-08 at 16:09 +0000, Chris Wakelin wrote:
The problem seems to be in src/lib-sql/Makefile[.in]
When there are no sql drivers to build, the shell-script for making sql-drivers-register.c fails.
Thanks, fixed. It's only a problem with Solaris's /bin/sh though. bash and zsh can handle it.
Darn! Solaris still doesn't like it (and it appears to be using bash as the shell)
make sql-drivers-register.c
rm -f sql-drivers-register.c echo '/* this file automatically generated by Makefile */'
sql-drivers-register.c echo '#include "lib.h"' >>sql-drivers-register.c echo '#include "sql-api.h"' >>sql-drivers-register.c if [ "" != "" ]; then
for i in ; do
echo "extern struct sql_db driver_${i}_db;"sql-drivers-register.c ;
done
fi bash: -c: line 2: syntax error near unexpected token;' *** Error code 2 make: Fatal error: Command failed for target
sql-drivers-register.c'
How about :-
sql-drivers-register.c: Makefile
rm -f $@
echo '/* this file automatically generated by Makefile */' >$@
echo '#include "lib.h"' >>$@
echo '#include "sql-api.h"' >>$@
for i in $(sql_drivers) null ; do
if [ "$${i}" != "null" ]; then
echo "extern struct sql_db driver_$${i}_db;" >>$@ ;
fi
done
echo 'void sql_drivers_register_all(void) {' >>$@
for i in $(sql_drivers) null ; do
if [ "$${i}" != "null" ]; then
echo "sql_driver_register(&driver_$${i}_db);" >>$@ ;
fi
done
echo '}' >>$@
I'm not too good at Makefiles (what needs escaping etc.) but it seems to work, at least on Solaris when $(sql_drivers) is empty ...
Best Wishes, Chris
-- --+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+- Christopher Wakelin, c.d.wakelin@reading.ac.uk IT Services Centre, The University of Reading, Tel: +44 (0)118 378 8439 Whiteknights, Reading, RG6 2AF, UK Fax: +44 (0)118 975 3094
participants (2)
-
Chris Wakelin
-
Timo Sirainen