Add configure scripts for rlm_securid
[freeradius.git] / src / modules / rlm_securid / configure.in
1 AC_PREREQ([2.59])
2 AC_INIT(rlm_securid.c)
3 AC_REVISION($Revision$)
4 AC_DEFUN(modname,[rlm_securid])
5
6 fail=
7 SMART_LIBS=
8 SMART_CLFAGS=
9 if test x$with_[]modname != xno; then
10
11     dnl ############################################################
12     dnl # Check for command line options
13     dnl ############################################################
14
15     dnl extra argument: --with-securid-include-dir=DIR
16     securid_include_dir=
17     AC_ARG_WITH(securid-include-dir,
18         [AS_HELP_STRING([--with-securid-include-dir=DIR],
19                 [Directory where the securid includes may be found])],
20         [case "$withval" in
21             no)
22                 AC_MSG_ERROR(Need securid-include-dir)
23                 ;;
24             yes)
25                 ;;
26             *)
27                 securid_include_dir="$withval"
28                 ;;
29         esac])
30
31     dnl extra argument: --with-securid-lib-dir=DIR
32     securid_lib_dir=
33     AC_ARG_WITH(securid-lib-dir,
34         [AS_HELP_STRING([--with-securid-lib-dir=DIR],
35                 [Directory where the securid libraries may be found])],
36         [case "$withval" in
37             no)
38                 AC_MSG_ERROR(Need securid-lib-dir)
39                 ;;
40             yes)
41                 ;;
42             *)
43                 securid_lib_dir="$withval"
44                 ;;
45         esac])
46
47     dnl extra argument: --with-securid-dir=DIR
48     AC_ARG_WITH(securid-dir,
49         [AS_HELP_STRING([--with-securid-dir=DIR],
50                 [Base directory where securid is installed])],
51         [case "$withval" in
52             no)
53                 AC_MSG_ERROR(Need securid-dir)
54                 ;;
55             yes)
56                 ;;
57             *)
58                 securid_lib_dir="$withval/lib"
59                 securid_include_dir="$withval/include"
60                 ;;
61         esac])
62
63     dnl ############################################################
64     dnl # Check for header files
65     dnl ############################################################
66     
67     FR_SMART_CHECK_INCLUDE(acexport.h)
68     if test "x$ac_cv_header_acexport_h" != "xyes"; then
69       AC_MSG_WARN([securid headers not found. Use --with-securid-include-dir=<path>.])
70       fail="$fail acexport.h"
71     fi
72
73     dnl ############################################################
74     dnl # Check for libraries
75     dnl ############################################################
76
77     dnl try to link to securid
78     smart_try_dir="$securid_lib_dir"
79     FR_SMART_CHECK_LIB(aceclnt, SD_Init)
80     if test "x$ac_cv_lib_aceclnt_SD_Init" != "xyes"
81     then
82       AC_MSG_WARN([securid libraries not found. Use --with-securid-lib-dir=<path>.])
83       fail="$fail libaceclnt"
84     fi
85
86     targetname=modname
87 else
88     targetname=
89     echo \*\*\* module modname is disabled.
90 fi
91
92 dnl Don't change this section.
93 if test "x$fail" != x; then
94         if test "x${enable_strict_dependencies}" = xyes; then
95                 AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.])
96         else
97                 AC_MSG_WARN([silently not building ]modname[.])
98                 AC_MSG_WARN([FAILURE: ]modname[ requires:$fail.]);
99                 targetname=
100         fi
101 fi
102
103 sql_securid_ldflags="$SMART_LIBS"
104 sql_securid_cflags="$SMART_CFLAGS"
105 AC_SUBST(sql_securid_ldflags)
106 AC_SUBST(sql_securid_cflags)
107 AC_SUBST(targetname)
108 AC_OUTPUT(all.mk)