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