[gnome-db] [PATCH] Old vs. new Graphviz API configure check fix


we were having trouble building libgda on a system where graphviz only
provides the new (libcgraph) API, not the old (libgraph) API.

Now I see that libgda apparently intends to build with both APIs, and
has a configure check that you added in commit

However, this check has a problem if you need special compiler options
to find the graphviz header, like -I /usr/include/graphviz.

Such options are detected by the PKG_CHECK_MODULES(GRAPHVIZ, ...)
test, and cause the GRAPHVIZ_CFLAGS to be set, which is later used
when building the actual libgda sources.

However, GRAPHVIZ_CFLAGS is *not* used during compilation of
the conftest test case checking for the new API.  On our system
this means the conftest always fails to compile, and thus
configure always thinks that only the old API is supported.

The patch below adds GRAPHVIZ_CFLAGS to the flags used when
compiling the conftest check.  This makes everything work for me.


diff --git a/configure.ac b/configure.ac
index 56d79b2..cd86cb9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -261,6 +261,8 @@ then
                        dnl test if new API is supported
                        AC_MSG_CHECKING([whether Graphviz's new API is supported])
+                       graphviz_save_CFLAGS=$CFLAGS
+                       CFLAGS="$CFLAGS $GRAPHVIZ_CFLAGS"
 #include <gvc.h>
 int main() {
@@ -270,6 +272,7 @@ int main() {
                         graphviz_new_api=yes, graphviz_new_api=no)
+                       CLFAGS=$graphviz_save_CFLAGS
                        if test "$graphviz_new_api" = "yes"; then
  Dr. Ulrich Weigand
  GNU/Linux compilers and toolchain
  Ulrich Weigand de ibm com

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