2 AC_INIT(rlm_sql_unixodbc.c)
3 AC_REVISION($Revision$)
4 AC_DEFUN(modname,[rlm_sql_unixodbc])
9 if test x$with_[]modname != xno; then
11 dnl extra argument: --with-unixodbc-include-dir
13 AC_ARG_WITH(unixodbc-include-dir,
14 [AS_HELP_STRING([--with-unixodbc-include-dir=DIR],
15 [Directory where the unixODBC includes may be found])],
18 AC_MSG_ERROR(Need unixodbc-include-dir)
23 unixodbc_include_dir="$withval"
27 dnl extra argument: --with-unixodbc-lib-dir
29 AC_ARG_WITH(unixodbc-lib-dir,
30 [AS_HELP_STRING([--with-unixodbc-lib-dir=DIR],
31 [Directory where the unixODBC libraries may be found])],
34 AC_MSG_ERROR(Need unixodbc-lib-dir)
39 unixodbc_lib_dir="$withval"
43 dnl extra argument: --with-unixodbc-dir
44 AC_ARG_WITH(unixodbc-dir,
45 [AS_HELP_STRING([--with-unixodbc-dir=DIR],
46 [Base directory where unixODBC is installed])],
49 AC_MSG_ERROR(Need unixodbc-dir)
54 unixodbc_lib_dir="$withval/lib"
55 unixodbc_include_dir="$withval/include"
59 dnl Check for SQLConnect in -lodbc
60 smart_try_dir="$unixodbc_lib_dir"
61 FR_SMART_CHECK_LIB(odbc, SQLConnect)
62 if test "x$ac_cv_lib_odbc_SQLConnect" != xyes; then
67 smart_try_dir="$unixodbc_include_dir"
68 FR_SMART_CHECK_INCLUDE(sql.h)
69 if test "x$ac_cv_header_sql_h" != xyes; then
76 echo \*\*\* module modname is disabled.
79 dnl Don't change this section.
80 if test "x$fail" != x; then
81 if test "x${enable_strict_dependencies}" = xyes; then
82 AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.])
84 AC_MSG_WARN([silently not building ]modname[.])
85 AC_MSG_WARN([FAILURE: ]modname[ requires:$fail.]);
90 mod_ldflags="$SMART_LIBS"
91 mod_cflags="$SMART_CFLAGS"