From 0ae7c820f24a4f0609fc0f08e425f0a506cf5d92 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sat, 1 Feb 2014 19:26:53 -0800 Subject: Search pkg-config before {xml2,xslt}-config 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 Signed-off-by: Dirk Hohndel --- subsurface-configure.pri | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/subsurface-configure.pri b/subsurface-configure.pri index 2df831d31..8e6aeadb8 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 -- cgit v1.2.3-70-g09d2