Fix header check for glpk.h.
authorMorgan Deters <mdeters@cs.nyu.edu>
Mon, 23 Jun 2014 21:38:20 +0000 (17:38 -0400)
committerMorgan Deters <mdeters@cs.nyu.edu>
Tue, 24 Jun 2014 21:02:17 +0000 (17:02 -0400)
config/glpk.m4

index cc2a3be71c85acc2ea43db00665140682d6c4c1b..2799d5a77c573cefe32cf3accbefe70eac23fec0 100644 (file)
@@ -34,7 +34,13 @@ elif test "$with_glpk" = yes; then
 
   dnl Try a bunch of combinations until something works :-/
   GLPK_LIBS=
+  AC_LANG_PUSH([C++])
+  cvc4_save_CPPFLAGS="$CPPFLAGS"
+  CPPFLAGS="$CVC4CPPFLAGS $CPPFLAGS"
   AC_CHECK_HEADER([glpk.h], [], [AC_MSG_FAILURE([cannot find glpk.h, the GLPK header!])])
+  CPPFLAGS="$cvc4_save_CPPFLAGS"
+  AC_LANG_POP([C++])
+
   AC_MSG_CHECKING([how to link glpk])
   CVC4_TRY_GLPK_WITH([])
   CVC4_TRY_GLPK_WITH([-lgmp])
@@ -107,7 +113,7 @@ AC_DEFUN([CVC4_TRY_GLPK_WITH], [
 if test -z "$GLPK_LIBS"; then
   AC_LANG_PUSH([C++])
   cvc4_save_LIBS="$LIBS"
-  cvc4_save_CPPFLAGS="$LDFLAGS"
+  cvc4_save_CPPFLAGS="$CPPFLAGS"
   cvc4_save_LDFLAGS="$LDFLAGS"
   CPPFLAGS="$CVC4CPPFLAGS $CPPFLAGS"
   LDFLAGS="$GLPK_LDFLAGS $LDFLAGS"