Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot build Qt 5.7.x for Win XP compatibility with qt5-freeze #1901

Closed
uwehermann opened this issue Sep 16, 2017 · 5 comments · Fixed by #1916
Closed

Cannot build Qt 5.7.x for Win XP compatibility with qt5-freeze #1901

uwehermann opened this issue Sep 16, 2017 · 5 comments · Fixed by #1916

Comments

@uwehermann
Copy link
Contributor

Hi, I'm aware that this is more or less just an example, but it would be nice if qt5-freeze could actually be used as is, without modifications, to build Qt 5.7.x on recent MXE (instead of the latest Qt5) in order to retain Windows XP compatibility.

I'm trying to build MXE from scratch (for building PulseView, see here: https://sigrok.org/gitweb/?p=sigrok-util.git;a=blob;f=cross-compile/mingw/sigrok-cross-mingw) as we usually do, with the only change being that I try to force building of Qt 5.7.x via the qt5-freeze plugin:

make MXE_TARGETS=i686-w64-mingw32.static.posix MXE_PLUGIN_DIRS=plugins/examples/qt5-freeze gcc glib libzip libusb1 libftdi1 glibmm boost check qt5 qtbase_CONFIGURE_OPTS='-no-sql-mysql'

It appears to work mostly OK, it does indeed build Qt 5.7.x, but then fails when it tries to download qtspeech-opensource-src-5.7.1.tar.xz, probably because that wasn't available yet in Qt 5.7.x.

I'm guessing the qt5.mk needs fixing to build its dependency list from qt5-freeze instead of src?

@uwehermann uwehermann changed the title Cannot built Qt 5.7.x for Win XP compatibility with qt5-freeze Cannot build Qt 5.7.x for Win XP compatibility with qt5-freeze Sep 16, 2017
@tonytheodore
Copy link
Member

Indeed, the deps also need to be frozen - something like this should work (untested):

# parent of Qt 5.8 update
git checkout a0f9e61
export QT5_PKGS=`grep -l qtbase_VERSION src/*.mk | sed -n 's,src/\(.*\)\.mk.*,\1,p' | tr '\n' ' ' | sed -n 's,qt5,qtbase,p'`

git checkout master
echo "\$(PKG)_DEPS     := $QT5_PKGS" >> plugins/examples/qt5-freeze/qt5.mk

or at least be a starting point for manual edits to qt5.mk.

@tonytheodore
Copy link
Member

I'm guessing the qt5.mk needs fixing to build its dependency list from qt5-freeze instead of src?

I didn't read to the end, that's a better approach!

Replacing $(TOP_DIR)/src with $(dir $(lastword $(MAKEFILE_LIST))) will read from current directory of qt5.mk.

@uwehermann
Copy link
Contributor Author

Looks good, but there's one additional issue which pops up with the following command-line:

make -j4 JOBS=4 MXE_TARGETS=i686-w64-mingw32.static.posix MXE_PLUGIN_DIRS=plugins/examples/qt5-freeze gcc glib libzip libusb1 libftdi1 glibmm boost check qt5 qtbase_CONFIGURE_OPTS='-no-sql-mysql'

qttools fails to build:

-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: [...]/mxe-git/usr/bin/i686-w64-mingw32.static.posix-gcc
-- Check for working C compiler: [...]/mxe-git/usr/bin/i686-w64-mingw32.static.posix-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: [...]/mxe-git/usr/bin/i686-w64-mingw32.static.posix-g++
-- Check for working CXX compiler: [...]/mxe-git/usr/bin/i686-w64-mingw32.static.posix-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    CMAKE_POLICY_DEFAULT_CMP0017
    CMAKE_POLICY_DEFAULT_CMP0020


-- Build files have been written to: [...]/mxe-git/tmp-qttools-i686-w64-mingw32.static.posix/qttools-opensource-src-5.7.1.test
make -C '[...]/mxe-git/tmp-qttools-i686-w64-mingw32.static.posix/qttools-opensource-src-5.7.1'.test
make[2]: Entering directory '[...]/mxe-git/tmp-qttools-i686-w64-mingw32.static.posix/qttools-opensource-src-5.7.1.test'
make[3]: Entering directory '[...]/mxe-git/tmp-qttools-i686-w64-mingw32.static.posix/qttools-opensource-src-5.7.1.test'
make[4]: Entering directory '[...]/mxe-git/tmp-qttools-i686-w64-mingw32.static.posix/qttools-opensource-src-5.7.1.test'
Scanning dependencies of target mxe-cmake-qtuitools
make[4]: Leaving directory '[...]/mxe-git/tmp-qttools-i686-w64-mingw32.static.posix/qttools-opensource-src-5.7.1.test'
make[4]: Entering directory '[...]/mxe-git/tmp-qttools-i686-w64-mingw32.static.posix/qttools-opensource-src-5.7.1.test'
[ 50%] Building CXX object CMakeFiles/mxe-cmake-qtuitools.dir/mxe-cmake-qtuitools.cpp.obj
[100%] Linking CXX executable mxe-cmake-qtuitools.exe
[...]/mxe-git/usr/bin/i686-w64-mingw32.static.posix-ld: cannot find -lpcre2-16
collect2: error: ld returned 1 exit status
CMakeFiles/mxe-cmake-qtuitools.dir/build.make:101: recipe for target 'mxe-cmake-qtuitools.exe' failed
make[4]: *** [mxe-cmake-qtuitools.exe] Error 1
make[4]: Leaving directory '[...]/mxe-git/tmp-qttools-i686-w64-mingw32.static.posix/qttools-opensource-src-5.7.1.test'
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/mxe-cmake-qtuitools.dir/all' failed
make[3]: *** [CMakeFiles/mxe-cmake-qtuitools.dir/all] Error 2
make[3]: Leaving directory '[...]/mxe-git/tmp-qttools-i686-w64-mingw32.static.posix/qttools-opensource-src-5.7.1.test'
Makefile:83: recipe for target 'all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory '[...]/mxe-git/tmp-qttools-i686-w64-mingw32.static.posix/qttools-opensource-src-5.7.1.test'
Makefile:655: recipe for target 'build-only-qttools_i686-w64-mingw32.static.posix' failed
make[1]: *** [build-only-qttools_i686-w64-mingw32.static.posix] Error 2
make[1]: Leaving directory '[...]/mxe-git'

@tonytheodore
Copy link
Member

cannot find -lpcre2-16

Strange, I don't know where that lib is from but I must have had it left over from previous build. #1932 fixes it.

@tonytheodore
Copy link
Member

pcre2 is a new package aea39fc#diff-9aa51a5895e280d1b25802fdbb29d683

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants