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



Hi!

Thanks for that correction!
I have committed it to the master branch (https://git.gnome.org/browse/libgda/commit/?id=6a712fe895f70110a55ef8a9708de7f2fda8494d)

Regards,

Vivien


On 18 December 2013 18:06, Ulrich Weigand <uweigand de ibm com> wrote:
Hello,

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
071bd53b80621cf2bf3cea9ef2a97c5b3fc56ee6

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.

Bye,
Ulrich


diff --git a/configure.ac b/configure.ac
index 56d79b2..cd86cb9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -261,6 +261,8 @@ then
                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"
                        AC_COMPILE_IFELSE([AC_LANG_SOURCE([
 #include <gvc.h>
 int main() {
@@ -270,6 +272,7 @@ int main() {
 }
 ])],
                         graphviz_new_api=yes, graphviz_new_api=no)
+                       CLFAGS=$graphviz_save_CFLAGS

                        AC_MSG_RESULT($graphviz_new_api)
                        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]