3 AC_REVISION($Revision$)
4 AC_DEFUN(modname,[rlm_yubikey])
6 if test x$with_[]modname != xno; then
7 dnl ############################################################
8 dnl # Check for command line options
9 dnl ############################################################
11 dnl ############################################################
13 dnl ############################################################
15 dnl extra argument: --with-yubikey-include-dir=DIR
17 AC_ARG_WITH(yubikey-include-dir,
18 [AS_HELP_STRING([--with-yubikey-include-dir=DIR],
19 [Directory where the yubikey includes may be found])],
22 AC_MSG_ERROR(Need yubikey-include-dir)
27 yubikey_include_dir="$withval"
31 dnl extra argument: --with-yubikey-lib-dir=DIR
33 AC_ARG_WITH(yubikey-lib-dir,
34 [AS_HELP_STRING([--with-yubikey-lib-dir=DIR],
35 [Directory where the yubikey libraries may be found])],
38 AC_MSG_ERROR(Need yubikey-lib-dir)
43 yubikey_lib_dir="$withval"
47 dnl extra argument: --with-yubikey-dir=DIR
48 AC_ARG_WITH(yubikey-dir,
49 [AS_HELP_STRING([--with-yubikey-dir=DIR],
50 [Base directory where yubikey is installed])],
53 AC_MSG_ERROR(Need yubikey-dir)
58 yubikey_lib_dir="$withval/lib"
59 yubikey_include_dir="$withval/include"
63 dnl ############################################################
64 dnl # Ykclient options
65 dnl ############################################################
67 dnl extra argument: --with-ykclient-include-dir=DIR
69 AC_ARG_WITH(ykclient-include-dir,
70 [AS_HELP_STRING([--with-ykclient-include-dir=DIR],
71 [Directory where the ykclient includes may be found])],
74 AC_MSG_ERROR(Need ykclient-include-dir)
79 ykclient_include_dir="$withval"
83 dnl extra argument: --with-ykclient-lib-dir=DIR
85 AC_ARG_WITH(ykclient-lib-dir,
86 [AS_HELP_STRING([--with-ykclient-lib-dir=DIR],
87 [Directory where the ykclient libraries may be found])],
90 AC_MSG_ERROR(Need ykclient-lib-dir)
95 ykclient_lib_dir="$withval"
99 dnl extra argument: --with-ykclient-dir=DIR
100 AC_ARG_WITH(ykclient-dir,
101 [AS_HELP_STRING([--with-ykclient-dir=DIR],
102 [Base directory where ykclient is installed])],
105 AC_MSG_ERROR(Need ykclient-dir)
110 ykclient_lib_dir="$withval/lib"
111 ykclient_include_dir="$withval/include"
115 dnl ############################################################
116 dnl # Check for yubikey header files (optional)
117 dnl ############################################################
120 smart_try_dir="$yubikey_include_dir"
121 FR_SMART_CHECK_INCLUDE(yubikey.h)
122 if test "x$ac_cv_header_yubikey_h" != "xyes"; then
124 AC_MSG_WARN([yubikey headers not found. Use --with-yubikey-include-dir=<path>.])
127 dnl ############################################################
128 dnl # Check for yubikey libraries (optional)
129 dnl ############################################################
131 dnl try to link to yubikey
132 smart_try_dir="$yubikey_lib_dir"
133 FR_SMART_CHECK_LIB(yubikey, yubikey_aes_decrypt)
134 if test "x$ac_cv_lib_yubikey_yubikey_aes_decrypt" != "xyes"; then
136 AC_MSG_WARN([yubikey libraries not found. Use --with-yubikey-lib-dir=<path>.])
139 if test "x$have_yubikey" = "xyes"; then
140 AC_DEFINE([HAVE_YUBIKEY],[1],[Build with yubikey token decryption support support from yubikey])
142 AC_MSG_WARN([silently building without yubikey token decryption support. requires: yubikey])
145 dnl ############################################################
146 dnl # Check for ykclient header files (optional)
147 dnl ############################################################
150 smart_try_dir="$ykclient_include_dir"
151 FR_SMART_CHECK_INCLUDE([ykclient.h])
152 if test "x$ac_cv_header_ykclient_h" != "xyes"; then
154 AC_MSG_WARN([ykclient headers not found. Use --with-ykclient-include-dir=<path>.])
157 dnl ############################################################
158 dnl # Check for ykclient libraries (optional)
159 dnl ############################################################
161 smart_try_dir="$ykclient_lib_dir"
162 FR_SMART_CHECK_LIB([ykclient], [ykclient_request_process])
163 if test "x$ac_cv_lib_ykclient_ykclient_request_process" != "xyes"; then
165 FR_SMART_CHECK_LIB([ykclient], [ykclient_request])
166 if test "x$ac_cv_lib_ykclient_ykclient_request" == "xyes"; then
167 AC_MSG_WARN([libykclient missing ykclient_request_process. A later version of libykclient is required.])
169 AC_MSG_WARN([ykclient libraries not found. Use --with-ykclient-lib-dir=<path>.])
173 if test "x$have_ykclient" = "xyes"; then
174 AC_DEFINE([HAVE_YKCLIENT],[1],[Build with yubicloud support from ykclient])
176 AC_MSG_WARN([silently building without yubicloud support. requires: ykclient])
182 echo \*\*\* module modname is disabled.
185 dnl Don't change this section.
186 if test x"$fail" != x""; then
187 if test x"${enable_strict_dependencies}" = x"yes"; then
188 AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.])
190 AC_MSG_WARN([silently not building ]modname[.])
191 AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.]);
196 mod_ldflags="$SMART_LIBS"
197 mod_cflags="$SMART_CPPFLAGS"
200 AC_SUBST(mod_ldflags)
202 AC_CONFIG_HEADER(config.h)