X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=acinclude.m4;h=f8a7efb39661a2c2fe499e0997d8743554dabb67;hb=733651ae26e4d340969941676fdd3021a1de16d2;hp=80c71bbd81f746d65c024644d2870bf230337473;hpb=7d9e313d49cefa01f59047e188accdea6cc09904;p=mech_eap.orig diff --git a/acinclude.m4 b/acinclude.m4 index 80c71bb..f8a7efb 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -258,3 +258,43 @@ else AC_SUBST(JANSSON_LIBS) fi ])dnl + +AC_DEFUN([AX_CHECK_LIBMOONSHOT], +[AC_MSG_CHECKING(for Moonshot identity selector implementation) +LIBMOONSHOT_DIR= +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 + libmoonshotdir="$dir" + if test -f "$dir/include/libmoonshot.h"; then + found_libmoonshot="yes"; + LIBMOONSHOT_DIR="${libmoonshotdir}" + LIBMOONSHOT_CFLAGS="-I$libmoonshotdir/include"; + break; + 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") +fi +])dnl +