AH_TOP([#define _GNU_SOURCE 1])
# Checks for programs.
-AC_CANONICAL_HOST
+AC_CANONICAL_TARGET
+AC_CANONICAL_SYSTEM
AC_PROG_AWK
AC_PROG_CC
gl_EARLY
AC_MSG_ERROR([GNUnet needs libgcrypt])
fi
+if test $build = $target
+then
AC_MSG_CHECKING([for working HMAC])
AC_LANG_PUSH(C)
LIBS="$LIBS $LIBGCRYPT_LIBS"
# restore LIBS
LIBS=$SAVE_LIBS
+fi # $build = $target
+
+# glpk
+#AC_CHECK_HEADERS(glpk.h, glpk=true)
+#AM_CONDITIONAL(HAVE_GLPK, test x$glpk = xtrue)
+#AC_CHECK_LIB([glpk],[glp_create_prob])
+
+glpk=true
+AC_CHECK_HEADERS(glpk.h, ,[gplk=false])
+AC_CHECK_LIB([glpk],[glp_create_prob], , [gplk=false])
+# GLPK must support atm MLP presolving, version >= 4.32
+AC_CHECK_MEMBERS(glp_iocp.presolve, ,[gplk=false],[[#include <glpk.h>]])
+if test $gplk = false
+then
+ AM_CONDITIONAL(HAVE_GLPK, [test x$gplk = xtrue])
+ AM_CONDITIONAL(HAVE_LIBGLPK, [test x$gplk != x$gplk])
+ AC_MSG_WARN([GNUnet requires GLPK >= 4.32])
+else
+ AM_CONDITIONAL(HAVE_GLPK, [test x$gplk = xtrue])
+ AM_CONDITIONAL(HAVE_LIBGLPK, [test x$gplk = x$gplk])
+fi
+
# test for kvm and kstat (for CPU stats under BSD/Solaris)
AC_CHECK_LIB([kvm],[kvm_open])
AC_CHECK_LIB([kstat],[kstat_open])
# restore LIBS
LIBS=$SAVE_LIBS
+
+
# check for gettext
AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION([0.16.1])