Skip to content

Commit 47ffb50

Browse files
committed
qt5: Use QT_SELECT for debian-based distros.
At least Debian/Ubuntu use 'qtchooser' for switching between qt4/qt5 binaries. It is a wrapper for all qt tools, and calls the named tool of the default version unless overridden by the -qt= option or QT_SELECT environment variable. QT_SELECT is set by configure once the qt version has been chosen. Take for example, moc. $ which moc /usr/bin/moc $ ls -go /usr/bin/moc lrwxrwxrwx 1 9 Jul 3 21:33 /usr/bin/moc -> qtchooser $ qtchooser -print-env QT_SELECT="default" QTTOOLDIR="/usr/lib/x86_64-linux-gnu/qt4/bin" QTLIBDIR="/usr/lib/x86_64-linux-gnu" $ QT_SELECT=qt5 qtchooser -print-env QT_SELECT="qt5" QTTOOLDIR="/usr/lib/x86_64-linux-gnu/qt5/bin" QTLIBDIR="/usr/lib/x86_64-linux-gnu" $ moc -v Qt Meta Object Compiler version 63 (Qt 4.8.4) $ QT_SELECT=qt5 moc -v Qt Meta Object Compiler version 67 (Qt 5.0.1) This should be harmless elsewhere.
1 parent 60dc589 commit 47ffb50

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/Makefile.include

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,23 +32,23 @@ $(LIBBITCOINQT):
3232

3333
ui_%.h: %.ui
3434
@test -d $(abs_builddir)/$(@D) || $(MKDIR_P) $(abs_builddir)/$(@D)
35-
@test -f $(UIC) && $(UIC) -o $(abs_builddir)/$@ $(abs_srcdir)/$< || echo error: could not build $(abs_builddir)/$@
35+
@test -f $(UIC) && QT_SELECT=$(QT_SELECT) $(UIC) -o $(abs_builddir)/$@ $(abs_srcdir)/$< || echo error: could not build $(abs_builddir)/$@
3636
$(SED) -i.bak -e '/^\*\*.*Created:/d' $(abs_builddir)/$@ && rm $(abs_builddir)/[email protected]
3737
$(SED) -i.bak -e '/^\*\*.*by:/d' $(abs_builddir)/$@ && rm $(abs_builddir)/[email protected]
3838

3939
%.moc: %.cpp
40-
$(MOC) $(QT_INCLUDES) $(MOC_DEFS) -o $@ $<
40+
QT_SELECT=$(QT_SELECT) $(MOC) $(QT_INCLUDES) $(MOC_DEFS) -o $@ $<
4141
$(SED) -i.bak -e '/^\*\*.*Created:/d' $@ && rm [email protected]
4242
$(SED) -i.bak -e '/^\*\*.*by:/d' $@ && rm [email protected]
4343

4444
moc_%.cpp: %.h
45-
$(MOC) $(QT_INCLUDES) $(MOC_DEFS) -o $@ $<
45+
QT_SELECT=$(QT_SELECT) $(MOC) $(QT_INCLUDES) $(MOC_DEFS) -o $@ $<
4646
$(SED) -i.bak -e '/^\*\*.*Created:/d' $@ && rm [email protected]
4747
$(SED) -i.bak -e '/^\*\*.*by:/d' $@ && rm [email protected]
4848

4949
%.qm: %.ts
5050
@test -d $(abs_builddir)/$(@D) || $(MKDIR_P) $(abs_builddir)/$(@D)
51-
@test -f $(LRELEASE) && $(LRELEASE) $(abs_srcdir)/$< -qm $(abs_builddir)/$@ || \
51+
@test -f $(LRELEASE) && QT_SELECT=$(QT_SELECT) $(LRELEASE) $(abs_srcdir)/$< -qm $(abs_builddir)/$@ || \
5252
echo error: could not build $(abs_builddir)/$@
5353

5454
%.pb.cc %.pb.h: %.proto

src/qt/Makefile.am

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,10 +220,10 @@ bitcoinstrings.cpp: FORCE
220220

221221
translate: bitcoinstrings.cpp $(QT_FORMS_UI) $(QT_FORMS_UI) $(BITCOIN_QT_CPP) $(BITCOIN_QT_H) $(BITCOIN_MM)
222222
@test -n $(LUPDATE) || echo "lupdate is required for updating translations"
223-
@$(LUPDATE) $^ -locations relative -no-obsolete -ts locale/bitcoin_en.ts
223+
@QT_SELECT=$(QT_SELECT) $(LUPDATE) $^ -locations relative -no-obsolete -ts locale/bitcoin_en.ts
224224

225225
$(QT_QRC_CPP): $(QT_QRC) $(QT_QM) $(QT_FORMS_H) $(RES_ICONS) $(RES_IMAGES) $(RES_MOVIES) $(PROTOBUF_H)
226-
@cd $(abs_srcdir); test -f $(RCC) && $(RCC) -name bitcoin -o $(abs_builddir)/$@ $< || \
226+
@cd $(abs_srcdir); test -f $(RCC) && QT_SELECT=$(QT_SELECT) $(RCC) -name bitcoin -o $(abs_builddir)/$@ $< || \
227227
echo error: could not build $@
228228
$(SED) -i.bak -e '/^\*\*.*Created:/d' $@ && rm $@.bak
229229
$(SED) -i.bak -e '/^\*\*.*by:/d' $@ && rm $@.bak

0 commit comments

Comments
 (0)