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

Diff for /mandoc/configure between version 1.35 and 1.43.2.3

version 1.35, 2015/11/07 20:52:52 version 1.43.2.3, 2016/08/02 11:19:26
Line 1 
Line 1 
 #!/bin/sh  #!/bin/sh
 #  #
 # Copyright (c) 2014, 2015 Ingo Schwarze <schwarze@openbsd.org>  # $Id$
 #  #
   # Copyright (c) 2014, 2015, 2016 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
 # copyright notice and this permission notice appear in all copies.  # copyright notice and this permission notice appear in all copies.
Line 16 
Line 18 
   
 set -e  set -e
   
 [ -e config.log ] && mv config.log config.log.old  [ -w config.log ] && mv config.log config.log.old
 [ -e config.h   ] && mv config.h config.h.old  [ -w config.h   ] && mv config.h config.h.old
   
 # Output file descriptor usage:  # Output file descriptor usage:
 # 1 (stdout): config.h, Makefile.local  # 1 (stdout): config.h, Makefile.local
Line 33  echo "config.log: writing..."
Line 35  echo "config.log: writing..."
   
 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=
   
 CC=`printf "all:\\n\\t@echo \\\$(CC)\\n" | make -f -`  CC=`printf "all:\\n\\t@echo \\\$(CC)\\n" | env -i make -f -`
 CFLAGS="-g -W -Wall -Wstrict-prototypes -Wno-unused-parameter -Wwrite-strings"  CFLAGS="-g -W -Wall -Wmissing-prototypes -Wstrict-prototypes -Wwrite-strings"
 DBLIB=  CFLAGS="${CFLAGS} -Wno-unused-parameter"
   LDADD=
   LDFLAGS=
   LD_NANOSLEEP=
   LD_OHASH=
   LD_SQLITE3=
 STATIC="-static"  STATIC="-static"
   
 BUILD_DB=1  BUILD_DB=1
Line 50  HAVE_GETSUBOPT=
Line 58  HAVE_GETSUBOPT=
 HAVE_ISBLANK=  HAVE_ISBLANK=
 HAVE_MKDTEMP=  HAVE_MKDTEMP=
 HAVE_MMAP=  HAVE_MMAP=
   HAVE_NANOSLEEP=
 HAVE_PLEDGE=  HAVE_PLEDGE=
 HAVE_PROGNAME=  HAVE_PROGNAME=
 HAVE_REALLOCARRAY=  HAVE_REALLOCARRAY=
 HAVE_REWB_BSD=  HAVE_REWB_BSD=
 HAVE_REWB_SYSV=  HAVE_REWB_SYSV=
   HAVE_SANDBOX_INIT=
 HAVE_STRCASESTR=  HAVE_STRCASESTR=
 HAVE_STRINGLIST=  HAVE_STRINGLIST=
 HAVE_STRLCAT=  HAVE_STRLCAT=
Line 102  INSTALL_DATA=
Line 112  INSTALL_DATA=
   
 # --- manual settings from configure.local -----------------------------  # --- manual settings from configure.local -----------------------------
   
 if [ -e ./configure.local ]; then  if [ -r ./configure.local ]; then
         echo "configure.local: reading..." 1>&2          echo "configure.local: reading..." 1>&2
         echo "configure.local: reading..." 1>&3          echo "configure.local: reading..." 1>&3
         cat ./configure.local 1>&3          cat ./configure.local 1>&3
Line 173  runtest() {
Line 183  runtest() {
         return 1          return 1
 }  }
   
   # Select a UTF-8 locale.
   get_locale() {
           [ -n "${HAVE_WCHAR}" ] && [ "${HAVE_WCHAR}" -eq 0 ] && return 0
           ismanual 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
                   UTF8_LOCALE=`locale -a | grep -i '\.UTF-*8' | head -n 1`
                   [ -n "${UTF8_LOCALE}" ] || return 1
           fi
           echo "UTF8_LOCALE=${UTF8_LOCALE}" 1>&2
           echo "UTF8_LOCALE=${UTF8_LOCALE}" 1>&3
           echo 1>&3
           return 0;
   }
   
   
 # --- library functions ---  # --- library functions ---
 runtest dirent-namlen   DIRENT_NAMLEN   || true  runtest dirent-namlen   DIRENT_NAMLEN   || true
 runtest err             ERR             || true  runtest err             ERR             || true
Line 182  runtest getsubopt GETSUBOPT || true
Line 209  runtest getsubopt GETSUBOPT || true
 runtest isblank         ISBLANK         || true  runtest isblank         ISBLANK         || true
 runtest mkdtemp         MKDTEMP         || true  runtest mkdtemp         MKDTEMP         || true
 runtest mmap            MMAP            || true  runtest mmap            MMAP            || true
   runtest PATH_MAX        PATH_MAX        || true
 runtest pledge          PLEDGE          || true  runtest pledge          PLEDGE          || true
   runtest sandbox_init    SANDBOX_INIT    || true
 runtest progname        PROGNAME        || true  runtest progname        PROGNAME        || true
 runtest reallocarray    REALLOCARRAY    || true  runtest reallocarray    REALLOCARRAY    || true
 runtest rewb-bsd        REWB_BSD        || true  runtest rewb-bsd        REWB_BSD        || true
Line 195  runtest strptime STRPTIME || true
Line 224  runtest strptime STRPTIME || true
 runtest strsep          STRSEP          || true  runtest strsep          STRSEP          || true
 runtest strtonum        STRTONUM        || true  runtest strtonum        STRTONUM        || true
 runtest vasprintf       VASPRINTF       || true  runtest vasprintf       VASPRINTF       || true
 runtest wchar           WCHAR           || true  
   
   # --- wide character and locale support ---
   if get_locale; then
           runtest wchar WCHAR -DUTF8_LOCALE=\"${UTF8_LOCALE}\" || true
   else
           HAVE_WCHAR=0
           echo "wchar: no (no UTF8_LOCALE)" 1>&2
           echo "wchar: no (no UTF8_LOCALE)" 1>&3
   fi
   
 # --- sqlite3 ---  # --- sqlite3 ---
 DETECTLIB=  
 if [ ${BUILD_DB} -eq 0 ]; then  if [ ${BUILD_DB} -eq 0 ]; then
         echo "BUILD_DB=0 (manual)" 1>&2          echo "BUILD_DB=0 (manual)" 1>&2
         echo "BUILD_DB=0 (manual)" 1>&3          echo "BUILD_DB=0 (manual)" 1>&3
         echo 1>&3          echo 1>&3
         HAVE_SQLITE3=0          HAVE_SQLITE3=0
 elif ismanual sqlite3 "${HAVE_SQLITE3}"; then  elif ismanual sqlite3 "${HAVE_SQLITE3}"; then
         DETECTLIB="-lsqlite3"          if [ -z "${LD_SQLITE3}" ]; then
 elif [ -n "${DBLIB}" ]; then                  LD_SQLITE3="-lsqlite3"
         runtest sqlite3 SQLITE3 "${DBLIB}" || true          fi
   elif [ -n "${LD_SQLITE3}" ]; then
           runtest sqlite3 SQLITE3 "${LD_SQLITE3}" || true
 elif singletest sqlite3 SQLITE3 "-lsqlite3"; then  elif singletest sqlite3 SQLITE3 "-lsqlite3"; then
         DETECTLIB="-lsqlite3"          LD_SQLITE3="-lsqlite3"
 elif runtest sqlite3 SQLITE3 \  elif runtest sqlite3 SQLITE3 \
                 "-I/usr/local/include -L/usr/local/lib -lsqlite3"; then                  "-I/usr/local/include -L/usr/local/lib -lsqlite3"; then
         DETECTLIB="-L/usr/local/lib -lsqlite3"          LD_SQLITE3="-L/usr/local/lib -lsqlite3"
         CFLAGS="${CFLAGS} -I/usr/local/include"          CFLAGS="${CFLAGS} -I/usr/local/include"
 fi  fi
 if [ ${BUILD_DB} -gt 0 -a ${HAVE_SQLITE3} -eq 0 ]; then  if [ ${HAVE_SQLITE3} -eq 0 ]; then
         echo "BUILD_DB=0 (no sqlite3)" 1>&2          LD_SQLITE3=
         echo "BUILD_DB=0 (no sqlite3)" 1>&3          if [ ${BUILD_DB} -gt 0 ]; then
         echo 1>&3                  echo "BUILD_DB=0 (no sqlite3)" 1>&2
         BUILD_DB=0                  echo "BUILD_DB=0 (no sqlite3)" 1>&3
                   echo 1>&3
                   BUILD_DB=0
           fi
 fi  fi
   
 # --- sqlite3_errstr ---  # --- sqlite3_errstr ---
Line 227  if [ ${BUILD_DB} -eq 0 ]; then
Line 268  if [ ${BUILD_DB} -eq 0 ]; then
         HAVE_SQLITE3_ERRSTR=1          HAVE_SQLITE3_ERRSTR=1
 elif ismanual sqlite3_errstr "${HAVE_SQLITE3_ERRSTR}"; then  elif ismanual sqlite3_errstr "${HAVE_SQLITE3_ERRSTR}"; then
         :          :
 elif [ -n "${DBLIB}" ]; then  
         runtest sqlite3_errstr SQLITE3_ERRSTR "${DBLIB}" || true  
 else  else
         runtest sqlite3_errstr SQLITE3_ERRSTR "${DETECTLIB}" || true          runtest sqlite3_errstr SQLITE3_ERRSTR "${LD_SQLITE3}" || true
 fi  fi
   
   # --- nanosleep ---
   if [ -n "${LD_NANOSLEEP}" ]; then
           runtest nanosleep NANOSLEEP "${LD_NANOSLEEP}" || true
   elif singletest nanosleep NANOSLEEP; then
           :
   elif runtest nanosleep NANOSLEEP "-lrt"; then
           LD_NANOSLEEP="-lrt"
   fi
   if [ "${HAVE_NANOSLEEP}" -eq 0 ]; then
           echo "FATAL: nanosleep: no" 1>&2
           echo "FATAL: nanosleep: no" 1>&3
           exit 1
   fi
   
 # --- ohash ---  # --- ohash ---
 if [ ${BUILD_DB} -eq 0 ]; then  if ismanual ohash "${HAVE_OHASH}"; then
         HAVE_OHASH=1  
 elif ismanual ohash "${HAVE_OHASH}"; then  
         :          :
 elif [ -n "${DBLIB}" ]; then  elif [ -n "${LD_OHASH}" ]; then
         runtest ohash OHASH "${DBLIB}" || true          runtest ohash OHASH "${LD_OHASH}" || true
 elif singletest ohash OHASH; then  elif singletest ohash OHASH; then
         :          :
 elif runtest ohash OHASH "-lutil"; then  elif runtest ohash OHASH "-lutil"; then
         DETECTLIB="${DETECTLIB} -lutil"          LD_OHASH="-lutil"
 fi  fi
   if [ "${HAVE_OHASH}" -eq 0 ]; then
 # --- DBLIB ---          LD_OHASH=
 if [ ${BUILD_DB} -eq 0 ]; then  
         DBLIB="-lz"  
 elif [ -z "${DBLIB}" ]; then  
         DBLIB="${DETECTLIB} -lz"  
         echo "DBLIB=\"${DBLIB}\"" 1>&2  
         echo "DBLIB=\"${DBLIB}\"" 1>&3  
         echo 1>&3  
 fi  fi
   
   # --- LDADD ---
   LDADD="${LDADD} ${LD_SQLITE3} ${LD_NANOSLEEP} ${LD_OHASH} -lz"
   echo "LDADD=\"${LDADD}\"" 1>&2
   echo "LDADD=\"${LDADD}\"" 1>&3
   echo 1>&3
   
 # --- manpath ---  # --- manpath ---
 if ismanual manpath "${HAVE_MANPATH}"; then  if ismanual manpath "${HAVE_MANPATH}"; then
         :          :
Line 280  cat << __HEREDOC__
Line 330  cat << __HEREDOC__
 #error "Do not use C++.  See the INSTALL file."  #error "Do not use C++.  See the INSTALL file."
 #endif  #endif
   
 #ifndef MANDOC_CONFIG_H  #if !defined(__GNUC__) || (__GNUC__ < 4)
 #define MANDOC_CONFIG_H  #define __attribute__(x)
   #endif
   
 #if defined(__linux__) || defined(__MINT__)  #if defined(__linux__) || defined(__MINT__)
 #define _GNU_SOURCE     /* See test-*.c what needs this. */  #define _GNU_SOURCE     /* See test-*.c what needs this. */
Line 299  echo
Line 350  echo
 echo "#define MAN_CONF_FILE \"/etc/${MANM_MANCONF}\""  echo "#define MAN_CONF_FILE \"/etc/${MANM_MANCONF}\""
 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 "${HOMEBREWDIR}" ] && echo "#define HOMEBREWDIR \"${HOMEBREWDIR}\""  [ -n "${HOMEBREWDIR}" ] && echo "#define HOMEBREWDIR \"${HOMEBREWDIR}\""
   [ ${HAVE_PATH_MAX} -eq 0 ] && echo "#define PATH_MAX 4096"
   
 cat << __HEREDOC__  cat << __HEREDOC__
 #define HAVE_DIRENT_NAMLEN ${HAVE_DIRENT_NAMLEN}  #define HAVE_DIRENT_NAMLEN ${HAVE_DIRENT_NAMLEN}
Line 315  cat << __HEREDOC__
Line 368  cat << __HEREDOC__
 #define HAVE_REALLOCARRAY ${HAVE_REALLOCARRAY}  #define HAVE_REALLOCARRAY ${HAVE_REALLOCARRAY}
 #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_STRCASESTR ${HAVE_STRCASESTR}  #define HAVE_STRCASESTR ${HAVE_STRCASESTR}
 #define HAVE_STRINGLIST ${HAVE_STRINGLIST}  #define HAVE_STRINGLIST ${HAVE_STRINGLIST}
 #define HAVE_STRLCAT ${HAVE_STRLCAT}  #define HAVE_STRLCAT ${HAVE_STRLCAT}
Line 339  __HEREDOC__
Line 393  __HEREDOC__
   
 if [ ${HAVE_ERR} -eq 0 ]; then  if [ ${HAVE_ERR} -eq 0 ]; then
         echo "extern    void      err(int, const char *, ...);"          echo "extern    void      err(int, const char *, ...);"
           echo "extern    void      errx(int, const char *, ...);"
         echo "extern    void      warn(const char *, ...);"          echo "extern    void      warn(const char *, ...);"
         echo "extern    void      warnx(const char *, ...);"          echo "extern    void      warnx(const char *, ...);"
 fi  fi
Line 384  fi
Line 439  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  
 echo "#endif /* MANDOC_CONFIG_H */"  
   
 echo "config.h: written" 1>&2  echo "config.h: written" 1>&2
 echo "config.h: written" 1>&3  echo "config.h: written" 1>&3
   
Line 425  BUILD_TARGETS = ${BUILD_TARGETS}
Line 477  BUILD_TARGETS = ${BUILD_TARGETS}
 INSTALL_TARGETS = ${INSTALL_TARGETS}  INSTALL_TARGETS = ${INSTALL_TARGETS}
 CC              = ${CC}  CC              = ${CC}
 CFLAGS          = ${CFLAGS}  CFLAGS          = ${CFLAGS}
 DBLIB           = ${DBLIB}  LDADD           = ${LDADD}
   LDFLAGS         = ${LDFLAGS}
 STATIC          = ${STATIC}  STATIC          = ${STATIC}
 PREFIX          = ${PREFIX}  PREFIX          = ${PREFIX}
 BINDIR          = ${BINDIR}  BINDIR          = ${BINDIR}

Legend:
Removed from v.1.35  
changed lines
  Added in v.1.43.2.3

CVSweb