Cross-compilation tools provide the right .pc files and a pkg-config to
match, but often don't provide the scripts to match. Even if they did,
you'd have to change PATH to find them. So give pkg-config precedence.

Signed-off-by: Thiago Macieira <[email protected]>
---
 subsurface-configure.pri | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)

diff --git a/subsurface-configure.pri b/subsurface-configure.pri
index 2df831d..8e6aead 100644
--- a/subsurface-configure.pri
+++ b/subsurface-configure.pri
@@ -89,11 +89,6 @@ PKG_CONFIG_OUT = $$system($$PKG_CONFIG --version 2> $$NUL)
 # run them. They also come with pkg-config files, but those are missing on
 # Mac (where they are part of the XCode-supplied tools).
 #
-XML2_CFLAGS = $$system(xml2-config --cflags 2>$$NUL)
-XSLT_CFLAGS = $$system(xslt-config --cflags 2>$$NUL)
-XML2_LIBS = $$system(xml2-config --libs 2>$$NUL)
-XSLT_LIBS = $$system(xslt-config --libs 2>$$NUL)
-
 link_pkgconfig {
        isEmpty(XML2_CFLAGS)|isEmpty(XML2_LIBS) {
                XML2_CFLAGS = $$system($$PKG_CONFIG --cflags libxml2 2> $$NUL)
@@ -107,11 +102,20 @@ link_pkgconfig {
                XSLT_CFLAGS = $$system($$PKG_CONFIG --cflags libxslt 2> $$NUL)
                XSLT_LIBS = $$system($$PKG_CONFIG --libs libxslt 2> $$NUL)
        }
-       isEmpty(XML2_CFLAGS)|isEmpty(XML2_LIBS): \
-               error("Could not find libxml2. Did you forget to install it?")
-       isEmpty(XSLT_CFLAGS)|isEmpty(XSLT_LIBS): \
-               error("Could not find libxslt. Did you forget to install it?")
 }
+isEmpty(XML2_CFLAGS)|isEmpty(XML2_LIBS) {
+       XML2_CFLAGS = $$system(xml2-config --cflags 2>$$NUL)
+       XML2_LIBS = $$system(xml2-config --libs 2>$$NUL)
+}
+isEmpty(XSLT_CFLAGS)|isEmpty(XSLT_LIBS) {
+       XSLT_CFLAGS = $$system(xslt-config --cflags 2>$$NUL)
+       XSLT_LIBS = $$system(xslt-config --libs 2>$$NUL)
+}
+isEmpty(XML2_CFLAGS)|isEmpty(XML2_LIBS): \
+       error("Could not find libxml2. Did you forget to install it?")
+isEmpty(XSLT_CFLAGS)|isEmpty(XSLT_LIBS): \
+       error("Could not find libxslt. Did you forget to install it?")
+
 
 QMAKE_CFLAGS *= $$XML2_CFLAGS $$XSLT_CFLAGS
 QMAKE_CXXFLAGS *= $$XML2_CFLAGS $$XSLT_CFLAGS
-- 
1.8.4.5

_______________________________________________
subsurface mailing list
[email protected]
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to