3 AC_REVISION($Revision$)
4 AC_DEFUN(modname,[rlm_otp])
9 if test x$with_[]modname != xno; then
11 dnl put configuration checks here.
12 dnl set $fail to what's missing, on fatal errors.
13 dnl use AC_MSG_WARN() on important messages.
15 dnl test for almost-c99 compliant compiler
16 AC_CHECK_HEADER(inttypes.h, ,
17 [ fail="$fail inttypes.h" ]
20 dnl ############################################################
21 dnl # Check for command line options
22 dnl ############################################################
24 dnl mostly for openssl
25 AC_ARG_WITH(rlm-otp-lib-dir,
26 [ --with-rlm-otp-lib-dir directory for otp libs],
27 otp_ldflags="-L$withval $otp_ldflags")
28 AC_ARG_WITH(rlm-otp-include-dir,
29 [ --with-rlm-otp-include-dir directory for otp includes],
30 otp_cflags="$otp_cflags -I$withval")
32 dnl extra argument: --openssl-libraries=dir
33 AC_ARG_WITH(openssl-libraries,
34 [ --with-openssl-libraries=DIR directory to look for OpenSSL library files],
35 otp_ldflags="-L$withval $otp_ldflags")
37 dnl extra argument: --openssl-includes=dir
38 AC_ARG_WITH(openssl-includes,
39 [ --with-openssl-includes=DIR directory to look for OpenSSL include files],
40 otp_cflags="$otp_cflags -I$withval")
42 dnl ############################################################
43 dnl # Check for libraries
44 dnl ############################################################
46 old_LDFLAGS="$LDFLAGS"
47 LDFLAGS="$otp_ldflags $LDFLAGS"
48 AC_CHECK_LIB(ssl, SSL_new, [], [ fail="$fail openssl-libs" ])
49 LDFLAGS="$old_LDFLAGS"
51 dnl ############################################################
52 dnl # Check for header files
53 dnl ############################################################
56 CFLAGS="$CFLAGS $otp_cflags"
64 [ fail="$fail openssl-includes" ]
68 targetname=modname # keep this! Don't change!
70 targetname= # keep this! Don't change!
71 echo \*\*\* module modname is disabled. # keep this! Don't change!
74 dnl Don't change this section.
75 if test x"$fail" != x""; then
76 if test x"${enable_strict_dependencies}" = x"yes"; then
77 AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.])
79 AC_MSG_WARN([silently not building ]modname[.])
80 AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.])
85 otp_cflags="$otp_cflags -DOTP_MODULE_NAME=\\\"modname\\\" -DFREERADIUS"
89 AC_SUBST(targetname) # keep this! Don't change!
90 AC_OUTPUT(Makefile) # keep this! Don't change!