+
+# 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]))])])