=================================================================== RCS file: /cvs/mandoc/configure,v retrieving revision 1.68 retrieving revision 1.73 diff -u -p -r1.68 -r1.73 --- mandoc/configure 2019/03/04 13:01:57 1.68 +++ mandoc/configure 2020/03/13 17:31:44 1.73 @@ -1,8 +1,8 @@ #!/bin/sh # -# $Id: configure,v 1.68 2019/03/04 13:01:57 schwarze Exp $ +# $Id: configure,v 1.73 2020/03/13 17:31:44 schwarze Exp $ # -# Copyright (c) 2014-2019 Ingo Schwarze +# Copyright (c) 2014-2020 Ingo Schwarze # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above @@ -41,7 +41,7 @@ OSENUM= OSNAME= UTF8_LOCALE= -CC=`printf "all:\\n\\t@echo \\\$(CC)\\n" | env -i make -sf -` +CC=cc CFLAGS= LDADD= LDFLAGS= @@ -65,6 +65,7 @@ HAVE_FTS_COMPARE_CONST= HAVE_GETLINE= HAVE_GETSUBOPT= HAVE_ISBLANK= +HAVE_LESS_T= HAVE_MKDTEMP= HAVE_NANOSLEEP= HAVE_NTOHL= @@ -226,7 +227,7 @@ if [ -n "${OSENUM}" ]; then echo "OSENUM specified manually: ${OSENUM}" 1>&2 echo "OSENUM specified manually: ${OSENUM}" 1>&3 else - OSDETECT=$(uname) + OSDETECT=`uname` if [ "X${OSDETECT}" = "XNetBSD" ]; then OSENUM=MANDOC_OS_NETBSD elif [ "X${OSDETECT}" = "XOpenBSD" ]; then @@ -326,14 +327,34 @@ if [ ${HAVE_ENDIAN} -eq 0 -a \ exit 1 fi -if ismanual fts FTS ${HAVE_FTS}; then +if [ "$1" == "-depend" ]; then + HAVE_FTS=0 HAVE_FTS_COMPARE_CONST=0 + echo "tested fts: HAVE_FTS=0 (for make depend)" 1>&2 + echo "tested fts: HAVE_FTS=0 (for make depend)" 1>&3 + echo 1>&3 +elif ismanual fts FTS ${HAVE_FTS}; then + HAVE_FTS_COMPARE_CONST=0 elif runtest fts FTS_COMPARE_CONST -DFTS_COMPARE_CONST; then HAVE_FTS=1 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}\" || \ @@ -391,7 +412,12 @@ if [ ${BUILD_CATMAN} -gt 0 ]; then fi # --- ohash --- -if ismanual ohash OHASH "${HAVE_OHASH}"; then +if [ "$1" == "-depend" ]; then + HAVE_OHASH=0 + echo "tested ohash: HAVE_OHASH=0 (for make depend)" 1>&2 + echo "tested ohash: HAVE_OHASH=0 (for make depend)" 1>&3 + echo 1>&3 +elif ismanual ohash OHASH "${HAVE_OHASH}"; then : elif [ -n "${LD_OHASH}" ]; then runtest ohash OHASH "${LD_OHASH}" || true @@ -462,6 +488,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} @@ -513,7 +540,7 @@ fi echo "extern char *mkdtemp(char *);" if [ ${HAVE_PROGNAME} -eq 0 ]; then - echo "extern const char *getprogname(void);" + echo "extern const char *getprogname(void);" echo "extern void setprogname(const char *);" fi