diff options
author | Arnaud Fontaine <arnau@debian.org> | 2010-08-08 22:07:50 +0100 |
---|---|---|
committer | Arnaud Fontaine <arnau@debian.org> | 2010-08-08 22:07:50 +0100 |
commit | 309b691da4d7a3c7e72f1b8a71c1fc18a7039cea (patch) | |
tree | d03445b9bbf389908e84ff4a144e312ca846f49e | |
parent | fbe66aedcf2165e43388894d3b2ee2f38e889f93 (diff) |
Add XORG_CHECK_GNU_M4 to check for GNU M4 as used mainly in xcb-util for now
-rw-r--r-- | xorg-macros.m4.in | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/xorg-macros.m4.in b/xorg-macros.m4.in index 0e84d5b..479a022 100644 --- a/xorg-macros.m4.in +++ b/xorg-macros.m4.in @@ -1111,3 +1111,35 @@ mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \ echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)" AC_SUBST([INSTALL_CMD]) ]) # XORG_INSTALL + +# XORG_CHECK_GNU_M4() +# ---------------- +# Minimum version: 1.11.0 +# +# Defines the variable GNU_M4 containing the location of GNU m4 if +# installed. +# +AC_DEFUN([XORG_CHECK_GNU_M4], [ +AC_CHECK_PROGS(GNU_M4, [m4 gm4], [no]) +if test $GNU_M4 != "no" ; then + AC_MSG_CHECKING([if $GNU_M4 supports -I]) + if $GNU_M4 -I. /dev/null > /dev/null 2>&1 ; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + # Try finding the gnu version + AC_CHECK_PROGS(GM4, gm4, [no]) + if test $GM4 = "no" ; then + AC_PATH_PROGS(GNUM4, m4, [no], [/usr/gnu/bin]) + GNU_M4="$GNUM4" + else + GNU_M4="$GM4" + fi + fi +fi +if test $GNU_M4 = "no"; then + AC_MSG_ERROR([Can't find usable GNU m4, please install it and try again]) +fi + +AC_SUBST(GNU_M4) +]) # XORG_CHECK_GNU_M4 |