Project

General

Profile

Feature #235 ยป 0036-Autotools-Add-gtk4x-fcmp-build-support.patch

Marko Lindqvist, 02/05/2024 10:26 PM

View differences:

configure.ac
done
AC_ARG_ENABLE([fcmp],
AS_HELP_STRING([--enable-fcmp=no/yes/gtk3/gtk4/qt/cli/all/auto], [build freeciv-modpack-program [auto]]),
AS_HELP_STRING([--enable-fcmp=no/yes/gtk3/gtk4/gtk4x/qt/cli/all/auto], [build freeciv-modpack-program [auto]]),
[fc_mp=${enableval}],
[if test "x$emscripten" = "xyes" ; then
fc_mp=no
......
fcmp_cli=no
fcmp_gtk3=no
fcmp_gtk4=no
fcmp_gtk5=no
fcmp_qt=no
fcmp_list=
......
req_fcmp_gtk3=yes
elif test "x$mp" = "xgtk4" ; then
req_fcmp_gtk4=yes
elif test "x$mp" = "xgtk4x" ; then
req_fcmp_gtk5=yes
elif test "x$mp" = "xqt" ; then
req_fcmp_qt=yes
elif test "x$mp" = "xcli" ; then
......
Maybe another --with-qtver value would help?])
fi
if test "x$req_fcmp_gtk5" = "xyes" ||
test "x$modinst" = "xall" || test "x$modinst" = "xauto" ; then
PKG_CHECK_MODULES([GTK5_MP], [gtk4 >= 4.10.0],
[
GTK5_MP_CFLAGS="$GTK5_MP_CFLAGS -DGDK_VERSION_MIN_REQUIRED=GDK_VERSION_4_8"
GTK5_MP_CFLAGS="$GTK5_MP_CFLAGS -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_66"
PKG_CHECK_MODULES([GTHREAD_GTK5], [gthread-2.0],
[
fcmp_gtk5=yes
fcmp_list="$fcmp_list gtk4x"
mp_gtk5_cflags="$GTK5_MP_CFLAGS $GTHREAD_GTK5_CFLAGS"
mp_gtk5_libs="$GTK5_MP_LIBS $GTHREAD_GTK5_LIBS"
if test "x$MINGW" = "xyes"; then
dnl Required to compile gtk5 on Windows platform
mp_gtk5_cflags="$mp_gtk5_cflags -mms-bitfields"
mp_gtk5_ldflags="$mp_gtk5_ldflags $MWINDOWS_FLAG"
fi
if test "x$modinst" = "xauto" ; then
modinst=found
fi
], [fcmp_gtk5=no])], [fcmp_gtk5=no])
fi
if test "x$req_fcmp_gtk5" = "xyes" && test "x$fcmp_gtk5" != "xyes" ; then
AC_MSG_ERROR([Cannot build gtk4x-version of freeciv-modpack as requested])
fi
dnl Cli does not satisfy --enable-fcmp=auto as it's not an gui.
if test "x$req_fcmp_cli" = "xyes" || test "x$modinst" = "xall" ; then
fcmp_cli=yes
......
test "x$modinst" != "xcli" &&
test "x$fcmp_gtk3" != "xyes" &&
test "x$fcmp_gtk4" != "xyes" &&
test "x$fcmp_gtk5" != "xyes" &&
test "x$fcmp_qt" != "xyes" ;then
AC_MSG_ERROR([Cannot build modpack installer with any gui])
fi
......
dnl Hack to get a run-time icon -- not needed on Windows
mp_gtk3_cflags="$mp_gtk3_cflags -DMPICON_PATH=\"\\\"$datadir/freeciv/misc/mpicon.png\\\"\""
mp_gtk4_cflags="$mp_gtk4_cflags -DMPICON_PATH=\"\\\"$datadir/freeciv/misc/mpicon.png\\\"\""
mp_gtk5_cflags="$mp_gtk5_cflags -DMPICON_PATH=\"\\\"$datadir/freeciv/misc/mpicon.png\\\"\""
fi
if test "x$fcmp_list" = "x" ; then
......
AM_CONDITIONAL([MODINST], [test "x$modinst" != "xno"])
AM_CONDITIONAL([MODINST_GTK3], [test "x$fcmp_gtk3" = "xyes"])
AM_CONDITIONAL([MODINST_GTK4], [test "x$fcmp_gtk4" = "xyes"])
AM_CONDITIONAL([MODINST_GTK5], [test "x$fcmp_gtk5" = "xyes"])
AM_CONDITIONAL([MODINST_QT], [test "x$fcmp_qt" = "xyes"])
AM_CONDITIONAL([MODINST_CLI], [test "x$fcmp_cli" = "xyes"])
......
AC_SUBST([mp_gtk4_cflags])
AC_SUBST([mp_gtk4_libs])
AC_SUBST([mp_gtk4_ldflags])
AC_SUBST([mp_gtk5_cflags])
AC_SUBST([mp_gtk5_libs])
AC_SUBST([mp_gtk5_ldflags])
AC_SUBST([mp_qt_cppflags])
AC_SUBST([mp_qt_cxxflags])
AC_SUBST([mp_qt_libs])
tools/fcmp/Makefile.am
if MODINST_GTK4
bin_PROGRAMS += freeciv-mp-gtk4
endif
if MODINST_GTK5
bin_PROGRAMS += freeciv-mp-gtk4x
endif
if MODINST_QT
bin_PROGRAMS += freeciv-mp-qt
endif
......
$(MPICON)
endif
if MODINST_GTK5
freeciv_mp_gtk4x_CPPFLAGS = $(common_cppflags) $(mp_gtk5_cflags)
freeciv_mp_gtk4x_SOURCES = mpgui_gtk5.c
freeciv_mp_gtk4x_LDFLAGS = $(mp_gtk5_ldflags)
freeciv_mp_gtk4x_LDADD = \
libfcmp.la \
$(top_builddir)/dependencies/cvercmp/libcvercmp.la \
$(top_builddir)/common/libfreeciv.la \
$(TINYCTHR_LIBS) $(MAPIMG_WAND_LIBS) \
$(mp_gtk5_libs) -lsqlite3 \
$(MPICON)
endif
if MODINST_QT
MOC_FILES = \
    (1-1/1)