On 2025-10-05 19:28:25+0200, Branko Čibej <[email protected]> wrote:
> The problem I have with this particular change is that it's not true. JavaHL
> works with just fine with C++11. I think a better approach would be to check
> the determined C++ version in build/ac-macros/kwallet.m4 and only fail if
> KWallet support was explicitly requested AND we have KWallet 6 available AND
> the compiler version is not C++17-compatible (this would be done with a
> check for the value of the __cplusplus macro).
OK, C++17 will be requested only if KDE 6 is requested.
See attached patches.
--
Danh
Index: build/ac-macros/kwallet.m4
===================================================================
--- build/ac-macros/kwallet.m4 (revision 1928804)
+++ build/ac-macros/kwallet.m4 (working copy)
@@ -45,14 +45,39 @@
if test -n "$PKG_CONFIG"; then
if test "$HAVE_DBUS" = "yes"; then
AC_MSG_CHECKING([for Qt])
- if $PKG_CONFIG --exists Qt5Core Qt5DBus Qt5Gui; then
+ kde_version=
+ if $PKG_CONFIG --exists Qt6Core Qt6DBus Qt6Gui; then
+ AC_MSG_RESULT([yes, Qt6])
+ kde_version=6
+ qt_pkg_config_names="Qt6Core Qt6DBus Qt6Gui"
+ kde_inc_names="KF6/KWallet KF6/KCoreAddons KF6/KI18n"
+ kde_lib_names="-lKF6Wallet -lKF6I18n -lKF6CoreAddons `$PKG_CONFIG --libs Qt6Gui Qt6DBus Qt6Core`"
+ AC_MSG_CHECKING([whether C++17 or later is used])
+ AC_LANG(C++)
+ old_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS $CXXMODEFLAGS"
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[static_assert(__cplusplus >= 201703L);]])],
+ AC_MSG_RESULT([yes]), AC_MSG_ERROR([no but required by KF6]))
+ CXXFLAGS="$old_CXXFLAGS"
+ AC_LANG(C)
+ elif $PKG_CONFIG --exists Qt5Core Qt5DBus Qt5Gui; then
AC_MSG_RESULT([yes, Qt5])
+ kde_version=5
qt_pkg_config_names="Qt5Core Qt5DBus Qt5Gui"
kde_config_name="kf5-config"
kde_inc_names="KF5/KWallet KF5/KCoreAddons KF5/KI18n"
kde_lib_names="-lKF5Wallet -lKF5I18n -lKF5CoreAddons -lQt5Gui -lQt5DBus -lQt5Core"
+ AC_MSG_CHECKING([whether C++11 or later is used])
+ AC_LANG(C++)
+ old_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS $CXXMODEFLAGS"
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[static_assert(__cplusplus >= 201103L);]])],
+ AC_MSG_RESULT([yes]), AC_MSG_ERROR([no but required by KF5]))
+ CXXFLAGS="$old_CXXFLAGS"
+ AC_LANG(C)
elif $PKG_CONFIG --exists QtCore QtDBus QtGui; then
AC_MSG_RESULT([yes, Qt4])
+ kde_version=4
qt_pkg_config_names="QtCore QtDBus QtGui"
kde_config_name="kde4-config"
kde_inc_names="/"
@@ -59,7 +84,20 @@
kde_lib_names="-lkdeui -lkdecore -lQtGui -lQtDBus -lQtCore"
fi
if test -n "$qt_pkg_config_names"; then
- if test "$svn_lib_kwallet" != "yes"; then
+ if test "$kde_version" = 6; then
+ KDE_CONFIG="unneeded"
+ AC_DEFINE([SVN_HAVE_KF6], [1], [Defined if KF6 available])
+ case "$svn_lib_kwallet" in
+ *:*)
+ kde_incdir="${svn_lib_kwallet%%:*}"
+ kde_libdir="${svn_lib_kwallet##*:}"
+ ;;
+ *)
+ kde_incdir="$svn_lib_kwallet/include"
+ kde_libdir="$svn_lib_kwallet/lib"
+ ;;
+ esac
+ elif test "$svn_lib_kwallet" != "yes"; then
AC_MSG_CHECKING([for $kde_config_name])
KDE_CONFIG="$svn_lib_kwallet/bin/$kde_config_name"
if test -f "$KDE_CONFIG" && test -x "$KDE_CONFIG"; then
Index: subversion/libsvn_auth_kwallet/kwallet.cpp
===================================================================
--- subversion/libsvn_auth_kwallet/kwallet.cpp (revision 1928804)
+++ subversion/libsvn_auth_kwallet/kwallet.cpp (working copy)
@@ -55,7 +55,7 @@
#include "svn_private_config.h"
-#ifndef SVN_HAVE_KF5
+#if !defined(SVN_HAVE_KF6) && !defined(SVN_HAVE_KF5)
#include <kcmdlineargs.h>
#include <kcomponentdata.h>
#endif
@@ -223,7 +223,7 @@
app = new QCoreApplication(argc, q_argv);
}
-#if SVN_HAVE_KF5
+#if defined(SVN_HAVE_KF6) || defined(SVN_HAVE_KF5)
KLocalizedString::setApplicationDomain("subversion"); /* translation domain */
/* componentName appears in KDE GUI prompts */
@@ -305,7 +305,7 @@
app = new QCoreApplication(argc, q_argv);
}
-#if SVN_HAVE_KF5
+#if defined(SVN_HAVE_KF6) || defined(SVN_HAVE_KF5)
KLocalizedString::setApplicationDomain("subversion"); /* translation domain */
/* componentName appears in KDE GUI prompts */