From 54c85353652d7c8a4c3eeb53e4dd25beadfb674b Mon Sep 17 00:00:00 2001 From: Christophe CURIS Date: Sun, 8 Aug 2021 09:58:45 +0200 Subject: [PATCH] Configure: Add an error message when using deprecated "--with-defsdatadir" --- configure.ac | 6 ++++++ m4/windowmaker.m4 | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/configure.ac b/configure.ac index ea1b8c6f..4b6a3409 100644 --- a/configure.ac +++ b/configure.ac @@ -846,6 +846,12 @@ AC_ARG_WITH([pkgconfdir], [AC_MSG_ERROR([bad path '$withval' for pkgconfdir, expecting an absolute path])])], [with_pkgconfdir=""]) +dnl Provide a message when trying to use "--with-defsdatadir" so that user can update its +dnl arguments. Otherwise only a warning is issued, which is likely to be missed, which will +dnl lead to perceived misbehaviour much later (and hard to debug). +WM_DENY_ARG_WITH([defsdatadir], + [AC_MSG_ERROR([option "--with-defsdatadir" have been replaced by "--with-pkgconfdir"])]) + AS_IF([test "x$with_pkgconfdir" != "x"], [pkgconfdir="$with_pkgconfdir"], [pkgconfdir='${sysconfdir}/${PACKAGE_TARNAME}']) diff --git a/m4/windowmaker.m4 b/m4/windowmaker.m4 index e4a92527..87263e04 100644 --- a/m4/windowmaker.m4 +++ b/m4/windowmaker.m4 @@ -24,6 +24,15 @@ m4_pattern_forbid([^_?WM_]) m4_pattern_allow([^WM_OSDEP(_[A-Z]*)?$]) +# WM_DENY_ARG_WITH(PACKAGE, ACTION-IF-GIVEN) +# +# Check if the argument "--with-PACKAGE" was used, and if it is the case +# execute ACTION-IF-GIVEN which is supposed to call AC_MSG_ERROR to +# stop any further processing and tell the user its arguments are bad +AC_DEFUN([WM_DENY_ARG_WITH], +[AS_IF([test "${[with_]m4_translit([$1], [-+.], [___])+set}" = set], [$2])]) + + # WM_CHECK_XFT_VERSION(MIN_VERSION, [ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]]) # # $XFT_CFLAGS should be defined before calling this macro,