mirror of
https://gitlab.com/mbunkus/mkvtoolnix.git
synced 2024-10-22 07:21:21 +00:00
configure: Qt6: pass -spec linux-clang/g++
if compiling on Linux
Otherwise `qmake` might add compiler flags that aren't understood by the other one. Actual issue that triggered this change: on Arch with Qt 6.5.2 no matter what `CC`/`CXX` are set to, `qmake` always assumes `g++` & uses `linux-g++` as the spec, adding `-mno-direct-extern-access`. `clang`'s equivalent is `-fno-direct-access-external-data`, though.
This commit is contained in:
parent
974cc0e5f0
commit
eade36c82d
11
NEWS.md
11
NEWS.md
@ -1,3 +1,14 @@
|
||||
# Version ?
|
||||
|
||||
## Bug fixes
|
||||
|
||||
* build system: fixed detection of Qt6 if `clang` is used for compilation on
|
||||
Linux. In that case Qt's `qmake` added a `gcc`-specific option that `clang`
|
||||
doesn't understand, `-mno-direct-extern-access`. `configure` will now pass
|
||||
the parameter `-spec linux-clang` to `qmake` so that it uses the correct
|
||||
compiler flags.
|
||||
|
||||
|
||||
# Version 79.0 "Funeral Pyres" 2023-08-20
|
||||
|
||||
## New features and enhancements
|
||||
|
17
ac/qt6.m4
17
ac/qt6.m4
@ -22,6 +22,15 @@ check_qt6() {
|
||||
return
|
||||
fi
|
||||
|
||||
QMAKE_SPEC=""
|
||||
if "$QMAKE6" -query | grep -F -q "QMAKE_XSPEC:linux-g++"; then
|
||||
if test x"$COMPILER_TYPE" = xclang; then
|
||||
QMAKE_SPEC="-spec linux-clang"
|
||||
else
|
||||
QMAKE_SPEC="-spec linux-g++"
|
||||
fi
|
||||
fi
|
||||
|
||||
rm -f src/mkvtoolnix-gui/static_plugins.cpp
|
||||
qmake_dir="`mktemp -d`"
|
||||
|
||||
@ -57,7 +66,7 @@ EOT
|
||||
old_wd="$PWD"
|
||||
cd "$qmake_dir"
|
||||
|
||||
"$QMAKE6" -makefile -nocache configure_non_gui.pro > /dev/null
|
||||
"$QMAKE6" -makefile -nocache $QMAKE_SPEC configure_non_gui.pro > /dev/null
|
||||
result=$?
|
||||
|
||||
if test $result = 0; then
|
||||
@ -81,7 +90,7 @@ HEADERS = configure.h
|
||||
SOURCES = configure.cpp
|
||||
EOT
|
||||
|
||||
"$QMAKE6" -makefile -nocache configure.pro > /dev/null 2> /dev/null
|
||||
"$QMAKE6" -makefile -nocache $QMAKE_SPEC configure.pro > /dev/null 2> /dev/null
|
||||
result2=$?
|
||||
|
||||
if test $result2 != 0; then
|
||||
@ -106,7 +115,7 @@ HEADERS = configure.h
|
||||
SOURCES = configure.cpp
|
||||
EOT
|
||||
|
||||
"$QMAKE6" -makefile -nocache configure.pro > /dev/null
|
||||
"$QMAKE6" -makefile -nocache $QMAKE_SPEC configure.pro > /dev/null
|
||||
result2=$?
|
||||
|
||||
if test $result2 = 0; then
|
||||
@ -119,7 +128,7 @@ EOT
|
||||
fi
|
||||
fi
|
||||
|
||||
"$QMAKE6" -query > "$qmake_dir/configure.properties"
|
||||
"$QMAKE6" -query $QMAKE_SPEC > "$qmake_dir/configure.properties"
|
||||
result3=$?
|
||||
|
||||
cd "$old_wd"
|
||||
|
Loading…
Reference in New Issue
Block a user