Add /usr/lib to search path, to avoid warning messages on build
[freeradius.git] / src / modules / rlm_sql / drivers / rlm_sql_iodbc / configure.in
1 AC_PREREQ([2.59])
2 AC_INIT(sql_iodbc.c)
3 AC_REVISION($Revision$)
4 AC_DEFUN(modname,[rlm_sql_iodbc])
5
6 fail=
7 SMART_LIBS=
8 SMART_CLFAGS=
9 if test x$with_[]modname != xno; then
10
11         dnl extra argument: --with-iodbc-include-dir
12         iodbc_include_dir=
13         AC_ARG_WITH(iodbc-include-dir,
14                 [AS_HELP_STRING([--with-iodbc-include-dir=DIR],
15                         [Directory where the Iodbc includes may be found])],
16                 [case "$withval" in
17                     no)
18                         AC_MSG_ERROR(Need iodbc-include-dir)
19                         ;;
20                     yes)
21                         ;;
22                     *)
23                         iodbc_include_dir="$withval"
24                         ;;
25                 esac])
26
27         dnl extra argument: --with-iodbc-lib-dir
28         iodbc_lib_dir=
29         AC_ARG_WITH(iodbc-lib-dir,
30                 [AS_HELP_STRING([--with-iodbc-lib-dir=DIR],
31                         [Directory where the Iodbc libraries may be found])],
32                 [case "$withval" in
33                     no)
34                         AC_MSG_ERROR(Need iodbc-lib-dir)
35                         ;;
36                     yes)
37                         ;;
38                     *)
39                         iodbc_lib_dir="$withval"
40                         ;;
41                 esac])
42
43         dnl extra argument: --with-iodbc-dir
44         AC_ARG_WITH(iodbc-dir,
45                 [AS_HELP_STRING([--with-iodbc-dir=DIR],
46                         [Base directory where Iodbc is installed])],
47                 [case "$withval" in
48                     no)
49                         AC_MSG_ERROR(Need iodbc-dir)
50                         ;;
51                     yes)
52                         ;;
53                     *)
54                         iodbc_lib_dir="$withval/lib"
55                         iodbc_include_dir="$withval/include"
56                         ;;
57                 esac])
58
59         dnl Check for SQLConnect in -liodbc
60         smart_try_dir="$iodbc_lib_dir /usr/lib /usr/lib/iodbc /usr/local/lib/iodbc /usr/local/iodbc/lib/iodbc"
61         FR_SMART_CHECK_LIB(iodbc, SQLConnect)
62         if test "x$ac_cv_lib_iodbc_SQLConnect" != xyes; then
63                 fail="$fail libiodbc"
64         fi
65
66         dnl Check for isql.h
67         smart_try_dir="$iodbc_include_dir /usr/local/iodbc/include"
68         FR_SMART_CHECK_INCLUDE(isql.h)
69         if test "x$ac_cv_header_isql_h" != xyes; then
70                 fail="$fail isql.h"
71         fi
72
73         targetname=modname
74 else
75         targetname=
76         echo \*\*\* module modname is disabled.
77 fi
78
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.])
83         else
84                 AC_MSG_WARN([silently not building ]modname[.])
85                 AC_MSG_WARN([FAILURE: ]modname[ requires:$fail.]);
86                 targetname=
87         fi
88 fi
89
90 sql_iodbc_ldflags="$SMART_LIBS"
91 sql_iodbc_cflags="$SMART_CFLAGS"
92 AC_SUBST(sql_iodbc_ldflags)
93 AC_SUBST(sql_iodbc_cflags)
94 AC_SUBST(targetname)
95 AC_OUTPUT(Makefile)