2 AC_INIT(rlm_sql_freetds.c)
3 AC_REVISION($Revision$)
4 AC_DEFUN(modname,[rlm_sql_freetds])
9 if test x$with_[]modname != xno; then
11 dnl ############################################################
12 dnl # Check for command line options
13 dnl ############################################################
15 dnl extra argument: --with-freetds-include-dir=DIR
17 AC_ARG_WITH(freetds-include-dir,
18 [AS_HELP_STRING([--with-freetds-include-dir=DIR],
19 [Directory where the freetds includes may be found])],
22 AC_MSG_ERROR(Need freetds-include-dir)
27 freetds_include_dir="$withval"
31 dnl extra argument: --with-freetds-lib-dir=DIR
33 AC_ARG_WITH(freetds-lib-dir,
34 [AS_HELP_STRING([--with-freetds-lib-dir=DIR],
35 [Directory where the freetds libraries may be found])],
38 AC_MSG_ERROR(Need freetds-lib-dir)
43 freetds_lib_dir="$withval"
47 dnl extra argument: --with-freetds-dir=DIR
48 AC_ARG_WITH(freetds-dir,
49 [AS_HELP_STRING([--with-freetds-dir=DIR],
50 [Base directory where freetds is installed])],
53 AC_MSG_ERROR(Need freetds-dir)
58 freetds_lib_dir="$withval/lib"
59 freetds_include_dir="$withval/include"
63 dnl ############################################################
64 dnl # Check for header files
65 dnl ############################################################
67 smart_try_dir="$freetds_include_dir"
68 FR_SMART_CHECK_INCLUDE(ctpublic.h)
69 if test "x$ac_cv_header_ctpublic_h" != "xyes"; then
70 AC_MSG_WARN([freetds headers not found. Use --with-freetds-include-dir=<path>.])
71 fail="$fail ctpublic.h"
74 dnl ############################################################
75 dnl # Check for libraries
76 dnl ############################################################
78 dnl try to link to freetds
79 smart_try_dir="$freetds_lib_dir"
80 FR_SMART_CHECK_LIB(ct, ct_command)
81 if test "x$ac_cv_lib_ct_ct_command" != "xyes"
83 AC_MSG_WARN([freetds libraries not found. Use --with-freetds-lib-dir=<path>.])
90 echo \*\*\* module modname is disabled.
93 dnl Don't change this section.
94 if test "x$fail" != x; then
95 if test "x${enable_strict_dependencies}" = xyes; then
96 AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.])
98 AC_MSG_WARN([silently not building ]modname[.])
99 AC_MSG_WARN([FAILURE: ]modname[ requires:$fail.]);
104 mod_ldflags="$SMART_LIBS"
105 mod_cflags="$SMART_CFLAGS"
106 AC_SUBST(mod_ldflags)