summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnaud Fontaine <arnau@debian.org>2014-02-08 10:31:39 -0500
committerGaetan Nadon <memsize@videotron.ca>2014-02-08 10:31:39 -0500
commit7acde944f40dad08fa8c43bc2548205e343afcd1 (patch)
tree64725e3c87e190f31d10c1c4b3423fdd0d036ece
parenta5092b6a9931c8a60813f4f8a038cc5d9771d212 (diff)
Add XORG_WITH_M4 macro
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@videotron.ca>
-rw-r--r--xorg-macros.m4.in23
1 files changed, 23 insertions, 0 deletions
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