wip
[oweals/gnunet.git] / configure.ac
index ad5cdaf2068ec64dafcd6e01aa1cf63aa6b926ab..563e7fec6b67675139e30c3c7fe85fc50c21249c 100644 (file)
 #
 #
 AC_PREREQ(2.61)
+# Checks for programs.
 AC_INIT([gnunet], [0.9.0pre2],[bug-gnunet@gnu.org])
+
+AC_CANONICAL_TARGET
+AC_CANONICAL_HOST
+AC_CANONICAL_SYSTEM
+
 AM_INIT_AUTOMAKE([gnunet], [0.9.0pre2])
 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
 AC_CONFIG_HEADERS([gnunet_config.h])
-
 AH_TOP([#define _GNU_SOURCE  1])
 
-# Checks for programs.
-AC_CANONICAL_HOST
 AC_PROG_AWK
 AC_PROG_CC
-gl_EARLY
-gl_INIT
 AC_PROG_CPP
 AC_PROG_CXX
 AC_PROG_OBJC
@@ -41,7 +42,6 @@ AC_PROG_INSTALL
 AC_PROG_LN_S
 AC_PROG_MAKE_SET
 AM_PROG_CC_C_O
-AC_CANONICAL_HOST
 LT_INIT([disable-static dlopen win32-dll])
 LTDL_INIT
 AC_SUBST(LTDLINCL)
@@ -193,6 +193,8 @@ then
   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"
@@ -247,22 +249,26 @@ LIBCURL_CHECK_CONFIG(,7.20.1,,AC_MSG_ERROR([GNUnet requires libcurl >= 7.20.1]))
 # 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])
 
-a=true
-AC_CHECK_HEADERS(glpk.h, ,[a=false])
-AC_CHECK_LIB([glpk],[glp_create_prob], , [a=false])
-if test $a == false
+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
-       AC_MSG_NOTICE([Feature b0rk is missing.])
-       AM_CONDITIONAL(HAVE_GLPK, [test x$a = xtrue])
+       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
-       AC_MSG_NOTICE([Feature b0rk is present.])
-       AM_CONDITIONAL(HAVE_GLPK, [test x$a = xtrue])
-       AM_CONDITIONAL(HAVE_LIBGLPK, [test x$a = x$a])
+       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)
@@ -313,7 +319,7 @@ AC_HEADER_STDC
 AC_CHECK_HEADERS([fcntl.h math.h errno.h ctype.h limits.h stdio.h stdlib.h string.h unistd.h stdarg.h signal.h locale.h sys/stat.h sys/types.h],,AC_MSG_ERROR([Compiling GNUnet requires standard UNIX headers files]))
 
 # Checks for headers that are only required on some systems or opional (and where we do NOT abort if they are not there)
-AC_CHECK_HEADERS([langinfo.h sys/param.h sys/mount.h sys/statvfs.h sys/select.h sockLib.h sys/mman.h sys/msg.h sys/vfs.h arpa/inet.h fcntl.h libintl.h netdb.h netinet/in.h netinet/in_systm.h sys/ioctl.h sys/socket.h sys/time.h unistd.h kstat.h sys/sysinfo.h kvm.h sys/file.h sys/resource.h ifaddrs.h mach/mach.h stddef.h sys/timeb.h terminos.h argz.h ucred.h])
+AC_CHECK_HEADERS([langinfo.h sys/param.h sys/mount.h sys/statvfs.h sys/select.h sockLib.h sys/mman.h sys/msg.h sys/vfs.h arpa/inet.h fcntl.h libintl.h netdb.h netinet/in.h netinet/in_systm.h sys/ioctl.h sys/socket.h sys/time.h unistd.h kstat.h sys/sysinfo.h kvm.h sys/file.h sys/resource.h ifaddrs.h mach/mach.h stddef.h sys/timeb.h terminos.h argz.h ucred.h endian.h sys/endian.h])
 
 SAVE_LDFLAGS=$LDFLAGS
 SAVE_CPPFLAGS=$CPPFLAGS