aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac25
-rw-r--r--src/transport/Makefile.am2
-rw-r--r--src/transport/gnunet-service-transport.c17
3 files changed, 24 insertions, 20 deletions
diff --git a/configure.ac b/configure.ac
index 699a63d3d..ad5cdaf20 100644
--- a/configure.ac
+++ b/configure.ac
@@ -248,15 +248,22 @@ LIBCURL_CHECK_CONFIG(,7.20.1,,AC_MSG_ERROR([GNUnet requires libcurl >= 7.20.1]))
248LIBS=$SAVE_LIBS 248LIBS=$SAVE_LIBS
249 249
250# glpk 250# glpk
251glpk=0 251#AC_CHECK_HEADERS(glpk.h, glpk=true)
252AC_CHECK_HEADERS([glpk.h]) 252#AM_CONDITIONAL(HAVE_GLPK, test x$glpk = xtrue)
253if test "$ac_cv_header_glpk_h" = yes; then 253#AC_CHECK_LIB([glpk],[glp_create_prob])
254AM_CONDITIONAL(HAVE_GLPK, 1) 254
255AC_DEFINE_UNQUOTED([HAVE_GLPK], test x$glpk = xtrue, [We have GLPK]) 255a=true
256else 256AC_CHECK_HEADERS(glpk.h, ,[a=false])
257AM_CONDITIONAL(HAVE_GLPK, test x$glpk = xtrue) 257AC_CHECK_LIB([glpk],[glp_create_prob], , [a=false])
258AC_MSG_WARN([GLPK not installed.]) 258if test $a == false
259fi 259then
260 AC_MSG_NOTICE([Feature b0rk is missing.])
261 AM_CONDITIONAL(HAVE_GLPK, [test x$a = xtrue])
262else
263 AC_MSG_NOTICE([Feature b0rk is present.])
264 AM_CONDITIONAL(HAVE_GLPK, [test x$a = xtrue])
265 AM_CONDITIONAL(HAVE_LIBGLPK, [test x$a = x$a])
266fi
260 267
261# test for kvm and kstat (for CPU stats under BSD/Solaris) 268# test for kvm and kstat (for CPU stats under BSD/Solaris)
262AC_CHECK_LIB([kvm],[kvm_open]) 269AC_CHECK_LIB([kvm],[kvm_open])
diff --git a/src/transport/Makefile.am b/src/transport/Makefile.am
index 43c4692b5..4706570e4 100644
--- a/src/transport/Makefile.am
+++ b/src/transport/Makefile.am
@@ -105,7 +105,7 @@ gnunet_transport_LDADD = \
105gnunet_transport_DEPENDENCIES = \ 105gnunet_transport_DEPENDENCIES = \
106 libgnunettransport.la 106 libgnunettransport.la
107 107
108if HAVE_GLPK 108if HAVE_LIBGLPK
109 GN_GLPK = -lglpk 109 GN_GLPK = -lglpk
110endif 110endif
111 111
diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c
index ba9cdfbc6..116482c60 100644
--- a/src/transport/gnunet-service-transport.c
+++ b/src/transport/gnunet-service-transport.c
@@ -38,7 +38,7 @@
38#include "gnunet_signatures.h" 38#include "gnunet_signatures.h"
39#include "gnunet_transport_plugin.h" 39#include "gnunet_transport_plugin.h"
40#include "transport.h" 40#include "transport.h"
41#if HAVE_GLPK 41#if HAVE_LIBGLPK
42#include <glpk.h> 42#include <glpk.h>
43#endif 43#endif
44 44
@@ -5548,12 +5548,14 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
5548 GNUNET_break (bl_head == NULL); 5548 GNUNET_break (bl_head == NULL);
5549 GNUNET_break (bc_head == NULL); 5549 GNUNET_break (bc_head == NULL);
5550} 5550}
5551#if !HAVE_LIBGLPK
5551 5552
5553void ats_create_problem(int peers, double b_min, double b_max, double r, const struct ATS_peer * list, int max_it, int max_dur)
5554{
5552 5555
5553 5556}
5554#if HAVE_GLPK 5557#else
5555 5558glp_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)
5556glp_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)
5557{ 5559{
5558 int c1, c2; 5560 int c1, c2;
5559 glp_prob *lp; 5561 glp_prob *lp;
@@ -5689,11 +5691,6 @@ glp_prob * ats_create_problem(int peers, double b_min, double b_max, double r, c
5689 //GNUNET_free(options); 5691 //GNUNET_free(options);
5690 return lp; 5692 return lp;
5691} 5693}
5692#else
5693void ats_create_problem(int peers, double b_min, double b_max, double r, const struct ATS_peer * list, int max_it, int max_dur)
5694{
5695
5696}
5697#endif 5694#endif
5698 5695
5699void ats_calculate_bandwidth_distribution (struct ATS_info * ats) 5696void ats_calculate_bandwidth_distribution (struct ATS_info * ats)