Skip to content

Commit

Permalink
Remove FC_ prefix for MOC search macros
Browse files Browse the repository at this point in the history
I didn’t immediately understand that the FC_ prefix apparently means
FreeCiv, where the templates for these macros were taken from.
  • Loading branch information
Gliese852 committed Aug 8, 2024
1 parent dc406c3 commit 492c705
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ if test x"$enable_liblightdm_qt5" != "xno"; then
fi
])

FC_QT5_VALIDATE_MOC(MOC5)
QT5_VALIDATE_MOC(MOC5)
if test x$MOC5 = x; then
compile_liblightdm_qt5=no
if test "x$enable_liblightdm_qt5" != xauto; then
Expand Down Expand Up @@ -139,7 +139,7 @@ if test x"$enable_liblightdm_qt6" != "xno"; then
fi
])

FC_QT6_VALIDATE_MOC(MOC6)
QT6_VALIDATE_MOC(MOC6)
if test x$MOC6 = x; then
compile_liblightdm_qt6=no
if test "x$enable_liblightdm_qt6" != xauto; then
Expand Down
20 changes: 10 additions & 10 deletions m4/qt-validate-moc.m4
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@
# partially borrowed from freeciv qt m4 scripts

dnl Qt5
AC_DEFUN([FC_QT5_IF_QT5_MOC],
AC_DEFUN([QT5_IF_QT5_MOC],
AS_IF([$1 -v >/dev/null 2>/dev/null &&
(test "`$1 -v 2<&1 | grep -o 'Qt [[[0-9]]]\+'`" = "Qt 5" ||
test "`$1 -v 2<&1 | grep -o 'moc [[[0-9]]]\+'`" = "moc 5" ||
test "`$1 -v 2<&1 | grep -o 'moc-qt[[[0-9]]]\+'`" = "moc-qt5")],
[$2]))

dnl Set MOCCMD to $1 if it is the Qt 5 "moc".
AC_DEFUN([FC_QT5_TRY_MOC],
[FC_QT5_IF_QT5_MOC([$1], [MOCCMD="$1"])])
AC_DEFUN([QT5_TRY_MOC],
[QT5_IF_QT5_MOC([$1], [MOCCMD="$1"])])

dnl If a usable moc command is found set $1
AC_DEFUN([FC_QT5_VALIDATE_MOC], [
AC_DEFUN([QT5_VALIDATE_MOC], [
AC_MSG_CHECKING([the Qt 5 moc command])
dnl Try to find a Qt 5 'moc'
AS_IF([test "x$MOCCMD" = "x"],
[for mocpath in "moc" "qtchooser -run-tool=moc -qt=5" "moc-qt5"
do
if test "x$MOCCMD" = "x" ; then
FC_QT5_TRY_MOC([$mocpath])
QT5_TRY_MOC([$mocpath])
fi
done
AS_IF([test "x$MOCCMD" = "x"],
Expand All @@ -33,19 +33,19 @@ AC_DEFUN([FC_QT5_VALIDATE_MOC], [


dnl Qt6
AC_DEFUN([FC_QT6_IF_QT6_MOC],
AC_DEFUN([QT6_IF_QT6_MOC],
AS_IF([$1 -v >/dev/null 2>/dev/null &&
(test "`$1 -v 2<&1 | grep -o 'Qt [[[0-9]]]\+'`" = "Qt 6" ||
test "`$1 -v 2<&1 | grep -o 'moc [[[0-9]]]\+'`" = "moc 6" ||
test "`$1 -v 2<&1 | grep -o 'moc-qt[[[0-9]]]\+'`" = "moc-qt6")],
[$2]))

dnl Set MOCCMD to $1 if it is the Qt 6 "moc".
AC_DEFUN([FC_QT6_TRY_MOC],
[FC_QT6_IF_QT6_MOC([$1], [MOCCMD="$1"])])
AC_DEFUN([QT6_TRY_MOC],
[QT6_IF_QT6_MOC([$1], [MOCCMD="$1"])])

dnl If a usable moc command is found set $1
AC_DEFUN([FC_QT6_VALIDATE_MOC], [
AC_DEFUN([QT6_VALIDATE_MOC], [
AC_MSG_CHECKING([the Qt 6 moc command])
dnl Try to find a Qt 6 'moc'
Expand All @@ -58,7 +58,7 @@ AC_DEFUN([FC_QT6_VALIDATE_MOC], [
"$libdir/qt6/moc" "$libdir/qt6/libexec/moc"
do
if test "x$MOCCMD" = "x" ; then
FC_QT6_TRY_MOC([$mocpath])
QT6_TRY_MOC([$mocpath])
fi
done
AS_IF([test "x$MOCCMD" = "x"],
Expand Down

0 comments on commit 492c705

Please sign in to comment.