[PATCH util-macros 2/2] Add XORG_WITH_M4 macro

Gaetan Nadon memsize at videotron.ca
Sat Feb 8 08:00:42 PST 2014


From: Arnaud Fontaine <arnau at debian.org>

Originally from XCB, this macro checks for the presence of m4 or gm4
which supports -I dir.

The AC_PATH_PROGS_FEATURE_CHECK autoconf macro requires autoconf 2.62.

Signed-off-by: Gaetan Nadon <memsize at videotron.ca>
---
 xorg-macros.m4.in |   23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/xorg-macros.m4.in b/xorg-macros.m4.in
index 200a36b..1680f32 100644
--- a/xorg-macros.m4.in
+++ b/xorg-macros.m4.in
@@ -882,6 +882,29 @@ fi])
 AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
 ]) # XORG_WITH_FOP
 
+# XORG_WITH_M4([MIN-VERSION])
+# ---------------------------
+# Minimum version: 1.19.0
+#
+# This macro attempts to locate an m4 macro processor which supports
+# -I option and is only useful for modules relying on M4 in order to
+# expand macros in source code files.
+#
+# Interface to module:
+# M4:	 	returns the path of the m4 program found
+#		returns the path set by the user in the environment
+#
+AC_DEFUN([XORG_WITH_M4], [
+AC_CACHE_CHECK([for m4 that supports -I option], [ac_cv_path_M4],
+   [AC_PATH_PROGS_FEATURE_CHECK([M4], [m4 gm4],
+       [[$ac_path_M4 -I. /dev/null > /dev/null 2>&1 && \
+         ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:]],
+   [AC_MSG_ERROR([could not find m4 that supports -I option])],
+   [$PATH:/usr/gnu/bin])])
+
+AC_SUBST([M4], [$ac_cv_path_M4])
+]) # XORG_WITH_M4
+
 # XORG_WITH_PS2PDF([DEFAULT])
 # ----------------
 # Minimum version: 1.6.0
-- 
1.7.9.5



More information about the xorg-devel mailing list