octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: glpk.h


From: John W. Eaton
Subject: Re: glpk.h
Date: Fri, 27 Jul 2007 11:40:50 -0400

On 27-Jul-2007, Donald Parsons wrote:

| Well I did now and it looks correct:
| 
| address@hidden octave]$  grep GLPK config.h
| /* Define if GLPK version is less than 4.14. */
| /* #undef GLPK_PRE_4_14 */
| /* Define if GLPK is available. */
| #define HAVE_GLPK 1
| #define HAVE_GLPK_GLPK_H 1
| /* #undef HAVE_GLPK_H */
| 
| 
| In looking at config.log and configure it seems glpk_missing=yes
| might be getting set after not finding glpk.h
| 
| configure:9660: result: no
| configure:9695: checking for glpk.h
| configure:9702: result: no
| configure:9756: checking for curl_easy_escape in -lcurl
| 
| (and has on line 9721:         glpk_missing=yes  )
| 
| This testing was done with your latest patch.  But it is
| still failing.  
| 
| (It would be easy to reproduce my difficulty by moving 
|   include/glpk.h to include/glpk/glpk.h)

OK, please try the following additional change.  It would be good if
someone would try to make all the checks for external libraries and
header files use similar logic and maybe define a macro to handle the
most common case(s).  Currently we seem to have too many different
ways of performing these checks.

Thanks,

jwe


Index: configure.in
===================================================================
RCS file: /cvs/octave/configure.in,v
retrieving revision 1.569
diff -u -u -r1.569 configure.in
--- configure.in        26 Jul 2007 18:44:06 -0000      1.569
+++ configure.in        27 Jul 2007 15:37:04 -0000
@@ -582,32 +582,28 @@
   with_glpk=$withval, with_glpk=yes)
 
 glpk_lib=
-glpk_missing=no
 if test "$with_glpk" = yes; then
   glpk_lib="glpk"
 elif test "$with_glpk" != no; then
   glpk_lib="$with_glpk"
-else
-  glpk_missing=yes
 fi
 
 GLPK_LIBS=
 if test -n "$glpk_lib"; then
-  AC_CHECK_LIB($glpk_lib, glp_lpx_simplex, [
-    GLPK_LIBS="-l$glpk_lib"
-    AC_DEFINE(GLPK_PRE_4_14, 1, [Define if GLPK version is less than 4.14.])], 
[
-    AC_CHECK_LIB($glpk_lib, _glp_lpx_simplex, [GLPK_LIBS="-l$glpk_lib"], [])])
-  if test -n "$GLPK_LIBS"; then
-    AC_CHECK_HEADERS([glpk/glpk.h glpk.h], [
-      glpk_missing=no
+  AC_CHECK_HEADERS([glpk/glpk.h glpk.h], [
+    AC_CHECK_LIB($glpk_lib, glp_lpx_simplex, [
       GLPK_LIBS="-l$glpk_lib"
-      AC_DEFINE(HAVE_GLPK, 1, [Define if GLPK is available.])], [
-        GLPK_LIBS=
-        glpk_missing=yes])
-  fi
+      AC_DEFINE(GLPK_PRE_4_14, 1, [Define if GLPK version is less than 
4.14.])], [
+        AC_CHECK_LIB($glpk_lib, _glp_lpx_simplex, [
+          GLPK_LIBS="-l$glpk_lib"], [])])
+
+    if test -n "$GLPK_LIBS"; then
+      AC_DEFINE(HAVE_GLPK, 1, [Define if GLPK is available.])
+    fi
+    break])
 fi
 AC_SUBST(GLPK_LIBS)
-if test "$glpk_missing" = yes; then
+if test -z "$GLPK_LIBS"; then
   warn_glpk="GLPK library not found.  The glpk function for solving linear 
programs will be disabled."
 fi
 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]