=================================================================== RCS file: /cvs/mandoc/configure,v retrieving revision 1.43.2.5 retrieving revision 1.43.2.6 diff -u -p -r1.43.2.5 -r1.43.2.6 --- mandoc/configure 2016/10/20 17:51:45 1.43.2.5 +++ mandoc/configure 2016/10/20 18:52:27 1.43.2.6 @@ -1,6 +1,6 @@ #!/bin/sh # -# $Id: configure,v 1.43.2.5 2016/10/20 17:51:45 schwarze Exp $ +# $Id: configure,v 1.43.2.6 2016/10/20 18:52:27 schwarze Exp $ # # Copyright (c) 2014, 2015, 2016 Ingo Schwarze # @@ -54,6 +54,7 @@ HAVE_DIRENT_NAMLEN= HAVE_EFTYPE= HAVE_ERR= HAVE_FTS= +HAVE_FTS_COMPARE_CONST= HAVE_GETLINE= HAVE_GETSUBOPT= HAVE_ISBLANK= @@ -132,9 +133,9 @@ COMP="${CC} ${CFLAGS} -Wno-unused -Werror" # If yes, use the override, if no, do not decide anything yet. # Arguments: lower-case test name, manual value ismanual() { - [ -z "${2}" ] && return 1 - echo "${1}: manual (${2})" 1>&2 - echo "${1}: manual (${2})" 1>&3 + [ -z "${3}" ] && return 1 + echo "${1}: manual (HAVE_${2}=${3})" 1>&2 + echo "${1}: manual (HAVE_${2}=${3})" 1>&3 echo 1>&3 return 0 } @@ -145,27 +146,27 @@ ismanual() { # Arguments: lower-case test name, upper-case test name, additional CFLAGS singletest() { cat 1>&3 << __HEREDOC__ -${1}: testing... +${1}${3}: testing... ${COMP} ${3} -o test-${1} test-${1}.c __HEREDOC__ if ${COMP} ${3} -o "test-${1}" "test-${1}.c" 1>&3 2>&3; then - echo "${1}: ${CC} succeeded" 1>&3 + echo "${1}${3}: ${CC} succeeded" 1>&3 else - echo "${1}: ${CC} failed with $?" 1>&3 + echo "${1}${3}: ${CC} failed with $?" 1>&3 echo 1>&3 return 1 fi if ./test-${1} 1>&3 2>&3; then - echo "${1}: yes" 1>&2 - echo "${1}: yes" 1>&3 + echo "${1}${3}: yes" 1>&2 + echo "${1}${3}: yes" 1>&3 echo 1>&3 eval HAVE_${2}=1 rm "test-${1}" return 0 else - echo "${1}: execution failed with $?" 1>&3 + echo "${1}${3}: execution failed with $?" 1>&3 echo 1>&3 rm "test-${1}" return 1 @@ -177,9 +178,9 @@ __HEREDOC__ # Arguments: lower case name, upper case name, additional CFLAGS runtest() { eval _manual=\${HAVE_${2}} - ismanual "${1}" "${_manual}" && return 0 + ismanual "${1}" "${2}" "${_manual}" && return 0 singletest "${1}" "${2}" "${3}" && return 0 - echo "${1}: no" 1>&2 + echo "${1}${3}: no" 1>&2 eval HAVE_${2}=0 return 1 } @@ -187,7 +188,7 @@ runtest() { # Select a UTF-8 locale. get_locale() { [ -n "${HAVE_WCHAR}" ] && [ "${HAVE_WCHAR}" -eq 0 ] && return 0 - ismanual UTF8_LOCALE "$UTF8_LOCALE" && return 0 + ismanual UTF8_LOCALE UTF8_LOCALE "$UTF8_LOCALE" && return 0 echo "UTF8_LOCALE: testing..." 1>&3 UTF8_LOCALE=`locale -a | grep -i '^en_US\.UTF-*8$' | head -n 1` if [ -z "${UTF8_LOCALE}" ]; then @@ -205,7 +206,6 @@ get_locale() { runtest dirent-namlen DIRENT_NAMLEN || true runtest EFTYPE EFTYPE || true runtest err ERR || true -runtest fts FTS || true runtest getline GETLINE || true runtest getsubopt GETSUBOPT || true runtest isblank ISBLANK || true @@ -227,6 +227,14 @@ runtest strsep STRSEP || true runtest strtonum STRTONUM || true runtest vasprintf VASPRINTF || true +if 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 + # --- wide character and locale support --- if get_locale; then runtest wchar WCHAR -DUTF8_LOCALE=\"${UTF8_LOCALE}\" || true @@ -242,7 +250,7 @@ if [ ${BUILD_DB} -eq 0 ]; then echo "BUILD_DB=0 (manual)" 1>&3 echo 1>&3 HAVE_SQLITE3=0 -elif ismanual sqlite3 "${HAVE_SQLITE3}"; then +elif ismanual sqlite3 SQLITE3 "${HAVE_SQLITE3}"; then if [ -z "${LD_SQLITE3}" ]; then LD_SQLITE3="-lsqlite3" fi @@ -268,7 +276,7 @@ fi # --- sqlite3_errstr --- if [ ${BUILD_DB} -eq 0 ]; then HAVE_SQLITE3_ERRSTR=1 -elif ismanual sqlite3_errstr "${HAVE_SQLITE3_ERRSTR}"; then +elif ismanual sqlite3_errstr SQLITE3_ERRSTR "${HAVE_SQLITE3_ERRSTR}"; then : else runtest sqlite3_errstr SQLITE3_ERRSTR "${LD_SQLITE3}" || true @@ -289,7 +297,7 @@ if [ "${HAVE_NANOSLEEP}" -eq 0 ]; then fi # --- ohash --- -if ismanual ohash "${HAVE_OHASH}"; then +if ismanual ohash OHASH "${HAVE_OHASH}"; then : elif [ -n "${LD_OHASH}" ]; then runtest ohash OHASH "${LD_OHASH}" || true @@ -309,7 +317,7 @@ echo "LDADD=\"${LDADD}\"" 1>&3 echo 1>&3 # --- manpath --- -if ismanual manpath "${HAVE_MANPATH}"; then +if ismanual manpath MANPATH "${HAVE_MANPATH}"; then : elif manpath 1>&3 2>&3; then echo "manpath: yes" 1>&2 @@ -361,6 +369,7 @@ cat << __HEREDOC__ #define HAVE_DIRENT_NAMLEN ${HAVE_DIRENT_NAMLEN} #define HAVE_ERR ${HAVE_ERR} #define HAVE_FTS ${HAVE_FTS} +#define HAVE_FTS_COMPARE_CONST ${HAVE_FTS_COMPARE_CONST} #define HAVE_GETLINE ${HAVE_GETLINE} #define HAVE_GETSUBOPT ${HAVE_GETSUBOPT} #define HAVE_ISBLANK ${HAVE_ISBLANK}