changes to configure.ac
authorMatthias Wachs <wachs@net.in.tum.de>
Wed, 23 Mar 2011 12:55:18 +0000 (12:55 +0000)
committerMatthias Wachs <wachs@net.in.tum.de>
Wed, 23 Mar 2011 12:55:18 +0000 (12:55 +0000)
configure.ac
src/transport/Makefile.am
src/transport/gnunet-service-transport.c

index 699a63d3d81f9f19c404408b24de2cc203ac7552..ad5cdaf2068ec64dafcd6e01aa1cf63aa6b926ab 100644 (file)
@@ -248,15 +248,22 @@ LIBCURL_CHECK_CONFIG(,7.20.1,,AC_MSG_ERROR([GNUnet requires libcurl >= 7.20.1]))
 LIBS=$SAVE_LIBS
 
 # glpk
-glpk=0
-AC_CHECK_HEADERS([glpk.h]) 
-if test "$ac_cv_header_glpk_h" = yes; then
-AM_CONDITIONAL(HAVE_GLPK, 1) 
-AC_DEFINE_UNQUOTED([HAVE_GLPK], test x$glpk = xtrue, [We have GLPK])
-else 
-AM_CONDITIONAL(HAVE_GLPK, test x$glpk = xtrue) 
-AC_MSG_WARN([GLPK not installed.]) 
-fi 
+#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
+then
+       AC_MSG_NOTICE([Feature b0rk is missing.])
+       AM_CONDITIONAL(HAVE_GLPK, [test x$a = xtrue])
+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])
+fi
 
 # test for kvm and kstat (for CPU stats under BSD/Solaris)
 AC_CHECK_LIB([kvm],[kvm_open])
index 43c4692b5043396bcc3953ab57d59dec62f42dcb..4706570e48e91f35aea2d1d7dba52cb0eca11f46 100644 (file)
@@ -105,7 +105,7 @@ gnunet_transport_LDADD = \
 gnunet_transport_DEPENDENCIES = \
   libgnunettransport.la                                
 
-if HAVE_GLPK
+if HAVE_LIBGLPK
   GN_GLPK = -lglpk
 endif
 
index ba9cdfbc6ee24d97d2843400f5f53993b0f76a14..116482c60d5ba87e34f7033a8568b69d88ad7ce7 100644 (file)
@@ -38,7 +38,7 @@
 #include "gnunet_signatures.h"
 #include "gnunet_transport_plugin.h"
 #include "transport.h"
-#if HAVE_GLPK
+#if HAVE_LIBGLPK
 #include <glpk.h>
 #endif
 
@@ -5548,12 +5548,14 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
   GNUNET_break (bl_head == NULL);
   GNUNET_break (bc_head == NULL);
 }
+#if !HAVE_LIBGLPK
 
+void ats_create_problem(int peers, double b_min, double b_max, double r, const struct ATS_peer * list, int max_it, int max_dur)
+{
 
-
-#if HAVE_GLPK
-
-glp_prob * ats_create_problem(int peers, double b_min, double b_max, double r, const struct ATS_peer * list, int max_it, int max_dur)
+}
+#else
+glp_prob * ats_create_problem (int peers, double b_min, double b_max, double r, const struct ATS_peer * list, int max_it, int max_dur)
 {
        int c1, c2;
        glp_prob *lp;
@@ -5688,11 +5690,6 @@ glp_prob * ats_create_problem(int peers, double b_min, double b_max, double r, c
        glp_delete_prob(lp);
        //GNUNET_free(options);
        return lp;
-}
-#else
-void ats_create_problem(int peers, double b_min, double b_max, double r, const struct ATS_peer * list, int max_it, int max_dur)
-{
-
 }
 #endif