X-Git-Url: http://git.draconx.ca/gitweb/dxcommon.git/blobdiff_plain/8c45dd9fec485578a09dbf541d4209dcf77acd5f..7029e258114ecffe7a80be495fba50a70e6ab00c:/m4/base.m4 diff --git a/m4/base.m4 b/m4/base.m4 index fd9b811..c14ba68 100644 --- a/m4/base.m4 +++ b/m4/base.m4 @@ -1,6 +1,6 @@ -dnl Copyright © 2012, 2014, 2021 Nick Bowler +dnl Copyright © 2012, 2014, 2021, 2023 Nick Bowler dnl -dnl Base directory handling for dxcommon. +dnl Basic macros for dxcommon. dnl dnl License WTFPL2: Do What The Fuck You Want To Public License, version 2. dnl This is free software: you are free to do what the fuck you want to. @@ -76,3 +76,10 @@ dnl complex shell command suitable for use in shell conditionals. AC_DEFUN([DX_RUN_LOG], [{ (set -x; $1;) >&AS_MESSAGE_LOG_FD 2>&1 dx_status=$?; AS_ECHO(["\$? = $dx_status"]) >&AS_MESSAGE_LOG_FD 2>&1 test $dx_status = 0; }]) + +# DX_PATCH_MACRO([macro-name], [regexp], [replacement]) +# +# Patches the definition of macro-name by replacing substrings that match +# the given regexp (a la m4_bpatsubst). +AC_DEFUN([DX_PATCH_MACRO], [m4_ifdef([$1], + [m4_define([$1], m4_bpatsubst(m4_dquote(m4_defn([$1])), [$2], [$3]))])])