add GET_LAST_ERROR macro
[mech_eap.orig] / 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 AM_INIT_AUTOMAKE
6 LT_PREREQ([2.2])
7 LT_INIT([dlopen disable-static])
8
9 AC_PROG_CC
10 AC_PROG_CXX
11 AC_CONFIG_HEADERS([config.h])
12 AC_CHECK_HEADERS(stdarg.h stdio.h stdint.h sys/param.h)
13 AC_REPLACE_FUNCS(vasprintf)
14 AC_GNU_SOURCE
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 AX_CHECK_KRB5
70 AX_CHECK_OPENSAML
71 AM_CONDITIONAL(OPENSAML, test "x_$check_opensaml_dir" != "x_no")
72
73 AX_CHECK_SHIBRESOLVER
74 AM_CONDITIONAL(SHIBRESOLVER, test "x_$check_shibresolver_dir" != "x_no")
75 if test x_$found_shibresolver = x_yes; then
76   AX_CHECK_SHIBSP
77 fi
78
79 if test "x$acceptor" = "xyes" ; then
80   AX_CHECK_RADSEC
81   AX_CHECK_JANSSON
82 fi
83
84 AX_CHECK_LIBMOONSHOT
85 AC_CONFIG_FILES([Makefile libeap/Makefile mech_eap/Makefile])
86 AC_OUTPUT