X-Git-Url: http://www.project-moonshot.org/gitweb/?p=mech_eap.orig;a=blobdiff_plain;f=acinclude.m4;h=6f43261fb91f0d09712894aea714f4adf6268a9a;hp=8ecdd9ca352b83fc52f5e6fc9c7338bd1bd4b3d7;hb=HEAD;hpb=54fa5230688cd4ecef74aaef6ebb3193e24f47f8 diff --git a/acinclude.m4 b/acinclude.m4 index 8ecdd9c..6f43261 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1,5 +1,13 @@ dnl Based on the one from the Boinc project by Reinhard +AC_DEFUN([AX_CHECK_WINDOWS], +[AC_MSG_CHECKING(for windows) +target_windows="no" +AC_CHECK_HEADER(windows.h,[target_windows="yes"],[target_windows="no"]) +AC_MSG_RESULT($target_windows) +AM_CONDITIONAL(TARGET_WINDOWS,test "x$target_windows" = "xyes") +])dnl + AC_DEFUN([AX_CHECK_KRB5], [AC_MSG_CHECKING(for GSS-API and Kerberos implementation) KRB5_DIR= @@ -9,18 +17,28 @@ AC_ARG_WITH(krb5, [Use krb5 (in specified installation directory)]), [check_krb5_dir="$withval"], [check_krb5_dir=]) -for dir in $check_krb5_dir $prefix /usr /usr/local ; do +for dir in $check_krb5_dir $prefix /usr/local /usr ; do krb5dir="$dir" if test -x "$dir/bin/krb5-config"; then found_krb5="yes"; - KRB5_CFLAGS=`$dir/bin/krb5-config gssapi --cflags`; - KRB5_LIBS=`$dir/bin/krb5-config gssapi --libs`; - COMPILE_ET="$dir/bin/compile_et"; + if test "x$target_windows" = "xyes"; then + KRB5_CFLAGS=-I"$check_krb5_dir/include"; + KRB5_LDFLAGS="-L$check_krb5_dir/lib/"; + KRB5_LIBS="-lkrb5_32 -lgssapi32"; + COMPILE_ET="$check_krb5_dir/bin/compile_et"; + AC_MSG_RESULT([yes]) + else + KRB5_CFLAGS=`$dir/bin/krb5-config gssapi --cflags`; + KRB5_LDFLAGS="-L$dir/lib"; + KRB5_LIBS=`$dir/bin/krb5-config gssapi --libs` +AC_MSG_RESULT([yes]) + AC_PATH_PROG(COMPILE_ET, [compile_et], [compile_et], [$dir/bin$PATH_SEPARATOr]) + fi break; fi done -AC_MSG_RESULT($found_krb5) if test x_$found_krb5 != x_yes; then + AC_MSG_RESULT($found_krb5) AC_MSG_ERROR([ ---------------------------------------------------------------------- Cannot find GSS-API/Kerberos libraries. @@ -32,6 +50,7 @@ if test x_$found_krb5 != x_yes; then else printf "Kerberos found in $krb5dir\n"; AC_SUBST(KRB5_CFLAGS) + AC_SUBST(KRB5_LDFLAGS) AC_SUBST(KRB5_LIBS) AC_SUBST(COMPILE_ET) AC_CHECK_LIB(krb5, GSS_C_NT_COMPOSITE_EXPORT, [AC_DEFINE_UNQUOTED([HAVE_GSS_C_NT_COMPOSITE_EXPORT], 1, [Define if GSS-API library supports recent naming extensions draft])], [], "$KRB5_LIBS") @@ -312,13 +331,16 @@ fi AC_DEFUN([AX_CHECK_LIBMOONSHOT], [AC_MSG_CHECKING(for Moonshot identity selector implementation) LIBMOONSHOT_DIR= +LIBMOONSHOT_CFLAGS= +LIBMOONSHOT_LDFLAGS= +LIBMOONSHOT_LIBS= found_libmoonshot="no" AC_ARG_WITH(libmoonshot, AC_HELP_STRING([--with-libmoonshot], [Use libmoonshot (in specified installation directory)]), [check_libmoonshot_dir="$withval"], [check_libmoonshot_dir=]) -for dir in $check_libmoonshot_dir $prefix /usr /usr/local ../../moonshot-ui/libmoonshot ; do +for dir in $check_libmoonshot_dir $prefix /usr /usr/local ; do libmoonshotdir="$dir" if test -f "$dir/include/libmoonshot.h"; then found_libmoonshot="yes"; @@ -328,23 +350,15 @@ for dir in $check_libmoonshot_dir $prefix /usr /usr/local ../../moonshot-ui/libm fi done AC_MSG_RESULT($found_libmoonshot) -if test x_$found_libmoonshot != x_yes; then - AC_MSG_ERROR([ ----------------------------------------------------------------------- - Cannot find Moonshot identity selector libraries. - - Please install wpa_supplicant or specify installation directory with - --with-libmoonshot=(dir). ----------------------------------------------------------------------- -]) -else - printf "libmoonshot found in $libmoonshotdir\n"; - LIBMOONSHOT_LIBS="-lmoonshot"; - LIBMOONSHOT_LDFLAGS="-L$libmoonshot/lib"; - AC_SUBST(LIBMOONSHOT_CFLAGS) - AC_SUBST(LIBMOONSHOT_LDFLAGS) - AC_SUBST(LIBMOONSHOT_LIBS) - AC_CHECK_LIB(moonshot, moonshot_get_identity, [AC_DEFINE_UNQUOTED([HAVE_MOONSHOT_GET_IDENTITY], 1, [Define if Moonshot identity selector is available])], [], "$LIBMOONSHOT_LIBS") +if test x_$found_libmoonshot = x_yes; then + printf "libmoonshot found in $libmoonshotdir\n"; + LIBMOONSHOT_LIBS="-lmoonshot"; + LIBMOONSHOT_LDFLAGS="-L$libmoonshot/lib"; + AC_CHECK_LIB(moonshot, moonshot_get_identity, [AC_DEFINE_UNQUOTED([HAVE_MOONSHOT_GET_IDENTITY], 1, [Define if Moonshot identity selector is available])], [], "$LIBMOONSHOT_LIBS") fi + AC_SUBST(LIBMOONSHOT_CFLAGS) + AC_SUBST(LIBMOONSHOT_LDFLAGS) + AC_SUBST(LIBMOONSHOT_LIBS) + AM_CONDITIONAL(LIBMOONSHOT, test "x$found_libmoonshot" != "xno") ])dnl