Ok thanks, I did it but there is another problem "Error opening plugin module; module='afsql', error='/usr/local/syslog-ng/lib/syslog-ng/libafsql.so: undefined symbol: dbi_result_free' but syslog-ng is running

I installed it using this:
./configure --prefix=/usr/local/syslog-ng \
> EVTLOG_CFLAGS="-I/usr/local/eventlog/include/eventlog" \
> EVTLOG_LIBS="-L/usr/local/eventlog/lib -levtlog" \
> GLIB_CFLAGS="-I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include" \
> GLIB_LIBS="-L/usr/lib -lglib-2.0 -lintl" \
> LIBDBI_CFLAGS="-I/usr/include/dbi" \
> LIBDBI_LIBS="-L/usr/lib" \
> --enable-sql \
> --enable-mixed-linking