1 AC_INIT(sql_firebird.c)
2 AC_REVISION($Revision$)
3 AC_DEFUN(modname,[rlm_sql_firebird])
8 AC_ARG_WITH(firebird-include-dir,
9 [ --with-firebird-include-dir=DIR Directory where the firebird includes may be found ],
10 [ firebird_include_dir="$withval" ]
13 AC_ARG_WITH(firebird-lib-dir,
14 [ --with-firebird-lib-dir=DIR Directory where the firebird libraries may be found ],
15 [ firebird_lib_dir="$withval" ]
18 AC_ARG_WITH(firebird-dir,
19 [ --with-firebird-dir=DIR Base directory where firebird is installed ],
20 [ firebird_lib_dir="$withval/lib"
21 firebird_include_dir="$withval/include"
25 if test x$with_[]modname != xno; then
27 targetname=modname # we might change this later.
29 AC_MSG_CHECKING([for ibase.h])
31 AC_TRY_COMPILE([#include <ibase.h>], [int a = 1;],
36 if test "x$FIREBIRD_INCLUDE" = "x"; then
39 for try in /usr/local/include $firebird_include_dir; do
40 CFLAGS="$old_CFLAGS -I$try"
41 AC_TRY_COMPILE([#include <ibase.h>], [int a = 1;],
42 FIREBIRD_INCLUDE="-I$try",
45 if test "x$FIREBIRD_INCLUDE" != "x"; then
52 if test "x$FIREBIRD_INCLUDE" = "x"; then
54 AC_MSG_WARN([firebird headers not found. Use --with-firebird-include-dir=<path>.])
55 targetname= # disabled module
57 sql_firebird_cflags="${sql_firebird_cflags} ${FIREBIRD_INCLUDE}"
60 AC_MSG_CHECKING([for isc_attach_database -l$GDS])
64 for try in /usr/lib $firebird_lib_dir; do
65 LIBS="$old_LIBS -L$try -lfbclient"
66 AC_TRY_LINK([extern char isc_attach_database();], [isc_attach_database()],
67 FIREBIRD_LIBS="-L$try -lfbclient",
70 if test "x$FIREBIRD_LIBS" != "x"; then
76 dnl # If one or the other isn't found, disable them both..
77 dnl # If both are found, enable them both.
78 if test "x$FIREBIRD_LIBS" = "x"; then
81 AC_MSG_WARN([firebird libraries not found. Use --with-firebird-lib-dir=<path>.])
82 targetname= # disabled module
85 sql_firebird_ldflags="$sql_firebird_ldflags $FIREBIRD_LIBS"
89 sql_firebird_ldflags="$sql_firebird_ldflags $LIBS"
91 if test "x$targetname" = "x"; then
92 AC_MSG_WARN([sql submodule 'firebird' disabled])
97 echo \*\*\* module modname is disabled.
100 AC_SUBST(sql_firebird_ldflags)
101 AC_SUBST(sql_firebird_cflags)