Skip to content

Instantly share code, notes, and snippets.

@kacf
Created July 29, 2014 13:06
Show Gist options
  • Save kacf/3d9b0c55dc297001d267 to your computer and use it in GitHub Desktop.
Save kacf/3d9b0c55dc297001d267 to your computer and use it in GitHub Desktop.
diff --git a/configure.ac b/configure.ac
index c960c10..77f4fd0 100755
--- a/configure.ac
+++ b/configure.ac
@@ -467,21 +467,18 @@ then
fi
# xml2-config is only for native builds
- if test "x$cross_compiling" = "xno"
+ if test "x$cross_compiling" = "xno" && test x`which $XML2_CONFIG` != x
then
- if test x`which $XML2_CONFIG` != x
+ xml2_include_dir=`$XML2_CONFIG --cflags`
+ if test -n "$xml2_include_dir"
then
- xml2_include_dir=`$XML2_CONFIG --cflags`
- if test -n "$xml2_include_dir"
- then
- LIBXML2_CPPFLAGS="$xml2_include_dir"
- fi
- else # xml2-config not found
- # if a path, e.g. /var/cfengine was given, then we
- # must take into account that libxml2 includes are in
- # /var/cfengine/include/libxml2
- LIBXML2_CPPFLAGS=-I$with_libxml2/include/libxml2
+ LIBXML2_CPPFLAGS="$xml2_include_dir"
fi
+ else # xml2-config not found
+ # if a path, e.g. /var/cfengine was given, then we
+ # must take into account that libxml2 includes are in
+ # /var/cfengine/include/libxml2
+ LIBXML2_CPPFLAGS=-I$with_libxml2/include/libxml2
fi
CF3_WITH_LIBRARY(libxml2,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment