From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from localhost (fantadrom.bsd.lv [local]) by fantadrom.bsd.lv (OpenSMTPD) with ESMTPA id ec501f7f for ; Wed, 6 Mar 2019 05:19:29 -0500 (EST) Date: Wed, 6 Mar 2019 05:19:29 -0500 (EST) X-Mailinglist: mandoc-source Reply-To: source@mandoc.bsd.lv MIME-Version: 1.0 From: schwarze@mandoc.bsd.lv To: source@mandoc.bsd.lv Subject: mandoc: autoconfiguration test whether less(1) supports the -T option; X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Message-ID: Log Message: ----------- autoconfiguration test whether less(1) supports the -T option; needed for Alpine Linux because it uses busybox less(1) by default; based on a patch from Daniel Sabogal explained to me by Natanael Copa Modified Files: -------------- mandoc: configure configure.local.example main.c Revision Data ------------- Index: main.c =================================================================== RCS file: /home/cvs/mandoc/mandoc/main.c,v retrieving revision 1.321 retrieving revision 1.322 diff -Lmain.c -Lmain.c -u -p -r1.321 -r1.322 --- main.c +++ main.c @@ -1161,7 +1161,9 @@ spawn_pager(struct tag_files *tag_files) char *argv[MAX_PAGER_ARGS]; const char *pager; char *cp; +#if HAVE_LESS_T size_t cmdlen; +#endif int argc, use_ofn; pid_t pager_pid; @@ -1193,6 +1195,7 @@ spawn_pager(struct tag_files *tag_files) /* For less(1), use the tag file. */ use_ofn = 1; +#if HAVE_LESS_T if ((cmdlen = strlen(argv[0])) >= 4) { cp = argv[0] + cmdlen - 4; if (strcmp(cp, "less") == 0) { @@ -1205,6 +1208,7 @@ spawn_pager(struct tag_files *tag_files) } } } +#endif if (use_ofn) argv[argc++] = tag_files->ofn; argv[argc] = NULL; Index: configure.local.example =================================================================== RCS file: /home/cvs/mandoc/mandoc/configure.local.example,v retrieving revision 1.35 retrieving revision 1.36 diff -Lconfigure.local.example -Lconfigure.local.example -u -p -r1.35 -r1.36 --- configure.local.example +++ configure.local.example @@ -304,6 +304,7 @@ HAVE_FTS_COMPARE_CONST=0 # Setting this HAVE_GETLINE=0 HAVE_GETSUBOPT=0 HAVE_ISBLANK=0 +HAVE_LESS_T=0 HAVE_MKDTEMP=0 HAVE_NTOHL=0 HAVE_O_DIRECTORY=0 Index: configure =================================================================== RCS file: /home/cvs/mandoc/mandoc/configure,v retrieving revision 1.68 retrieving revision 1.69 diff -Lconfigure -Lconfigure -u -p -r1.68 -r1.69 --- configure +++ configure @@ -65,6 +65,7 @@ HAVE_FTS_COMPARE_CONST= HAVE_GETLINE= HAVE_GETSUBOPT= HAVE_ISBLANK= +HAVE_LESS_T= HAVE_MKDTEMP= HAVE_NANOSLEEP= HAVE_NTOHL= @@ -334,6 +335,20 @@ else runtest fts FTS || true fi +if ismanual "less -T" LESS_T ${HAVE_LESS_T}; then + : +elif less -ET /dev/null test-noop.c 1>/dev/null 2>&3; then + HAVE_LESS_T=1 + echo "tested less -T: yes" 1>&2 + echo "tested less -T: yes" 1>&3 + echo 1>&3 +else + HAVE_LESS_T=0 + echo "tested less -T: no" 1>&2 + echo "tested less -T: no" 1>&3 + echo 1>&3 +fi + # --- wide character and locale support --- if get_locale; then singletest wchar WCHAR -DUTF8_LOCALE=\"${UTF8_LOCALE}\" || \ @@ -462,6 +477,7 @@ cat << __HEREDOC__ #define HAVE_GETLINE ${HAVE_GETLINE} #define HAVE_GETSUBOPT ${HAVE_GETSUBOPT} #define HAVE_ISBLANK ${HAVE_ISBLANK} +#define HAVE_LESS_T ${HAVE_LESS_T} #define HAVE_MKDTEMP ${HAVE_MKDTEMP} #define HAVE_NTOHL ${HAVE_NTOHL} #define HAVE_PLEDGE ${HAVE_PLEDGE} -- To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv