5948d741878d577b08caa95ef84a6950fdebf501
[moonshot.git] / moonshot / configure.ac
1 AC_PREREQ([2.61])
2 AC_INIT([mech_eap], [0.1], [bugs@project-moonshot.org])
3 dnl AC_CONFIG_MACRO_DIR([m4])
4 dnl AM_INIT_AUTOMAKE([silent-rules])
5 AC_USE_SYSTEM_EXTENSIONS
6 AC_GNU_SOURCE
7 AM_INIT_AUTOMAKE
8 AM_PROG_CC_C_O
9 AM_MAINTAINER_MODE()
10 LT_PREREQ([2.4])
11 LT_INIT([dlopen disable-static win32-dll])
12
13 dnl AC_PROG_CC
14 AC_PROG_CXX
15 AC_CONFIG_HEADERS([config.h])
16 AC_CHECK_HEADERS(stdarg.h stdio.h stdint.h sys/param.h)
17 AC_REPLACE_FUNCS(vasprintf)
18
19 dnl Check if we're on Solaris and set CFLAGS accordingly
20 dnl AC_CANONICAL_TARGET
21 dnl case "${target_os}" in
22 dnl   solaris*)
23 dnl     TARGET_CFLAGS="-DSYS_SOLARIS9 -D_POSIX_PTHREAD_SEMANTICS"
24 dnl     if test "$GCC" != yes ; then
25 dnl       TARGET_CFLAGS="$TARGET_CFLAGS -mt"
26 dnl     else
27 dnl       TARGET_CFLAGS="$TARGET_CFLAGS -pthreads"
28 dnl     fi
29 dnl     TARGET_LDFLAGS="-lpthread -lsocket -lnsl"
30 dnl     ;;
31 dnl   *)
32 dnl     TARGET_CFLAGS="-Wall -pedantic -pthread"
33 dnl     TARGET_LDFLAGS=""
34 dnl   esac
35
36 reauth=no
37 AC_ARG_ENABLE(reauth,
38   [  --enable-reauth whether to enable fast reauthentication protocol: yes/no; default no ],
39   [ if test "x$enableval" = "xyes" -o "x$enableval" = "xno" ; then
40       reauth=$enableval
41     else
42       echo "--enable-reauth argument must be yes or no"
43       exit -1
44     fi
45   ])
46
47 if test "x$reauth" = "xyes" ; then
48   echo "Fast reauthentication protocol enabled"
49   TARGET_CFLAGS="$TARGET_CFLAGS -DGSSEAP_ENABLE_REAUTH"
50 fi
51 AM_CONDITIONAL(GSSEAP_ENABLE_REAUTH, test "x$reauth" != "xno")
52
53 acceptor=yes
54 AC_ARG_ENABLE(acceptor,
55   [  --enable-acceptor whether to enable acceptor codepaths: yes/no; default yes ],
56   [ if test "x$enableval" = "xyes" -o "x$enableval" = "xno" ; then
57       acceptor=$enableval
58     else
59       echo "--enable-acceptor argument must be yes or no"
60       exit -1
61     fi
62   ])
63
64 if test "x$acceptor" = "xyes" ; then
65   echo "acceptor enabled"
66   TARGET_CFLAGS="$TARGET_CFLAGS -DGSSEAP_ENABLE_ACCEPTOR"
67 fi
68 AM_CONDITIONAL(GSSEAP_ENABLE_ACCEPTOR, test "x$acceptor" != "xno")
69
70 AC_SUBST(TARGET_CFLAGS)
71 AC_SUBST(TARGET_LDFLAGS)
72 AX_CHECK_WINDOWS
73 AX_CHECK_KRB5
74 AM_CONDITIONAL(HEIMDAL, test "x$heimdal" != "xno")
75 dnl AX_CHECK_EAP
76 if test "x$acceptor" = "xyes" ; then
77   AX_CHECK_SHIBSP
78   AX_CHECK_SHIBRESOLVER
79   AX_CHECK_RADSEC
80   AX_CHECK_JANSSON
81 fi
82 AC_CONFIG_FILES([Makefile libeap/Makefile mech_eap/Makefile])
83 AC_OUTPUT