diff -urN fvwm-2.6.5-orig/acinclude.m4 fvwm-2.6.5/acinclude.m4
--- fvwm-2.6.5-orig/acinclude.m4	2011-04-11 03:47:18 +0900
+++ fvwm-2.6.5/acinclude.m4	2022-07-19 07:07:44 +0900
@@ -902,140 +902,6 @@
 ])
 
 #-----------------------------------------------------------------------------
-# Configure paths for FreeType2
-# Marcelo Magallon 2001-10-26, based on gtk.m4 by Owen Taylor
-
-dnl AM_CHECK_FT2([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
-dnl Test for FreeType2, and define FT2_CFLAGS and FT2_LIBS
-dnl
-AC_DEFUN([AM_CHECK_FT2],
-[dnl
-dnl Get the cflags and libraries from the freetype-config script
-dnl
-AC_ARG_WITH(freetype-prefix,
-AS_HELP_STRING([--with-freetype-prefix=PFX],[prefix where FreeType is installed (for Xft)]),
-            ft_config_prefix="$withval", ft_config_prefix="")
-AC_ARG_WITH(freetype-exec-prefix,
-AS_HELP_STRING([--with-freetype-exec-prefix=PFX],[exec prefix where FreeType is installed]),
-            ft_config_exec_prefix="$withval", ft_config_exec_prefix="")
-AC_ARG_ENABLE(freetypetest,
-AS_HELP_STRING([--disable-freetypetest],[do not try to compile and run a test FreeType program]),
-            [], enable_fttest=yes)
-
-if test x$ft_config_exec_prefix != x ; then
-  ft_config_args="$ft_config_args --exec-prefix=$ft_config_exec_prefix"
-  if test x${FT2_CONFIG+set} != xset ; then
-    FT2_CONFIG=$ft_config_exec_prefix/bin/freetype-config
-  fi
-fi
-if test x$ft_config_prefix != x ; then
-  ft_config_args="$ft_config_args --prefix=$ft_config_prefix"
-  if test x${FT2_CONFIG+set} != xset ; then
-    FT2_CONFIG=$ft_config_prefix/bin/freetype-config
-  fi
-fi
-AC_PATH_PROG(FT2_CONFIG, freetype-config, no)
-
-min_ft_version=ifelse([$1], ,6.1.0,$1)
-AC_MSG_CHECKING(for FreeType - version >= $min_ft_version)
-no_ft=""
-if test "$FT2_CONFIG" = "no" ; then
-  no_ft=yes
-else
-  FT2_CFLAGS=`$FT2_CONFIG $ft_config_args --cflags`
-  FT2_LIBS=`$FT2_CONFIG $ft_config_args --libs`
-  ft_config_major_version=`$FT2_CONFIG $ft_config_args --version | \
-         sed 's/^[[^0-9.]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*$/\1/'`
-  ft_config_minor_version=`$FT2_CONFIG $ft_config_args --version | \
-         sed 's/^[[^0-9.]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*$/\2/'`
-  ft_config_micro_version=`$FT2_CONFIG $ft_config_args --version | \
-         sed 's/^[[^0-9.]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*$/\3/'`
-  ft_min_major_version=`echo $min_ft_version | \
-         sed 's/^[[^0-9.]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*$/\1/'`
-  ft_min_minor_version=`echo $min_ft_version | \
-         sed 's/^[[^0-9.]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*$/\2/'`
-  ft_min_micro_version=`echo $min_ft_version | \
-         sed 's/^[[^0-9.]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*$/\3/'`
-  if test "x$enable_fttest" = "xyes" ; then
-    ft_config_is_lt=no
-    if test $ft_config_major_version -lt $ft_min_major_version ; then
-      ft_config_is_lt=yes
-    else
-      if test $ft_config_major_version -eq $ft_min_major_version ; then
-        if test $ft_config_minor_version -lt $ft_min_minor_version ; then
-          ft_config_is_lt=yes
-        else
-          if test $ft_config_minor_version -eq $ft_min_minor_version ; then
-            if test $ft_config_micro_version -lt $ft_min_micro_version ; then
-              ft_config_is_lt=yes
-            fi
-          fi
-        fi
-      fi
-    fi
-    if test "x$ft_config_is_lt" = "xyes" ; then
-      ifelse([$3], , :, [$3])
-    else
-      ac_save_CFLAGS="$CFLAGS"
-      ac_save_LIBS="$LIBS"
-      CFLAGS="$CFLAGS $FT2_CFLAGS"
-      LIBS="$FT2_LIBS $LIBS"
-dnl
-dnl Sanity checks for the results of freetype-config to some extent
-dnl
-      AC_TRY_RUN([
-#include <ft2build.h>
-#include FT_FREETYPE_H
-#include <stdio.h>
-#include <stdlib.h>
-
-int
-main()
-{
-  FT_Library library;
-  FT_Error error;
-
-  error = FT_Init_FreeType(&library);
-
-  if (error)
-    return 1;
-  else
-  {
-    FT_Done_FreeType(library);
-    return 0;
-  }
-}
-],, no_ft=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
-      CFLAGS="$ac_save_CFLAGS"
-      LIBS="$ac_save_LIBS"
-    fi             # test $ft_config_version -lt $ft_min_version
-  fi               # test "x$enable_fttest" = "xyes"
-fi                 # test "$FT2_CONFIG" = "no"
-if test "x$no_ft" = x ; then
-   AC_MSG_RESULT(yes)
-   ifelse([$2], , :, [$2])
-else
-   AC_MSG_RESULT(no)
-   if test "$FT2_CONFIG" = "no" ; then
-     echo "*** The freetype-config script installed by FreeType 2 could not be found."
-     echo "*** If FreeType 2 was installed in PREFIX, make sure PREFIX/bin is in"
-     echo "*** your path, or set the FT2_CONFIG environment variable to the"
-     echo "*** full path to freetype-config."
-   else
-     echo "*** The FreeType test program failed to run.  If your system uses"
-     echo "*** shared libraries and they are installed outside the normal"
-     echo "*** system library path, make sure the variable LD_LIBRARY_PATH"
-     echo "*** (or whatever is appropiate for your system) is correctly set."
-   fi
-   FT2_CFLAGS=""
-   FT2_LIBS=""
-   ifelse([$3], , :, [$3])
-fi
-AC_SUBST(FT2_CFLAGS)
-AC_SUBST(FT2_LIBS)
-])
-
-#-----------------------------------------------------------------------------
 # Configure paths for fontconfig
 # Marcelo Magallon 2001-10-26, based on gtk.m4 by Owen Taylor
 # modified by olicha for fontconfig
diff -urN fvwm-2.6.5-orig/configure fvwm-2.6.5/configure
--- fvwm-2.6.5-orig/configure	2012-04-20 20:03:57 +0900
+++ fvwm-2.6.5/configure	2022-07-19 07:09:39 +0900
@@ -690,9 +690,6 @@
 FC_LIBS
 FC_CFLAGS
 FC_CONFIG
-FT2_LIBS
-FT2_CFLAGS
-FT2_CONFIG
 Xcursor_LIBS
 Xcursor_CFLAGS
 Xrender_CFLAGS
@@ -854,9 +851,6 @@
 enable_xrender
 enable_xcursor
 enable_xft
-with_freetype_prefix
-with_freetype_exec_prefix
-enable_freetypetest
 with_fontconfig_prefix
 with_fontconfig_exec_prefix
 enable_fontconfigtest
@@ -1551,8 +1545,6 @@
   --disable-xrender       disable Xrender alpha-blend rendering
   --disable-xcursor       disable Xcursor ARGB/animated cursor loading
   --disable-xft           disable Xft anti-aliased font rendering
-  --disable-freetypetest  do not try to compile and run a test FreeType
-                          program
   --disable-fontconfigtest
                           do not try to compile and run a test fontconfig
                           program
@@ -1575,10 +1567,6 @@
                           prefix where pkg-config is installed
   --with-pkgconfig-exec-prefix=PFX
                           exec prefix where pkg-config is installed
-  --with-freetype-prefix=PFX
-                          prefix where FreeType is installed (for Xft)
-  --with-freetype-exec-prefix=PFX
-                          exec prefix where FreeType is installed
   --with-fontconfig-prefix=PFX
                           prefix where fontconfig is installed (for Xft2)
   --with-fontconfig-exec-prefix=PFX
@@ -7689,205 +7677,20 @@
 
 
 if test ! x"$with_xft" = xno; then
-
-  # first check for freetype2
-  have_freetype=no
-
-# Check whether --with-freetype-prefix was given.
-if test "${with_freetype_prefix+set}" = set; then :
-  withval=$with_freetype_prefix; ft_config_prefix="$withval"
-else
-  ft_config_prefix=""
-fi
-
-
-# Check whether --with-freetype-exec-prefix was given.
-if test "${with_freetype_exec_prefix+set}" = set; then :
-  withval=$with_freetype_exec_prefix; ft_config_exec_prefix="$withval"
-else
-  ft_config_exec_prefix=""
-fi
-
-# Check whether --enable-freetypetest was given.
-if test "${enable_freetypetest+set}" = set; then :
-  enableval=$enable_freetypetest;
-else
-  enable_fttest=yes
-fi
-
-
-if test x$ft_config_exec_prefix != x ; then
-  ft_config_args="$ft_config_args --exec-prefix=$ft_config_exec_prefix"
-  if test x${FT2_CONFIG+set} != xset ; then
-    FT2_CONFIG=$ft_config_exec_prefix/bin/freetype-config
-  fi
-fi
-if test x$ft_config_prefix != x ; then
-  ft_config_args="$ft_config_args --prefix=$ft_config_prefix"
-  if test x${FT2_CONFIG+set} != xset ; then
-    FT2_CONFIG=$ft_config_prefix/bin/freetype-config
-  fi
-fi
-# Extract the first word of "freetype-config", so it can be a program name with args.
-set dummy freetype-config; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_FT2_CONFIG+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $FT2_CONFIG in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_FT2_CONFIG="$FT2_CONFIG" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path_FT2_CONFIG="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-  test -z "$ac_cv_path_FT2_CONFIG" && ac_cv_path_FT2_CONFIG="no"
-  ;;
-esac
-fi
-FT2_CONFIG=$ac_cv_path_FT2_CONFIG
-if test -n "$FT2_CONFIG"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FT2_CONFIG" >&5
-$as_echo "$FT2_CONFIG" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-
-min_ft_version=6.1.0
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for FreeType - version >= $min_ft_version" >&5
-$as_echo_n "checking for FreeType - version >= $min_ft_version... " >&6; }
-no_ft=""
-if test "$FT2_CONFIG" = "no" ; then
-  no_ft=yes
-else
-  FT2_CFLAGS=`$FT2_CONFIG $ft_config_args --cflags`
-  FT2_LIBS=`$FT2_CONFIG $ft_config_args --libs`
-  ft_config_major_version=`$FT2_CONFIG $ft_config_args --version | \
-         sed 's/^[^0-9.]*\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*$/\1/'`
-  ft_config_minor_version=`$FT2_CONFIG $ft_config_args --version | \
-         sed 's/^[^0-9.]*\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*$/\2/'`
-  ft_config_micro_version=`$FT2_CONFIG $ft_config_args --version | \
-         sed 's/^[^0-9.]*\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*$/\3/'`
-  ft_min_major_version=`echo $min_ft_version | \
-         sed 's/^[^0-9.]*\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*$/\1/'`
-  ft_min_minor_version=`echo $min_ft_version | \
-         sed 's/^[^0-9.]*\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*$/\2/'`
-  ft_min_micro_version=`echo $min_ft_version | \
-         sed 's/^[^0-9.]*\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*$/\3/'`
-  if test "x$enable_fttest" = "xyes" ; then
-    ft_config_is_lt=no
-    if test $ft_config_major_version -lt $ft_min_major_version ; then
-      ft_config_is_lt=yes
-    else
-      if test $ft_config_major_version -eq $ft_min_major_version ; then
-        if test $ft_config_minor_version -lt $ft_min_minor_version ; then
-          ft_config_is_lt=yes
-        else
-          if test $ft_config_minor_version -eq $ft_min_minor_version ; then
-            if test $ft_config_micro_version -lt $ft_min_micro_version ; then
-              ft_config_is_lt=yes
-            fi
-          fi
-        fi
-      fi
-    fi
-    if test "x$ft_config_is_lt" = "xyes" ; then
-      :
-    else
-      ac_save_CFLAGS="$CFLAGS"
-      ac_save_LIBS="$LIBS"
-      CFLAGS="$CFLAGS $FT2_CFLAGS"
-      LIBS="$FT2_LIBS $LIBS"
-      if test "$cross_compiling" = yes; then :
-  echo $ac_n "cross compiling; assumed OK... $ac_c"
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-#include <ft2build.h>
-#include FT_FREETYPE_H
-#include <stdio.h>
-#include <stdlib.h>
-
-int
-main()
-{
-  FT_Library library;
-  FT_Error error;
-
-  error = FT_Init_FreeType(&library);
-
-  if (error)
-    return 1;
-  else
-  {
-    FT_Done_FreeType(library);
-    return 0;
-  }
-}
-
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-
-else
-  no_ft=yes
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-      CFLAGS="$ac_save_CFLAGS"
-      LIBS="$ac_save_LIBS"
-    fi             # test $ft_config_version -lt $ft_min_version
-  fi               # test "x$enable_fttest" = "xyes"
-fi                 # test "$FT2_CONFIG" = "no"
-if test "x$no_ft" = x ; then
-   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pkg-config could find freetype2" >&5
+$as_echo_n "checking whether pkg-config could find freetype2... " >&6; }
+  if "${PKG_CONFIG}" --exists freetype2; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
-   :
-else
-   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-   if test "$FT2_CONFIG" = "no" ; then
-     echo "*** The freetype-config script installed by FreeType 2 could not be found."
-     echo "*** If FreeType 2 was installed in PREFIX, make sure PREFIX/bin is in"
-     echo "*** your path, or set the FT2_CONFIG environment variable to the"
-     echo "*** full path to freetype-config."
-   else
-     echo "*** The FreeType test program failed to run.  If your system uses"
-     echo "*** shared libraries and they are installed outside the normal"
-     echo "*** system library path, make sure the variable LD_LIBRARY_PATH"
-     echo "*** (or whatever is appropiate for your system) is correctly set."
-   fi
-   FT2_CFLAGS=""
-   FT2_LIBS=""
-   :
-fi
-
-
-
-  if test x"$no_ft" = x; then
+    CFLAGS_FREETYPE=`"${PKG_CONFIG}" --cflags freetype2`
+    FREETYPE_LIBS=`"${PKG_CONFIG}" --libs freetype2`
+    CFLAGS="$CFLAGS $CFLAGS_FREETYPE"
+    LIBS="$LIBS $FREETYPE_LIBS"
     have_freetype=yes
   else
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
     have_freetype=no
-    problem_xft=": Can't detect freetype2 >= 6.1.0/2.0.6"
   fi
 
   # check for fontconfig for Xft 2
diff -urN fvwm-2.6.5-orig/configure.ac fvwm-2.6.5/configure.ac
--- fvwm-2.6.5-orig/configure.ac	2012-04-20 19:58:29 +0900
+++ fvwm-2.6.5/configure.ac	2022-07-19 07:07:44 +0900
@@ -682,15 +682,18 @@
 AH_TEMPLATE([HAVE_XFT2],[Define if Xft 2 library is used.])
 AH_TEMPLATE([HAVE_XFT_UTF8],[Define if Xft library can handle utf8 encoding])
 if test ! x"$with_xft" = xno; then
+  AC_MSG_CHECKING([whether pkg-config could find freetype2])
+  if "${PKG_CONFIG}" --exists freetype2; then
+    AC_MSG_RESULT([yes])
+    CFLAGS_FREETYPE=`"${PKG_CONFIG}" --cflags freetype2`
+    FREETYPE_LIBS=`"${PKG_CONFIG}" --libs freetype2`
+    CFLAGS="$CFLAGS $CFLAGS_FREETYPE"
+    LIBS="$LIBS $FREETYPE_LIBS"
 
-  # first check for freetype2
-  have_freetype=no
-  AM_CHECK_FT2(6.1.0)
-  if test x"$no_ft" = x; then
     have_freetype=yes
   else
-    have_freetype=no
-    problem_xft=": Can't detect freetype2 >= 6.1.0/2.0.6"
+  AC_MSG_RESULT([no])
+  have_freetype=no
   fi
 
   # check for fontconfig for Xft 2
