Merge pull request #700 from mcnewton/rlm_files
[freeradius.git] / src / modules / rlm_sql / drivers / rlm_sql_firebird / configure.ac
1 AC_PREREQ([2.59])
2 AC_INIT(rlm_sql_firebird.c)
3 AC_REVISION($Revision$)
4 AC_DEFUN(modname,[rlm_sql_firebird])
5
6 fail=
7 SMART_LIBS=
8 SMART_CLFAGS=
9 if test x$with_[]modname != xno; then
10         dnl extra argument: --with-firebird-include-dir
11         firebird_include_dir=
12         AC_ARG_WITH(firebird-include-dir,
13                 [AS_HELP_STRING([--with-firebird-include-dir=DIR],
14                         [Directory where the firebird includes may be found])],
15                 [case "$withval" in
16                     no)
17                         AC_MSG_ERROR(Need firebird-include-dir)
18                         ;;
19                     yes)
20                         ;;
21                     *)
22                         firebird_include_dir="$withval"
23                         ;;
24                 esac])
25
26         dnl extra argument: --with-firebird-lib-dir
27         firebird_lib_dir=
28         AC_ARG_WITH(firebird-lib-dir,
29                 [AS_HELP_STRING([--with-firebird-lib-dir=DIR],
30                         [Directory where the firebird libraries may be found])],
31                 [case "$withval" in
32                     no)
33                         AC_MSG_ERROR(Need firebird-lib-dir)
34                         ;;
35                     yes)
36                         ;;
37                     *)
38                         firebird_lib_dir="$withval"
39                         ;;
40                 esac])
41
42         dnl extra argument: --with-firebird-dir
43         AC_ARG_WITH(firebird-dir,
44                 [AS_HELP_STRING([--with-firebird-dir=DIR],
45                         [Base directory where firebird is installed])],
46                 [case "$withval" in
47                     no)
48                         AC_MSG_ERROR(Need firebird-dir)
49                         ;;
50                     yes)
51                         ;;
52                     *)
53                         firebird_lib_dir="$withval/lib"
54                         firebird_include_dir="$withval/include"
55                         ;;
56                 esac])
57
58         dnl Check for isc_attach_database in -lfbclient
59         smart_try_dir="$firebird_lib_dir /usr/lib/firebird2/lib /usr/local/firebird/lib"
60         FR_SMART_CHECK_LIB(fbclient, isc_attach_database)
61         if test "x$ac_cv_lib_fbclient_isc_attach_database" != xyes; then
62                 fail="$fail libfbclient"
63         fi
64
65         dnl Check for ibase.h
66         smart_try_dir="$firebird_include_dir /usr/lib/firebird2/include /usr/local/firebird/include"
67         FR_SMART_CHECK_INCLUDE(ibase.h)
68         if test "x$ac_cv_header_ibase_h" != xyes; then
69                 fail="$fail ibase.h"
70         fi
71
72         targetname=modname
73 else
74         targetname=
75         echo \*\*\* module modname is disabled.
76 fi
77
78 dnl Don't change this section.
79 if test "x$fail" != x; then
80         if test "x${enable_strict_dependencies}" = xyes; then
81                 AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.])
82         else
83                 AC_MSG_WARN([silently not building ]modname[.])
84                 AC_MSG_WARN([FAILURE: ]modname[ requires:$fail.]);
85                 targetname=
86         fi
87 fi
88
89 mod_ldflags="$SMART_LIBS"
90 mod_cflags="$SMART_CPPFLAGS"
91 AC_SUBST(mod_ldflags)
92 AC_SUBST(mod_cflags)
93 AC_SUBST(targetname)
94 AC_OUTPUT(all.mk)