summaryrefslogtreecommitdiffstats
path: root/m4/ndim_detect_man2txt.m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4/ndim_detect_man2txt.m4')
-rw-r--r--m4/ndim_detect_man2txt.m423
1 files changed, 23 insertions, 0 deletions
diff --git a/m4/ndim_detect_man2txt.m4 b/m4/ndim_detect_man2txt.m4
new file mode 100644
index 0000000..ad08d74
--- /dev/null
+++ b/m4/ndim_detect_man2txt.m4
@@ -0,0 +1,23 @@
+# serial 1.1
+m4_pattern_forbid([NDIM_DETECT_MAN2TXT])dnl
+AC_DEFUN([NDIM_DETECT_MAN2TXT], [dnl
+AC_ARG_VAR([MAN])
+AC_PATH_PROG([MAN], [man], [false])
+AC_ARG_VAR([COL])
+AC_PATH_PROG([COL], [col], [false])
+AM_CONDITIONAL([HAVE_NDIM_MAN2TXT],
+ [test "x$MAN" != "xfalse" &&
+ test "x$COL" != "xfalse" &&
+ test "x$(echo "ABXY" | $COL -b)" = "xBY"])
+AC_MSG_CHECKING([man and col -b work correctly])
+if test "x$HAVE_NDIM_MAN2TXT_FALSE" = "x#"; then
+ AC_MSG_RESULT([yes])
+ AC_SUBST([NDIM_MAN2TXT], ['m2t(){ $(MAN) "$$(dirname "$$][1")/$$(basename "$$][1")"|$(COL) -b; }; m2t'])dnl
+else
+ AC_MSG_RESULT([no $(echo "ABXY" | $COL -b)])
+fi
+])dnl
+dnl
+dnl Local Variables:
+dnl mode: autoconf
+dnl End: