[BACK]Return to configure CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / mandoc

Diff for /mandoc/configure between version 1.62 and 1.66

version 1.62, 2017/03/04 16:36:29 version 1.66, 2018/07/31 15:34:00
Line 2 
Line 2 
 #  #
 # $Id$  # $Id$
 #  #
 # Copyright (c) 2014, 2015, 2016, 2017 Ingo Schwarze <schwarze@openbsd.org>  # Copyright (c) 2014,2015,2016,2017,2018 Ingo Schwarze <schwarze@openbsd.org>
 #  #
 # Permission to use, copy, modify, and distribute this software for any  # Permission to use, copy, modify, and distribute this software for any
 # purpose with or without fee is hereby granted, provided that the above  # purpose with or without fee is hereby granted, provided that the above
Line 27  set -e
Line 27  set -e
 # 3: config.log  # 3: config.log
   
 exec 3> config.log  exec 3> config.log
 echo "config.log: writing..."  echo "file config.log: writing..."
   
 # --- default settings -------------------------------------------------  # --- default settings -------------------------------------------------
 # Initialize all variables here,  # Initialize all variables here,
Line 35  echo "config.log: writing..."
Line 35  echo "config.log: writing..."
   
 SOURCEDIR=`dirname "$0"`  SOURCEDIR=`dirname "$0"`
   
   MANPATH_BASE="/usr/share/man:/usr/X11R6/man"
 MANPATH_DEFAULT="/usr/share/man:/usr/X11R6/man:/usr/local/man"  MANPATH_DEFAULT="/usr/share/man:/usr/X11R6/man:/usr/local/man"
 OSNAME=  OSNAME=
 UTF8_LOCALE=  UTF8_LOCALE=
   
 CC=`printf "all:\\n\\t@echo \\\$(CC)\\n" | env -i make -sf -`  CC=`printf "all:\\n\\t@echo \\\$(CC)\\n" | env -i make -sf -`
 CFLAGS="-g -W -Wall -Wmissing-prototypes -Wstrict-prototypes -Wwrite-strings"  CFLAGS=
 CFLAGS="${CFLAGS} -Wno-unused-parameter"  
 LDADD=  LDADD=
 LDFLAGS=  LDFLAGS=
 LD_NANOSLEEP=  LD_NANOSLEEP=
 LD_OHASH=  LD_OHASH=
 LD_RECVMSG=  LD_RECVMSG=
 STATIC="-static"  STATIC=
   
 BUILD_CGI=0  BUILD_CGI=0
 BUILD_CATMAN=0  BUILD_CATMAN=0
Line 73  HAVE_PATH_MAX=
Line 73  HAVE_PATH_MAX=
 HAVE_PLEDGE=  HAVE_PLEDGE=
 HAVE_PROGNAME=  HAVE_PROGNAME=
 HAVE_REALLOCARRAY=  HAVE_REALLOCARRAY=
   HAVE_RECALLOCARRAY=
 HAVE_RECVMSG=  HAVE_RECVMSG=
 HAVE_REWB_BSD=  HAVE_REWB_BSD=
 HAVE_REWB_SYSV=  HAVE_REWB_SYSV=
Line 81  HAVE_STRCASESTR=
Line 82  HAVE_STRCASESTR=
 HAVE_STRINGLIST=  HAVE_STRINGLIST=
 HAVE_STRLCAT=  HAVE_STRLCAT=
 HAVE_STRLCPY=  HAVE_STRLCPY=
   HAVE_STRNDUP=
 HAVE_STRPTIME=  HAVE_STRPTIME=
 HAVE_STRSEP=  HAVE_STRSEP=
 HAVE_STRTONUM=  HAVE_STRTONUM=
Line 124  LN="ln -f"
Line 126  LN="ln -f"
 # --- manual settings from configure.local -----------------------------  # --- manual settings from configure.local -----------------------------
   
 if [ -r ./configure.local ]; then  if [ -r ./configure.local ]; then
         echo "configure.local: reading..." 1>&2          echo "file configure.local: reading..." 1>&2
         echo "configure.local: reading..." 1>&3          echo "file configure.local: reading..." 1>&3
         cat ./configure.local 1>&3          cat ./configure.local 1>&3
         . ./configure.local          . ./configure.local
 else  else
         echo "configure.local: no (fully automatic configuration)" 1>&2          echo "file configure.local: no (fully automatic configuration)" 1>&2
         echo "configure.local: no (fully automatic configuration)" 1>&3          echo "file configure.local: no (fully automatic configuration)" 1>&3
 fi  fi
 echo 1>&3  echo 1>&3
   
 # --- tests for config.h  ----------------------------------------------  # --- tests functions --------------------------------------------------
   
 COMP="${CC} ${CFLAGS} -Wno-unused -Werror"  
   
 # Check whether this HAVE_ setting is manually overridden.  # Check whether this HAVE_ setting is manually overridden.
 # If yes, use the override, if no, do not decide anything yet.  # If yes, use the override, if no, do not decide anything yet.
 # Arguments: lower-case test name, manual value  # Arguments: test file name, test var name, manual value
 ismanual() {  ismanual() {
         [ -z "${3}" ] && return 1          [ -z "${3}" ] && return 1
         echo "${1}: manual (HAVE_${2}=${3})" 1>&2          echo "tested ${1}: HAVE_${2}=${3} (manual)" 1>&2
         echo "${1}: manual (HAVE_${2}=${3})" 1>&3          echo "tested ${1}: HAVE_${2}=${3} (manual)" 1>&3
         echo 1>&3          echo 1>&3
         return 0          return 0
 }  }
Line 152  ismanual() {
Line 152  ismanual() {
 # Run a single autoconfiguration test.  # Run a single autoconfiguration test.
 # In case of success, enable the feature.  # In case of success, enable the feature.
 # In case of failure, do not decide anything yet.  # In case of failure, do not decide anything yet.
 # Arguments: lower-case test name, upper-case test name, additional CFLAGS  # Arguments: test file name, test var name, additional CFLAGS
 singletest() {  singletest() {
         cat 1>&3 << __HEREDOC__          cat 1>&3 << __HEREDOC__
 ${1}${3}: testing...  testing ${1}${3} ...
 ${COMP} -o test-${1} test-${1}.c ${3}  ${COMP} -o test-${1} test-${1}.c ${3}
 __HEREDOC__  __HEREDOC__
   
         if ${COMP} -o "test-${1}" "${SOURCEDIR}/test-${1}.c" ${3} 1>&3 2>&3          if ${COMP} -o "test-${1}" "${SOURCEDIR}/test-${1}.c" ${3} 1>&3 2>&3
         then          then
                 echo "${1}${3}: ${CC} succeeded" 1>&3                  echo "partial result of ${1}${3}: ${CC} succeeded" 1>&3
         else          else
                 echo "${1}${3}: ${CC} failed with $?" 1>&3                  echo "result of ${1}${3}: ${CC} failed with exit status $?" 1>&3
                   echo "result of compiling ${1}${3}: no" 1>&3
                 echo 1>&3                  echo 1>&3
                 return 1                  return 1
         fi          fi
   
         if ./test-${1} 1>&3 2>&3; then          if ./test-${1} 1>&3 2>&3; then
                 echo "${1}${3}: yes" 1>&2                  echo "tested ${1}${3}: yes" 1>&2
                 echo "${1}${3}: yes" 1>&3                  echo "result of running ${1}${3}: yes" 1>&3
                 echo 1>&3                  echo 1>&3
                 eval HAVE_${2}=1                  eval HAVE_${2}=1
                 rm "test-${1}"                  rm "test-${1}"
                 return 0                  return 0
         else          else
                 echo "${1}${3}: execution failed with $?" 1>&3                  echo "result of ${1}${3}: execution failed with exit status $?" 1>&3
                   echo "result of running ${1}${3}: no" 1>&3
                 echo 1>&3                  echo 1>&3
                 rm "test-${1}"                  rm "test-${1}"
                 return 1                  return 1
Line 185  __HEREDOC__
Line 187  __HEREDOC__
   
 # Run a complete autoconfiguration test, including the check for  # Run a complete autoconfiguration test, including the check for
 # a manual override and disabling the feature on failure.  # a manual override and disabling the feature on failure.
 # Arguments: lower case name, upper case name, additional CFLAGS  # Arguments: test file name, test var name, additional CFLAGS
 runtest() {  runtest() {
         eval _manual=\${HAVE_${2}}          eval _manual=\${HAVE_${2}}
         ismanual "${1}" "${2}" "${_manual}" && return 0          ismanual "${1}" "${2}" "${_manual}" && return 0
         singletest "${1}" "${2}" "${3}" && return 0          singletest "${1}" "${2}" "${3}" && return 0
         echo "${1}${3}: no" 1>&2          echo "tested ${1}${3}: no" 1>&2
         eval HAVE_${2}=0          eval HAVE_${2}=0
         return 1          return 1
 }  }
Line 199  runtest() {
Line 201  runtest() {
 get_locale() {  get_locale() {
         [ -n "${HAVE_WCHAR}" ] && [ "${HAVE_WCHAR}" -eq 0 ] && return 0          [ -n "${HAVE_WCHAR}" ] && [ "${HAVE_WCHAR}" -eq 0 ] && return 0
         ismanual UTF8_LOCALE UTF8_LOCALE "$UTF8_LOCALE" && return 0          ismanual UTF8_LOCALE UTF8_LOCALE "$UTF8_LOCALE" && return 0
         echo "UTF8_LOCALE: testing..." 1>&3          echo "testing UTF8_LOCALE ..." 1>&3
         UTF8_LOCALE=`locale -a | grep -i '^en_US\.UTF-*8$' | head -n 1`          UTF8_LOCALE=`locale -a | grep -i '^en_US\.UTF-*8$' | head -n 1`
         if [ -z "${UTF8_LOCALE}" ]; then          if [ -z "${UTF8_LOCALE}" ]; then
                 UTF8_LOCALE=`locale -a | grep -i '\.UTF-*8' | head -n 1`                  UTF8_LOCALE=`locale -a | grep -i '\.UTF-*8' | head -n 1`
                 [ -n "${UTF8_LOCALE}" ] || return 1                  [ -n "${UTF8_LOCALE}" ] || return 1
         fi          fi
         echo "UTF8_LOCALE=${UTF8_LOCALE}" 1>&2          echo "selected UTF8_LOCALE=${UTF8_LOCALE}" 1>&2
         echo "UTF8_LOCALE=${UTF8_LOCALE}" 1>&3          echo "selected UTF8_LOCALE=${UTF8_LOCALE}" 1>&3
         echo 1>&3          echo 1>&3
         return 0;          return 0;
 }  }
   
   # --- compiler options -------------------------------------------------
   
   if [ -n "${CFLAGS}" ]; then
           COMP="${CC} ${CFLAGS}"
           echo "selected CFLAGS=\"${CFLAGS}\" (manual)" 1>&2
           echo "selected CFLAGS=\"${CFLAGS}\" (manual)" 1>&3
           echo 1>&3
   else
           CFLAGS="-g -W -Wall -Wmissing-prototypes -Wstrict-prototypes"
           CFLAGS="${CFLAGS} -Wwrite-strings -Wno-unused-parameter"
           COMP="${CC} ${CFLAGS} -Wno-unused -Werror"
           echo -n "tested ${CC} -W: " 1>&2
           echo -n "testing ${CC} -W: " 1>&3
           runtest noop WFLAG || true
           if [ "${HAVE_WFLAG}" -eq 0 ]; then
                   CFLAGS="-g"
                   COMP="${CC} ${CFLAGS}"
           fi
           echo "selected CFLAGS=\"${CFLAGS}\"" 1>&2
           echo "selected CFLAGS=\"${CFLAGS}\"" 1>&3
           echo 1>&3
   fi
   
   if [ -n "${STATIC}" ]; then
           echo "selected STATIC=\"${STATIC}\" (manual)" 1>&2
           echo "selected STATIC=\"${STATIC}\" (manual)" 1>&3
           echo 1>&3
   else
           runtest noop STATIC -static || true
           [ ${HAVE_STATIC} -eq 0 ] || STATIC="-static"
           echo "selected STATIC=\"${STATIC}\"" 1>&2
           echo "selected STATIC=\"${STATIC}\"" 1>&3
           echo 1>&3
   fi
   
   # --- tests for config.h  ----------------------------------------------
   
 # --- library functions ---  # --- library functions ---
 runtest dirent-namlen   DIRENT_NAMLEN   || true  runtest dirent-namlen   DIRENT_NAMLEN   || true
 runtest be32toh         ENDIAN          || true  runtest be32toh         ENDIAN          || true
Line 229  runtest pledge  PLEDGE  || true
Line 267  runtest pledge  PLEDGE  || true
 runtest sandbox_init    SANDBOX_INIT    || true  runtest sandbox_init    SANDBOX_INIT    || true
 runtest progname        PROGNAME        || true  runtest progname        PROGNAME        || true
 runtest reallocarray    REALLOCARRAY    || true  runtest reallocarray    REALLOCARRAY    || true
   runtest recallocarray   RECALLOCARRAY   || true
 runtest rewb-bsd        REWB_BSD        || true  runtest rewb-bsd        REWB_BSD        || true
 runtest rewb-sysv       REWB_SYSV       || true  runtest rewb-sysv       REWB_SYSV       || true
 runtest strcasestr      STRCASESTR      || true  runtest strcasestr      STRCASESTR      || true
 runtest stringlist      STRINGLIST      || true  runtest stringlist      STRINGLIST      || true
 runtest strlcat         STRLCAT         || true  runtest strlcat         STRLCAT         || true
 runtest strlcpy         STRLCPY         || true  runtest strlcpy         STRLCPY         || true
   runtest strndup         STRNDUP         || true
 runtest strptime        STRPTIME        || true  runtest strptime        STRPTIME        || true
 runtest strsep          STRSEP          || true  runtest strsep          STRSEP          || true
 runtest strtonum        STRTONUM        || true  runtest strtonum        STRTONUM        || true
Line 261  if get_locale; then
Line 301  if get_locale; then
         runtest wchar WCHAR -DUTF8_LOCALE=\"${UTF8_LOCALE}\" || true          runtest wchar WCHAR -DUTF8_LOCALE=\"${UTF8_LOCALE}\" || true
 else  else
         HAVE_WCHAR=0          HAVE_WCHAR=0
         echo "wchar: no (no UTF8_LOCALE)" 1>&2          echo "tested wchar: no (no UTF8_LOCALE)" 1>&2
         echo "wchar: no (no UTF8_LOCALE)" 1>&3          echo "tested wchar: no (no UTF8_LOCALE)" 1>&3
           echo 1>&3
 fi  fi
   
 # --- nanosleep ---  # --- nanosleep ---
Line 325  fi
Line 366  fi
   
 # --- LDADD ---  # --- LDADD ---
 LDADD="${LDADD} ${LD_NANOSLEEP} ${LD_RECVMSG} ${LD_OHASH} -lz"  LDADD="${LDADD} ${LD_NANOSLEEP} ${LD_RECVMSG} ${LD_OHASH} -lz"
 echo "LDADD=\"${LDADD}\"" 1>&2  echo "selected LDADD=\"${LDADD}\"" 1>&2
 echo "LDADD=\"${LDADD}\"" 1>&3  echo "selected LDADD=\"${LDADD}\"" 1>&3
 echo 1>&3  echo 1>&3
   
 # --- write config.h ---  # --- write config.h ---
Line 348  cat << __HEREDOC__
Line 389  cat << __HEREDOC__
   
 __HEREDOC__  __HEREDOC__
   
 [ ${HAVE_GETLINE} -eq 0 -o ${HAVE_REALLOCARRAY} -eq 0 -o \  [ ${HAVE_GETLINE} -eq 0 -o \
   ${HAVE_STRLCAT} -eq 0 -o ${HAVE_STRLCPY} -eq 0 ] \    ${HAVE_REALLOCARRAY} -eq 0 -o ${HAVE_RECALLOCARRAY} -eq 0 -o \
     ${HAVE_STRLCAT} -eq 0 -o ${HAVE_STRLCPY} -eq 0 -o \
     ${HAVE_STRNDUP} -eq 0 ] \
         && echo "#include <sys/types.h>"          && echo "#include <sys/types.h>"
 [ ${HAVE_VASPRINTF} -eq 0 ] && echo "#include <stdarg.h>"  [ ${HAVE_VASPRINTF} -eq 0 ] && echo "#include <stdarg.h>"
 [ ${HAVE_GETLINE} -eq 0 ] && echo "#include <stdio.h>"  [ ${HAVE_GETLINE} -eq 0 ] && echo "#include <stdio.h>"
   
 echo  echo
 echo "#define MAN_CONF_FILE \"/etc/${MANM_MANCONF}\""  echo "#define MAN_CONF_FILE \"/etc/${MANM_MANCONF}\""
   echo "#define MANPATH_BASE \"${MANPATH_BASE}\""
 echo "#define MANPATH_DEFAULT \"${MANPATH_DEFAULT}\""  echo "#define MANPATH_DEFAULT \"${MANPATH_DEFAULT}\""
 [ -n "${OSNAME}" ] && echo "#define OSNAME \"${OSNAME}\""  [ -n "${OSNAME}" ] && echo "#define OSNAME \"${OSNAME}\""
 [ -n "${UTF8_LOCALE}" ] && echo "#define UTF8_LOCALE \"${UTF8_LOCALE}\""  [ -n "${UTF8_LOCALE}" ] && echo "#define UTF8_LOCALE \"${UTF8_LOCALE}\""
Line 383  cat << __HEREDOC__
Line 427  cat << __HEREDOC__
 #define HAVE_PLEDGE ${HAVE_PLEDGE}  #define HAVE_PLEDGE ${HAVE_PLEDGE}
 #define HAVE_PROGNAME ${HAVE_PROGNAME}  #define HAVE_PROGNAME ${HAVE_PROGNAME}
 #define HAVE_REALLOCARRAY ${HAVE_REALLOCARRAY}  #define HAVE_REALLOCARRAY ${HAVE_REALLOCARRAY}
   #define HAVE_RECALLOCARRAY ${HAVE_RECALLOCARRAY}
 #define HAVE_REWB_BSD ${HAVE_REWB_BSD}  #define HAVE_REWB_BSD ${HAVE_REWB_BSD}
 #define HAVE_REWB_SYSV ${HAVE_REWB_SYSV}  #define HAVE_REWB_SYSV ${HAVE_REWB_SYSV}
 #define HAVE_SANDBOX_INIT ${HAVE_SANDBOX_INIT}  #define HAVE_SANDBOX_INIT ${HAVE_SANDBOX_INIT}
Line 390  cat << __HEREDOC__
Line 435  cat << __HEREDOC__
 #define HAVE_STRINGLIST ${HAVE_STRINGLIST}  #define HAVE_STRINGLIST ${HAVE_STRINGLIST}
 #define HAVE_STRLCAT ${HAVE_STRLCAT}  #define HAVE_STRLCAT ${HAVE_STRLCAT}
 #define HAVE_STRLCPY ${HAVE_STRLCPY}  #define HAVE_STRLCPY ${HAVE_STRLCPY}
   #define HAVE_STRNDUP ${HAVE_STRNDUP}
 #define HAVE_STRPTIME ${HAVE_STRPTIME}  #define HAVE_STRPTIME ${HAVE_STRPTIME}
 #define HAVE_STRSEP ${HAVE_STRSEP}  #define HAVE_STRSEP ${HAVE_STRSEP}
 #define HAVE_STRTONUM ${HAVE_STRTONUM}  #define HAVE_STRTONUM ${HAVE_STRTONUM}
Line 434  fi
Line 480  fi
 [ ${HAVE_REALLOCARRAY} -eq 0 ] && \  [ ${HAVE_REALLOCARRAY} -eq 0 ] && \
         echo "extern    void     *reallocarray(void *, size_t, size_t);"          echo "extern    void     *reallocarray(void *, size_t, size_t);"
   
   [ ${HAVE_RECALLOCARRAY} -eq 0 ] && \
           echo "extern    void     *recallocarray(void *, size_t, size_t, size_t);"
   
 [ ${HAVE_STRCASESTR} -eq 0 ] && \  [ ${HAVE_STRCASESTR} -eq 0 ] && \
         echo "extern    char     *strcasestr(const char *, const char *);"          echo "extern    char     *strcasestr(const char *, const char *);"
   
Line 443  fi
Line 492  fi
 [ ${HAVE_STRLCPY} -eq 0 ] && \  [ ${HAVE_STRLCPY} -eq 0 ] && \
         echo "extern    size_t    strlcpy(char *, const char *, size_t);"          echo "extern    size_t    strlcpy(char *, const char *, size_t);"
   
   [ ${HAVE_STRNDUP} -eq 0 ] && \
           echo "extern    char     *strndup(const char *, size_t);"
   
 [ ${HAVE_STRSEP} -eq 0 ] && \  [ ${HAVE_STRSEP} -eq 0 ] && \
         echo "extern    char     *strsep(char **, const char *);"          echo "extern    char     *strsep(char **, const char *);"
   
Line 452  fi
Line 504  fi
 [ ${HAVE_VASPRINTF} -eq 0 ] && \  [ ${HAVE_VASPRINTF} -eq 0 ] && \
         echo "extern    int       vasprintf(char **, const char *, va_list);"          echo "extern    int       vasprintf(char **, const char *, va_list);"
   
 echo "config.h: written" 1>&2  echo "file config.h: written" 1>&2
 echo "config.h: written" 1>&3  echo "file config.h: written" 1>&3
   
 # --- tests for Makefile.local -----------------------------------------  # --- tests for Makefile.local -----------------------------------------
   
Line 522  INSTALL_DATA = ${INSTALL_DATA}
Line 574  INSTALL_DATA = ${INSTALL_DATA}
 LN              = ${LN}  LN              = ${LN}
 __HEREDOC__  __HEREDOC__
   
 echo "Makefile.local: written" 1>&2  echo "file Makefile.local: written" 1>&2
 echo "Makefile.local: written" 1>&3  echo "file Makefile.local: written" 1>&3
   
 exit 0  exit 0

Legend:
Removed from v.1.62  
changed lines
  Added in v.1.66

CVSweb