From 6287c1f34ece76e88f16f227976d042512de2b01 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Sat, 13 Aug 2011 18:12:28 -0400 Subject: [PATCH] Add checks for nroff -c and -Tascii flags --HG-- branch : 1.7 --- configure | 37 ++++++++++++++++++++++++++++++++++++- configure.in | 25 ++++++++++++++++++++++++- 2 files changed, 60 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 3945e3143..f7ca48142 100755 --- a/configure +++ b/configure @@ -13608,7 +13608,42 @@ fi test -n "$NROFFPROG" && break done -if test -z "$NROFFPROG"; then +if test -n "$NROFFPROG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $NROFFPROG supports the -c option" >&5 +$as_echo_n "checking whether $NROFFPROG supports the -c option... " >&6; } +if ${sudo_cv_var_nroff_opt_c+:} false; then : + $as_echo_n "(cached) " >&6 +else + if $NROFFPROG -c /dev/null 2>&1; then + sudo_cv_var_nroff_opt_c=yes + else + sudo_cv_var_nroff_opt_c=no + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $sudo_cv_var_nroff_opt_c" >&5 +$as_echo "$sudo_cv_var_nroff_opt_c" >&6; } + if test "$sudo_cv_var_nroff_opt_c" = "yes"; then + NROFFPROG="$NROFFPROG -c" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $NROFFPROG supports the -Tascii option" >&5 +$as_echo_n "checking whether $NROFFPROG supports the -Tascii option... " >&6; } +if ${sudo_cv_var_nroff_opt_Tascii+:} false; then : + $as_echo_n "(cached) " >&6 +else + if $NROFFPROG -Tascii /dev/null 2>&1; then + sudo_cv_var_nroff_opt_Tascii=yes + else + sudo_cv_var_nroff_opt_Tascii=no + fi + if test "$sudo_cv_var_nroff_opt_Tascii" = "yes"; then + NROFFPROG="$NROFFPROG -Tascii" + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $sudo_cv_var_nroff_opt_Tascii" >&5 +$as_echo "$sudo_cv_var_nroff_opt_Tascii" >&6; } +else MANTYPE="cat" mansrcdir='$(srcdir)' fi diff --git a/configure.in b/configure.in index 358ef67f1..962f8fce0 100644 --- a/configure.in +++ b/configure.in @@ -1389,7 +1389,30 @@ dnl AC_CHECK_PROG(UNAMEPROG, [uname], [uname]) AC_CHECK_PROG(TRPROG, [tr], [tr]) AC_CHECK_PROGS(NROFFPROG, [nroff mandoc]) -if test -z "$NROFFPROG"; then +if test -n "$NROFFPROG"; then + AC_CACHE_CHECK([whether $NROFFPROG supports the -c option], + [sudo_cv_var_nroff_opt_c], + [if $NROFFPROG -c /dev/null 2>&1; then + sudo_cv_var_nroff_opt_c=yes + else + sudo_cv_var_nroff_opt_c=no + fi] + ) + if test "$sudo_cv_var_nroff_opt_c" = "yes"; then + NROFFPROG="$NROFFPROG -c" + fi + AC_CACHE_CHECK([whether $NROFFPROG supports the -Tascii option], + [sudo_cv_var_nroff_opt_Tascii], + [if $NROFFPROG -Tascii /dev/null 2>&1; then + sudo_cv_var_nroff_opt_Tascii=yes + else + sudo_cv_var_nroff_opt_Tascii=no + fi] + if test "$sudo_cv_var_nroff_opt_Tascii" = "yes"; then + NROFFPROG="$NROFFPROG -Tascii" + fi + ) +else MANTYPE="cat" mansrcdir='$(srcdir)' fi -- 2.40.0