From 12bf2b84e6b3488455379adb9a555858f6f46c9c Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Tue, 21 Dec 2021 04:17:33 +0200 Subject: [PATCH 31/31] Replace --with-qt5 / --with-qt6 with --with-qtver=(qt5|qt6) - Introduce new --with-qtver=(qt5|qt6) configure option - Deprecate --with-qt5 / --with-qt6. They are not completely removed yet, to ease transition (many build scripts rely on them) See osdn #43445 Signed-off-by: Marko Lindqvist --- INSTALL | 6 +++--- configure.ac | 25 +++++++++++++++++++++---- doc/README.packaging | 2 +- scripts/ci-build.sh | 2 +- windows/installer_msys2/Makefile | 8 ++++---- 5 files changed, 30 insertions(+), 13 deletions(-) diff --git a/INSTALL b/INSTALL index e54c9f9e74..4b0e5c9ec1 100644 --- a/INSTALL +++ b/INSTALL @@ -4,7 +4,7 @@ Installing Freeciv: This file describes how to compile and install Freeciv. Last time we made sure this file is up to date was 16-Jul-06. -Last minor update was 10-Sep-21. +Last minor update was 21-Dec-21. There may be a localized version of this file in the ./doc directory, named INSTALL. (e.g., INSTALL.de). @@ -313,7 +313,7 @@ following order: pkg-config, Glib, Atk, Pango, Gdk-Pixbuf, Gtk+. Qt-client is written in C++, so you need appropriate compiler. Compiler needs to support c++11 standard, or, - in case of --with-qt6 build, c++17 standard + in case of --with-qtver=qt6 build, c++17 standard In Freeciv development, g++ has been the primary C++ compiler. Also clang++ has been used. @@ -331,7 +331,7 @@ following order: pkg-config, Glib, Atk, Pango, Gdk-Pixbuf, Gtk+. - Qt5Core, Qt5Gui, and Qt5Widgets libraries and headers. At least version 5.11 is required. - If one builds with configure option --with-qt6, + If one builds with configure option --with-qtver=qt6, required libraries and headers are Qt6Core, Qt6Gui, and Qt6Widgets and at least version 6.0 of Qt is required. diff --git a/configure.ac b/configure.ac index 7239dbae35..5000b43bc8 100644 --- a/configure.ac +++ b/configure.ac @@ -650,10 +650,27 @@ dnl when setting compiler flags. AC_ARG_WITH([qt6], AS_HELP_STRING([--with-qt6], [build Qt6 versions of Qt programs]), [case "${withval}" in - yes) qt_ver="Qt6" - AC_DEFINE([FC_QT6_MODE], [1], [this is Qt6 based build]) ;; - *) qt_ver="Qt5" ;; -esac], [qt_ver="Qt5"]) + yes) qt_default="Qt6" ;; + *) qt_default="Qt5" ;; +esac]) + +if test "x$qt_default" = "x" ; then + qt_default="Qt5" +else + AC_MSG_WARN([--with-qt6 deprecated. Please use --with-qtver=[qt5|qt6] instead]) +fi + +AC_ARG_WITH([qtver], + AS_HELP_STRING([--with-qtver], [which Qt version to build against qt5/qt6]), +[case "${withval}" in + qt5|Qt5) qt_ver="Qt5" ;; + qt6|Qt6) qt_ver="Qt6" ;; + *) AC_MSG_ERROR([bad value ${enableval} for --with-qtver]) ;; +esac], [qt_ver="$qt_default"]) + +if test "x$qt_ver" = "xQt6" ; then + AC_DEFINE([FC_QT6_MODE], [1], [this is Qt6 based build]) +fi FC_WORKING_CXX diff --git a/doc/README.packaging b/doc/README.packaging index 6c6bf1159a..6f7517b843 100644 --- a/doc/README.packaging +++ b/doc/README.packaging @@ -31,7 +31,7 @@ Updating from 3.0 to 3.1 implementation supports it. * Minimum Qt5 requirement for Qt-client, Qt modpack installer, and Ruledit is 5.11. -* New configure option --with-qt6 builds Qt6 versions of Qt programs +* New configure option --with-qtver=qt6 builds Qt6 versions of Qt programs * Support for zstd compressed savegames added, requires libzstd and headers ---------------------------------------------------------------------- diff --git a/scripts/ci-build.sh b/scripts/ci-build.sh index bfda407ec4..37c9ac1950 100755 --- a/scripts/ci-build.sh +++ b/scripts/ci-build.sh @@ -51,7 +51,7 @@ cd build ../autogen.sh --no-configure-run ../configure \ --enable-debug \ - --enable-sys-lua --with-qt6 \ + --enable-sys-lua --with-qtver=qt6 \ --enable-client=gtk3.22,sdl2,qt,gtk4 \ --enable-fcmp=gtk3,gtk4,qt,cli \ --enable-freeciv-manual \ diff --git a/windows/installer_msys2/Makefile b/windows/installer_msys2/Makefile index d6ad91f474..03122e0791 100644 --- a/windows/installer_msys2/Makefile +++ b/windows/installer_msys2/Makefile @@ -59,10 +59,10 @@ sdl2-installer: qt-installer: qt5-installer qt5-installer: - make GUI=qt5 CLIENT=qt FCMP=qt EXTRA_CONFIG="--with-qt5-includes=/$(ARCHDIR)/include --with-qt5-libs=/$(ARCHDIR)/lib $(EXTRA_CONFIG)" wrap-qt5 + make GUI=qt5 CLIENT=qt FCMP=qt EXTRA_CONFIG="--with-qtver=qt5 --with-qt5-includes=/$(ARCHDIR)/include --with-qt5-libs=/$(ARCHDIR)/lib $(EXTRA_CONFIG)" wrap-qt5 qt6-installer: - make GUI=qt6 CLIENT=qt FCMP=qt EXTRA_CONFIG="--with-qt6 --with-qt6-includes=/$(ARCHDIR)/include/qt6 --with-qt6-libs=/$(ARCHDIR)/lib $(EXTRA_CONFIG)" MOCCMD="$(QT6_MOCCMD)" wrap-qt6 + make GUI=qt6 CLIENT=qt FCMP=qt EXTRA_CONFIG="--with-qtver=qt6 --with-qt6-includes=/$(ARCHDIR)/include/qt6 --with-qt6-libs=/$(ARCHDIR)/lib $(EXTRA_CONFIG)" MOCCMD="$(QT6_MOCCMD)" wrap-qt6 ruledit-installer: ruledit-installer-qt5 @@ -99,13 +99,13 @@ configure-freeciv-ruledit-qt5: # create build directory mkdir -p build-$(WINARCH)-ruledit-qt5 # configure - cd build-$(WINARCH)-ruledit-qt5; ../../../configure FREECIV_LABEL_FORCE="-msys2" CPPFLAGS="-D_WIN32_WINNT=$(MIN_WIN_VER)" --disable-client --disable-server --disable-fcmp --disable-freeciv-manual --disable-sys-lua --enable-ruledit --enable-ai-static=stub --with-cacert-path="./ssl/certs/ca-bundle.crt" --with-qt5-includes=/$(ARCHDIR)/include --with-qt5-libs=/$(ARCHDIR)/lib $(EXTRA_CONFIG) + cd build-$(WINARCH)-ruledit-qt5; ../../../configure FREECIV_LABEL_FORCE="-msys2" CPPFLAGS="-D_WIN32_WINNT=$(MIN_WIN_VER)" --with-qtver=qt5 --disable-client --disable-server --disable-fcmp --disable-freeciv-manual --disable-sys-lua --enable-ruledit --enable-ai-static=stub --with-cacert-path="./ssl/certs/ca-bundle.crt" --with-qt5-includes=/$(ARCHDIR)/include --with-qt5-libs=/$(ARCHDIR)/lib $(EXTRA_CONFIG) configure-freeciv-ruledit-qt6: # create build directory mkdir -p build-$(WINARCH)-ruledit-qt6 # configure - cd build-$(WINARCH)-ruledit-qt6; ../../../configure FREECIV_LABEL_FORCE="-msys2" CPPFLAGS="-D_WIN32_WINNT=$(MIN_WIN_VER)" --with-qt6 --disable-client --disable-server --disable-fcmp --disable-freeciv-manual --disable-sys-lua --enable-ruledit --enable-ai-static=stub --with-cacert-path="./ssl/certs/ca-bundle.crt" --with-qt6-includes=/$(ARCHDIR)/include/qt6 --with-qt6-libs=/$(ARCHDIR)/lib $(EXTRA_CONFIG) + cd build-$(WINARCH)-ruledit-qt6; ../../../configure FREECIV_LABEL_FORCE="-msys2" CPPFLAGS="-D_WIN32_WINNT=$(MIN_WIN_VER)" --with-qtver=qt6 --disable-client --disable-server --disable-fcmp --disable-freeciv-manual --disable-sys-lua --enable-ruledit --enable-ai-static=stub --with-cacert-path="./ssl/certs/ca-bundle.crt" --with-qt6-includes=/$(ARCHDIR)/include/qt6 --with-qt6-libs=/$(ARCHDIR)/lib $(EXTRA_CONFIG) # install Freeciv -- 2.34.1