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

Annotation of mandoc/configure, Revision 1.58

1.1       schwarze    1: #!/bin/sh
                      2: #
1.58    ! schwarze    3: # $Id: configure,v 1.57 2017/02/08 16:11:41 schwarze Exp $
1.47      schwarze    4: #
1.38      schwarze    5: # Copyright (c) 2014, 2015, 2016 Ingo Schwarze <schwarze@openbsd.org>
1.1       schwarze    6: #
                      7: # Permission to use, copy, modify, and distribute this software for any
                      8: # purpose with or without fee is hereby granted, provided that the above
                      9: # copyright notice and this permission notice appear in all copies.
                     10: #
                     11: # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                     12: # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                     13: # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                     14: # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                     15: # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                     16: # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                     17: # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                     18:
1.11      schwarze   19: set -e
                     20:
1.36      schwarze   21: [ -w config.log ] && mv config.log config.log.old
                     22: [ -w config.h   ] && mv config.h config.h.old
1.11      schwarze   23:
                     24: # Output file descriptor usage:
                     25: # 1 (stdout): config.h, Makefile.local
                     26: # 2 (stderr): original stderr, usually to the console
                     27: # 3: config.log
                     28:
                     29: exec 3> config.log
                     30: echo "config.log: writing..."
                     31:
                     32: # --- default settings -------------------------------------------------
                     33: # Initialize all variables here,
                     34: # such that nothing can leak in from the environment.
                     35:
1.24      schwarze   36: MANPATH_DEFAULT="/usr/share/man:/usr/X11R6/man:/usr/local/man"
1.11      schwarze   37: OSNAME=
1.48      schwarze   38: UTF8_LOCALE=
1.11      schwarze   39:
1.51      schwarze   40: CC=`printf "all:\\n\\t@echo \\\$(CC)\\n" | env -i make -sf -`
1.42      schwarze   41: CFLAGS="-g -W -Wall -Wmissing-prototypes -Wstrict-prototypes -Wwrite-strings"
                     42: CFLAGS="${CFLAGS} -Wno-unused-parameter"
1.38      schwarze   43: LDADD=
1.39      schwarze   44: LDFLAGS=
1.47      schwarze   45: LD_NANOSLEEP=
1.38      schwarze   46: LD_OHASH=
1.57      schwarze   47: LD_RECVMSG=
1.11      schwarze   48: STATIC="-static"
                     49:
                     50: BUILD_CGI=0
1.56      schwarze   51: BUILD_CATMAN=0
1.54      schwarze   52: INSTALL_LIBMANDOC=0
1.11      schwarze   53:
1.57      schwarze   54: HAVE_CMSG=
                     55: HAVE_CMSG_XPG42=0
1.11      schwarze   56: HAVE_DIRENT_NAMLEN=
1.46      schwarze   57: HAVE_EFTYPE=
1.50      schwarze   58: HAVE_ENDIAN=
1.28      schwarze   59: HAVE_ERR=
1.11      schwarze   60: HAVE_FTS=
1.52      schwarze   61: HAVE_FTS_COMPARE_CONST=
1.35      schwarze   62: HAVE_GETLINE=
1.11      schwarze   63: HAVE_GETSUBOPT=
1.23      schwarze   64: HAVE_ISBLANK=
                     65: HAVE_MKDTEMP=
1.47      schwarze   66: HAVE_NANOSLEEP=
1.50      schwarze   67: HAVE_NTOHL=
1.45      schwarze   68: HAVE_OHASH=
1.49      schwarze   69: HAVE_PATH_MAX=
1.30      schwarze   70: HAVE_PLEDGE=
1.28      schwarze   71: HAVE_PROGNAME=
1.11      schwarze   72: HAVE_REALLOCARRAY=
1.57      schwarze   73: HAVE_RECVMSG=
1.31      schwarze   74: HAVE_REWB_BSD=
                     75: HAVE_REWB_SYSV=
1.40      kristaps   76: HAVE_SANDBOX_INIT=
1.11      schwarze   77: HAVE_STRCASESTR=
1.26      schwarze   78: HAVE_STRINGLIST=
1.11      schwarze   79: HAVE_STRLCAT=
                     80: HAVE_STRLCPY=
                     81: HAVE_STRPTIME=
                     82: HAVE_STRSEP=
1.19      schwarze   83: HAVE_STRTONUM=
1.50      schwarze   84: HAVE_SYS_ENDIAN=
1.23      schwarze   85: HAVE_VASPRINTF=
1.11      schwarze   86: HAVE_WCHAR=
                     87:
                     88: PREFIX="/usr/local"
                     89: BINDIR=
                     90: SBINDIR=
                     91: INCLUDEDIR=
                     92: LIBDIR=
                     93: MANDIR=
1.18      schwarze   94: HOMEBREWDIR=
1.11      schwarze   95:
                     96: WWWPREFIX="/var/www"
                     97: HTDOCDIR=
                     98: CGIBINDIR=
                     99:
1.16      schwarze  100: BINM_APROPOS="apropos"
1.58    ! schwarze  101: BINM_CATMAN="catman"
1.26      schwarze  102: BINM_MAKEWHATIS="makewhatis"
1.16      schwarze  103: BINM_MAN="man"
1.26      schwarze  104: BINM_SOELIM="soelim"
1.16      schwarze  105: BINM_WHATIS="whatis"
                    106: MANM_MAN="man"
1.25      schwarze  107: MANM_MANCONF="man.conf"
1.16      schwarze  108: MANM_MDOC="mdoc"
                    109: MANM_ROFF="roff"
                    110: MANM_EQN="eqn"
                    111: MANM_TBL="tbl"
                    112:
1.11      schwarze  113: INSTALL="install"
                    114: INSTALL_PROGRAM=
                    115: INSTALL_LIB=
                    116: INSTALL_MAN=
                    117: INSTALL_DATA=
                    118:
                    119: # --- manual settings from configure.local -----------------------------
1.8       schwarze  120:
1.36      schwarze  121: if [ -r ./configure.local ]; then
1.11      schwarze  122:        echo "configure.local: reading..." 1>&2
                    123:        echo "configure.local: reading..." 1>&3
                    124:        cat ./configure.local 1>&3
                    125:        . ./configure.local
                    126: else
                    127:        echo "configure.local: no (fully automatic configuration)" 1>&2
                    128:        echo "configure.local: no (fully automatic configuration)" 1>&3
                    129: fi
                    130: echo 1>&3
                    131:
                    132: # --- tests for config.h  ----------------------------------------------
                    133:
                    134: COMP="${CC} ${CFLAGS} -Wno-unused -Werror"
                    135:
                    136: # Check whether this HAVE_ setting is manually overridden.
                    137: # If yes, use the override, if no, do not decide anything yet.
                    138: # Arguments: lower-case test name, manual value
                    139: ismanual() {
1.52      schwarze  140:        [ -z "${3}" ] && return 1
                    141:        echo "${1}: manual (HAVE_${2}=${3})" 1>&2
                    142:        echo "${1}: manual (HAVE_${2}=${3})" 1>&3
1.11      schwarze  143:        echo 1>&3
                    144:        return 0
                    145: }
                    146:
                    147: # Run a single autoconfiguration test.
                    148: # In case of success, enable the feature.
                    149: # In case of failure, do not decide anything yet.
                    150: # Arguments: lower-case test name, upper-case test name, additional CFLAGS
                    151: singletest() {
                    152:        cat 1>&3 << __HEREDOC__
1.52      schwarze  153: ${1}${3}: testing...
1.55      schwarze  154: ${COMP} -o test-${1} test-${1}.c ${3}
1.11      schwarze  155: __HEREDOC__
                    156:
1.55      schwarze  157:        if ${COMP} -o "test-${1}" "test-${1}.c" ${3} 1>&3 2>&3; then
1.52      schwarze  158:                echo "${1}${3}: ${CC} succeeded" 1>&3
1.11      schwarze  159:        else
1.52      schwarze  160:                echo "${1}${3}: ${CC} failed with $?" 1>&3
1.11      schwarze  161:                echo 1>&3
                    162:                return 1
                    163:        fi
1.1       schwarze  164:
1.11      schwarze  165:        if ./test-${1} 1>&3 2>&3; then
1.52      schwarze  166:                echo "${1}${3}: yes" 1>&2
                    167:                echo "${1}${3}: yes" 1>&3
1.11      schwarze  168:                echo 1>&3
                    169:                eval HAVE_${2}=1
                    170:                rm "test-${1}"
                    171:                return 0
                    172:        else
1.52      schwarze  173:                echo "${1}${3}: execution failed with $?" 1>&3
1.11      schwarze  174:                echo 1>&3
                    175:                rm "test-${1}"
                    176:                return 1
                    177:        fi
                    178: }
1.1       schwarze  179:
1.11      schwarze  180: # Run a complete autoconfiguration test, including the check for
                    181: # a manual override and disabling the feature on failure.
                    182: # Arguments: lower case name, upper case name, additional CFLAGS
1.1       schwarze  183: runtest() {
1.11      schwarze  184:        eval _manual=\${HAVE_${2}}
1.52      schwarze  185:        ismanual "${1}" "${2}" "${_manual}" && return 0
1.11      schwarze  186:        singletest "${1}" "${2}" "${3}" && return 0
1.52      schwarze  187:        echo "${1}${3}: no" 1>&2
1.11      schwarze  188:        eval HAVE_${2}=0
                    189:        return 1
1.1       schwarze  190: }
                    191:
1.48      schwarze  192: # Select a UTF-8 locale.
                    193: get_locale() {
                    194:        [ -n "${HAVE_WCHAR}" ] && [ "${HAVE_WCHAR}" -eq 0 ] && return 0
1.53      schwarze  195:        ismanual UTF8_LOCALE UTF8_LOCALE "$UTF8_LOCALE" && return 0
1.48      schwarze  196:        echo "UTF8_LOCALE: testing..." 1>&3
                    197:        UTF8_LOCALE=`locale -a | grep -i '^en_US\.UTF-*8$' | head -n 1`
                    198:        if [ -z "${UTF8_LOCALE}" ]; then
                    199:                UTF8_LOCALE=`locale -a | grep -i '\.UTF-*8' | head -n 1`
                    200:                [ -n "${UTF8_LOCALE}" ] || return 1
                    201:        fi
                    202:        echo "UTF8_LOCALE=${UTF8_LOCALE}" 1>&2
                    203:        echo "UTF8_LOCALE=${UTF8_LOCALE}" 1>&3
                    204:        echo 1>&3
                    205:        return 0;
                    206: }
                    207:
                    208:
1.11      schwarze  209: # --- library functions ---
                    210: runtest dirent-namlen  DIRENT_NAMLEN   || true
1.50      schwarze  211: runtest be32toh                ENDIAN          || true
                    212: runtest be32toh                SYS_ENDIAN      -DSYS_ENDIAN || true
1.46      schwarze  213: runtest EFTYPE         EFTYPE          || true
1.28      schwarze  214: runtest err            ERR             || true
1.35      schwarze  215: runtest getline                GETLINE         || true
1.11      schwarze  216: runtest getsubopt      GETSUBOPT       || true
1.23      schwarze  217: runtest isblank                ISBLANK         || true
                    218: runtest mkdtemp                MKDTEMP         || true
1.50      schwarze  219: runtest ntohl          NTOHL           || true
1.49      schwarze  220: runtest PATH_MAX       PATH_MAX        || true
1.30      schwarze  221: runtest pledge         PLEDGE          || true
1.40      kristaps  222: runtest sandbox_init   SANDBOX_INIT    || true
1.28      schwarze  223: runtest progname       PROGNAME        || true
1.11      schwarze  224: runtest reallocarray   REALLOCARRAY    || true
1.31      schwarze  225: runtest rewb-bsd       REWB_BSD        || true
                    226: runtest rewb-sysv      REWB_SYSV       || true
1.11      schwarze  227: runtest strcasestr     STRCASESTR      || true
1.26      schwarze  228: runtest stringlist     STRINGLIST      || true
1.11      schwarze  229: runtest strlcat                STRLCAT         || true
                    230: runtest strlcpy                STRLCPY         || true
                    231: runtest strptime       STRPTIME        || true
                    232: runtest strsep         STRSEP          || true
1.19      schwarze  233: runtest strtonum       STRTONUM        || true
1.23      schwarze  234: runtest vasprintf      VASPRINTF       || true
1.48      schwarze  235:
1.50      schwarze  236: if [ ${HAVE_ENDIAN} -eq 0 -a \
                    237:      ${HAVE_SYS_ENDIAN} -eq 0 -a \
                    238:      ${HAVE_NTOHL} -eq 0 ]; then
                    239:        echo "FATAL: no endian conversion functions found" 1>&2
                    240:        echo "FATAL: no endian conversion functions found" 1>&3
                    241:        exit 1
                    242: fi
                    243:
1.52      schwarze  244: if ismanual fts FTS ${HAVE_FTS}; then
                    245:        HAVE_FTS_COMPARE_CONST=0
                    246: elif runtest fts FTS_COMPARE_CONST -DFTS_COMPARE_CONST; then
                    247:        HAVE_FTS=1
                    248: else
                    249:        runtest fts FTS || true
                    250: fi
                    251:
1.48      schwarze  252: # --- wide character and locale support ---
                    253: if get_locale; then
                    254:        runtest wchar WCHAR -DUTF8_LOCALE=\"${UTF8_LOCALE}\" || true
                    255: else
                    256:        HAVE_WCHAR=0
                    257:        echo "wchar: no (no UTF8_LOCALE)" 1>&2
                    258:        echo "wchar: no (no UTF8_LOCALE)" 1>&3
                    259: fi
1.11      schwarze  260:
1.47      schwarze  261: # --- nanosleep ---
                    262: if [ -n "${LD_NANOSLEEP}" ]; then
                    263:        runtest nanosleep NANOSLEEP "${LD_NANOSLEEP}" || true
                    264: elif singletest nanosleep NANOSLEEP; then
                    265:        :
                    266: elif runtest nanosleep NANOSLEEP "-lrt"; then
                    267:        LD_NANOSLEEP="-lrt"
                    268: fi
                    269: if [ "${HAVE_NANOSLEEP}" -eq 0 ]; then
                    270:        echo "FATAL: nanosleep: no" 1>&2
                    271:        echo "FATAL: nanosleep: no" 1>&3
                    272:        exit 1
                    273: fi
                    274:
1.57      schwarze  275: if [ ${BUILD_CATMAN} -gt 0 ]; then
                    276:        # --- recvmsg ---
                    277:        if [ -n "${LD_RECVMSG}" ]; then
                    278:                runtest recvmsg RECVMSG "${LD_RECVMSG}" || true
                    279:        elif singletest recvmsg RECVMSG; then
                    280:                :
                    281:        elif runtest recvmsg RECVMSG "-lsocket"; then
                    282:                LD_RECVMSG="-lsocket"
                    283:        fi
                    284:        if [ "${HAVE_RECVMSG}" -eq 0 ]; then
                    285:                echo "FATAL: recvmsg: no" 1>&2
                    286:                echo "FATAL: recvmsg: no" 1>&3
                    287:                echo "Without recvmsg(2), you cannot BUILD_CATMAN." 1>&2
                    288:                exit 1
                    289:        fi
                    290:
                    291:        # --- cmsg ---
                    292:        if singletest cmsg CMSG; then
                    293:                :
                    294:        elif runtest cmsg CMSG "-D_XPG4_2"; then
                    295:                HAVE_CMSG_XPG42=1
                    296:        fi
                    297:        if [ "${HAVE_CMSG}" -eq 0 ]; then
                    298:                echo "FATAL: cmsg: no" 1>&2
                    299:                echo "FATAL: cmsg: no" 1>&3
                    300:                echo "Without CMSG_FIRSTHDR(3), you cannot BUILD_CATMAN." 1>&2
                    301:                exit 1
                    302:        fi
                    303: fi
                    304:
1.11      schwarze  305: # --- ohash ---
1.52      schwarze  306: if ismanual ohash OHASH "${HAVE_OHASH}"; then
1.11      schwarze  307:        :
1.38      schwarze  308: elif [ -n "${LD_OHASH}" ]; then
                    309:        runtest ohash OHASH "${LD_OHASH}" || true
1.11      schwarze  310: elif singletest ohash OHASH; then
                    311:        :
                    312: elif runtest ohash OHASH "-lutil"; then
1.38      schwarze  313:        LD_OHASH="-lutil"
                    314: fi
                    315: if [ "${HAVE_OHASH}" -eq 0 ]; then
                    316:        LD_OHASH=
1.11      schwarze  317: fi
                    318:
1.38      schwarze  319: # --- LDADD ---
1.57      schwarze  320: LDADD="${LDADD} ${LD_NANOSLEEP} ${LD_RECVMSG} ${LD_OHASH} -lz"
1.38      schwarze  321: echo "LDADD=\"${LDADD}\"" 1>&2
                    322: echo "LDADD=\"${LDADD}\"" 1>&3
                    323: echo 1>&3
1.11      schwarze  324:
                    325: # --- write config.h ---
                    326:
                    327: exec > config.h
                    328:
                    329: cat << __HEREDOC__
1.33      schwarze  330: #ifdef __cplusplus
                    331: #error "Do not use C++.  See the INSTALL file."
                    332: #endif
                    333:
1.43      schwarze  334: #if !defined(__GNUC__) || (__GNUC__ < 4)
                    335: #define __attribute__(x)
                    336: #endif
1.11      schwarze  337:
                    338: #if defined(__linux__) || defined(__MINT__)
1.14      schwarze  339: #define _GNU_SOURCE    /* See test-*.c what needs this. */
1.11      schwarze  340: #endif
                    341:
                    342: __HEREDOC__
                    343:
1.35      schwarze  344: [ ${HAVE_GETLINE} -eq 0 -o ${HAVE_REALLOCARRAY} -eq 0 -o \
1.11      schwarze  345:   ${HAVE_STRLCAT} -eq 0 -o ${HAVE_STRLCPY} -eq 0 ] \
                    346:        && echo "#include <sys/types.h>"
1.23      schwarze  347: [ ${HAVE_VASPRINTF} -eq 0 ] && echo "#include <stdarg.h>"
1.35      schwarze  348: [ ${HAVE_GETLINE} -eq 0 ] && echo "#include <stdio.h>"
1.11      schwarze  349:
1.1       schwarze  350: echo
1.25      schwarze  351: echo "#define MAN_CONF_FILE \"/etc/${MANM_MANCONF}\""
1.24      schwarze  352: echo "#define MANPATH_DEFAULT \"${MANPATH_DEFAULT}\""
1.11      schwarze  353: [ -n "${OSNAME}" ] && echo "#define OSNAME \"${OSNAME}\""
1.48      schwarze  354: [ -n "${UTF8_LOCALE}" ] && echo "#define UTF8_LOCALE \"${UTF8_LOCALE}\""
1.18      schwarze  355: [ -n "${HOMEBREWDIR}" ] && echo "#define HOMEBREWDIR \"${HOMEBREWDIR}\""
1.46      schwarze  356: [ ${HAVE_EFTYPE} -eq 0 ] && echo "#define EFTYPE EINVAL"
1.49      schwarze  357: [ ${HAVE_PATH_MAX} -eq 0 ] && echo "#define PATH_MAX 4096"
1.50      schwarze  358: if [ ${HAVE_ENDIAN} -eq 0 -a ${HAVE_SYS_ENDIAN} -eq 0 ]; then
                    359:        echo "#define be32toh ntohl"
                    360:        echo "#define htobe32 htonl"
                    361: fi
1.11      schwarze  362:
                    363: cat << __HEREDOC__
1.57      schwarze  364: #define HAVE_CMSG_XPG42 ${HAVE_CMSG_XPG42}
1.11      schwarze  365: #define HAVE_DIRENT_NAMLEN ${HAVE_DIRENT_NAMLEN}
1.50      schwarze  366: #define HAVE_ENDIAN ${HAVE_ENDIAN}
1.28      schwarze  367: #define HAVE_ERR ${HAVE_ERR}
1.11      schwarze  368: #define HAVE_FTS ${HAVE_FTS}
1.52      schwarze  369: #define HAVE_FTS_COMPARE_CONST ${HAVE_FTS_COMPARE_CONST}
1.35      schwarze  370: #define HAVE_GETLINE ${HAVE_GETLINE}
1.11      schwarze  371: #define HAVE_GETSUBOPT ${HAVE_GETSUBOPT}
1.23      schwarze  372: #define HAVE_ISBLANK ${HAVE_ISBLANK}
                    373: #define HAVE_MKDTEMP ${HAVE_MKDTEMP}
1.50      schwarze  374: #define HAVE_NTOHL ${HAVE_NTOHL}
1.30      schwarze  375: #define HAVE_PLEDGE ${HAVE_PLEDGE}
1.28      schwarze  376: #define HAVE_PROGNAME ${HAVE_PROGNAME}
1.11      schwarze  377: #define HAVE_REALLOCARRAY ${HAVE_REALLOCARRAY}
1.31      schwarze  378: #define HAVE_REWB_BSD ${HAVE_REWB_BSD}
                    379: #define HAVE_REWB_SYSV ${HAVE_REWB_SYSV}
1.40      kristaps  380: #define HAVE_SANDBOX_INIT ${HAVE_SANDBOX_INIT}
1.11      schwarze  381: #define HAVE_STRCASESTR ${HAVE_STRCASESTR}
1.26      schwarze  382: #define HAVE_STRINGLIST ${HAVE_STRINGLIST}
1.11      schwarze  383: #define HAVE_STRLCAT ${HAVE_STRLCAT}
                    384: #define HAVE_STRLCPY ${HAVE_STRLCPY}
                    385: #define HAVE_STRPTIME ${HAVE_STRPTIME}
                    386: #define HAVE_STRSEP ${HAVE_STRSEP}
1.19      schwarze  387: #define HAVE_STRTONUM ${HAVE_STRTONUM}
1.50      schwarze  388: #define HAVE_SYS_ENDIAN ${HAVE_SYS_ENDIAN}
1.23      schwarze  389: #define HAVE_VASPRINTF ${HAVE_VASPRINTF}
1.11      schwarze  390: #define HAVE_WCHAR ${HAVE_WCHAR}
                    391: #define HAVE_OHASH ${HAVE_OHASH}
                    392:
1.16      schwarze  393: #define BINM_APROPOS "${BINM_APROPOS}"
1.58    ! schwarze  394: #define BINM_CATMAN "${BINM_CATMAN}"
1.26      schwarze  395: #define BINM_MAKEWHATIS "${BINM_MAKEWHATIS}"
1.16      schwarze  396: #define BINM_MAN "${BINM_MAN}"
1.26      schwarze  397: #define BINM_SOELIM "${BINM_SOELIM}"
1.16      schwarze  398: #define BINM_WHATIS "${BINM_WHATIS}"
1.11      schwarze  399:
                    400: __HEREDOC__
1.28      schwarze  401:
                    402: if [ ${HAVE_ERR} -eq 0 ]; then
                    403:        echo "extern    void      err(int, const char *, ...);"
1.37      schwarze  404:        echo "extern    void      errx(int, const char *, ...);"
1.28      schwarze  405:        echo "extern    void      warn(const char *, ...);"
                    406:        echo "extern    void      warnx(const char *, ...);"
                    407: fi
1.35      schwarze  408:
                    409: [ ${HAVE_GETLINE} -eq 0 ] && \
                    410:        echo "extern    ssize_t   getline(char **, size_t *, FILE *);"
1.11      schwarze  411:
1.13      schwarze  412: [ ${HAVE_GETSUBOPT} -eq 0 ] && \
1.11      schwarze  413:        echo "extern    int       getsubopt(char **, char * const *, char **);"
                    414:
1.23      schwarze  415: [ ${HAVE_ISBLANK} -eq 0 ] && \
                    416:        echo "extern    int       isblank(int);"
                    417:
                    418: [ ${HAVE_MKDTEMP} -eq 0 ] && \
                    419:        echo "extern    char     *mkdtemp(char *);"
1.29      schwarze  420:
                    421: if [ ${HAVE_PROGNAME} -eq 0 ]; then
                    422:        echo "extern    const char *getprogname(void);"
                    423:        echo "extern    void      setprogname(const char *);"
                    424: fi
1.23      schwarze  425:
1.11      schwarze  426: [ ${HAVE_REALLOCARRAY} -eq 0 ] && \
                    427:        echo "extern    void     *reallocarray(void *, size_t, size_t);"
                    428:
                    429: [ ${HAVE_STRCASESTR} -eq 0 ] && \
                    430:        echo "extern    char     *strcasestr(const char *, const char *);"
                    431:
                    432: [ ${HAVE_STRLCAT} -eq 0 ] && \
                    433:        echo "extern    size_t    strlcat(char *, const char *, size_t);"
                    434:
                    435: [ ${HAVE_STRLCPY} -eq 0 ] && \
                    436:        echo "extern    size_t    strlcpy(char *, const char *, size_t);"
                    437:
                    438: [ ${HAVE_STRSEP} -eq 0 ] && \
                    439:        echo "extern    char     *strsep(char **, const char *);"
1.19      schwarze  440:
                    441: [ ${HAVE_STRTONUM} -eq 0 ] && \
                    442:        echo "extern    long long strtonum(const char *, long long, long long, const char **);"
1.23      schwarze  443:
                    444: [ ${HAVE_VASPRINTF} -eq 0 ] && \
                    445:        echo "extern    int       vasprintf(char **, const char *, va_list);"
1.11      schwarze  446:
                    447: echo "config.h: written" 1>&2
                    448: echo "config.h: written" 1>&3
                    449:
                    450: # --- tests for Makefile.local -----------------------------------------
                    451:
                    452: exec > Makefile.local
                    453:
                    454: [ -z "${BINDIR}"     ] && BINDIR="${PREFIX}/bin"
                    455: [ -z "${SBINDIR}"    ] && SBINDIR="${PREFIX}/sbin"
                    456: [ -z "${INCLUDEDIR}" ] && INCLUDEDIR="${PREFIX}/include/mandoc"
                    457: [ -z "${LIBDIR}"     ] && LIBDIR="${PREFIX}/lib/mandoc"
                    458: [ -z "${MANDIR}"     ] && MANDIR="${PREFIX}/man"
                    459:
                    460: [ -z "${HTDOCDIR}"   ] && HTDOCDIR="${WWWPREFIX}/htdocs"
                    461: [ -z "${CGIBINDIR}"  ] && CGIBINDIR="${WWWPREFIX}/cgi-bin"
                    462:
                    463: [ -z "${INSTALL_PROGRAM}" ] && INSTALL_PROGRAM="${INSTALL} -m 0555"
                    464: [ -z "${INSTALL_LIB}"     ] && INSTALL_LIB="${INSTALL} -m 0444"
                    465: [ -z "${INSTALL_MAN}"     ] && INSTALL_MAN="${INSTALL} -m 0444"
                    466: [ -z "${INSTALL_DATA}"    ] && INSTALL_DATA="${INSTALL} -m 0444"
                    467:
1.44      schwarze  468: BUILD_TARGETS=
1.56      schwarze  469: [ ${BUILD_CGI} -gt 0 ] && BUILD_TARGETS="man.cgi"
                    470: [ ${BUILD_CATMAN} -gt 0 ] && \
                    471:        BUILD_TARGETS="${BUILD_TARGETS} mandocd catman"
1.44      schwarze  472: INSTALL_TARGETS=
1.54      schwarze  473: [ ${INSTALL_LIBMANDOC} -gt 0 ] && INSTALL_TARGETS="lib-install"
                    474: [ ${BUILD_CGI} -gt 0 ] && INSTALL_TARGETS="${INSTALL_TARGETS} cgi-install"
1.56      schwarze  475: [ ${BUILD_CATMAN} -gt 0 ] && \
                    476:        INSTALL_TARGETS="${INSTALL_TARGETS} catman-install"
1.11      schwarze  477:
                    478: cat << __HEREDOC__
                    479: BUILD_TARGETS  = ${BUILD_TARGETS}
1.15      schwarze  480: INSTALL_TARGETS        = ${INSTALL_TARGETS}
1.22      schwarze  481: CC             = ${CC}
1.11      schwarze  482: CFLAGS         = ${CFLAGS}
1.38      schwarze  483: LDADD          = ${LDADD}
1.39      schwarze  484: LDFLAGS                = ${LDFLAGS}
1.11      schwarze  485: STATIC         = ${STATIC}
                    486: PREFIX         = ${PREFIX}
                    487: BINDIR         = ${BINDIR}
                    488: SBINDIR                = ${SBINDIR}
                    489: INCLUDEDIR     = ${INCLUDEDIR}
                    490: LIBDIR         = ${LIBDIR}
                    491: MANDIR         = ${MANDIR}
                    492: WWWPREFIX      = ${WWWPREFIX}
                    493: HTDOCDIR       = ${HTDOCDIR}
                    494: CGIBINDIR      = ${CGIBINDIR}
1.16      schwarze  495: BINM_APROPOS   = ${BINM_APROPOS}
1.58    ! schwarze  496: BINM_CATMAN    = ${BINM_CATMAN}
1.26      schwarze  497: BINM_MAKEWHATIS        = ${BINM_MAKEWHATIS}
1.16      schwarze  498: BINM_MAN       = ${BINM_MAN}
1.26      schwarze  499: BINM_SOELIM    = ${BINM_SOELIM}
1.16      schwarze  500: BINM_WHATIS    = ${BINM_WHATIS}
                    501: MANM_MAN       = ${MANM_MAN}
1.25      schwarze  502: MANM_MANCONF   = ${MANM_MANCONF}
1.16      schwarze  503: MANM_MDOC      = ${MANM_MDOC}
                    504: MANM_ROFF      = ${MANM_ROFF}
                    505: MANM_EQN       = ${MANM_EQN}
                    506: MANM_TBL       = ${MANM_TBL}
1.11      schwarze  507: INSTALL                = ${INSTALL}
                    508: INSTALL_PROGRAM        = ${INSTALL_PROGRAM}
                    509: INSTALL_LIB    = ${INSTALL_LIB}
                    510: INSTALL_MAN    = ${INSTALL_MAN}
                    511: INSTALL_DATA   = ${INSTALL_DATA}
                    512: __HEREDOC__
                    513:
                    514: echo "Makefile.local: written" 1>&2
                    515: echo "Makefile.local: written" 1>&3
1.1       schwarze  516:
                    517: exit 0

CVSweb