configure: fix setting HAVE_QTDBUS if module is found

The m4 macro `AC_DEFINE()` seems to write the definition into a file
that's later evaluated and from which `config.h` is built. This
temporary file must reside in the proper directory, otherwise
`configure` will only know that `HAVE_QTDBUS` might be defined but not
that it should actually be set.

The function checking for Qt6 uses a different temporary directory for
its checks whether `qmake` can compile with certain modules. For the
invocations it changes the current working directory to the temporary
directory. If `AC_DEFINE()` is used while the working directory is
changed, this will break the mechanism described above.

The solution is to only use `AC_DEFINE()` once the current working
directory's been changed back to the original one.

fixes #3744
This commit is contained in:
Moritz Bunkus 2024-10-01 12:50:14 +02:00
parent 94bb863030
commit ecf44d0dbc
No known key found for this signature in database
GPG Key ID: 74AF00ADF2E32C85
2 changed files with 13 additions and 1 deletions

View File

@ -1,3 +1,11 @@
# Version ?
## Bug fixes
* configure: fixed setting `HAVE_QTDBUS` properly if the QtDbus module is
found. Fixes #3744.
# Version 87.0 "Black as the Sky" 2024-09-07
## New features and enhancements

View File

@ -77,6 +77,7 @@ EOT
fi
fi
dbus=0
modules_to_test=dbus
if test x"$enable_gui" = xno; then
@ -103,7 +104,7 @@ EOT
continue
elif test $qt_module = dbus; then
qmake_qt_ui="$qmake_qt_ui dbus"
AC_DEFINE(HAVE_QTDBUS, 1, [Define if QtDBus is present])
dbus=1
fi
done
@ -265,6 +266,9 @@ return 0;
fi
AC_DEFINE(HAVE_QT, 1, [Define if Qt is present])
if test "x$dbus" = x1; then
AC_DEFINE(HAVE_QTDBUS, 1, [Define if QtDBus is present])
fi
AC_MSG_CHECKING(for Qt 6)
AC_MSG_RESULT(yes)
have_qt6=yes