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