Skip to content

Commit

Permalink
Use target-arch pkg-config not local arch
Browse files Browse the repository at this point in the history
ktikz fails to cross build from source (i.e. build for arm64 on amd64),
because it searches for poppler-qt* using the build architecture pkg-config.
This patch makes it use the requested pkg-config and that's sufficient to make
ktikz cross buildable.

(Patch from Helmut Grohne <[email protected]> as part of the cross-building /
bootstrapping project)
  • Loading branch information
llimeht authored and jfmcarreira committed Dec 8, 2018
1 parent 9da6f4e commit 9cff561
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
9 changes: 5 additions & 4 deletions qmake/findpoppler.pri
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
unix:!macx {
# QMAKE_CXXFLAGS += `pkg-config --cflags poppler-qt4`
# QMAKE_LFLAGS += `pkg-config --libs poppler-qt4` # using this, qmake adds 3 times "--libs" to the LFLAGS, which is not recognized by g++ 4.6
PKG_CONFIG = $$pkgConfigExecutable()
greaterThan(QT_MAJOR_VERSION, 4) {
POPPLERINCLUDES = $$system(pkg-config --cflags poppler-qt5)
POPPLERLIBS = $$system(pkg-config --libs poppler-qt5)
POPPLERINCLUDES = $$system($$PKG_CONFIG --cflags poppler-qt5)
POPPLERLIBS = $$system($$PKG_CONFIG --libs poppler-qt5)
} else {
POPPLERINCLUDES = $$system(pkg-config --cflags poppler-qt4)
POPPLERLIBS = $$system(pkg-config --libs poppler-qt4)
POPPLERINCLUDES = $$system($$PKG_CONFIG --cflags poppler-qt4)
POPPLERLIBS = $$system($$PKG_CONFIG --libs poppler-qt4)
}
QMAKE_CXXFLAGS += $$POPPLERINCLUDES
QMAKE_LFLAGS += $$POPPLERLIBS
Expand Down
9 changes: 5 additions & 4 deletions qmake/qtikzmacros.pri
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
unix:!macx {
# QMAKE_CXXFLAGS += `pkg-config --cflags poppler-qt4`
# QMAKE_LFLAGS += `pkg-config --libs poppler-qt4` # using this, qmake adds 3 times "--libs" to the LFLAGS, which is not recognized by g++ 4.6
PKG_CONFIG = $$pkgConfigExecutable()
greaterThan(QT_MAJOR_VERSION, 4) {
POPPLERINCLUDES = $$system(pkg-config --cflags poppler-qt5)
POPPLERLIBS = $$system(pkg-config --libs poppler-qt5)
POPPLERINCLUDES = $$system($$PKG_CONFIG --cflags poppler-qt5)
POPPLERLIBS = $$system($$PKG_CONFIG --libs poppler-qt5)
} else {
POPPLERINCLUDES = $$system(pkg-config --cflags poppler-qt4)
POPPLERLIBS = $$system(pkg-config --libs poppler-qt4)
POPPLERINCLUDES = $$system($$PKG_CONFIG --cflags poppler-qt4)
POPPLERLIBS = $$system($$PKG_CONFIG --libs poppler-qt4)
}
QMAKE_CXXFLAGS += $$POPPLERINCLUDES
QMAKE_LFLAGS += $$POPPLERLIBS
Expand Down

0 comments on commit 9cff561

Please sign in to comment.