a637f9a4e868004b920484f56fa20bbbf312b347
[mech_eap.git] / 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_MAINTAINER_MODE()
9 LT_PREREQ([2.2])
10 LT_INIT([dlopen disable-static win32-dll])
11
12 AC_PROG_CC
13 AC_PROG_CXX
14 AC_CONFIG_HEADERS([config.h])
15
16 dnl Check if we're on Solaris and set CFLAGS accordingly
17 dnl AC_CANONICAL_TARGET
18 dnl case "${target_os}" in
19 dnl   solaris*)
20 dnl     TARGET_CFLAGS="-DSYS_SOLARIS9 -D_POSIX_PTHREAD_SEMANTICS"
21 dnl     if test "$GCC" != yes ; then
22 dnl       TARGET_CFLAGS="$TARGET_CFLAGS -mt"
23 dnl     else
24 dnl       TARGET_CFLAGS="$TARGET_CFLAGS -pthreads"
25 dnl     fi
26 dnl     TARGET_LDFLAGS="-lpthread -lsocket -lnsl"
27 dnl     ;;
28 dnl   *)
29 dnl     TARGET_CFLAGS="-Wall -pedantic -pthread"
30 dnl     TARGET_LDFLAGS=""
31 dnl   esac
32
33 reauth=no
34 AC_ARG_ENABLE(reauth,
35   [  --enable-reauth whether to enable fast reauthentication protocol: yes/no; default no ],
36   [ if test "x$enableval" = "xyes" -o "x$enableval" = "xno" ; then
37       reauth=$enableval
38     else
39       echo "--enable-reauth argument must be yes or no"
40       exit -1
41     fi
42   ])
43
44 if test "x$reauth" = "xyes" ; then
45   echo "Fast reauthentication protocol enabled"
46   TARGET_CFLAGS="$TARGET_CFLAGS -DGSSEAP_ENABLE_REAUTH"
47 fi
48 AM_CONDITIONAL(GSSEAP_ENABLE_REAUTH, test "x$reauth" != "xno")
49
50 acceptor=yes
51 AC_ARG_ENABLE(acceptor,
52   [  --enable-acceptor whether to enable acceptor codepaths: yes/no; default yes ],
53   [ if test "x$enableval" = "xyes" -o "x$enableval" = "xno" ; then
54       acceptor=$enableval
55     else
56       echo "--enable-acceptor argument must be yes or no"
57       exit -1
58     fi
59   ])
60
61 if test "x$acceptor" = "xyes" ; then
62   echo "acceptor enabled"
63   TARGET_CFLAGS="$TARGET_CFLAGS -DGSSEAP_ENABLE_ACCEPTOR"
64 fi
65 AM_CONDITIONAL(GSSEAP_ENABLE_ACCEPTOR, test "x$acceptor" != "xno")
66
67 AC_SUBST(TARGET_CFLAGS)
68 AC_SUBST(TARGET_LDFLAGS)
69 dnl AX_CHECK_KRB5
70 AM_CONDITIONAL(HEIMDAL, test "x$heimdal" != "xno")
71 dnl AX_CHECK_EAP
72 if test "x$acceptor" = "xyes" ; then
73   AX_CHECK_SHIBSP
74   AX_CHECK_SHIBRESOLVER
75   AX_CHECK_RADSEC
76   AX_CHECK_JANSSON
77 fi
78 AC_CONFIG_FILES([Makefile libeap/Makefile mech_eap/Makefile])
79 AC_OUTPUT