diff --git a/Dockerfile b/Dockerfile index 217a24e8..aa4cf552 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ ENV GID 1234 ENV UID 1234 RUN DEBIAN_FRONTEND=noninteractive RUNLEVEL=1 apt-get update -RUN DEBIAN_FRONTEND=noninteractive RUNLEVEL=1 apt-get -y install build-essential libssl-dev autoconf automake flex libpcre3-dev byacc gawk git vim procps net-tools iputils-ping bind9-host +RUN DEBIAN_FRONTEND=noninteractive RUNLEVEL=1 apt-get -y install build-essential libssl-dev autoconf automake flex libpcre3-dev byacc gawk git vim procps net-tools iputils-ping bind9-host libgit2-dev openssh-client #libgeoip-dev libmaxminddb-dev # Perl dependencies for iauthd.pl (commented out - using TypeScript version) @@ -31,8 +31,9 @@ WORKDIR /home/nefarious/nefarious2 # I cant get the maxminddb library to compile in at all in debian 12, give up on geoip for now # --with-geoip=/usr --with-mmdb=/usr \ -RUN ./configure --libdir=/home/nefarious/ircd --enable-debug --with-maxcon=4096 +RUN ./configure --libdir=/home/nefarious/ircd --enable-debug --with-maxcon=4096 --with-libgit2=/usr RUN make +# make install runs an interactive SSL generator - pre-create pem to skip, then remove so entrypoint generates fresh one RUN touch /home/nefarious/ircd/ircd.pem && make install && rm /home/nefarious/ircd/ircd.pem # Build iauthd-ts @@ -53,8 +54,7 @@ RUN ln -sf /dev/stdout /home/nefarious/ircd/ircd.log USER root #Clean up build RUN rm -rf /home/nefarious/nefarious2 -RUN apt-get remove -y build-essential && apt-get autoremove -y -RUN apt-get clean +RUN apt-get remove -y build-essential && apt-get autoremove -y && apt-get clean USER nefarious @@ -71,6 +71,7 @@ COPY tools/docker/base.conf-dist /home/nefarious/ircd/base.conf-dist COPY tools/docker/ircd.conf /home/nefarious/ircd/ircd.conf COPY tools/docker/linesync.conf /home/nefarious/ircd/linesync.conf +# Run entrypoint (volume permissions fixed by init container in docker-compose) ENTRYPOINT ["/home/nefarious/dockerentrypoint.sh"] CMD ["/home/nefarious/bin/ircd", "-n", "-x", "5", "-f", "ircd-docker.conf"] diff --git a/config.h.in b/config.h.in index 6c4b04ce..b13bbb47 100644 --- a/config.h.in +++ b/config.h.in @@ -33,27 +33,27 @@ /* Define to 1 if you have the header file. */ #undef HAVE_CRYPT_H -/* Define to 1 if you have the `getrusage' function. */ +/* Define to 1 if you have the 'getrusage' function. */ #undef HAVE_GETRUSAGE +/* Define to 1 if you have the header file. */ +#undef HAVE_GIT2_H + /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H -/* Define to 1 if you have the `kqueue' function. */ +/* Define to 1 if you have the 'kqueue' function. */ #undef HAVE_KQUEUE -/* Define to 1 if you have the `nsl' library (-lnsl). */ +/* Define to 1 if you have the 'nsl' library (-lnsl). */ #undef HAVE_LIBNSL -/* Define to 1 if you have the `resolv' library (-lresolv). */ +/* Define to 1 if you have the 'resolv' library (-lresolv). */ #undef HAVE_LIBRESOLV -/* Define to 1 if you have the `socket' library (-lsocket). */ +/* Define to 1 if you have the 'socket' library (-lsocket). */ #undef HAVE_LIBSOCKET -/* Define to 1 if you have the header file. */ -#undef HAVE_MEMORY_H - /* Define to 1 if you have the header file. */ #undef HAVE_POLL_H @@ -61,12 +61,15 @@ signal. */ #undef HAVE_RESTARTABLE_SYSCALLS -/* Define to 1 if you have the `setrlimit' function. */ +/* Define to 1 if you have the 'setrlimit' function. */ #undef HAVE_SETRLIMIT /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H +/* Define to 1 if you have the header file. */ +#undef HAVE_STDIO_H + /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H @@ -97,13 +100,16 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TIME_H + /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have that is POSIX.1 compatible. */ #undef HAVE_SYS_WAIT_H -/* Define to 1 if you have the `times' function. */ +/* Define to 1 if you have the 'times' function. */ #undef HAVE_TIMES /* Define to 1 if you have the header file. */ @@ -169,22 +175,22 @@ /* Define if you have POSIX signals. */ #undef POSIX_SIGNALS -/* The size of `int', as computed by sizeof. */ +/* The size of 'int', as computed by sizeof. */ #undef SIZEOF_INT -/* The size of `int64_t', as computed by sizeof. */ +/* The size of 'int64_t', as computed by sizeof. */ #undef SIZEOF_INT64_T -/* The size of `long', as computed by sizeof. */ +/* The size of 'long', as computed by sizeof. */ #undef SIZEOF_LONG -/* The size of `long long', as computed by sizeof. */ +/* The size of 'long long', as computed by sizeof. */ #undef SIZEOF_LONG_LONG -/* The size of `short', as computed by sizeof. */ +/* The size of 'short', as computed by sizeof. */ #undef SIZEOF_SHORT -/* The size of `void *', as computed by sizeof. */ +/* The size of 'void *', as computed by sizeof. */ #undef SIZEOF_VOID_P /* Path to executable for restarts */ @@ -196,16 +202,19 @@ /* Path name used as a base for the ssl lib files. */ #undef SSL_LIBS_PATH -/* Define to 1 if you have the ANSI C header files. */ +/* Define to 1 if all of the C89 standard headers exist (not just the ones + required in a freestanding environment). This macro is provided for + backward compatibility; new code need not use it. */ #undef STDC_HEADERS /* Define if you have (unreliable) SysV signals. */ #undef SYSV_UNRELIABLE_SIGNALS -/* Define to 1 if you can safely include both and . */ +/* Define to 1 if you can safely include both and . This + macro is obsolete. */ #undef TIME_WITH_SYS_TIME -/* Define to 1 if your declares `struct tm'. */ +/* Define to 1 if your declares 'struct tm'. */ #undef TM_IN_SYS_TIME /* Define to enable the /dev/poll engine */ @@ -223,6 +232,12 @@ /* Define to enable the kqueue engine */ #undef USE_KQUEUE +/* Define if you are using libgit2 for gitsync */ +#undef USE_LIBGIT2 + +/* Define if you are using LMDB for chathistory */ +#undef USE_LMDB + /* Define if you are using MaxMindDB */ #undef USE_MMDB @@ -232,6 +247,9 @@ /* Define if you are using OpenSSL */ #undef USE_SSL +/* Define if you are using zstd compression */ +#undef USE_ZSTD + /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD @@ -244,36 +262,36 @@ # endif #endif -/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a - `char[]'. */ +/* Define to 1 if 'lex' declares 'yytext' as a 'char *' by default, not a + 'char[]'. */ #undef YYTEXT_POINTER -/* Define to `int' if doesn't define. */ +/* Define as 'int' if doesn't define. */ #undef gid_t -/* Define to `short' if does not define. */ +/* Define to 'short' if does not define. */ #undef int16_t -/* Define to `long' if does not define. */ +/* Define to 'long' if does not define. */ #undef int32_t -/* Define to `long long' if does not define. */ +/* Define to 'long long' if does not define. */ #undef int64_t -/* Define to `unsigned int' if does not define. */ +/* Define as 'unsigned int' if doesn't define. */ #undef size_t /* type to use in place of socklen_t if not defined */ #undef socklen_t -/* Define to `int' if doesn't define. */ +/* Define as 'int' if doesn't define. */ #undef uid_t -/* Define to `unsigned short' if does not define. */ +/* Define to 'unsigned short' if does not define. */ #undef uint16_t -/* Define to `unsigned long' if does not define. */ +/* Define to 'unsigned long' if does not define. */ #undef uint32_t -/* Define to `unsigned long long' if does not define. */ +/* Define to 'unsigned long long' if does not define. */ #undef uint64_t diff --git a/configure b/configure index 3b6da6a8..31d4f791 100755 --- a/configure +++ b/configure @@ -1,9 +1,10 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69. +# Generated by GNU Autoconf 2.72. # # -# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# Copyright (C) 1992-1996, 1998-2017, 2020-2023 Free Software Foundation, +# Inc. # # # This configure script is free software; the Free Software Foundation @@ -14,63 +15,65 @@ # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in #( +else case e in #( + e) case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; +esac ;; esac fi + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then +if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || @@ -79,13 +82,6 @@ if test "${PATH_SEPARATOR+set}" != set; then fi -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( @@ -94,43 +90,27 @@ case $0 in #(( for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS ;; esac -# We did not find ourselves, most probably we were run as `sh COMMAND' +# We did not find ourselves, most probably we were run as 'sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. @@ -151,26 +131,28 @@ case $- in # (((( esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 -as_fn_exit 255 +# out after a failed 'exec'. +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + as_bourne_compatible="if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST -else - case \`(set -o) 2>/dev/null\` in #( +else case e in #( + e) case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; +esac ;; esac fi " @@ -185,42 +167,55 @@ as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } -if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : +if ( set x; as_fn_ret_success y && test x = \"\$1\" ) +then : -else - exitcode=1; echo positional parameters were not saved. +else case e in #( + e) exitcode=1; echo positional parameters were not saved. ;; +esac fi test x\$exitcode = x0 || exit 1 +blah=\$(echo \$(echo blah)) +test x\"\$blah\" = xblah || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" - if (eval "$as_required") 2>/dev/null; then : + if (eval "$as_required") 2>/dev/null +then : as_have_required=yes -else - as_have_required=no +else case e in #( + e) as_have_required=no ;; +esac fi - if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null +then : -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +else case e in #( + e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. - as_shell=$as_dir/$as_base + as_shell=$as_dir$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : CONFIG_SHELL=$as_shell as_have_required=yes - if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null +then : break 2 fi fi @@ -228,14 +223,22 @@ fi esac as_found=false done -$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : - CONFIG_SHELL=$SHELL as_have_required=yes -fi; } IFS=$as_save_IFS +if $as_found +then : + +else case e in #( + e) if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi ;; +esac +fi - if test "x$CONFIG_SHELL" != x; then : + if test "x$CONFIG_SHELL" != x +then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also @@ -252,25 +255,27 @@ case $- in # (((( esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +# out after a failed 'exec'. +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi - if test x$as_have_required = xno; then : - $as_echo "$0: This script requires a shell more modern than all" - $as_echo "$0: the shells that I found on your system." - if test x${ZSH_VERSION+set} = xset ; then - $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" - $as_echo "$0: be upgraded to zsh 4.3.4 or later." + if test x$as_have_required = xno +then : + printf "%s\n" "$0: This script requires a shell more modern than all" + printf "%s\n" "$0: the shells that I found on your system." + if test ${ZSH_VERSION+y} ; then + printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" + printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." else - $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, + printf "%s\n" "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 -fi +fi ;; +esac fi fi SHELL=${CONFIG_SHELL-/bin/sh} @@ -291,6 +296,7 @@ as_fn_unset () } as_unset=as_fn_unset + # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. @@ -322,7 +328,7 @@ as_fn_mkdir_p () as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -331,7 +337,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | +printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -370,16 +376,18 @@ as_fn_executable_p () # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : eval 'as_fn_append () { eval $1+=\$2 }' -else - as_fn_append () +else case e in #( + e) as_fn_append () { eval $1=\$$1\$2 - } + } ;; +esac fi # as_fn_append # as_fn_arith ARG... @@ -387,16 +395,18 @@ fi # as_fn_append # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : eval 'as_fn_arith () { as_val=$(( $* )) }' -else - as_fn_arith () +else case e in #( + e) as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` - } + } ;; +esac fi # as_fn_arith @@ -410,9 +420,9 @@ as_fn_error () as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $2" >&2 + printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error @@ -439,7 +449,7 @@ as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | +printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -472,6 +482,8 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits /[$]LINENO/= ' <$as_myself | sed ' + t clear + :clear s/[$]LINENO.*/&-/ t lineno b @@ -483,7 +495,7 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall @@ -497,6 +509,10 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits exit } + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) @@ -510,6 +526,12 @@ case `echo -n x` in #((((( ECHO_N='-n';; esac +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +as_echo='printf %s\n' +as_echo_n='printf %s' + rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file @@ -521,9 +543,9 @@ if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. + # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable. + # In both cases, we have to default to 'cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then @@ -548,10 +570,12 @@ as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" +as_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated # Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" +as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" +as_tr_sh="eval sed '$as_sed_sh'" # deprecated test -n "$DJDIR" || exec 7<&0 /dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" + as_fn_error $? "invalid feature name: '$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" @@ -881,9 +910,9 @@ do ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" + as_fn_error $? "invalid feature name: '$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" @@ -1036,6 +1065,15 @@ do | -silent | --silent | --silen | --sile | --sil) silent=yes ;; + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1085,9 +1123,9 @@ do ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" + as_fn_error $? "invalid package name: '$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" @@ -1101,9 +1139,9 @@ do ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" + as_fn_error $? "invalid package name: '$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" @@ -1131,8 +1169,8 @@ do | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; - -*) as_fn_error $? "unrecognized option: \`$ac_option' -Try \`$0 --help' for more information" + -*) as_fn_error $? "unrecognized option: '$ac_option' +Try '$0 --help' for more information" ;; *=*) @@ -1140,16 +1178,16 @@ Try \`$0 --help' for more information" # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) - as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + as_fn_error $? "invalid variable name: '$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. - $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; @@ -1165,7 +1203,7 @@ if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; - *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi @@ -1173,7 +1211,7 @@ fi for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir + libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -1190,7 +1228,7 @@ do as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done -# There might be people who depend on the old broken behavior: `$host' +# There might be people who depend on the old broken behavior: '$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias @@ -1229,7 +1267,7 @@ $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_myself" | +printf "%s\n" X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -1258,7 +1296,7 @@ if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi -ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_msg="sources are in $srcdir, but 'cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` @@ -1286,7 +1324,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures this package to adapt to many kinds of systems. +'configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1300,11 +1338,11 @@ Configuration: --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking ...' messages + -q, --quiet, --silent do not print 'checking ...' messages --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for \`--cache-file=config.cache' + -C, --config-cache alias for '--cache-file=config.cache' -n, --no-create do not create output files - --srcdir=DIR find the sources in DIR [configure dir or \`..'] + --srcdir=DIR find the sources in DIR [configure dir or '..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX @@ -1312,10 +1350,10 @@ Installation directories: --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] -By default, \`make install' will install all the files in -\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify -an installation prefix other than \`$ac_default_prefix' using \`--prefix', -for instance \`--prefix=\$HOME'. +By default, 'make install' will install all the files in +'$ac_default_prefix/bin', '$ac_default_prefix/lib' etc. You can specify +an installation prefix other than '$ac_default_prefix' using '--prefix', +for instance '--prefix=\$HOME'. For better control, use the options below. @@ -1326,6 +1364,7 @@ Fine tuning of the installation directories: --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] @@ -1371,6 +1410,8 @@ Optional Features: --disable-ssl Disable Secure Sockets Layer support --disable-geoip Disable GeoIP support --disable-mmdb Disable MaxMindDB support + --disable-lmdb Disable LMDB/chathistory support + --disable-zstd Disable zstd compression support Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -1407,6 +1448,22 @@ Optional Packages: /usr/local/include) --with-mmdb-libs=dir Specify location of MaxMindDB libs (default: /usr/local/lib) + --with-lmdb=dir Specify the installation prefix of LMDB (default: + /usr) + --with-lmdb-includes=dir + Specify location of LMDB header files (default: + /usr/include) + --with-lmdb-libs=dir Specify location of LMDB libs (default: /usr/lib) + --with-zstd=dir Specify the installation prefix of zstd (default: + /usr) + --with-zstd-includes=dir + Specify location of zstd header files (default: + /usr/include) + --with-zstd-libs=dir Specify location of zstd libs (default: /usr/lib) + --with-libgit2 Enable libgit2 for gitsync feature + --with-libgit2-includes=dir + Specify location of libgit2 header files + --with-libgit2-libs=dir Specify location of libgit2 libs --with-maxcon=maxcon Maximum number of connections server will accept Some influential environment variables: @@ -1417,15 +1474,14 @@ Some influential environment variables: LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory - CPP C preprocessor - YACC The `Yet Another Compiler Compiler' implementation to use. - Defaults to the first program found out of: `bison -y', `byacc', - `yacc'. + YACC The 'Yet Another Compiler Compiler' implementation to use. + Defaults to the first program found out of: 'bison -y', 'byacc', + 'yacc'. YFLAGS The list of arguments that will be passed by default to $YACC. This script will default YFLAGS to the empty string to avoid a - default value of `-d' given by some make applications. + default value of '-d' given by some make applications. -Use these variables to override the choices made by `configure' or to help +Use these variables to override the choices made by 'configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to the package provider. @@ -1444,9 +1500,9 @@ if test "$ac_init_help" = "recursive"; then case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -1474,7 +1530,8 @@ esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested configure. + # Check for configure.gnu first; this name is used for a wrapper for + # Metaconfig's "Configure" on case-insensitive file systems. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive @@ -1482,7 +1539,7 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix echo && $SHELL "$ac_srcdir/configure" --help=recursive else - $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done @@ -1492,9 +1549,9 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure -generated by GNU Autoconf 2.69 +generated by GNU Autoconf 2.72 -Copyright (C) 2012 Free Software Foundation, Inc. +Copyright (C) 2023 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1511,14 +1568,14 @@ fi ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext + rm -f conftest.$ac_objext conftest.beam if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -1526,17 +1583,19 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest.$ac_objext; then : + } && test -s conftest.$ac_objext +then : ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else case e in #( + e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=1 + ac_retval=1 ;; +esac fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval @@ -1549,14 +1608,14 @@ fi ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext + rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -1564,20 +1623,22 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext - }; then : + } +then : ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else case e in #( + e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=1 + ac_retval=1 ;; +esac fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would @@ -1595,28 +1656,22 @@ fi ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $2 (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif + which can conflict with char $2 (void); below. */ +#include #undef $2 /* Override any GCC internal prototype to avoid an error. @@ -1625,7 +1680,7 @@ else #ifdef __cplusplus extern "C" #endif -char $2 (); +char $2 (void); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ @@ -1634,69 +1689,70 @@ choke me #endif int -main () +main (void) { return $2 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : eval "$3=yes" -else - eval "$3=no" +else case e in #( + e) eval "$3=no" ;; +esac fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext ;; +esac fi eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func -# ac_fn_c_try_cpp LINENO -# ---------------------- -# Try to preprocess conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_cpp () +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$3=yes" +else case e in #( + e) eval "$3=no" ;; esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } > conftest.i && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$3 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval -} # ac_fn_c_try_cpp +} # ac_fn_c_check_header_compile # ac_fn_c_try_run LINENO # ---------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes -# that executables *can* be run. +# Try to run conftest.$ac_ext, and return whether this succeeded. Assumes that +# executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack @@ -1706,28 +1762,30 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then : + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } +then : ac_retval=0 -else - $as_echo "$as_me: program exited with status $ac_status" >&5 - $as_echo "$as_me: failed program was:" >&5 +else case e in #( + e) printf "%s\n" "$as_me: program exited with status $ac_status" >&5 + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=$ac_status + ac_retval=$ac_status ;; +esac fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno @@ -1735,124 +1793,6 @@ fi } # ac_fn_c_try_run -# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists, giving a warning if it cannot be compiled using -# the include files in INCLUDES and setting the cache variable VAR -# accordingly. -ac_fn_c_check_header_mongrel () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if eval \${$3+:} false; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 -$as_echo_n "checking $2 usability... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_header_compiler=yes -else - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 -$as_echo_n "checking $2 presence... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <$2> -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - ac_header_preproc=yes -else - ac_header_preproc=no -fi -rm -f conftest.err conftest.i conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( - yes:no: ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; - no:yes:* ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; -esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=\$ac_header_compiler" -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_header_mongrel - -# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists and can be compiled using the include files in -# INCLUDES, setting the cache variable VAR accordingly. -ac_fn_c_check_header_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_header_compile - # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache @@ -1860,17 +1800,18 @@ $as_echo "$ac_res" >&6; } ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main () +main (void) { if (sizeof ($2)) return 0; @@ -1878,12 +1819,13 @@ if (sizeof ($2)) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main () +main (void) { if (sizeof (($2))) return 0; @@ -1891,18 +1833,21 @@ if (sizeof (($2))) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : -else - eval "$3=yes" +else case e in #( + e) eval "$3=yes" ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type @@ -1921,7 +1866,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main () +main (void) { static int test_array [1 - 2 * !(($2) >= 0)]; test_array [0] = 0; @@ -1931,14 +1876,15 @@ return test_array [0]; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_lo=0 ac_mid=0 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main () +main (void) { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; @@ -1948,24 +1894,26 @@ return test_array [0]; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_hi=$ac_mid; break -else - as_fn_arith $ac_mid + 1 && ac_lo=$as_val +else case e in #( + e) as_fn_arith $ac_mid + 1 && ac_lo=$as_val if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi - as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val + as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main () +main (void) { static int test_array [1 - 2 * !(($2) < 0)]; test_array [0] = 0; @@ -1975,14 +1923,15 @@ return test_array [0]; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_hi=-1 ac_mid=-1 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main () +main (void) { static int test_array [1 - 2 * !(($2) >= $ac_mid)]; test_array [0] = 0; @@ -1992,24 +1941,28 @@ return test_array [0]; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_lo=$ac_mid; break -else - as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val +else case e in #( + e) as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi - as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val + as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done -else - ac_lo= ac_hi= +else case e in #( + e) ac_lo= ac_hi= ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val @@ -2017,7 +1970,7 @@ while test "x$ac_lo" != "x$ac_hi"; do /* end confdefs.h. */ $4 int -main () +main (void) { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; @@ -2027,12 +1980,14 @@ return test_array [0]; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_hi=$ac_mid -else - as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val +else case e in #( + e) as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done case $ac_lo in #(( ?*) eval "$3=\$ac_lo"; ac_retval=0 ;; @@ -2042,12 +1997,12 @@ esac cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 -static long int longval () { return $2; } -static unsigned long int ulongval () { return $2; } +static long int longval (void) { return $2; } +static unsigned long int ulongval (void) { return $2; } #include #include int -main () +main (void) { FILE *f = fopen ("conftest.val", "w"); @@ -2075,10 +2030,12 @@ main () return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : echo >>conftest.val; read $3 config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was -generated by GNU Autoconf 2.69. Invocation command line was +generated by GNU Autoconf 2.72. Invocation command line was - $ $0 $@ + $ $0$ac_configure_args_raw _ACEOF exec 5>>config.log @@ -2129,8 +2106,12 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + printf "%s\n" "PATH: $as_dir" done IFS=$as_save_IFS @@ -2165,7 +2146,7 @@ do | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) - ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; @@ -2200,11 +2181,13 @@ done # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? + # Sanitize IFS. + IFS=" "" $as_nl" # Save into config.log some information that might help in debugging. { echo - $as_echo "## ---------------- ## + printf "%s\n" "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo @@ -2215,8 +2198,8 @@ trap 'exit_status=$? case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( @@ -2240,7 +2223,7 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; ) echo - $as_echo "## ----------------- ## + printf "%s\n" "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo @@ -2248,14 +2231,14 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - $as_echo "$ac_var='\''$ac_val'\''" + printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then - $as_echo "## ------------------- ## + printf "%s\n" "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo @@ -2263,15 +2246,15 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - $as_echo "$ac_var='\''$ac_val'\''" + printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then - $as_echo "## ----------- ## + printf "%s\n" "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo @@ -2279,8 +2262,8 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; echo fi test "$ac_signal" != 0 && - $as_echo "$as_me: caught signal $ac_signal" - $as_echo "$as_me: exit $exit_status" + printf "%s\n" "$as_me: caught signal $ac_signal" + printf "%s\n" "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && @@ -2294,65 +2277,50 @@ ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h -$as_echo "/* confdefs.h */" > confdefs.h +printf "%s\n" "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. -cat >>confdefs.h <<_ACEOF -#define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF +printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF +printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF +printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF +printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF +printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_URL "$PACKAGE_URL" -_ACEOF +printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. -ac_site_file1=NONE -ac_site_file2=NONE if test -n "$CONFIG_SITE"; then - # We do not want a PATH search for config.site. - case $CONFIG_SITE in #(( - -*) ac_site_file1=./$CONFIG_SITE;; - */*) ac_site_file1=$CONFIG_SITE;; - *) ac_site_file1=./$CONFIG_SITE;; - esac + ac_site_files="$CONFIG_SITE" elif test "x$prefix" != xNONE; then - ac_site_file1=$prefix/share/config.site - ac_site_file2=$prefix/etc/config.site + ac_site_files="$prefix/share/config.site $prefix/etc/config.site" else - ac_site_file1=$ac_default_prefix/share/config.site - ac_site_file2=$ac_default_prefix/etc/config.site + ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi -for ac_site_file in "$ac_site_file1" "$ac_site_file2" + +for ac_site_file in $ac_site_files do - test "x$ac_site_file" = xNONE && continue - if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 -$as_echo "$as_me: loading site script $ac_site_file" >&6;} + case $ac_site_file in #( + */*) : + ;; #( + *) : + ac_site_file=./$ac_site_file ;; +esac + if test -f "$ac_site_file" && test -r "$ac_site_file"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ - || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } fi done @@ -2360,61 +2328,495 @@ if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 -$as_echo "$as_me: loading cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +printf "%s\n" "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 -$as_echo "$as_me: creating cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +printf "%s\n" "$as_me: creating cache $cache_file" >&6;} >$cache_file fi -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in $ac_precious_vars; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val=\$ac_cv_env_${ac_var}_value - eval ac_new_val=\$ac_env_${ac_var}_value - case $ac_old_set,$ac_new_set in - set,) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - # differences in whitespace do not lead to failure. - ac_old_val_w=`echo x $ac_old_val` - ac_new_val_w=`echo x $ac_new_val` - if test "$ac_old_val_w" != "$ac_new_val_w"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - ac_cache_corrupted=: - else - { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} - eval $ac_var=\$ac_old_val - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then +# Test code for whether the C compiler supports C89 (global declarations) +ac_c_conftest_c89_globals=' +/* Does the compiler advertise C89 conformance? + Do not test the value of __STDC__, because some compilers set it to 0 + while being otherwise adequately conformant. */ +#if !defined __STDC__ +# error "Compiler does not advertise C89 conformance" +#endif + +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ +struct buf { int x; }; +struct buf * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (char **p, int i) +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* C89 style stringification. */ +#define noexpand_stringify(a) #a +const char *stringified = noexpand_stringify(arbitrary+token=sequence); + +/* C89 style token pasting. Exercises some of the corner cases that + e.g. old MSVC gets wrong, but not very hard. */ +#define noexpand_concat(a,b) a##b +#define expand_concat(a,b) noexpand_concat(a,b) +extern int vA; +extern int vbee; +#define aye A +#define bee B +int *pvA = &expand_concat(v,aye); +int *pvbee = &noexpand_concat(v,bee); + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not \xHH hex character constants. + These do not provoke an error unfortunately, instead are silently treated + as an "x". The following induces an error, until -std is added to get + proper ANSI mode. Curiously \x00 != x always comes out true, for an + array size at least. It is necessary to write \x00 == 0 to get something + that is true only with -std. */ +int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) '\''x'\'' +int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int), + int, int);' + +# Test code for whether the C compiler supports C89 (body of main). +ac_c_conftest_c89_main=' +ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); +' + +# Test code for whether the C compiler supports C99 (global declarations) +ac_c_conftest_c99_globals=' +/* Does the compiler advertise C99 conformance? */ +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L +# error "Compiler does not advertise C99 conformance" +#endif + +// See if C++-style comments work. + +#include +extern int puts (const char *); +extern int printf (const char *, ...); +extern int dprintf (int, const char *, ...); +extern void *malloc (size_t); +extern void free (void *); + +// Check varargs macros. These examples are taken from C99 6.10.3.5. +// dprintf is used instead of fprintf to avoid needing to declare +// FILE and stderr. +#define debug(...) dprintf (2, __VA_ARGS__) +#define showlist(...) puts (#__VA_ARGS__) +#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) +static void +test_varargs_macros (void) +{ + int x = 1234; + int y = 5678; + debug ("Flag"); + debug ("X = %d\n", x); + showlist (The first, second, and third items.); + report (x>y, "x is %d but y is %d", x, y); +} + +// Check long long types. +#define BIG64 18446744073709551615ull +#define BIG32 4294967295ul +#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) +#if !BIG_OK + #error "your preprocessor is broken" +#endif +#if BIG_OK +#else + #error "your preprocessor is broken" +#endif +static long long int bignum = -9223372036854775807LL; +static unsigned long long int ubignum = BIG64; + +struct incomplete_array +{ + int datasize; + double data[]; +}; + +struct named_init { + int number; + const wchar_t *name; + double average; +}; + +typedef const char *ccp; + +static inline int +test_restrict (ccp restrict text) +{ + // Iterate through items via the restricted pointer. + // Also check for declarations in for loops. + for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) + continue; + return 0; +} + +// Check varargs and va_copy. +static bool +test_varargs (const char *format, ...) +{ + va_list args; + va_start (args, format); + va_list args_copy; + va_copy (args_copy, args); + + const char *str = ""; + int number = 0; + float fnumber = 0; + + while (*format) + { + switch (*format++) + { + case '\''s'\'': // string + str = va_arg (args_copy, const char *); + break; + case '\''d'\'': // int + number = va_arg (args_copy, int); + break; + case '\''f'\'': // float + fnumber = va_arg (args_copy, double); + break; + default: + break; + } + } + va_end (args_copy); + va_end (args); + + return *str && number && fnumber; +} +' + +# Test code for whether the C compiler supports C99 (body of main). +ac_c_conftest_c99_main=' + // Check bool. + _Bool success = false; + success |= (argc != 0); + + // Check restrict. + if (test_restrict ("String literal") == 0) + success = true; + char *restrict newvar = "Another string"; + + // Check varargs. + success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); + test_varargs_macros (); + + // Check flexible array members. + struct incomplete_array *ia = + malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); + ia->datasize = 10; + for (int i = 0; i < ia->datasize; ++i) + ia->data[i] = i * 1.234; + // Work around memory leak warnings. + free (ia); + + // Check named initializers. + struct named_init ni = { + .number = 34, + .name = L"Test wide string", + .average = 543.34343, + }; + + ni.number = 58; + + int dynamic_array[ni.number]; + dynamic_array[0] = argv[0][0]; + dynamic_array[ni.number - 1] = 543; + + // work around unused variable warnings + ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' + || dynamic_array[ni.number - 1] != 543); +' + +# Test code for whether the C compiler supports C11 (global declarations) +ac_c_conftest_c11_globals=' +/* Does the compiler advertise C11 conformance? */ +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L +# error "Compiler does not advertise C11 conformance" +#endif + +// Check _Alignas. +char _Alignas (double) aligned_as_double; +char _Alignas (0) no_special_alignment; +extern char aligned_as_int; +char _Alignas (0) _Alignas (int) aligned_as_int; + +// Check _Alignof. +enum +{ + int_alignment = _Alignof (int), + int_array_alignment = _Alignof (int[100]), + char_alignment = _Alignof (char) +}; +_Static_assert (0 < -_Alignof (int), "_Alignof is signed"); + +// Check _Noreturn. +int _Noreturn does_not_return (void) { for (;;) continue; } + +// Check _Static_assert. +struct test_static_assert +{ + int x; + _Static_assert (sizeof (int) <= sizeof (long int), + "_Static_assert does not work in struct"); + long int y; +}; + +// Check UTF-8 literals. +#define u8 syntax error! +char const utf8_literal[] = u8"happens to be ASCII" "another string"; + +// Check duplicate typedefs. +typedef long *long_ptr; +typedef long int *long_ptr; +typedef long_ptr long_ptr; + +// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. +struct anonymous +{ + union { + struct { int i; int j; }; + struct { int k; long int l; } w; + }; + int m; +} v1; +' + +# Test code for whether the C compiler supports C11 (body of main). +ac_c_conftest_c11_main=' + _Static_assert ((offsetof (struct anonymous, i) + == offsetof (struct anonymous, w.k)), + "Anonymous union alignment botch"); + v1.i = 2; + v1.w.k = 5; + ok |= v1.i != 5; +' + +# Test code for whether the C compiler supports C11 (complete). +ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} +${ac_c_conftest_c99_globals} +${ac_c_conftest_c11_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + ${ac_c_conftest_c99_main} + ${ac_c_conftest_c11_main} + return ok; +} +" + +# Test code for whether the C compiler supports C99 (complete). +ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} +${ac_c_conftest_c99_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + ${ac_c_conftest_c99_main} + return ok; +} +" + +# Test code for whether the C compiler supports C89 (complete). +ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + return ok; +} +" + +as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" +as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H" +as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H" +as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" +as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" +as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" +as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" +as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" +as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" +as_fn_append ac_header_c_list " sys/time.h sys_time_h HAVE_SYS_TIME_H" + +# Auxiliary files required by this configure script. +ac_aux_files="install-sh config.guess config.sub" + +# Locations in which to look for auxiliary files. +ac_aux_dir_candidates="${srcdir}${PATH_SEPARATOR}${srcdir}/..${PATH_SEPARATOR}${srcdir}/../.." + +# Search for a directory containing all of the required auxiliary files, +# $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates. +# If we don't find one directory that contains all the files we need, +# we report the set of missing files from the *first* directory in +# $ac_aux_dir_candidates and give up. +ac_missing_aux_files="" +ac_first_candidate=: +printf "%s\n" "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in $ac_aux_dir_candidates +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + as_found=: + + printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5 + ac_aux_dir_found=yes + ac_install_sh= + for ac_aux in $ac_aux_files + do + # As a special case, if "install-sh" is required, that requirement + # can be satisfied by any of "install-sh", "install.sh", or "shtool", + # and $ac_install_sh is set appropriately for whichever one is found. + if test x"$ac_aux" = x"install-sh" + then + if test -f "${as_dir}install-sh"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install-sh found" >&5 + ac_install_sh="${as_dir}install-sh -c" + elif test -f "${as_dir}install.sh"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install.sh found" >&5 + ac_install_sh="${as_dir}install.sh -c" + elif test -f "${as_dir}shtool"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}shtool found" >&5 + ac_install_sh="${as_dir}shtool install -c" + else + ac_aux_dir_found=no + if $ac_first_candidate; then + ac_missing_aux_files="${ac_missing_aux_files} install-sh" + else + break + fi + fi + else + if test -f "${as_dir}${ac_aux}"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5 + else + ac_aux_dir_found=no + if $ac_first_candidate; then + ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}" + else + break + fi + fi + fi + done + if test "$ac_aux_dir_found" = yes; then + ac_aux_dir="$as_dir" + break + fi + ac_first_candidate=false + + as_found=false +done +IFS=$as_save_IFS +if $as_found +then : + +else case e in #( + e) as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 ;; +esac +fi + + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +if test -f "${ac_aux_dir}config.guess"; then + ac_config_guess="$SHELL ${ac_aux_dir}config.guess" +fi +if test -f "${ac_aux_dir}config.sub"; then + ac_config_sub="$SHELL ${ac_aux_dir}config.sub" +fi +if test -f "$ac_aux_dir/configure"; then + ac_configure="$SHELL ${ac_aux_dir}configure" +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&5 +printf "%s\n" "$as_me: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was not set in the previous run" >&5 +printf "%s\n" "$as_me: error: '$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' has changed since the previous run:" >&5 +printf "%s\n" "$as_me: error: '$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&5 +printf "%s\n" "$as_me: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: '$ac_old_val'" >&5 +printf "%s\n" "$as_me: former value: '$ac_old_val'" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: '$ac_new_val'" >&5 +printf "%s\n" "$as_me: current value: '$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then case $ac_new_val in - *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in @@ -2424,11 +2826,12 @@ $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi done if $ac_cache_corrupted; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 -$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run '${MAKE-make} distclean' and/or 'rm $cache_file' + and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## @@ -2443,19 +2846,21 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for installation prefix" >&5 -$as_echo_n "checking for installation prefix... " >&6; } -if ${unet_cv_prefix+:} false; then : - $as_echo_n "(cached) " >&6 -else - unet_cv_prefix=$HOME +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for installation prefix" >&5 +printf %s "checking for installation prefix... " >&6; } +if test ${unet_cv_prefix+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) unet_cv_prefix=$HOME ;; +esac fi if test x"$prefix" != xNONE; then unet_cv_prefix=$prefix fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $unet_cv_prefix" >&5 -$as_echo "$unet_cv_prefix" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $unet_cv_prefix" >&5 +printf "%s\n" "$unet_cv_prefix" >&6; } ac_default_prefix=$unet_cv_prefix ac_config_headers="$ac_config_headers config.h" @@ -2463,55 +2868,31 @@ ac_config_headers="$ac_config_headers config.h" -ac_aux_dir= -for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do - if test -f "$ac_dir/install-sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f "$ac_dir/install.sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f "$ac_dir/shtool"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 -fi -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. -# Make sure we can run config.sub. -$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + # Make sure we can run config.sub. +$SHELL "${ac_aux_dir}config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL ${ac_aux_dir}config.sub" "$LINENO" 5 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 -$as_echo_n "checking build system type... " >&6; } -if ${ac_cv_build+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_build_alias=$build_alias +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +printf %s "checking build system type... " >&6; } +if test ${ac_cv_build+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_build_alias=$build_alias test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` + ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 -ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 - +ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5 + ;; +esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 -$as_echo "$ac_cv_build" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +printf "%s\n" "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; @@ -2530,21 +2911,23 @@ IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 -$as_echo_n "checking host system type... " >&6; } -if ${ac_cv_host+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "x$host_alias" = x; then +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +printf %s "checking host system type... " >&6; } +if test ${ac_cv_host+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else - ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 + ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` || + as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5 fi - + ;; +esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 -$as_echo "$ac_cv_host" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +printf "%s\n" "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; @@ -2564,6 +2947,15 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + + + + + + + + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -2572,38 +2964,44 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -2612,38 +3010,44 @@ if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then @@ -2651,8 +3055,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -2665,38 +3069,44 @@ if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -2705,12 +3115,13 @@ fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no @@ -2718,15 +3129,19 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2742,18 +3157,19 @@ if test $ac_prog_rejected = yes; then # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" fi fi -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -2764,38 +3180,44 @@ if test -z "$CC"; then do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -2808,38 +3230,44 @@ if test -z "$CC"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -2851,34 +3279,140 @@ done else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. +set dummy ${ac_tool_prefix}clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "clang", so it can be a program name with args. +set dummy clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi +else + CC="$ac_cv_prog_CC" fi fi -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 -for ac_option in --version -v -V -qversion; do +for ac_option in --version -v -V -qversion -version; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -2888,7 +3422,7 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done @@ -2896,7 +3430,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; @@ -2908,9 +3442,9 @@ ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } -ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +printf %s "checking whether the C compiler works... " >&6; } +ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" @@ -2931,13 +3465,14 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. -# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : + # Autoconf-2.13 could set the ac_cv_exeext variable to 'no'. +# So ignore a value of 'no', otherwise this would lead to 'EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. @@ -2952,12 +3487,12 @@ do # certainly right. break;; *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not - # safe: cross compilers may not add the suffix if given an `-o' + # safe: cross compilers may not add the suffix if given an '-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. @@ -2968,48 +3503,52 @@ do done test "$ac_cv_exeext" = no && ac_cv_exeext= -else - ac_file='' +else case e in #( + e) ac_file='' ;; +esac fi -if test -z "$ac_file"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -$as_echo "$as_me: failed program was:" >&5 +if test -z "$ac_file" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables -See \`config.log' for more details" "$LINENO" 5; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +See 'config.log' for more details" "$LINENO" 5; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } ;; +esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +printf %s "checking for C compiler default output file name... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +printf "%s\n" "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 -$as_echo_n "checking for suffix of executables... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +printf %s "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : + # If both 'conftest.exe' and 'conftest' are 'present' (well, observable) +# catch 'conftest.exe'. For instance with Cygwin, 'ls conftest' will +# work properly (i.e., refer to 'conftest.exe'), while it won't with +# 'rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in @@ -3019,15 +3558,16 @@ for ac_file in conftest.exe conftest conftest.*; do * ) break;; esac done -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +else case e in #( + e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } ;; +esac fi rm -f conftest conftest$ac_cv_exeext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 -$as_echo "$ac_cv_exeext" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +printf "%s\n" "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext @@ -3036,9 +3576,11 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { FILE *f = fopen ("conftest.out", "w"); + if (!f) + return 1; return ferror (f) || fclose (f) != 0; ; @@ -3048,8 +3590,8 @@ _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +printf %s "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in @@ -3057,10 +3599,10 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in @@ -3068,39 +3610,41 @@ $as_echo "$ac_try_echo"; } >&5 *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details" "$LINENO" 5; } + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error 77 "cannot run C compiled programs. +If you meant to cross compile, use '--host'. +See 'config.log' for more details" "$LINENO" 5; } fi fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +printf "%s\n" "$cross_compiling" >&6; } -rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +rm -f conftest.$ac_ext conftest$ac_cv_exeext \ + conftest.o conftest.obj conftest.out ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 -$as_echo_n "checking for suffix of object files... " >&6; } -if ${ac_cv_objext+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +printf %s "checking for suffix of object files... " >&6; } +if test ${ac_cv_objext+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; @@ -3114,11 +3658,12 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in @@ -3127,31 +3672,34 @@ $as_echo "$ac_try_echo"; } >&5 break;; esac done -else - $as_echo "$as_me: failed program was:" >&5 +else case e in #( + e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } ;; +esac fi -rm -f conftest.$ac_cv_objext conftest.$ac_ext +rm -f conftest.$ac_cv_objext conftest.$ac_ext ;; +esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 -$as_echo "$ac_cv_objext" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +printf "%s\n" "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if ${ac_cv_c_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 +printf %s "checking whether the compiler supports GNU C... " >&6; } +if test ${ac_cv_c_compiler_gnu+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { #ifndef __GNUC__ choke me @@ -3161,30 +3709,36 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_compiler_gnu=yes -else - ac_compiler_gnu=no +else case e in #( + e) ac_compiler_gnu=no ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu - + ;; +esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } +ac_compiler_gnu=$ac_cv_c_compiler_gnu + if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi -ac_test_CFLAGS=${CFLAGS+set} +ac_test_CFLAGS=${CFLAGS+y} ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_save_c_werror_flag=$ac_c_werror_flag +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +printf %s "checking whether $CC accepts -g... " >&6; } +if test ${ac_cv_prog_cc_g+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" @@ -3192,57 +3746,63 @@ else /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_prog_cc_g=yes -else - CFLAGS="" +else case e in #( + e) CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : -else - ac_c_werror_flag=$ac_save_c_werror_flag +else case e in #( + e) ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_prog_cc_g=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag ;; +esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +printf "%s\n" "$ac_cv_prog_cc_g" >&6; } +if test $ac_test_CFLAGS; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then @@ -3257,94 +3817,153 @@ else CFLAGS= fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c89=no +ac_prog_cc_stdc=no +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 +printf %s "checking for $CC option to enable C11 features... " >&6; } +if test ${ac_cv_prog_cc_c11+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_cv_prog_cc_c11=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include -struct stat; -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; +$ac_c_conftest_c11_program +_ACEOF +for ac_arg in '' -std=gnu11 +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c11=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c11" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC ;; +esac +fi -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; +if test "x$ac_cv_prog_cc_c11" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else case e in #( + e) if test "x$ac_cv_prog_cc_c11" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 +printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } + CC="$CC $ac_cv_prog_cc_c11" ;; +esac +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 + ac_prog_cc_stdc=c11 ;; +esac +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 +printf %s "checking for $CC option to enable C99 features... " >&6; } +if test ${ac_cv_prog_cc_c99+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_cv_prog_cc_c99=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c99_program +_ACEOF +for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c99=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c99" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC ;; +esac +fi -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} +if test "x$ac_cv_prog_cc_c99" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else case e in #( + e) if test "x$ac_cv_prog_cc_c99" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } + CC="$CC $ac_cv_prog_cc_c99" ;; +esac +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 + ac_prog_cc_stdc=c99 ;; +esac +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 +printf %s "checking for $CC option to enable C89 features... " >&6; } +if test ${ac_cv_prog_cc_c89+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c89_program _ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : + if ac_fn_c_try_compile "$LINENO" +then : ac_cv_prog_cc_c89=$ac_arg fi -rm -f core conftest.err conftest.$ac_objext +rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext -CC=$ac_save_CC +CC=$ac_save_CC ;; +esac +fi +if test "x$ac_cv_prog_cc_c89" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else case e in #( + e) if test "x$ac_cv_prog_cc_c89" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } + CC="$CC $ac_cv_prog_cc_c89" ;; +esac fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 + ac_prog_cc_stdc=c89 ;; esac -if test "x$ac_cv_prog_cc_c89" != xno; then : - +fi fi ac_ext=c @@ -3362,38 +3981,44 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3402,38 +4027,44 @@ if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then @@ -3441,8 +4072,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -3455,38 +4086,44 @@ if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3495,12 +4132,13 @@ fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no @@ -3508,15 +4146,19 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3532,143 +4174,262 @@ if test $ac_prog_rejected = yes; then # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" + fi +fi +fi ;; +esac +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi + + + test -n "$CC" && break + done fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then - for ac_prog in cl.exe - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then + # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. +set dummy ${ac_tool_prefix}clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi - test -n "$CC" && break - done fi -if test -z "$CC"; then +if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC - for ac_prog in cl.exe -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then + # Extract the first word of "clang", so it can be a program name with args. +set dummy clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi - - test -n "$ac_ct_CC" && break -done - if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi +else + CC="$ac_cv_prog_CC" fi fi -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 -for ac_option in --version -v -V -qversion; do +for ac_option in --version -v -V -qversion -version; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -3678,20 +4439,21 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if ${ac_cv_c_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 +printf %s "checking whether the compiler supports GNU C... " >&6; } +if test ${ac_cv_c_compiler_gnu+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { #ifndef __GNUC__ choke me @@ -3701,30 +4463,36 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_compiler_gnu=yes -else - ac_compiler_gnu=no +else case e in #( + e) ac_compiler_gnu=no ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu - + ;; +esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } +ac_compiler_gnu=$ac_cv_c_compiler_gnu + if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi -ac_test_CFLAGS=${CFLAGS+set} +ac_test_CFLAGS=${CFLAGS+y} ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_save_c_werror_flag=$ac_c_werror_flag +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +printf %s "checking whether $CC accepts -g... " >&6; } +if test ${ac_cv_prog_cc_g+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" @@ -3732,407 +4500,308 @@ else /* end confdefs.h. */ int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -else - CFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -struct stat; -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_c89=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC - -fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c89" != xno; then : - -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5 -$as_echo_n "checking for $CC option to accept ISO C99... " >&6; } -if ${ac_cv_prog_cc_c99+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c99=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include -#include - -// Check varargs macros. These examples are taken from C99 6.10.3.5. -#define debug(...) fprintf (stderr, __VA_ARGS__) -#define showlist(...) puts (#__VA_ARGS__) -#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) -static void -test_varargs_macros (void) -{ - int x = 1234; - int y = 5678; - debug ("Flag"); - debug ("X = %d\n", x); - showlist (The first, second, and third items.); - report (x>y, "x is %d but y is %d", x, y); -} - -// Check long long types. -#define BIG64 18446744073709551615ull -#define BIG32 4294967295ul -#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) -#if !BIG_OK - your preprocessor is broken; -#endif -#if BIG_OK -#else - your preprocessor is broken; -#endif -static long long int bignum = -9223372036854775807LL; -static unsigned long long int ubignum = BIG64; - -struct incomplete_array -{ - int datasize; - double data[]; -}; - -struct named_init { - int number; - const wchar_t *name; - double average; -}; - -typedef const char *ccp; - -static inline int -test_restrict (ccp restrict text) -{ - // See if C++-style comments work. - // Iterate through items via the restricted pointer. - // Also check for declarations in for loops. - for (unsigned int i = 0; *(text+i) != '\0'; ++i) - continue; - return 0; -} - -// Check varargs and va_copy. -static void -test_varargs (const char *format, ...) -{ - va_list args; - va_start (args, format); - va_list args_copy; - va_copy (args_copy, args); - - const char *str; - int number; - float fnumber; - - while (*format) - { - switch (*format++) - { - case 's': // string - str = va_arg (args_copy, const char *); - break; - case 'd': // int - number = va_arg (args_copy, int); - break; - case 'f': // float - fnumber = va_arg (args_copy, double); - break; - default: - break; - } - } - va_end (args_copy); - va_end (args); -} - -int -main () +main (void) { - // Check bool. - _Bool success = false; - - // Check restrict. - if (test_restrict ("String literal") == 0) - success = true; - char *restrict newvar = "Another string"; - - // Check varargs. - test_varargs ("s, d' f .", "string", 65, 34.234); - test_varargs_macros (); - - // Check flexible array members. - struct incomplete_array *ia = - malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); - ia->datasize = 10; - for (int i = 0; i < ia->datasize; ++i) - ia->data[i] = i * 1.234; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_g=yes +else case e in #( + e) CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - // Check named initializers. - struct named_init ni = { - .number = 34, - .name = L"Test wide string", - .average = 543.34343, - }; +int +main (void) +{ - ni.number = 58; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : - int dynamic_array[ni.number]; - dynamic_array[ni.number - 1] = 543; +else case e in #( + e) ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - // work around unused variable warnings - return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x' - || dynamic_array[ni.number - 1] != 543); +int +main (void) +{ ; return 0; } _ACEOF -for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc99 +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +printf "%s\n" "$ac_cv_prog_cc_g" >&6; } +if test $ac_test_CFLAGS; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +ac_prog_cc_stdc=no +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 +printf %s "checking for $CC option to enable C11 features... " >&6; } +if test ${ac_cv_prog_cc_c11+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_cv_prog_cc_c11=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c11_program +_ACEOF +for ac_arg in '' -std=gnu11 +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c11=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c11" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC ;; +esac +fi + +if test "x$ac_cv_prog_cc_c11" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else case e in #( + e) if test "x$ac_cv_prog_cc_c11" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 +printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } + CC="$CC $ac_cv_prog_cc_c11" ;; +esac +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 + ac_prog_cc_stdc=c11 ;; +esac +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 +printf %s "checking for $CC option to enable C99 features... " >&6; } +if test ${ac_cv_prog_cc_c99+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_cv_prog_cc_c99=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c99_program +_ACEOF +for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= do CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : + if ac_fn_c_try_compile "$LINENO" +then : ac_cv_prog_cc_c99=$ac_arg fi -rm -f core conftest.err conftest.$ac_objext +rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext -CC=$ac_save_CC +CC=$ac_save_CC ;; +esac +fi +if test "x$ac_cv_prog_cc_c99" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else case e in #( + e) if test "x$ac_cv_prog_cc_c99" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } + CC="$CC $ac_cv_prog_cc_c99" ;; +esac fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c99" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c99" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 -$as_echo "$ac_cv_prog_cc_c99" >&6; } ;; + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 + ac_prog_cc_stdc=c99 ;; +esac +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 +printf %s "checking for $CC option to enable C89 features... " >&6; } +if test ${ac_cv_prog_cc_c89+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c89_program +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC ;; esac -if test "x$ac_cv_prog_cc_c99" != xno; then : +fi +if test "x$ac_cv_prog_cc_c89" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else case e in #( + e) if test "x$ac_cv_prog_cc_c89" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } + CC="$CC $ac_cv_prog_cc_c89" ;; +esac +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 + ac_prog_cc_stdc=c89 ;; +esac +fi fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing crypt" >&5 -$as_echo_n "checking for library containing crypt... " >&6; } -if ${ac_cv_search_crypt+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing crypt" >&5 +printf %s "checking for library containing crypt... " >&6; } +if test ${ac_cv_search_crypt+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif -char crypt (); +char crypt (void); int -main () +main (void) { return crypt (); ; return 0; } _ACEOF -for ac_lib in '' descrypt crypt; do +for ac_lib in '' descrypt crypt +do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi - if ac_fn_c_try_link "$LINENO"; then : + if ac_fn_c_try_link "$LINENO" +then : ac_cv_search_crypt=$ac_res fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext - if ${ac_cv_search_crypt+:} false; then : + if test ${ac_cv_search_crypt+y} +then : break fi done -if ${ac_cv_search_crypt+:} false; then : +if test ${ac_cv_search_crypt+y} +then : -else - ac_cv_search_crypt=no +else case e in #( + e) ac_cv_search_crypt=no ;; +esac fi rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS +LIBS=$ac_func_search_save_LIBS ;; +esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_crypt" >&5 -$as_echo "$ac_cv_search_crypt" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_crypt" >&5 +printf "%s\n" "$ac_cv_search_crypt" >&6; } ac_res=$ac_cv_search_crypt -if test "$ac_res" != no; then : +if test "$ac_res" != no +then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" -else - as_fn_error $? "Unable to find library containing crypt()" "$LINENO" 5 +else case e in #( + e) as_fn_error $? "Unable to find library containing crypt()" "$LINENO" 5 ;; +esac fi @@ -4140,460 +4809,406 @@ fi # Most operating systems have gethostbyname() in the default searched # libraries (i.e. libc): ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname" -if test "x$ac_cv_func_gethostbyname" = xyes; then : - -else - # Some OSes (eg. Solaris) place it in libnsl: - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5 -$as_echo_n "checking for gethostbyname in -lnsl... " >&6; } -if ${ac_cv_lib_nsl_gethostbyname+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS +if test "x$ac_cv_func_gethostbyname" = xyes +then : + +else case e in #( + e) # Some OSes (eg. Solaris) place it in libnsl: + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5 +printf %s "checking for gethostbyname in -lnsl... " >&6; } +if test ${ac_cv_lib_nsl_gethostbyname+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif -char gethostbyname (); +char gethostbyname (void); int -main () +main (void) { return gethostbyname (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_nsl_gethostbyname=yes -else - ac_cv_lib_nsl_gethostbyname=no +else case e in #( + e) ac_cv_lib_nsl_gethostbyname=no ;; +esac fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5 -$as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; } -if test "x$ac_cv_lib_nsl_gethostbyname" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBNSL 1 -_ACEOF +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5 +printf "%s\n" "$ac_cv_lib_nsl_gethostbyname" >&6; } +if test "x$ac_cv_lib_nsl_gethostbyname" = xyes +then : + printf "%s\n" "#define HAVE_LIBNSL 1" >>confdefs.h LIBS="-lnsl $LIBS" -else - # Some strange OSes (SINIX) have it in libsocket: - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lsocket" >&5 -$as_echo_n "checking for gethostbyname in -lsocket... " >&6; } -if ${ac_cv_lib_socket_gethostbyname+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) # Some strange OSes (SINIX) have it in libsocket: + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lsocket" >&5 +printf %s "checking for gethostbyname in -lsocket... " >&6; } +if test ${ac_cv_lib_socket_gethostbyname+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif -char gethostbyname (); +char gethostbyname (void); int -main () +main (void) { return gethostbyname (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_socket_gethostbyname=yes -else - ac_cv_lib_socket_gethostbyname=no +else case e in #( + e) ac_cv_lib_socket_gethostbyname=no ;; +esac fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_gethostbyname" >&5 -$as_echo "$ac_cv_lib_socket_gethostbyname" >&6; } -if test "x$ac_cv_lib_socket_gethostbyname" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBSOCKET 1 -_ACEOF +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_gethostbyname" >&5 +printf "%s\n" "$ac_cv_lib_socket_gethostbyname" >&6; } +if test "x$ac_cv_lib_socket_gethostbyname" = xyes +then : + printf "%s\n" "#define HAVE_LIBSOCKET 1" >>confdefs.h LIBS="-lsocket $LIBS" -else - # Unfortunately libsocket sometimes depends on libnsl. +else case e in #( + e) # Unfortunately libsocket sometimes depends on libnsl. # AC_CHECK_LIB's API is essentially broken so the following # ugliness is necessary: - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lsocket" >&5 -$as_echo_n "checking for gethostbyname in -lsocket... " >&6; } -if ${ac_cv_lib_socket_gethostbyname+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lsocket" >&5 +printf %s "checking for gethostbyname in -lsocket... " >&6; } +if test ${ac_cv_lib_socket_gethostbyname+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket -lnsl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif -char gethostbyname (); +char gethostbyname (void); int -main () +main (void) { return gethostbyname (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_socket_gethostbyname=yes -else - ac_cv_lib_socket_gethostbyname=no +else case e in #( + e) ac_cv_lib_socket_gethostbyname=no ;; +esac fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_gethostbyname" >&5 -$as_echo "$ac_cv_lib_socket_gethostbyname" >&6; } -if test "x$ac_cv_lib_socket_gethostbyname" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_gethostbyname" >&5 +printf "%s\n" "$ac_cv_lib_socket_gethostbyname" >&6; } +if test "x$ac_cv_lib_socket_gethostbyname" = xyes +then : LIBS="-lsocket -lnsl $LIBS" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lresolv" >&5 -$as_echo_n "checking for gethostbyname in -lresolv... " >&6; } -if ${ac_cv_lib_resolv_gethostbyname+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lresolv" >&5 +printf %s "checking for gethostbyname in -lresolv... " >&6; } +if test ${ac_cv_lib_resolv_gethostbyname+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lresolv $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif -char gethostbyname (); +char gethostbyname (void); int -main () +main (void) { return gethostbyname (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_resolv_gethostbyname=yes -else - ac_cv_lib_resolv_gethostbyname=no +else case e in #( + e) ac_cv_lib_resolv_gethostbyname=no ;; +esac fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv_gethostbyname" >&5 -$as_echo "$ac_cv_lib_resolv_gethostbyname" >&6; } -if test "x$ac_cv_lib_resolv_gethostbyname" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBRESOLV 1 -_ACEOF +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv_gethostbyname" >&5 +printf "%s\n" "$ac_cv_lib_resolv_gethostbyname" >&6; } +if test "x$ac_cv_lib_resolv_gethostbyname" = xyes +then : + printf "%s\n" "#define HAVE_LIBRESOLV 1" >>confdefs.h LIBS="-lresolv $LIBS" fi - + ;; +esac fi - + ;; +esac fi - + ;; +esac fi - + ;; +esac fi ac_fn_c_check_func "$LINENO" "socket" "ac_cv_func_socket" -if test "x$ac_cv_func_socket" = xyes; then : - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket" >&5 -$as_echo_n "checking for socket in -lsocket... " >&6; } -if ${ac_cv_lib_socket_socket+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS +if test "x$ac_cv_func_socket" = xyes +then : + +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket" >&5 +printf %s "checking for socket in -lsocket... " >&6; } +if test ${ac_cv_lib_socket_socket+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif -char socket (); +char socket (void); int -main () +main (void) { return socket (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_socket_socket=yes -else - ac_cv_lib_socket_socket=no +else case e in #( + e) ac_cv_lib_socket_socket=no ;; +esac fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_socket" >&5 -$as_echo "$ac_cv_lib_socket_socket" >&6; } -if test "x$ac_cv_lib_socket_socket" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBSOCKET 1 -_ACEOF +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_socket" >&5 +printf "%s\n" "$ac_cv_lib_socket_socket" >&6; } +if test "x$ac_cv_lib_socket_socket" = xyes +then : + printf "%s\n" "#define HAVE_LIBSOCKET 1" >>confdefs.h LIBS="-lsocket $LIBS" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket" >&5 -$as_echo_n "checking for socket in -lsocket... " >&6; } -if ${ac_cv_lib_socket_socket+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket" >&5 +printf %s "checking for socket in -lsocket... " >&6; } +if test ${ac_cv_lib_socket_socket+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket -lnsl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif -char socket (); +char socket (void); int -main () +main (void) { return socket (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_socket_socket=yes -else - ac_cv_lib_socket_socket=no +else case e in #( + e) ac_cv_lib_socket_socket=no ;; +esac fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_socket" >&5 -$as_echo "$ac_cv_lib_socket_socket" >&6; } -if test "x$ac_cv_lib_socket_socket" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_socket" >&5 +printf "%s\n" "$ac_cv_lib_socket_socket" >&6; } +if test "x$ac_cv_lib_socket_socket" = xyes +then : LIBS="-lsocket -lnsl $LIBS" fi - + ;; +esac fi - + ;; +esac fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if ${ac_cv_prog_CPP+:} false; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes +ac_header= ac_cache= +for ac_item in $ac_header_c_list do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - + if test $ac_cache; then + ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" + if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then + printf "%s\n" "#define $ac_item 1" >> confdefs.h + fi + ac_header= ac_cache= + elif test $ac_header; then + ac_cache=$ac_item + else + ac_header=$ac_item + fi done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - break -fi - done - ac_cv_prog_CPP=$CPP -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -$as_echo "$CPP" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } -fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes +then : -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if ${ac_cv_path_GREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$GREP"; then +printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +printf %s "checking for grep that handles long lines and -e... " >&6; } +if test ${ac_cv_path_GREP+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in grep ggrep + do for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + ac_path_GREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in +case `"$ac_path_GREP" --version 2>&1` in #( *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +#( *) ac_count=0 - $as_echo_n 0123456789 >"conftest.in" + printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" + printf "%s\n" 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val @@ -4619,19 +5234,24 @@ IFS=$as_save_IFS else ac_cv_path_GREP=$GREP fi - + ;; +esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +printf "%s\n" "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if ${ac_cv_path_EGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 +# Autoupdate added the next two lines to ensure that your configure +# script's behavior did not change. They are probably safe to remove. + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +printf %s "checking for egrep... " >&6; } +if test ${ac_cv_path_EGREP+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then @@ -4641,25 +5261,31 @@ else for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in egrep + do for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in +case `"$ac_path_EGREP" --version 2>&1` in #( *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +#( *) ac_count=0 - $as_echo_n 0123456789 >"conftest.in" + printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" + printf "%s\n" 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val @@ -4686,162 +5312,86 @@ else ac_cv_path_EGREP=$EGREP fi - fi + fi ;; +esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +printf "%s\n" "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" + EGREP_TRADITIONAL=$EGREP + ac_cv_path_EGREP_TRADITIONAL=$EGREP -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include -int -main () -{ +ac_fn_c_check_header_compile "$LINENO" "crypt.h" "ac_cv_header_crypt_h" "$ac_includes_default" +if test "x$ac_cv_header_crypt_h" = xyes +then : + printf "%s\n" "#define HAVE_CRYPT_H 1" >>confdefs.h - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include +ac_fn_c_check_header_compile "$LINENO" "poll.h" "ac_cv_header_poll_h" "$ac_includes_default" +if test "x$ac_cv_header_poll_h" = xyes +then : + printf "%s\n" "#define HAVE_POLL_H 1" >>confdefs.h -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no fi -rm -f conftest* +ac_fn_c_check_header_compile "$LINENO" "inttypes.h" "ac_cv_header_inttypes_h" "$ac_includes_default" +if test "x$ac_cv_header_inttypes_h" = xyes +then : + printf "%s\n" "#define HAVE_INTTYPES_H 1" >>confdefs.h fi +ac_fn_c_check_header_compile "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default" +if test "x$ac_cv_header_stdint_h" = xyes +then : + printf "%s\n" "#define HAVE_STDINT_H 1" >>confdefs.h -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no fi -rm -f conftest* +ac_fn_c_check_header_compile "$LINENO" "sys/devpoll.h" "ac_cv_header_sys_devpoll_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_devpoll_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_DEVPOLL_H 1" >>confdefs.h fi +ac_fn_c_check_header_compile "$LINENO" "sys/epoll.h" "ac_cv_header_sys_epoll_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_epoll_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_EPOLL_H 1" >>confdefs.h -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - -else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext fi +ac_fn_c_check_header_compile "$LINENO" "sys/event.h" "ac_cv_header_sys_event_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_event_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_EVENT_H 1" >>confdefs.h fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -$as_echo "#define STDC_HEADERS 1" >>confdefs.h +ac_fn_c_check_header_compile "$LINENO" "sys/param.h" "ac_cv_header_sys_param_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_param_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_PARAM_H 1" >>confdefs.h fi - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +ac_fn_c_check_header_compile "$LINENO" "sys/resource.h" "ac_cv_header_sys_resource_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_resource_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_RESOURCE_H 1" >>confdefs.h fi - -done - - -for ac_header in crypt.h poll.h inttypes.h stdint.h sys/devpoll.h sys/epoll.h sys/event.h sys/param.h sys/resource.h sys/socket.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +ac_fn_c_check_header_compile "$LINENO" "sys/socket.h" "ac_cv_header_sys_socket_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_socket_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_SOCKET_H 1" >>confdefs.h fi -done - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 -$as_echo_n "checking whether byte ordering is bigendian... " >&6; } -if ${ac_cv_c_bigendian+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_c_bigendian=unknown + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 +printf %s "checking whether byte ordering is bigendian... " >&6; } +if test ${ac_cv_c_bigendian+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_cv_c_bigendian=unknown # See if we're dealing with a universal compiler. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -4851,7 +5401,8 @@ else typedef int dummy; _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : # Check for potential -arch flags. It is not universal unless # there are at least two -arch flags with different values. @@ -4875,7 +5426,7 @@ if ac_fn_c_try_compile "$LINENO"; then : fi done fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext if test $ac_cv_c_bigendian = unknown; then # See if sys/param.h defines the BYTE_ORDER macro. cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4884,10 +5435,10 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext #include int -main () +main (void) { -#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ - && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \\ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \\ && LITTLE_ENDIAN) bogus endian macros #endif @@ -4896,7 +5447,8 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : # It does; now see whether it defined to BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -4904,7 +5456,7 @@ if ac_fn_c_try_compile "$LINENO"; then : #include int -main () +main (void) { #if BYTE_ORDER != BIG_ENDIAN not big endian @@ -4914,14 +5466,16 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_c_bigendian=yes -else - ac_cv_c_bigendian=no +else case e in #( + e) ac_cv_c_bigendian=no ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). @@ -4930,7 +5484,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext #include int -main () +main (void) { #if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) bogus endian macros @@ -4940,14 +5494,15 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : # It does; now see whether it defined to _BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { #ifndef _BIG_ENDIAN not big endian @@ -4957,50 +5512,55 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_c_bigendian=yes -else - ac_cv_c_bigendian=no +else case e in #( + e) ac_cv_c_bigendian=no ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # Compile a test program. - if test "$cross_compiling" = yes; then : + if test "$cross_compiling" = yes +then : # Try to guess by grepping values from an object file. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -short int ascii_mm[] = +unsigned short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; - short int ascii_ii[] = + unsigned short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; int use_ascii (int i) { return ascii_mm[i] + ascii_ii[i]; } - short int ebcdic_ii[] = + unsigned short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; - short int ebcdic_mm[] = + unsigned short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; int use_ebcdic (int i) { return ebcdic_mm[i] + ebcdic_ii[i]; } - extern int foo; - -int -main () -{ -return use_ascii (foo) == use_ebcdic (foo); - ; - return 0; -} + int + main (int argc, char **argv) + { + /* Intimidate the compiler so that it does not + optimize the arrays away. */ + char *p = argv[0]; + ascii_mm[1] = *p++; ebcdic_mm[1] = *p++; + ascii_ii[1] = *p++; ebcdic_ii[1] = *p++; + return use_ascii (argc) == use_ebcdic (*p); + } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then +if ac_fn_c_try_link "$LINENO" +then : + if grep BIGenDianSyS conftest$ac_exeext >/dev/null; then ac_cv_c_bigendian=yes fi - if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if grep LiTTleEnDian conftest$ac_exeext >/dev/null ; then if test "$ac_cv_c_bigendian" = unknown; then ac_cv_c_bigendian=no else @@ -5009,13 +5569,14 @@ if ac_fn_c_try_compile "$LINENO"; then : fi fi fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int -main () +main (void) { /* Are we little or big endian? From Harbison&Steele. */ @@ -5031,28 +5592,32 @@ main () return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ac_cv_c_bigendian=no -else - ac_cv_c_bigendian=yes +else case e in #( + e) ac_cv_c_bigendian=yes ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - fi + fi ;; +esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 -$as_echo "$ac_cv_c_bigendian" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 +printf "%s\n" "$ac_cv_c_bigendian" >&6; } case $ac_cv_c_bigendian in #( yes) - $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h + printf "%s\n" "#define WORDS_BIGENDIAN 1" >>confdefs.h ;; #( no) ;; #( universal) -$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h +printf "%s\n" "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h ;; #( *) @@ -5061,63 +5626,39 @@ $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h esac ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" -if test "x$ac_cv_type_size_t" = xyes; then : - -else - -cat >>confdefs.h <<_ACEOF -#define size_t unsigned int -_ACEOF +if test "x$ac_cv_type_size_t" = xyes +then : +else case e in #( + e) +printf "%s\n" "#define size_t unsigned int" >>confdefs.h + ;; +esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 -$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } -if ${ac_cv_header_time+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -int -main () -{ -if ((struct tm *) 0) -return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_time=yes -else - ac_cv_header_time=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 -$as_echo "$ac_cv_header_time" >&6; } -if test $ac_cv_header_time = yes; then -$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h +# Obsolete code to be removed. +if test $ac_cv_header_sys_time_h = yes; then + +printf "%s\n" "#define TIME_WITH_SYS_TIME 1" >>confdefs.h fi +# End of obsolete code. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 -$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } -if ${ac_cv_struct_tm+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 +printf %s "checking whether struct tm is in sys/time.h or time.h... " >&6; } +if test ${ac_cv_struct_tm+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int -main () +main (void) { struct tm tm; int *p = &tm.tm_sec; @@ -5126,293 +5667,300 @@ struct tm tm; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_struct_tm=time.h -else - ac_cv_struct_tm=sys/time.h +else case e in #( + e) ac_cv_struct_tm=sys/time.h ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 -$as_echo "$ac_cv_struct_tm" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 +printf "%s\n" "$ac_cv_struct_tm" >&6; } if test $ac_cv_struct_tm = sys/time.h; then -$as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h +printf "%s\n" "#define TM_IN_SYS_TIME 1" >>confdefs.h fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5 -$as_echo_n "checking for uid_t in sys/types.h... " >&6; } -if ${ac_cv_type_uid_t+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "uid_t" >/dev/null 2>&1; then : - ac_cv_type_uid_t=yes -else - ac_cv_type_uid_t=no -fi -rm -f conftest* +ac_fn_c_check_type "$LINENO" "uid_t" "ac_cv_type_uid_t" "$ac_includes_default" +if test "x$ac_cv_type_uid_t" = xyes +then : +else case e in #( + e) +printf "%s\n" "#define uid_t int" >>confdefs.h + ;; +esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5 -$as_echo "$ac_cv_type_uid_t" >&6; } -if test $ac_cv_type_uid_t = no; then - -$as_echo "#define uid_t int" >>confdefs.h - -$as_echo "#define gid_t int" >>confdefs.h +ac_fn_c_check_type "$LINENO" "gid_t" "ac_cv_type_gid_t" "$ac_includes_default" +if test "x$ac_cv_type_gid_t" = xyes +then : +else case e in #( + e) +printf "%s\n" "#define gid_t int" >>confdefs.h + ;; +esac fi # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# declarations like 'int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of short" >&5 -$as_echo_n "checking size of short... " >&6; } -if ${ac_cv_sizeof_short+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short))" "ac_cv_sizeof_short" "$ac_includes_default"; then : - -else - if test "$ac_cv_type_short" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of short" >&5 +printf %s "checking size of short... " >&6; } +if test ${ac_cv_sizeof_short+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short))" "ac_cv_sizeof_short" "$ac_includes_default" +then : + +else case e in #( + e) if test "$ac_cv_type_short" = yes; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (short) -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_short=0 - fi + fi ;; +esac fi - + ;; +esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_short" >&5 -$as_echo "$ac_cv_sizeof_short" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_short" >&5 +printf "%s\n" "$ac_cv_sizeof_short" >&6; } -cat >>confdefs.h <<_ACEOF -#define SIZEOF_SHORT $ac_cv_sizeof_short -_ACEOF +printf "%s\n" "#define SIZEOF_SHORT $ac_cv_sizeof_short" >>confdefs.h # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# declarations like 'int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 -$as_echo_n "checking size of int... " >&6; } -if ${ac_cv_sizeof_int+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default"; then : - -else - if test "$ac_cv_type_int" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 +printf %s "checking size of int... " >&6; } +if test ${ac_cv_sizeof_int+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default" +then : + +else case e in #( + e) if test "$ac_cv_type_int" = yes; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (int) -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_int=0 - fi + fi ;; +esac fi - + ;; +esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5 -$as_echo "$ac_cv_sizeof_int" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5 +printf "%s\n" "$ac_cv_sizeof_int" >&6; } -cat >>confdefs.h <<_ACEOF -#define SIZEOF_INT $ac_cv_sizeof_int -_ACEOF +printf "%s\n" "#define SIZEOF_INT $ac_cv_sizeof_int" >>confdefs.h # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# declarations like 'int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 -$as_echo_n "checking size of long... " >&6; } -if ${ac_cv_sizeof_long+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : - -else - if test "$ac_cv_type_long" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 +printf %s "checking size of long... " >&6; } +if test ${ac_cv_sizeof_long+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default" +then : + +else case e in #( + e) if test "$ac_cv_type_long" = yes; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (long) -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_long=0 - fi + fi ;; +esac fi - + ;; +esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 -$as_echo "$ac_cv_sizeof_long" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 +printf "%s\n" "$ac_cv_sizeof_long" >&6; } -cat >>confdefs.h <<_ACEOF -#define SIZEOF_LONG $ac_cv_sizeof_long -_ACEOF +printf "%s\n" "#define SIZEOF_LONG $ac_cv_sizeof_long" >>confdefs.h # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# declarations like 'int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5 -$as_echo_n "checking size of void *... " >&6; } -if ${ac_cv_sizeof_void_p+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void *))" "ac_cv_sizeof_void_p" "$ac_includes_default"; then : - -else - if test "$ac_cv_type_void_p" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5 +printf %s "checking size of void *... " >&6; } +if test ${ac_cv_sizeof_void_p+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void *))" "ac_cv_sizeof_void_p" "$ac_includes_default" +then : + +else case e in #( + e) if test "$ac_cv_type_void_p" = yes; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (void *) -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_void_p=0 - fi + fi ;; +esac fi - + ;; +esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_void_p" >&5 -$as_echo "$ac_cv_sizeof_void_p" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_void_p" >&5 +printf "%s\n" "$ac_cv_sizeof_void_p" >&6; } -cat >>confdefs.h <<_ACEOF -#define SIZEOF_VOID_P $ac_cv_sizeof_void_p -_ACEOF +printf "%s\n" "#define SIZEOF_VOID_P $ac_cv_sizeof_void_p" >>confdefs.h # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# declarations like 'int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int64_t" >&5 -$as_echo_n "checking size of int64_t... " >&6; } -if ${ac_cv_sizeof_int64_t+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int64_t))" "ac_cv_sizeof_int64_t" "$ac_includes_default"; then : - -else - if test "$ac_cv_type_int64_t" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of int64_t" >&5 +printf %s "checking size of int64_t... " >&6; } +if test ${ac_cv_sizeof_int64_t+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int64_t))" "ac_cv_sizeof_int64_t" "$ac_includes_default" +then : + +else case e in #( + e) if test "$ac_cv_type_int64_t" = yes; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (int64_t) -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_int64_t=0 - fi + fi ;; +esac fi - + ;; +esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int64_t" >&5 -$as_echo "$ac_cv_sizeof_int64_t" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int64_t" >&5 +printf "%s\n" "$ac_cv_sizeof_int64_t" >&6; } -cat >>confdefs.h <<_ACEOF -#define SIZEOF_INT64_T $ac_cv_sizeof_int64_t -_ACEOF +printf "%s\n" "#define SIZEOF_INT64_T $ac_cv_sizeof_int64_t" >>confdefs.h # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# declarations like 'int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long" >&5 -$as_echo_n "checking size of long long... " >&6; } -if ${ac_cv_sizeof_long_long+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long))" "ac_cv_sizeof_long_long" "$ac_includes_default"; then : - -else - if test "$ac_cv_type_long_long" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of long long" >&5 +printf %s "checking size of long long... " >&6; } +if test ${ac_cv_sizeof_long_long+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long))" "ac_cv_sizeof_long_long" "$ac_includes_default" +then : + +else case e in #( + e) if test "$ac_cv_type_long_long" = yes; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (long long) -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_long_long=0 - fi + fi ;; +esac fi - + ;; +esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long" >&5 -$as_echo "$ac_cv_sizeof_long_long" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long" >&5 +printf "%s\n" "$ac_cv_sizeof_long_long" >&6; } -cat >>confdefs.h <<_ACEOF -#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long -_ACEOF +printf "%s\n" "#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long" >>confdefs.h if test "$ac_cv_sizeof_int" = 2 ; then ac_fn_c_check_type "$LINENO" "int16_t" "ac_cv_type_int16_t" "$ac_includes_default" -if test "x$ac_cv_type_int16_t" = xyes; then : - -else - -cat >>confdefs.h <<_ACEOF -#define int16_t int -_ACEOF +if test "x$ac_cv_type_int16_t" = xyes +then : +else case e in #( + e) +printf "%s\n" "#define int16_t int" >>confdefs.h + ;; +esac fi ac_fn_c_check_type "$LINENO" "uint16_t" "ac_cv_type_uint16_t" "$ac_includes_default" -if test "x$ac_cv_type_uint16_t" = xyes; then : - -else - -cat >>confdefs.h <<_ACEOF -#define uint16_t unsigned int -_ACEOF +if test "x$ac_cv_type_uint16_t" = xyes +then : +else case e in #( + e) +printf "%s\n" "#define uint16_t unsigned int" >>confdefs.h + ;; +esac fi elif test "$ac_cv_sizeof_short" = 2 ; then ac_fn_c_check_type "$LINENO" "int16_t" "ac_cv_type_int16_t" "$ac_includes_default" -if test "x$ac_cv_type_int16_t" = xyes; then : - -else - -cat >>confdefs.h <<_ACEOF -#define int16_t short -_ACEOF +if test "x$ac_cv_type_int16_t" = xyes +then : +else case e in #( + e) +printf "%s\n" "#define int16_t short" >>confdefs.h + ;; +esac fi ac_fn_c_check_type "$LINENO" "uint16_t" "ac_cv_type_uint16_t" "$ac_includes_default" -if test "x$ac_cv_type_uint16_t" = xyes; then : - -else - -cat >>confdefs.h <<_ACEOF -#define uint16_t unsigned short -_ACEOF +if test "x$ac_cv_type_uint16_t" = xyes +then : +else case e in #( + e) +printf "%s\n" "#define uint16_t unsigned short" >>confdefs.h + ;; +esac fi else @@ -5420,71 +5968,71 @@ else fi if test "$ac_cv_sizeof_int" = 4 ; then ac_fn_c_check_type "$LINENO" "int32_t" "ac_cv_type_int32_t" "$ac_includes_default" -if test "x$ac_cv_type_int32_t" = xyes; then : - -else - -cat >>confdefs.h <<_ACEOF -#define int32_t int -_ACEOF +if test "x$ac_cv_type_int32_t" = xyes +then : +else case e in #( + e) +printf "%s\n" "#define int32_t int" >>confdefs.h + ;; +esac fi ac_fn_c_check_type "$LINENO" "uint32_t" "ac_cv_type_uint32_t" "$ac_includes_default" -if test "x$ac_cv_type_uint32_t" = xyes; then : - -else - -cat >>confdefs.h <<_ACEOF -#define uint32_t unsigned int -_ACEOF +if test "x$ac_cv_type_uint32_t" = xyes +then : +else case e in #( + e) +printf "%s\n" "#define uint32_t unsigned int" >>confdefs.h + ;; +esac fi elif test "$ac_cv_sizeof_short" = 4 ; then ac_fn_c_check_type "$LINENO" "int32_t" "ac_cv_type_int32_t" "$ac_includes_default" -if test "x$ac_cv_type_int32_t" = xyes; then : - -else - -cat >>confdefs.h <<_ACEOF -#define int32_t short -_ACEOF +if test "x$ac_cv_type_int32_t" = xyes +then : +else case e in #( + e) +printf "%s\n" "#define int32_t short" >>confdefs.h + ;; +esac fi ac_fn_c_check_type "$LINENO" "uint32_t" "ac_cv_type_uint32_t" "$ac_includes_default" -if test "x$ac_cv_type_uint32_t" = xyes; then : - -else - -cat >>confdefs.h <<_ACEOF -#define uint32_t unsigned short -_ACEOF +if test "x$ac_cv_type_uint32_t" = xyes +then : +else case e in #( + e) +printf "%s\n" "#define uint32_t unsigned short" >>confdefs.h + ;; +esac fi elif test "$ac_cv_sizeof_long" = 4 ; then ac_fn_c_check_type "$LINENO" "int32_t" "ac_cv_type_int32_t" "$ac_includes_default" -if test "x$ac_cv_type_int32_t" = xyes; then : - -else - -cat >>confdefs.h <<_ACEOF -#define int32_t long -_ACEOF +if test "x$ac_cv_type_int32_t" = xyes +then : +else case e in #( + e) +printf "%s\n" "#define int32_t long" >>confdefs.h + ;; +esac fi ac_fn_c_check_type "$LINENO" "uint32_t" "ac_cv_type_uint32_t" "$ac_includes_default" -if test "x$ac_cv_type_uint32_t" = xyes; then : - -else - -cat >>confdefs.h <<_ACEOF -#define uint32_t unsigned long -_ACEOF +if test "x$ac_cv_type_uint32_t" = xyes +then : +else case e in #( + e) +printf "%s\n" "#define uint32_t unsigned long" >>confdefs.h + ;; +esac fi else @@ -5492,36 +6040,38 @@ else fi if test "$ac_cv_sizeof_int64_t" = 8 ; then ac_fn_c_check_type "$LINENO" "int64_t" "ac_cv_type_int64_t" "$ac_includes_default" -if test "x$ac_cv_type_int64_t" = xyes; then : +if test "x$ac_cv_type_int64_t" = xyes +then : fi ac_fn_c_check_type "$LINENO" "uint64_t" "ac_cv_type_uint64_t" "$ac_includes_default" -if test "x$ac_cv_type_uint64_t" = xyes; then : +if test "x$ac_cv_type_uint64_t" = xyes +then : fi elif test "$ac_cv_sizeof_long_long" = 8 ; then ac_fn_c_check_type "$LINENO" "int64_t" "ac_cv_type_int64_t" "$ac_includes_default" -if test "x$ac_cv_type_int64_t" = xyes; then : - -else - -cat >>confdefs.h <<_ACEOF -#define int64_t long long -_ACEOF +if test "x$ac_cv_type_int64_t" = xyes +then : +else case e in #( + e) +printf "%s\n" "#define int64_t long long" >>confdefs.h + ;; +esac fi - ac_fn_c_check_type "$LINENO" "uint64_t" "ac_cv_type_uint64_t" "$ac_includes_default" -if test "x$ac_cv_type_uint64_t" = xyes; then : - -else - -cat >>confdefs.h <<_ACEOF -#define uint64_t unsigned long long -_ACEOF + ac_fn_c_check_type "$LINENO" "uint64_t" "ac_cv_type_uint64_t" "$ac_includes_default" +if test "x$ac_cv_type_uint64_t" = xyes +then : +else case e in #( + e) +printf "%s\n" "#define uint64_t unsigned long long" >>confdefs.h + ;; +esac fi else @@ -5530,26 +6080,30 @@ fi ac_fn_c_check_type "$LINENO" "struct sockaddr_in6" "ac_cv_type_struct_sockaddr_in6" "#include #include " -if test "x$ac_cv_type_struct_sockaddr_in6" = xyes; then : +if test "x$ac_cv_type_struct_sockaddr_in6" = xyes +then : unet_have_sockaddr_in6="yes" -else - unet_have_sockaddr_in6="no" +else case e in #( + e) unet_have_sockaddr_in6="no" ;; +esac fi ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" "#include #include " -if test "x$ac_cv_type_socklen_t" = xyes; then : - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socklen_t equivalent" >&5 -$as_echo_n "checking for socklen_t equivalent... " >&6; } - if ${curl_cv_socklen_t_equiv+:} false; then : - $as_echo_n "(cached) " >&6 -else - +if test "x$ac_cv_type_socklen_t" = xyes +then : + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for socklen_t equivalent" >&5 +printf %s "checking for socklen_t equivalent... " >&6; } + if test ${curl_cv_socklen_t_equiv+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) curl_cv_socklen_t_equiv= for arg2 in "struct sockaddr" void ; do for t in int size_t unsigned long "unsigned long" ; do @@ -5559,7 +6113,7 @@ else #include int getpeername (int $arg2 *, $t *); int -main () +main (void) { $t len; getpeername(0, 0, &len); @@ -5567,45 +6121,60 @@ $t len; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : curl_cv_socklen_t_equiv="$t" break fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done done + ;; +esac +fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $curl_cv_socklen_t_equiv" >&5 +printf "%s\n" "$curl_cv_socklen_t_equiv" >&6; } + +printf "%s\n" "#define socklen_t $curl_cv_socklen_t_equiv" >>confdefs.h + ;; +esac fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $curl_cv_socklen_t_equiv" >&5 -$as_echo "$curl_cv_socklen_t_equiv" >&6; } -cat >>confdefs.h <<_ACEOF -#define socklen_t $curl_cv_socklen_t_equiv -_ACEOF +ac_fn_c_check_func "$LINENO" "kqueue" "ac_cv_func_kqueue" +if test "x$ac_cv_func_kqueue" = xyes +then : + printf "%s\n" "#define HAVE_KQUEUE 1" >>confdefs.h fi +ac_fn_c_check_func "$LINENO" "setrlimit" "ac_cv_func_setrlimit" +if test "x$ac_cv_func_setrlimit" = xyes +then : + printf "%s\n" "#define HAVE_SETRLIMIT 1" >>confdefs.h +fi +ac_fn_c_check_func "$LINENO" "getrusage" "ac_cv_func_getrusage" +if test "x$ac_cv_func_getrusage" = xyes +then : + printf "%s\n" "#define HAVE_GETRUSAGE 1" >>confdefs.h -for ac_func in kqueue setrlimit getrusage times -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF +fi +ac_fn_c_check_func "$LINENO" "times" "ac_cv_func_times" +if test "x$ac_cv_func_times" = xyes +then : + printf "%s\n" "#define HAVE_TIMES 1" >>confdefs.h fi -done -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sys/wait.h that is POSIX.1 compatible" >&5 -$as_echo_n "checking for sys/wait.h that is POSIX.1 compatible... " >&6; } -if ${ac_cv_header_sys_wait_h+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sys/wait.h that is POSIX.1 compatible" >&5 +printf %s "checking for sys/wait.h that is POSIX.1 compatible... " >&6; } +if test ${ac_cv_header_sys_wait_h+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -5617,7 +6186,7 @@ else #endif int -main () +main (void) { int s; wait (&s); @@ -5626,33 +6195,38 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_header_sys_wait_h=yes -else - ac_cv_header_sys_wait_h=no +else case e in #( + e) ac_cv_header_sys_wait_h=no ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_sys_wait_h" >&5 -$as_echo "$ac_cv_header_sys_wait_h" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_sys_wait_h" >&5 +printf "%s\n" "$ac_cv_header_sys_wait_h" >&6; } if test $ac_cv_header_sys_wait_h = yes; then -$as_echo "#define HAVE_SYS_WAIT_H 1" >>confdefs.h +printf "%s\n" "#define HAVE_SYS_WAIT_H 1" >>confdefs.h fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for restartable system calls" >&5 -$as_echo_n "checking for restartable system calls... " >&6; } -if ${ac_cv_sys_restartable_syscalls+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for restartable system calls" >&5 +printf %s "checking for restartable system calls... " >&6; } +if test ${ac_cv_sys_restartable_syscalls+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test "$cross_compiling" = yes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling -See \`config.log' for more details" "$LINENO" 5; } -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +See 'config.log' for more details" "$LINENO" 5; } +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Exit 0 (true) if wait returns something other than -1, i.e. the pid of the child, which means that wait was restarted @@ -5667,13 +6241,12 @@ $ac_includes_default /* Some platforms explicitly require an extern "C" signal handler when using C++. */ #ifdef __cplusplus -extern "C" void ucatch (int dummy) { } -#else -void ucatch (dummy) int dummy; { } +extern "C" #endif +void ucatch (int dummy) { } int -main () +main (void) { int i = fork (), status; @@ -5694,80 +6267,91 @@ main () return status == -1; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ac_cv_sys_restartable_syscalls=yes -else - ac_cv_sys_restartable_syscalls=no +else case e in #( + e) ac_cv_sys_restartable_syscalls=no ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - + ;; +esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_restartable_syscalls" >&5 -$as_echo "$ac_cv_sys_restartable_syscalls" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_restartable_syscalls" >&5 +printf "%s\n" "$ac_cv_sys_restartable_syscalls" >&6; } if test $ac_cv_sys_restartable_syscalls = yes; then -$as_echo "#define HAVE_RESTARTABLE_SYSCALLS 1" >>confdefs.h +printf "%s\n" "#define HAVE_RESTARTABLE_SYSCALLS 1" >>confdefs.h fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for donuts" >&5 -$as_echo_n "checking for donuts... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for donuts" >&5 +printf %s "checking for donuts... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AWK+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$AWK"; then +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AWK+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS -fi +fi ;; +esac fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 -$as_echo "$AWK" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +printf "%s\n" "$AWK" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi test -n "$AWK" && break done -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} -ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat >conftest.make <<\_ACEOF +ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval test \${ac_cv_prog_make_${ac_make}_set+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' @@ -5779,19 +6363,21 @@ case `${MAKE-make} -f conftest.make 2>/dev/null` in *) eval ac_cv_prog_make_${ac_make}_set=no;; esac -rm -f conftest.make +rm -f conftest.make ;; +esac fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } SET_MAKE= else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi -# Find a good install program. We prefer a C program (faster), + + # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install @@ -5805,20 +6391,25 @@ fi # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 -$as_echo_n "checking for a BSD-compatible install... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +printf %s "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then -if ${ac_cv_path_install+:} false; then : - $as_echo_n "(cached) " >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +if test ${ac_cv_path_install+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in #(( - ./ | .// | /[cC]/* | \ + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + # Account for fact that we put trailing slashes in our PATH walk. +case $as_dir in #(( + ./ | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; @@ -5828,13 +6419,13 @@ case $as_dir/ in #(( # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext"; then if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + grep dspmsg "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + grep pwplus "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else @@ -5842,12 +6433,12 @@ case $as_dir/ in #(( echo one > conftest.one echo two > conftest.two mkdir conftest.dir - if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + if "$as_dir$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir/" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + ac_cv_path_install="$as_dir$ac_prog$ac_exec_ext -c" break 3 fi fi @@ -5861,9 +6452,10 @@ esac IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir - + ;; +esac fi - if test "${ac_cv_path_install+set}" = set; then + if test ${ac_cv_path_install+y}; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a @@ -5873,8 +6465,8 @@ fi INSTALL=$ac_install_sh fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 -$as_echo "$INSTALL" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +printf "%s\n" "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. @@ -5884,27 +6476,28 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 -$as_echo_n "checking whether ln -s works... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +printf %s "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 -$as_echo "no, using $LN_S" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +printf "%s\n" "no, using $LN_S" >&6; } fi for ac_prog in rm do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_RMPROG+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $RMPROG in +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_RMPROG+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) case $RMPROG in [\\/]* | ?:[\\/]*) ac_cv_path_RMPROG="$RMPROG" # Let the user override the test with a path. ;; @@ -5913,11 +6506,15 @@ else for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_RMPROG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_RMPROG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5925,15 +6522,16 @@ done IFS=$as_save_IFS ;; +esac ;; esac fi RMPROG=$ac_cv_path_RMPROG if test -n "$RMPROG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RMPROG" >&5 -$as_echo "$RMPROG" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RMPROG" >&5 +printf "%s\n" "$RMPROG" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -5945,12 +6543,13 @@ for ac_prog in sh do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_SHPROG+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $SHPROG in +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_SHPROG+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) case $SHPROG in [\\/]* | ?:[\\/]*) ac_cv_path_SHPROG="$SHPROG" # Let the user override the test with a path. ;; @@ -5959,11 +6558,15 @@ else for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_SHPROG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_SHPROG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5971,15 +6574,16 @@ done IFS=$as_save_IFS ;; +esac ;; esac fi SHPROG=$ac_cv_path_SHPROG if test -n "$SHPROG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SHPROG" >&5 -$as_echo "$SHPROG" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $SHPROG" >&5 +printf "%s\n" "$SHPROG" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -5992,38 +6596,44 @@ for ac_prog in flex lex do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_LEX+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$LEX"; then +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_LEX+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -n "$LEX"; then ac_cv_prog_LEX="$LEX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_LEX="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS -fi +fi ;; +esac fi LEX=$ac_cv_prog_LEX if test -n "$LEX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LEX" >&5 -$as_echo "$LEX" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LEX" >&5 +printf "%s\n" "$LEX" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -6031,15 +6641,26 @@ fi done test -n "$LEX" || LEX=":" -if test "x$LEX" != "x:"; then - cat >conftest.l <<_ACEOF + if test "x$LEX" != "x:"; then + cat >conftest.l <<_ACEOF +%{ +#ifdef __cplusplus +extern "C" +#endif +int yywrap(void); +%} %% a { ECHO; } b { REJECT; } c { yymore (); } d { yyless (1); } e { /* IRIX 6.5 flex 2.5.4 underquotes its yyless argument. */ - yyless ((input () != 0)); } +#ifdef __cplusplus + yyless ((yyinput () != 0)); +#else + yyless ((input () != 0)); +#endif + } f { unput (yytext[0]); } . { BEGIN INITIAL; } %% @@ -6047,101 +6668,218 @@ f { unput (yytext[0]); } extern char *yytext; #endif int +yywrap (void) +{ + return 1; +} +int main (void) { - return ! yylex () + ! yywrap (); + return ! yylex (); } _ACEOF +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for lex output file root" >&5 +printf %s "checking for lex output file root... " >&6; } +if test ${ac_cv_prog_lex_root+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) +ac_cv_prog_lex_root=unknown { { ac_try="$LEX conftest.l" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$LEX conftest.l") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking lex output file root" >&5 -$as_echo_n "checking lex output file root... " >&6; } -if ${ac_cv_prog_lex_root+:} false; then : - $as_echo_n "(cached) " >&6 -else - + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && if test -f lex.yy.c; then ac_cv_prog_lex_root=lex.yy elif test -f lexyy.c; then ac_cv_prog_lex_root=lexyy -else - as_fn_error $? "cannot find output from $LEX; giving up" "$LINENO" 5 +fi ;; +esac fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_root" >&5 +printf "%s\n" "$ac_cv_prog_lex_root" >&6; } +if test "$ac_cv_prog_lex_root" = unknown +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cannot find output from $LEX; giving up on $LEX" >&5 +printf "%s\n" "$as_me: WARNING: cannot find output from $LEX; giving up on $LEX" >&2;} + LEX=: LEXLIB= fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_root" >&5 -$as_echo "$ac_cv_prog_lex_root" >&6; } LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root -if test -z "${LEXLIB+set}"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking lex library" >&5 -$as_echo_n "checking lex library... " >&6; } -if ${ac_cv_lib_lex+:} false; then : - $as_echo_n "(cached) " >&6 -else +if test ${LEXLIB+y} +then : + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for lex library" >&5 +printf %s "checking for lex library... " >&6; } +if test ${ac_cv_lib_lex+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + ac_save_LIBS="$LIBS" + ac_found=false + for ac_cv_lib_lex in 'none needed' -lfl -ll 'not found'; do + case $ac_cv_lib_lex in #( + 'none needed') : + ;; #( + 'not found') : + break ;; #( + *) : + LIBS="$ac_cv_lib_lex $ac_save_LIBS" ;; #( + *) : + ;; +esac - ac_save_LIBS=$LIBS - ac_cv_lib_lex='none needed' - for ac_lib in '' -lfl -ll; do - LIBS="$ac_lib $ac_save_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ `cat $LEX_OUTPUT_ROOT.c` _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_lex=$ac_lib +if ac_fn_c_try_link "$LINENO" +then : + ac_found=: fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - test "$ac_cv_lib_lex" != 'none needed' && break + if $ac_found; then + break + fi done - LIBS=$ac_save_LIBS + LIBS="$ac_save_LIBS" + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lex" >&5 +printf "%s\n" "$ac_cv_lib_lex" >&6; } + if test "$ac_cv_lib_lex" = 'not found' +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: required lex library not found; giving up on $LEX" >&5 +printf "%s\n" "$as_me: WARNING: required lex library not found; giving up on $LEX" >&2;} + LEX=: LEXLIB= +elif test "$ac_cv_lib_lex" = 'none needed' +then : + LEXLIB='' +else case e in #( + e) LEXLIB=$ac_cv_lib_lex ;; +esac +fi + ac_save_LIBS="$LIBS" + LIBS= + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing yywrap" >&5 +printf %s "checking for library containing yywrap... " >&6; } +if test ${ac_cv_search_yywrap+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char yywrap (void); +int +main (void) +{ +return yywrap (); + ; + return 0; +} +_ACEOF +for ac_lib in '' fl l +do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO" +then : + ac_cv_search_yywrap=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext + if test ${ac_cv_search_yywrap+y} +then : + break +fi +done +if test ${ac_cv_search_yywrap+y} +then : +else case e in #( + e) ac_cv_search_yywrap=no ;; +esac +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_yywrap" >&5 +printf "%s\n" "$ac_cv_search_yywrap" >&6; } +ac_res=$ac_cv_search_yywrap +if test "$ac_res" != no +then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + LEXLIB="$LIBS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lex" >&5 -$as_echo "$ac_cv_lib_lex" >&6; } - test "$ac_cv_lib_lex" != 'none needed' && LEXLIB=$ac_cv_lib_lex + + LIBS="$ac_save_LIBS" ;; +esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether yytext is a pointer" >&5 -$as_echo_n "checking whether yytext is a pointer... " >&6; } -if ${ac_cv_prog_lex_yytext_pointer+:} false; then : - $as_echo_n "(cached) " >&6 -else - # POSIX says lex can declare yytext either as a pointer or an array; the +if test "$LEX" != : +then : + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether yytext is a pointer" >&5 +printf %s "checking whether yytext is a pointer... " >&6; } +if test ${ac_cv_prog_lex_yytext_pointer+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) # POSIX says lex can declare yytext either as a pointer or an array; the # default is implementation-dependent. Figure out which it is, since # not all implementations provide the %pointer and %array declarations. ac_cv_prog_lex_yytext_pointer=no -ac_save_LIBS=$LIBS -LIBS="$LEXLIB $ac_save_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define YYTEXT_POINTER 1 `cat $LEX_OUTPUT_ROOT.c` _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_prog_lex_yytext_pointer=yes fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_save_LIBS - +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; +esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_yytext_pointer" >&5 -$as_echo "$ac_cv_prog_lex_yytext_pointer" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_yytext_pointer" >&5 +printf "%s\n" "$ac_cv_prog_lex_yytext_pointer" >&6; } if test $ac_cv_prog_lex_yytext_pointer = yes; then -$as_echo "#define YYTEXT_POINTER 1" >>confdefs.h +printf "%s\n" "#define YYTEXT_POINTER 1" >>confdefs.h + +fi fi rm -f conftest.l $LEX_OUTPUT_ROOT.c @@ -6159,38 +6897,44 @@ for ac_prog in 'bison -y' byacc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_YACC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$YACC"; then +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_YACC+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_YACC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS -fi +fi ;; +esac fi YACC=$ac_cv_prog_YACC if test -n "$YACC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $YACC" >&5 -$as_echo "$YACC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $YACC" >&5 +printf "%s\n" "$YACC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -6203,22 +6947,24 @@ if test "$YACC" = ":" ; then elif echo "" | $YACC -V -v --version > /dev/null 2>&1 ; then : else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $YACC may not work as yacc." >&5 -$as_echo "$as_me: WARNING: $YACC may not work as yacc." >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $YACC may not work as yacc." >&5 +printf "%s\n" "$as_me: WARNING: $YACC may not work as yacc." >&2;} fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for posix non-blocking" >&5 -$as_echo_n "checking for posix non-blocking... " >&6; } -if ${unet_cv_sys_nonblocking_posix+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for posix non-blocking" >&5 +printf %s "checking for posix non-blocking... " >&6; } +if test ${unet_cv_sys_nonblocking_posix+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test "$cross_compiling" = yes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling -See \`config.log' for more details" "$LINENO" 5; } -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +See 'config.log' for more details" "$LINENO" 5; } +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -6244,35 +6990,41 @@ int main(void) exit(1); } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : unet_cv_sys_nonblocking_posix=yes -else - unet_cv_sys_nonblocking_posix=no +else case e in #( + e) unet_cv_sys_nonblocking_posix=no ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - + ;; +esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $unet_cv_sys_nonblocking_posix" >&5 -$as_echo "$unet_cv_sys_nonblocking_posix" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $unet_cv_sys_nonblocking_posix" >&5 +printf "%s\n" "$unet_cv_sys_nonblocking_posix" >&6; } if test $unet_cv_sys_nonblocking_posix = yes; then -$as_echo "#define NBLOCK_POSIX /**/" >>confdefs.h +printf "%s\n" "#define NBLOCK_POSIX /**/" >>confdefs.h else -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for bsd non-blocking" >&5 -$as_echo_n "checking for bsd non-blocking... " >&6; } -if ${unet_cv_sys_nonblocking_bsd+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for bsd non-blocking" >&5 +printf %s "checking for bsd non-blocking... " >&6; } +if test ${unet_cv_sys_nonblocking_bsd+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test "$cross_compiling" = yes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling -See \`config.log' for more details" "$LINENO" 5; } -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +See 'config.log' for more details" "$LINENO" 5; } +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -6298,70 +7050,80 @@ int main(void) exit(1); } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : unet_cv_sys_nonblocking_bsd=yes -else - unet_cv_sys_nonblocking_bsd=no +else case e in #( + e) unet_cv_sys_nonblocking_bsd=no ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - + ;; +esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $unet_cv_sys_nonblocking_bsd" >&5 -$as_echo "$unet_cv_sys_nonblocking_bsd" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $unet_cv_sys_nonblocking_bsd" >&5 +printf "%s\n" "$unet_cv_sys_nonblocking_bsd" >&6; } if test $unet_cv_sys_nonblocking_bsd = yes; then -$as_echo "#define NBLOCK_BSD /**/" >>confdefs.h +printf "%s\n" "#define NBLOCK_BSD /**/" >>confdefs.h else -$as_echo "#define NBLOCK_SYSV /**/" >>confdefs.h +printf "%s\n" "#define NBLOCK_SYSV /**/" >>confdefs.h fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for posix signals" >&5 -$as_echo_n "checking for posix signals... " >&6; } -if ${unet_cv_sys_signal_posix+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for posix signals" >&5 +printf %s "checking for posix signals... " >&6; } +if test ${unet_cv_sys_signal_posix+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { sigaction(SIGTERM, (struct sigaction *)0L, (struct sigaction *)0L) ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : unet_cv_sys_signal_posix=yes -else - unet_cv_sys_signal_posix=no +else case e in #( + e) unet_cv_sys_signal_posix=no ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $unet_cv_sys_signal_posix" >&5 -$as_echo "$unet_cv_sys_signal_posix" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $unet_cv_sys_signal_posix" >&5 +printf "%s\n" "$unet_cv_sys_signal_posix" >&6; } if test $unet_cv_sys_signal_posix = yes; then -$as_echo "#define POSIX_SIGNALS /**/" >>confdefs.h +printf "%s\n" "#define POSIX_SIGNALS /**/" >>confdefs.h else -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for bsd reliable signals" >&5 -$as_echo_n "checking for bsd reliable signals... " >&6; } -if ${unet_cv_sys_signal_bsd+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for bsd reliable signals" >&5 +printf %s "checking for bsd reliable signals... " >&6; } +if test ${unet_cv_sys_signal_bsd+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test "$cross_compiling" = yes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling -See \`config.log' for more details" "$LINENO" 5; } -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +See 'config.log' for more details" "$LINENO" 5; } +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int calls = 0; @@ -6379,60 +7141,64 @@ int main(void) exit (0); } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : unet_cv_sys_signal_bsd=yes -else - unet_cv_sys_signal_bsd=no +else case e in #( + e) unet_cv_sys_signal_bsd=no ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - + ;; +esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $unet_cv_sys_signal_bsd" >&5 -$as_echo "$unet_cv_sys_signal_bsd" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $unet_cv_sys_signal_bsd" >&5 +printf "%s\n" "$unet_cv_sys_signal_bsd" >&6; } if test $unet_cv_sys_signal_bsd = yes; then -$as_echo "#define BSD_RELIABLE_SIGNALS /**/" >>confdefs.h +printf "%s\n" "#define BSD_RELIABLE_SIGNALS /**/" >>confdefs.h else -$as_echo "#define SYSV_UNRELIABLE_SIGNALS /**/" >>confdefs.h +printf "%s\n" "#define SYSV_UNRELIABLE_SIGNALS /**/" >>confdefs.h fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for OS-dependent information" >&5 -$as_echo_n "checking for OS-dependent information... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for OS-dependent information" >&5 +printf %s "checking for OS-dependent information... " >&6; } case "$host" in *-linux*) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Linux ($host) found." >&5 -$as_echo "Linux ($host) found." >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Linux ($host) found." >&5 +printf "%s\n" "Linux ($host) found." >&6; } unet_poll_syscall=yes ;; *-solaris*) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Solaris ($host) found." >&5 -$as_echo "Solaris ($host) found." >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Solaris ($host) found." >&5 +printf "%s\n" "Solaris ($host) found." >&6; } if test x"$ac_cv_header_poll_h" = xyes; then unet_poll_syscall=yes else unet_poll_syscall=no fi -$as_echo "#define IRCU_SOLARIS 1" >>confdefs.h +printf "%s\n" "#define IRCU_SOLARIS 1" >>confdefs.h ;; *-sunos*) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Solaris ($host) found." >&5 -$as_echo "Solaris ($host) found." >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Solaris ($host) found." >&5 +printf "%s\n" "Solaris ($host) found." >&6; } unet_poll_syscall=no ;; *-openbsd*) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: OpenBSD ($host) found." >&5 -$as_echo "OpenBSD ($host) found." >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: OpenBSD ($host) found." >&5 +printf "%s\n" "OpenBSD ($host) found." >&6; } if test x"$ac_cv_header_poll_h" = xyes; then unet_poll_syscall=yes else @@ -6441,8 +7207,8 @@ $as_echo "OpenBSD ($host) found." >&6; } ;; *-*bsd*) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Generic BSD ($host) found." >&5 -$as_echo "Generic BSD ($host) found." >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Generic BSD ($host) found." >&5 +printf "%s\n" "Generic BSD ($host) found." >&6; } if test x"$ac_cv_header_poll_h" = xyes; then unet_poll_syscall=yes else @@ -6451,32 +7217,36 @@ $as_echo "Generic BSD ($host) found." >&6; } ;; *-darwin*) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Darwin (Mac OS X) ($host) found." >&5 -$as_echo "Darwin (Mac OS X) ($host) found." >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Darwin (Mac OS X) ($host) found." >&5 +printf "%s\n" "Darwin (Mac OS X) ($host) found." >&6; } unet_poll_syscall=no ;; *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Unknown system type $host found." >&5 -$as_echo "Unknown system type $host found." >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unknown OS type; using generic routines." >&5 -$as_echo "$as_me: WARNING: Unknown OS type; using generic routines." >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Unknown system type $host found." >&5 +printf "%s\n" "Unknown system type $host found." >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Unknown OS type; using generic routines." >&5 +printf "%s\n" "$as_me: WARNING: Unknown OS type; using generic routines." >&2;} unet_poll_syscall=no ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable use of poll()" >&5 -$as_echo_n "checking whether to enable use of poll()... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable use of poll()" >&5 +printf %s "checking whether to enable use of poll()... " >&6; } # Check whether --enable-poll was given. -if test "${enable_poll+set}" = set; then : +if test ${enable_poll+y} +then : enableval=$enable_poll; unet_cv_enable_poll=$enable_poll -else - if ${unet_cv_enable_poll+:} false; then : - $as_echo_n "(cached) " >&6 -else - unet_cv_enable_poll=$unet_poll_syscall +else case e in #( + e) if test ${unet_cv_enable_poll+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) unet_cv_enable_poll=$unet_poll_syscall ;; +esac fi - + ;; +esac fi @@ -6485,12 +7255,12 @@ if test x"$ac_cv_header_poll_h" != xyes; then unet_cv_enable_poll=no fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $unet_cv_enable_poll" >&5 -$as_echo "$unet_cv_enable_poll" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $unet_cv_enable_poll" >&5 +printf "%s\n" "$unet_cv_enable_poll" >&6; } if test x"$unet_cv_enable_poll" = xyes; then -$as_echo "#define USE_POLL 1" >>confdefs.h +printf "%s\n" "#define USE_POLL 1" >>confdefs.h ENGINE_C=engine_poll.c else @@ -6498,46 +7268,54 @@ else fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable debug mode" >&5 -$as_echo_n "checking whether to enable debug mode... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable debug mode" >&5 +printf %s "checking whether to enable debug mode... " >&6; } # Check whether --enable-debug was given. -if test "${enable_debug+set}" = set; then : +if test ${enable_debug+y} +then : enableval=$enable_debug; unet_cv_enable_debug=$enable_debug -else - if ${unet_cv_enable_debug+:} false; then : - $as_echo_n "(cached) " >&6 -else - unet_cv_enable_debug=no +else case e in #( + e) if test ${unet_cv_enable_debug+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) unet_cv_enable_debug=no ;; +esac fi - + ;; +esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $unet_cv_enable_debug" >&5 -$as_echo "$unet_cv_enable_debug" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $unet_cv_enable_debug" >&5 +printf "%s\n" "$unet_cv_enable_debug" >&6; } if test x"$unet_cv_enable_debug" = xyes; then -$as_echo "#define DEBUGMODE 1" >>confdefs.h +printf "%s\n" "#define DEBUGMODE 1" >>confdefs.h fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable leak detection" >&5 -$as_echo_n "checking whether to enable leak detection... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable leak detection" >&5 +printf %s "checking whether to enable leak detection... " >&6; } # Check whether --with-leak-detect was given. -if test "${with_leak_detect+set}" = set; then : +if test ${with_leak_detect+y} +then : withval=$with_leak_detect; unet_cv_with_leak_detect=$with_leak_detect -else - if ${unet_cv_with_leak_detect+:} false; then : - $as_echo_n "(cached) " >&6 -else - unet_cv_with_leak_detect=no +else case e in #( + e) if test ${unet_cv_with_leak_detect+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) unet_cv_with_leak_detect=no ;; +esac fi - + ;; +esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $unet_cv_enable_leak_detect" >&5 -$as_echo "$unet_cv_enable_leak_detect" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $unet_cv_enable_leak_detect" >&5 +printf "%s\n" "$unet_cv_enable_leak_detect" >&6; } if test x"$unet_cv_with_leak_detect" != xno; then LIBS="-lgc $LIBS" @@ -6549,149 +7327,177 @@ fi # Check whether --with-ipv6 was given. -if test "${with_ipv6+set}" = set; then : +if test ${with_ipv6+y} +then : withval=$with_ipv6; ac_cv_use_ipv6=$withval -else - ac_cv_use_ipv6=$unet_have_sockaddr_in6 +else case e in #( + e) ac_cv_use_ipv6=$unet_have_sockaddr_in6 ;; +esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use IPv6" >&5 -$as_echo_n "checking whether to use IPv6... " >&6; } -if ${ac_cv_use_ipv6+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_use_ipv6=no +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use IPv6" >&5 +printf %s "checking whether to use IPv6... " >&6; } +if test ${ac_cv_use_ipv6+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_cv_use_ipv6=no ;; +esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_use_ipv6" >&5 -$as_echo "$ac_cv_use_ipv6" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_use_ipv6" >&5 +printf "%s\n" "$ac_cv_use_ipv6" >&6; } if test x"$ac_cv_use_ipv6" != "xno" ; then -$as_echo "#define IPV6 1" >>confdefs.h +printf "%s\n" "#define IPV6 1" >>confdefs.h fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable asserts" >&5 -$as_echo_n "checking whether to enable asserts... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable asserts" >&5 +printf %s "checking whether to enable asserts... " >&6; } # Check whether --enable-asserts was given. -if test "${enable_asserts+set}" = set; then : +if test ${enable_asserts+y} +then : enableval=$enable_asserts; unet_cv_enable_asserts=$enable_asserts -else - if ${unet_cv_enable_asserts+:} false; then : - $as_echo_n "(cached) " >&6 -else - unet_cv_enable_asserts=yes +else case e in #( + e) if test ${unet_cv_enable_asserts+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) unet_cv_enable_asserts=yes ;; +esac fi - + ;; +esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $unet_cv_enable_asserts" >&5 -$as_echo "$unet_cv_enable_asserts" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $unet_cv_enable_asserts" >&5 +printf "%s\n" "$unet_cv_enable_asserts" >&6; } if test x"$unet_cv_enable_asserts" = xno; then -$as_echo "#define NDEBUG 1" >>confdefs.h +printf "%s\n" "#define NDEBUG 1" >>confdefs.h fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable profiling support (gprof)" >&5 -$as_echo_n "checking whether to enable profiling support (gprof)... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable profiling support (gprof)" >&5 +printf %s "checking whether to enable profiling support (gprof)... " >&6; } # Check whether --enable-profile was given. -if test "${enable_profile+set}" = set; then : +if test ${enable_profile+y} +then : enableval=$enable_profile; unet_cv_enable_profile=$enable_profile -else - if ${unet_cv_enable_profile+:} false; then : - $as_echo_n "(cached) " >&6 -else - unet_cv_enable_profile=no +else case e in #( + e) if test ${unet_cv_enable_profile+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) unet_cv_enable_profile=no ;; +esac fi - + ;; +esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $unet_cv_enable_profile" >&5 -$as_echo "$unet_cv_enable_profile" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $unet_cv_enable_profile" >&5 +printf "%s\n" "$unet_cv_enable_profile" >&6; } if test x"$unet_cv_enable_profile" = xyes; then CFLAGS="-pg $CFLAGS" LDFLAGS="-pg $LDFLAGS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable pedantic compiler warnings" >&5 -$as_echo_n "checking whether to enable pedantic compiler warnings... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable pedantic compiler warnings" >&5 +printf %s "checking whether to enable pedantic compiler warnings... " >&6; } # Check whether --enable-pedantic was given. -if test "${enable_pedantic+set}" = set; then : +if test ${enable_pedantic+y} +then : enableval=$enable_pedantic; unet_cv_enable_pedantic=$enable_pedantic -else - if ${unet_cv_enable_pedantic+:} false; then : - $as_echo_n "(cached) " >&6 -else - unet_cv_enable_pedantic=no +else case e in #( + e) if test ${unet_cv_enable_pedantic+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) unet_cv_enable_pedantic=no ;; +esac fi - + ;; +esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $unet_cv_enable_pedantic" >&5 -$as_echo "$unet_cv_enable_pedantic" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $unet_cv_enable_pedantic" >&5 +printf "%s\n" "$unet_cv_enable_pedantic" >&6; } if test x"$unet_cv_enable_pedantic" = xyes; then CFLAGS="-pedantic $CFLAGS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable compiler warnings" >&5 -$as_echo_n "checking whether to enable compiler warnings... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable compiler warnings" >&5 +printf %s "checking whether to enable compiler warnings... " >&6; } # Check whether --enable-warnings was given. -if test "${enable_warnings+set}" = set; then : +if test ${enable_warnings+y} +then : enableval=$enable_warnings; unet_cv_enable_warnings=$enable_warnings -else - if ${unet_cv_enable_warnings+:} false; then : - $as_echo_n "(cached) " >&6 -else - unet_cv_enable_warnings=no +else case e in #( + e) if test ${unet_cv_enable_warnings+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) unet_cv_enable_warnings=no ;; +esac fi - + ;; +esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $unet_cv_enable_warnings" >&5 -$as_echo "$unet_cv_enable_warnings" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $unet_cv_enable_warnings" >&5 +printf "%s\n" "$unet_cv_enable_warnings" >&6; } if test x"$unet_cv_enable_warnings" = xyes; then CFLAGS="-Wall $CFLAGS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable inlining for a few critical functions" >&5 -$as_echo_n "checking whether to enable inlining for a few critical functions... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable inlining for a few critical functions" >&5 +printf %s "checking whether to enable inlining for a few critical functions... " >&6; } # Check whether --enable-inlines was given. -if test "${enable_inlines+set}" = set; then : +if test ${enable_inlines+y} +then : enableval=$enable_inlines; unet_cv_enable_inlines=$enable_inlines -else - if ${unet_cv_enable_inlines+:} false; then : - $as_echo_n "(cached) " >&6 -else - unet_cv_enable_inlines=yes +else case e in #( + e) if test ${unet_cv_enable_inlines+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) unet_cv_enable_inlines=yes ;; +esac fi - + ;; +esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $unet_cv_enable_inlines" >&5 -$as_echo "$unet_cv_enable_inlines" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $unet_cv_enable_inlines" >&5 +printf "%s\n" "$unet_cv_enable_inlines" >&6; } if test x"$unet_cv_enable_inlines" = xyes; then -$as_echo "#define FORCEINLINE 1" >>confdefs.h +printf "%s\n" "#define FORCEINLINE 1" >>confdefs.h fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable the /dev/poll event engine" >&5 -$as_echo_n "checking whether to enable the /dev/poll event engine... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable the /dev/poll event engine" >&5 +printf %s "checking whether to enable the /dev/poll event engine... " >&6; } # Check whether --enable-devpoll was given. -if test "${enable_devpoll+set}" = set; then : +if test ${enable_devpoll+y} +then : enableval=$enable_devpoll; unet_cv_enable_devpoll=$enable_devpoll -else - if ${unet_cv_enable_devpoll+:} false; then : - $as_echo_n "(cached) " >&6 -else - unet_cv_enable_devpoll=yes +else case e in #( + e) if test ${unet_cv_enable_devpoll+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) unet_cv_enable_devpoll=yes ;; +esac fi - + ;; +esac fi @@ -6699,28 +7505,32 @@ if test x"$ac_cv_header_sys_devpoll_h" = xno; then unet_cv_enable_devpoll=no fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $unet_cv_enable_devpoll" >&5 -$as_echo "$unet_cv_enable_devpoll" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $unet_cv_enable_devpoll" >&5 +printf "%s\n" "$unet_cv_enable_devpoll" >&6; } if test x"$unet_cv_enable_devpoll" != xno; then -$as_echo "#define USE_DEVPOLL 1" >>confdefs.h +printf "%s\n" "#define USE_DEVPOLL 1" >>confdefs.h ENGINE_C="engine_devpoll.c $ENGINE_C" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable the kqueue event engine" >&5 -$as_echo_n "checking whether to enable the kqueue event engine... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable the kqueue event engine" >&5 +printf %s "checking whether to enable the kqueue event engine... " >&6; } # Check whether --enable-kqueue was given. -if test "${enable_kqueue+set}" = set; then : +if test ${enable_kqueue+y} +then : enableval=$enable_kqueue; unet_cv_enable_kqueue=$enable_kqueue -else - if ${unet_cv_enable_kqueue+:} false; then : - $as_echo_n "(cached) " >&6 -else - unet_cv_enable_kqueue=yes +else case e in #( + e) if test ${unet_cv_enable_kqueue+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) unet_cv_enable_kqueue=yes ;; +esac fi - + ;; +esac fi @@ -6728,28 +7538,32 @@ if test x"$ac_cv_header_sys_event_h" = xno -o x"$ac_cv_func_kqueue" = xno; then unet_cv_enable_kqueue=no fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $unet_cv_enable_kqueue" >&5 -$as_echo "$unet_cv_enable_kqueue" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $unet_cv_enable_kqueue" >&5 +printf "%s\n" "$unet_cv_enable_kqueue" >&6; } if test x"$unet_cv_enable_kqueue" != xno; then -$as_echo "#define USE_KQUEUE 1" >>confdefs.h +printf "%s\n" "#define USE_KQUEUE 1" >>confdefs.h ENGINE_C="engine_kqueue.c $ENGINE_C" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable the epoll event engine" >&5 -$as_echo_n "checking whether to enable the epoll event engine... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable the epoll event engine" >&5 +printf %s "checking whether to enable the epoll event engine... " >&6; } # Check whether --enable-epoll was given. -if test "${enable_epoll+set}" = set; then : +if test ${enable_epoll+y} +then : enableval=$enable_epoll; unet_cv_enable_epoll=$enable_epoll -else - if ${unet_cv_enable_epoll+:} false; then : - $as_echo_n "(cached) " >&6 -else - unet_cv_enable_epoll=yes +else case e in #( + e) if test ${unet_cv_enable_epoll+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) unet_cv_enable_epoll=yes ;; +esac fi - + ;; +esac fi @@ -6757,120 +7571,134 @@ if test x"$ac_cv_header_sys_epoll_h" = xno -o x"$ac_cv_func_epoll" = xno; then unet_cv_enable_epoll=no fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $unet_cv_enable_epoll" >&5 -$as_echo "$unet_cv_enable_epoll" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $unet_cv_enable_epoll" >&5 +printf "%s\n" "$unet_cv_enable_epoll" >&6; } if test x"$unet_cv_enable_epoll" != xno; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether epoll functions are properly defined" >&5 -$as_echo_n "checking whether epoll functions are properly defined... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether epoll functions are properly defined" >&5 +printf %s "checking whether epoll functions are properly defined... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { epoll_create(10); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -$as_echo "#define EPOLL_NEED_BODY 1" >>confdefs.h +if ac_fn_c_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +printf "%s\n" "#define EPOLL_NEED_BODY 1" >>confdefs.h + ;; +esac fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -$as_echo "#define USE_EPOLL 1" >>confdefs.h +printf "%s\n" "#define USE_EPOLL 1" >>confdefs.h ENGINE_C="engine_epoll.c $ENGINE_C" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for va_copy" >&5 -$as_echo_n "checking for va_copy... " >&6; } -if ${unet_cv_c_va_copy+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for va_copy" >&5 +printf %s "checking for va_copy... " >&6; } +if test ${unet_cv_c_va_copy+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { va_list ap1, ap2; va_copy(ap1, ap2); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : unet_cv_c_va_copy="yes" -else - unet_cv_c_va_copy="no" - +else case e in #( + e) unet_cv_c_va_copy="no" + ;; +esac fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext ;; +esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $unet_cv_c_va_copy" >&5 -$as_echo "$unet_cv_c_va_copy" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $unet_cv_c_va_copy" >&5 +printf "%s\n" "$unet_cv_c_va_copy" >&6; } if test "$unet_cv_c_va_copy" = "yes" ; then -$as_echo "#define HAVE_VA_COPY 1" >>confdefs.h +printf "%s\n" "#define HAVE_VA_COPY 1" >>confdefs.h fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __va_copy" >&5 -$as_echo_n "checking for __va_copy... " >&6; } -if ${unet_cv_c___va_copy+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for __va_copy" >&5 +printf %s "checking for __va_copy... " >&6; } +if test ${unet_cv_c___va_copy+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { va_list ap1, ap2; __va_copy(ap1, ap2); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : unet_cv_c___va_copy="yes" -else - unet_cv_c___va_copy="no" - +else case e in #( + e) unet_cv_c___va_copy="no" + ;; +esac fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext ;; +esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $unet_cv_c___va_copy" >&5 -$as_echo "$unet_cv_c___va_copy" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $unet_cv_c___va_copy" >&5 +printf "%s\n" "$unet_cv_c___va_copy" >&6; } if test "$unet_cv_c___va_copy" = "yes" ; then -$as_echo "#define HAVE___VA_COPY 1" >>confdefs.h +printf "%s\n" "#define HAVE___VA_COPY 1" >>confdefs.h fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking what name to give the symlink" >&5 -$as_echo_n "checking what name to give the symlink... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking what name to give the symlink" >&5 +printf %s "checking what name to give the symlink... " >&6; } # Check whether --with-symlink was given. -if test "${with_symlink+set}" = set; then : +if test ${with_symlink+y} +then : withval=$with_symlink; unet_cv_with_symlink=$with_symlink -else - if ${unet_cv_with_symlink+:} false; then : - $as_echo_n "(cached) " >&6 -else - unet_cv_with_symlink="ircd" +else case e in #( + e) if test ${unet_cv_with_symlink+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) unet_cv_with_symlink="ircd" ;; +esac fi - + ;; +esac fi @@ -6878,8 +7706,8 @@ if test x"$unet_cv_with_symlink" = xyes; then unet_cv_with_symlink="ircd" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $unet_cv_with_symlink" >&5 -$as_echo "$unet_cv_with_symlink" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $unet_cv_with_symlink" >&5 +printf "%s\n" "$unet_cv_with_symlink" >&6; } if test x"$unet_cv_with_symlink" = xno; then INSTALL_RULE=install-no-symlink @@ -6891,19 +7719,23 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking what permissions to set on the installed binary" >&5 -$as_echo_n "checking what permissions to set on the installed binary... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking what permissions to set on the installed binary" >&5 +printf %s "checking what permissions to set on the installed binary... " >&6; } # Check whether --with-mode was given. -if test "${with_mode+set}" = set; then : +if test ${with_mode+y} +then : withval=$with_mode; unet_cv_with_mode=$with_mode -else - if ${unet_cv_with_mode+:} false; then : - $as_echo_n "(cached) " >&6 -else - unet_cv_with_mode=711 +else case e in #( + e) if test ${unet_cv_with_mode+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) unet_cv_with_mode=711 ;; +esac fi - + ;; +esac fi @@ -6911,26 +7743,30 @@ if test x"$unet_cv_with_mode" = xyes -o x"$unet_cv_with_mode" = xno; then unet_cv_with_mode=711 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $unet_cv_with_mode" >&5 -$as_echo "$unet_cv_with_mode" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $unet_cv_with_mode" >&5 +printf "%s\n" "$unet_cv_with_mode" >&6; } IRCDMODE=$unet_cv_with_mode unet_uid=`id | sed -e 's/.*uid=[0-9]*(//' -e 's/).*//' 2> /dev/null` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which user should own the installed binary" >&5 -$as_echo_n "checking which user should own the installed binary... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking which user should own the installed binary" >&5 +printf %s "checking which user should own the installed binary... " >&6; } # Check whether --with-owner was given. -if test "${with_owner+set}" = set; then : +if test ${with_owner+y} +then : withval=$with_owner; unet_cv_with_owner=$with_owner -else - if ${unet_cv_with_owner+:} false; then : - $as_echo_n "(cached) " >&6 -else - unet_cv_with_owner=$unet_uid +else case e in #( + e) if test ${unet_cv_with_owner+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) unet_cv_with_owner=$unet_uid ;; +esac fi - + ;; +esac fi @@ -6938,26 +7774,30 @@ if test x"$unet_cv_with_owner" = xyes -o x"$unet_cv_with_owner" = xno; then unet_cv_with_owner=$unet_uid fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $unet_cv_with_owner" >&5 -$as_echo "$unet_cv_with_owner" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $unet_cv_with_owner" >&5 +printf "%s\n" "$unet_cv_with_owner" >&6; } IRCDOWN=$unet_cv_with_owner unet_gid=`id | sed -e 's/.*gid=[0-9]*(//' -e 's/).*//' 2> /dev/null` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which group should own the installed binary" >&5 -$as_echo_n "checking which group should own the installed binary... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking which group should own the installed binary" >&5 +printf %s "checking which group should own the installed binary... " >&6; } # Check whether --with-group was given. -if test "${with_group+set}" = set; then : +if test ${with_group+y} +then : withval=$with_group; unet_cv_with_group=$with_group -else - if ${unet_cv_with_group+:} false; then : - $as_echo_n "(cached) " >&6 -else - unet_cv_with_group=$unet_gid +else case e in #( + e) if test ${unet_cv_with_group+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) unet_cv_with_group=$unet_gid ;; +esac fi - + ;; +esac fi @@ -6965,8 +7805,8 @@ if test x"$unet_cv_with_group" = xyes -o x"$unet_cv_with_group" = xno; then unet_cv_with_group=$unet_gid fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $unet_cv_with_group" >&5 -$as_echo "$unet_cv_with_group" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $unet_cv_with_group" >&5 +printf "%s\n" "$unet_cv_with_group" >&6; } IRCDGRP=$unet_cv_with_group @@ -6978,19 +7818,23 @@ if test -f /etc/resolv.conf; then unet_domain=`awk '/^search/ { print $2; exit }' /etc/resolv.conf` fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for site domain name" >&5 -$as_echo_n "checking for site domain name... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for site domain name" >&5 +printf %s "checking for site domain name... " >&6; } # Check whether --with-domain was given. -if test "${with_domain+set}" = set; then : +if test ${with_domain+y} +then : withval=$with_domain; unet_cv_with_domain=$with_domain -else - if ${unet_cv_with_domain+:} false; then : - $as_echo_n "(cached) " >&6 -else - unet_cv_with_domain=$unet_domain +else case e in #( + e) if test ${unet_cv_with_domain+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) unet_cv_with_domain=$unet_domain ;; +esac fi - + ;; +esac fi @@ -7001,28 +7845,30 @@ if test x"$unet_cv_with_domain" = xno; then as_fn_error $? "Unable to determine server DNS domain; use --with-domain to set it" "$LINENO" 5 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $unet_cv_with_domain" >&5 -$as_echo "$unet_cv_with_domain" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $unet_cv_with_domain" >&5 +printf "%s\n" "$unet_cv_with_domain" >&6; } -cat >>confdefs.h <<_ACEOF -#define DOMAINNAME "*$unet_cv_with_domain" -_ACEOF +printf "%s\n" "#define DOMAINNAME \"*$unet_cv_with_domain\"" >>confdefs.h -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if chroot operation is desired" >&5 -$as_echo_n "checking if chroot operation is desired... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if chroot operation is desired" >&5 +printf %s "checking if chroot operation is desired... " >&6; } # Check whether --with-chroot was given. -if test "${with_chroot+set}" = set; then : +if test ${with_chroot+y} +then : withval=$with_chroot; unet_cv_with_chroot=$with_chroot -else - if ${unet_cv_with_chroot+:} false; then : - $as_echo_n "(cached) " >&6 -else - unet_cv_with_chroot=no +else case e in #( + e) if test ${unet_cv_with_chroot+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) unet_cv_with_chroot=no ;; +esac fi - + ;; +esac fi @@ -7033,8 +7879,8 @@ fi # Ensure there are no trailing /'s to mess us up unet_cv_with_chroot=`echo "$unet_cv_with_chroot" | sed 's%/*$%%'` -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $unet_cv_with_chroot" >&5 -$as_echo "$unet_cv_with_chroot" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $unet_cv_with_chroot" >&5 +printf "%s\n" "$unet_cv_with_chroot" >&6; } # Deal with the annoying value "NONE" here unet_save_prefix=$prefix @@ -7059,44 +7905,46 @@ unet_libdir=`eval echo "$libdir"` prefix=$unet_save_prefix exec_prefix=$unet_save_exec_prefix -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking where the binary will be for /restart" >&5 -$as_echo_n "checking where the binary will be for /restart... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking where the binary will be for /restart" >&5 +printf %s "checking where the binary will be for /restart... " >&6; } if test x"$unet_cv_with_symlink" = xno; then unet_spath="$unet_bindir/ircd" else unet_spath="$unet_bindir/$unet_cv_with_symlink" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $unet_spath" >&5 -$as_echo "$unet_spath" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $unet_spath" >&5 +printf "%s\n" "$unet_spath" >&6; } if test x"$unet_cv_with_chroot" != xno; then if echo "$unet_spath" | grep "^$unet_cv_with_chroot" > /dev/null 2>&1; then unet_spath=`echo "$unet_spath" | sed "s%^$unet_cv_with_chroot%%"` else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Binary $unet_spath not relative to root directory $unet_cv_with_chroot; restarts will probably fail" >&5 -$as_echo "$as_me: WARNING: Binary $unet_spath not relative to root directory $unet_cv_with_chroot; restarts will probably fail" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Binary $unet_spath not relative to root directory $unet_cv_with_chroot; restarts will probably fail" >&5 +printf "%s\n" "$as_me: WARNING: Binary $unet_spath not relative to root directory $unet_cv_with_chroot; restarts will probably fail" >&2;} fi fi -cat >>confdefs.h <<_ACEOF -#define SPATH "$unet_spath" -_ACEOF +printf "%s\n" "#define SPATH \"$unet_spath\"" >>confdefs.h -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking what the data directory should be" >&5 -$as_echo_n "checking what the data directory should be... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking what the data directory should be" >&5 +printf %s "checking what the data directory should be... " >&6; } # Check whether --with-dpath was given. -if test "${with_dpath+set}" = set; then : +if test ${with_dpath+y} +then : withval=$with_dpath; unet_cv_with_dpath=$with_dpath -else - if ${unet_cv_with_dpath+:} false; then : - $as_echo_n "(cached) " >&6 -else - unet_cv_with_dpath=$unet_libdir +else case e in #( + e) if test ${unet_cv_with_dpath+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) unet_cv_with_dpath=$unet_libdir ;; +esac fi - + ;; +esac fi @@ -7107,8 +7955,8 @@ fi # Ensure there are no trailing /'s to mess us up unet_cv_with_dpath=`echo "$unet_cv_with_dpath" | sed 's%/*$%%'` -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $unet_cv_with_dpath" >&5 -$as_echo "$unet_cv_with_dpath" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $unet_cv_with_dpath" >&5 +printf "%s\n" "$unet_cv_with_dpath" >&6; } if test x"$unet_cv_with_chroot" != xno; then if echo "$unet_cv_with_dpath" | grep "^$unet_cv_with_chroot" > /dev/null 2>&1; then @@ -7121,27 +7969,29 @@ else fi -cat >>confdefs.h <<_ACEOF -#define DPATH "$unet_dpath" -_ACEOF +printf "%s\n" "#define DPATH \"$unet_dpath\"" >>confdefs.h DPATH=$unet_cv_with_dpath -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking where the default configuration file resides" >&5 -$as_echo_n "checking where the default configuration file resides... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking where the default configuration file resides" >&5 +printf %s "checking where the default configuration file resides... " >&6; } # Check whether --with-cpath was given. -if test "${with_cpath+set}" = set; then : +if test ${with_cpath+y} +then : withval=$with_cpath; unet_cv_with_cpath=$with_cpath -else - if ${unet_cv_with_cpath+:} false; then : - $as_echo_n "(cached) " >&6 -else - unet_cv_with_cpath="ircd.conf" +else case e in #( + e) if test ${unet_cv_with_cpath+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) unet_cv_with_cpath="ircd.conf" ;; +esac fi - + ;; +esac fi @@ -7149,8 +7999,8 @@ if test x"$unet_cv_with_cpath" = xyes -o x"$unet_cv_with_cpath" = xno; then unet_cv_with_cpath="ircd.conf" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $unet_cv_with_cpath" >&5 -$as_echo "$unet_cv_with_cpath" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $unet_cv_with_cpath" >&5 +printf "%s\n" "$unet_cv_with_cpath" >&6; } if echo "$unet_cv_with_cpath" | grep '^/' > /dev/null 2>&1; then # Absolute path; check against chroot stuff @@ -7168,24 +8018,26 @@ else fi -cat >>confdefs.h <<_ACEOF -#define CPATH "$unet_cpath" -_ACEOF +printf "%s\n" "#define CPATH \"$unet_cpath\"" >>confdefs.h -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking where to put the debugging log if debugging enabled" >&5 -$as_echo_n "checking where to put the debugging log if debugging enabled... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking where to put the debugging log if debugging enabled" >&5 +printf %s "checking where to put the debugging log if debugging enabled... " >&6; } # Check whether --with-lpath was given. -if test "${with_lpath+set}" = set; then : +if test ${with_lpath+y} +then : withval=$with_lpath; unet_cv_with_lpath=$with_lpath -else - if ${unet_cv_with_lpath+:} false; then : - $as_echo_n "(cached) " >&6 -else - unet_cv_with_lpath="ircd.log" +else case e in #( + e) if test ${unet_cv_with_lpath+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) unet_cv_with_lpath="ircd.log" ;; +esac fi - + ;; +esac fi @@ -7193,8 +8045,8 @@ if test x"$unet_cv_with_lpath" = xyes -o x"$unet_cv_with_lpath" = xno; then unet_cv_with_lpath="ircd.log" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $unet_cv_with_lpath" >&5 -$as_echo "$unet_cv_with_lpath" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $unet_cv_with_lpath" >&5 +printf "%s\n" "$unet_cv_with_lpath" >&6; } if echo "$unet_cv_with_lpath" | grep '^/' > /dev/null 2>&1; then # Absolute path; check against chroot stuff @@ -7202,8 +8054,8 @@ if echo "$unet_cv_with_lpath" | grep '^/' > /dev/null 2>&1; then if echo "$unet_cv_with_lpath" | grep "^$unet_cv_with_chroot" > /dev/null 2>&1; then unet_lpath=`echo "$unet_cv_with_lpath" | sed "s%^$unet_cv_with_chroot%%"` else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Log file $unet_cv_with_lpath not relative to root directory $unet_cv_with_chroot; using default ircd.log instead" >&5 -$as_echo "$as_me: WARNING: Log file $unet_cv_with_lpath not relative to root directory $unet_cv_with_chroot; using default ircd.log instead" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Log file $unet_cv_with_lpath not relative to root directory $unet_cv_with_chroot; using default ircd.log instead" >&5 +printf "%s\n" "$as_me: WARNING: Log file $unet_cv_with_lpath not relative to root directory $unet_cv_with_chroot; using default ircd.log instead" >&2;} unet_cv_with_lpath="ircd.log" unet_lpath="ircd.log" fi @@ -7215,80 +8067,82 @@ else fi -cat >>confdefs.h <<_ACEOF -#define LPATH "$unet_lpath" -_ACEOF +printf "%s\n" "#define LPATH \"$unet_lpath\"" >>confdefs.h -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for /dev/null" >&5 -$as_echo_n "checking for /dev/null... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for /dev/null" >&5 +printf %s "checking for /dev/null... " >&6; } if test -c /dev/null ; then -$as_echo "#define PATH_DEVNULL \"/dev/null\"" >>confdefs.h +printf "%s\n" "#define PATH_DEVNULL \"/dev/null\"" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } else -$as_echo "#define PATH_DEVNULL \"devnull.log\"" >>confdefs.h +printf "%s\n" "#define PATH_DEVNULL \"devnull.log\"" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no - using devnull.log" >&5 -$as_echo "no - using devnull.log" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no - using devnull.log" >&5 +printf "%s\n" "no - using devnull.log" >&6; } fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable OpenSSL support" >&5 -$as_echo_n "checking whether to enable OpenSSL support... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable OpenSSL support" >&5 +printf %s "checking whether to enable OpenSSL support... " >&6; } # Check whether --enable-ssl was given. -if test "${enable_ssl+set}" = set; then : +if test ${enable_ssl+y} +then : enableval=$enable_ssl; unet_cv_enable_ssl=$enable_ssl -else - if ${unet_cv_enable_ssl+:} false; then : - $as_echo_n "(cached) " >&6 -else - unet_cv_enable_ssl=yes +else case e in #( + e) if test ${unet_cv_enable_ssl+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) unet_cv_enable_ssl=yes ;; +esac fi - + ;; +esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $unet_cv_enable_ssl" >&5 -$as_echo "$unet_cv_enable_ssl" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $unet_cv_enable_ssl" >&5 +printf "%s\n" "$unet_cv_enable_ssl" >&6; } if test x"$unet_cv_enable_ssl" = xyes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenSSL includes" >&5 -$as_echo_n "checking for OpenSSL includes... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for OpenSSL includes" >&5 +printf %s "checking for OpenSSL includes... " >&6; } # Check whether --with-openssl-includes was given. -if test "${with_openssl_includes+set}" = set; then : +if test ${with_openssl_includes+y} +then : withval=$with_openssl_includes; base_ssl_inc=$withval -else - base_ssl_inc=/usr/include +else case e in #( + e) base_ssl_inc=/usr/include ;; +esac fi unet_cv_with_openssl_inc_prefix=$base_ssl_inc - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $unet_cv_with_openssl_inc_prefix" >&5 -$as_echo "$unet_cv_with_openssl_inc_prefix" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $unet_cv_with_openssl_inc_prefix" >&5 +printf "%s\n" "$unet_cv_with_openssl_inc_prefix" >&6; } -cat >>confdefs.h <<_ACEOF -#define SSL_INCLUDES_PATH "$base_ssl_inc" -_ACEOF +printf "%s\n" "#define SSL_INCLUDES_PATH \"$base_ssl_inc\"" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenSSL libraries" >&5 -$as_echo_n "checking for OpenSSL libraries... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for OpenSSL libraries" >&5 +printf %s "checking for OpenSSL libraries... " >&6; } # Check whether --with-openssl-libs was given. -if test "${with_openssl_libs+set}" = set; then : +if test ${with_openssl_libs+y} +then : withval=$with_openssl_libs; unet_cv_with_openssl_prefix=$withval -else - unet_cv_with_openssl_prefix=/usr/lib +else case e in #( + e) unet_cv_with_openssl_prefix=/usr/lib ;; +esac fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $unet_cv_with_openssl_prefix" >&5 -$as_echo "$unet_cv_with_openssl_prefix" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $unet_cv_with_openssl_prefix" >&5 +printf "%s\n" "$unet_cv_with_openssl_prefix" >&6; } -cat >>confdefs.h <<_ACEOF -#define SSL_LIBS_PATH "$unet_cv_with_openssl_prefix" -_ACEOF +printf "%s\n" "#define SSL_LIBS_PATH \"$unet_cv_with_openssl_prefix\"" >>confdefs.h save_CFLAGS=$CFLAGS @@ -7297,127 +8151,152 @@ _ACEOF CFLAGS="-I$unet_cv_with_openssl_inc_prefix -lcrypto" LIBS="-Wl,-rpath=$unet_cv_with_openssl_prefix -L$unet_cv_with_openssl_prefix -lssl -lcrypto" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSL_read in -lssl" >&5 -$as_echo_n "checking for SSL_read in -lssl... " >&6; } -if ${ac_cv_lib_ssl_SSL_read+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SSL_read in -lssl" >&5 +printf %s "checking for SSL_read in -lssl... " >&6; } +if test ${ac_cv_lib_ssl_SSL_read+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lssl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif -char SSL_read (); +char SSL_read (void); int -main () +main (void) { return SSL_read (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_ssl_SSL_read=yes -else - ac_cv_lib_ssl_SSL_read=no +else case e in #( + e) ac_cv_lib_ssl_SSL_read=no ;; +esac fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ssl_SSL_read" >&5 -$as_echo "$ac_cv_lib_ssl_SSL_read" >&6; } -if test "x$ac_cv_lib_ssl_SSL_read" = xyes; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X509_new in -lcrypto" >&5 -$as_echo_n "checking for X509_new in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_X509_new+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ssl_SSL_read" >&5 +printf "%s\n" "$ac_cv_lib_ssl_SSL_read" >&6; } +if test "x$ac_cv_lib_ssl_SSL_read" = xyes +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for X509_new in -lcrypto" >&5 +printf %s "checking for X509_new in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_X509_new+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif -char X509_new (); +char X509_new (void); int -main () +main (void) { return X509_new (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_X509_new=yes -else - ac_cv_lib_crypto_X509_new=no +else case e in #( + e) ac_cv_lib_crypto_X509_new=no ;; +esac fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_X509_new" >&5 -$as_echo "$ac_cv_lib_crypto_X509_new" >&6; } -if test "x$ac_cv_lib_crypto_X509_new" = xyes; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_sha256 in -lcrypto" >&5 -$as_echo_n "checking for EVP_sha256 in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_sha256+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_X509_new" >&5 +printf "%s\n" "$ac_cv_lib_crypto_X509_new" >&6; } +if test "x$ac_cv_lib_crypto_X509_new" = xyes +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_sha256 in -lcrypto" >&5 +printf %s "checking for EVP_sha256 in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_sha256+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif -char EVP_sha256 (); +char EVP_sha256 (void); int -main () +main (void) { return EVP_sha256 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_sha256=yes -else - ac_cv_lib_crypto_EVP_sha256=no +else case e in #( + e) ac_cv_lib_crypto_EVP_sha256=no ;; +esac fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_sha256" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_sha256" >&6; } -if test "x$ac_cv_lib_crypto_EVP_sha256" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_sha256" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_sha256" >&6; } +if test "x$ac_cv_lib_crypto_EVP_sha256" = xyes +then : - for ac_header in $base_ssl_inc/openssl/ssl.h $base_ssl_inc/openssl/err.h + for ac_header in $base_ssl_inc/openssl/ssl.h $base_ssl_inc/openssl/err.h do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + as_ac_Header=`printf "%s\n" "ac_cv_header_$ac_header" | sed "$as_sed_sh"` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes" +then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `printf "%s\n" "HAVE_$ac_header" | sed "$as_sed_cpp"` 1 _ACEOF enable_ssl="yes"; @@ -7427,7 +8306,6 @@ fi done - fi @@ -7442,7 +8320,7 @@ fi if test "x$enable_ssl" = xyes; then -$as_echo "#define USE_SSL /**/" >>confdefs.h +printf "%s\n" "#define USE_SSL /**/" >>confdefs.h LIBS="$LIBS -Wl,-rpath=$unet_cv_with_openssl_prefix -L$unet_cv_with_openssl_prefix $OPENSSL_LDFLAGS" CFLAGS="$CFLAGS -I$unet_cv_with_openssl_inc_prefix" @@ -7451,69 +8329,75 @@ $as_echo "#define USE_SSL /**/" >>confdefs.h fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable GeoIP support" >&5 -$as_echo_n "checking whether to enable GeoIP support... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable GeoIP support" >&5 +printf %s "checking whether to enable GeoIP support... " >&6; } # Check whether --enable-geoip was given. -if test "${enable_geoip+set}" = set; then : +if test ${enable_geoip+y} +then : enableval=$enable_geoip; unet_cv_enable_geoip=$enable_geoip -else - if ${unet_cv_enable_geoip+:} false; then : - $as_echo_n "(cached) " >&6 -else - unet_cv_enable_geoip=yes +else case e in #( + e) if test ${unet_cv_enable_geoip+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) unet_cv_enable_geoip=yes ;; +esac fi - + ;; +esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $unet_cv_enable_geoip" >&5 -$as_echo "$unet_cv_enable_geoip" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $unet_cv_enable_geoip" >&5 +printf "%s\n" "$unet_cv_enable_geoip" >&6; } if test x"$unet_cv_enable_geoip" = xyes; then # Check whether --with-geoip was given. -if test "${with_geoip+set}" = set; then : +if test ${with_geoip+y} +then : withval=$with_geoip; base_geoip_prefix=$withval -else - base_geoip_prefix=/usr/local +else case e in #( + e) base_geoip_prefix=/usr/local ;; +esac fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GeoIP includes" >&5 -$as_echo_n "checking for GeoIP includes... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GeoIP includes" >&5 +printf %s "checking for GeoIP includes... " >&6; } # Check whether --with-geoip-includes was given. -if test "${with_geoip_includes+set}" = set; then : +if test ${with_geoip_includes+y} +then : withval=$with_geoip_includes; base_geoip_inc=$withval -else - base_geoip_inc=$base_geoip_prefix/include +else case e in #( + e) base_geoip_inc=$base_geoip_prefix/include ;; +esac fi unet_cv_with_geoip_inc_prefix=$base_geoip_inc - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $unet_cv_with_geoip_inc_prefix" >&5 -$as_echo "$unet_cv_with_geoip_inc_prefix" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $unet_cv_with_geoip_inc_prefix" >&5 +printf "%s\n" "$unet_cv_with_geoip_inc_prefix" >&6; } -cat >>confdefs.h <<_ACEOF -#define GEOIP_INCLUDES_PATH "$base_geoip_inc" -_ACEOF +printf "%s\n" "#define GEOIP_INCLUDES_PATH \"$base_geoip_inc\"" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GeoIP libraries" >&5 -$as_echo_n "checking for GeoIP libraries... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GeoIP libraries" >&5 +printf %s "checking for GeoIP libraries... " >&6; } # Check whether --with-geoip-libs was given. -if test "${with_geoip_libs+set}" = set; then : +if test ${with_geoip_libs+y} +then : withval=$with_geoip_libs; base_geoip_lib=$withval -else - base_geoip_lib=$base_geoip_prefix/lib +else case e in #( + e) base_geoip_lib=$base_geoip_prefix/lib ;; +esac fi unet_cv_with_geoip_prefix=$base_geoip_lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $unet_cv_with_geoip_prefix" >&5 -$as_echo "$unet_cv_with_geoip_prefix" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $unet_cv_with_geoip_prefix" >&5 +printf "%s\n" "$unet_cv_with_geoip_prefix" >&6; } -cat >>confdefs.h <<_ACEOF -#define GEOIP_LIBS_PATH "$unet_cv_with_geoip_prefix" -_ACEOF +printf "%s\n" "#define GEOIP_LIBS_PATH \"$unet_cv_with_geoip_prefix\"" >>confdefs.h save_CFLAGS=$CFLAGS @@ -7522,90 +8406,107 @@ _ACEOF CFLAGS="-I$unet_cv_with_geoip_inc_prefix" LIBS="-L$unet_cv_with_geoip_prefix" - for ac_header in $unet_cv_with_geoip_inc_prefix/GeoIP.h + for ac_header in $unet_cv_with_geoip_inc_prefix/GeoIP.h do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + as_ac_Header=`printf "%s\n" "ac_cv_header_$ac_header" | sed "$as_sed_sh"` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes" +then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `printf "%s\n" "HAVE_$ac_header" | sed "$as_sed_cpp"` 1 _ACEOF - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GeoIP_id_by_addr_gl in -lGeoIP" >&5 -$as_echo_n "checking for GeoIP_id_by_addr_gl in -lGeoIP... " >&6; } -if ${ac_cv_lib_GeoIP_GeoIP_id_by_addr_gl+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GeoIP_id_by_addr_gl in -lGeoIP" >&5 +printf %s "checking for GeoIP_id_by_addr_gl in -lGeoIP... " >&6; } +if test ${ac_cv_lib_GeoIP_GeoIP_id_by_addr_gl+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lGeoIP $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif -char GeoIP_id_by_addr_gl (); +char GeoIP_id_by_addr_gl (void); int -main () +main (void) { return GeoIP_id_by_addr_gl (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_GeoIP_GeoIP_id_by_addr_gl=yes -else - ac_cv_lib_GeoIP_GeoIP_id_by_addr_gl=no +else case e in #( + e) ac_cv_lib_GeoIP_GeoIP_id_by_addr_gl=no ;; +esac fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_GeoIP_GeoIP_id_by_addr_gl" >&5 -$as_echo "$ac_cv_lib_GeoIP_GeoIP_id_by_addr_gl" >&6; } -if test "x$ac_cv_lib_GeoIP_GeoIP_id_by_addr_gl" = xyes; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GeoIP_id_by_addr_v6_gl in -lGeoIP" >&5 -$as_echo_n "checking for GeoIP_id_by_addr_v6_gl in -lGeoIP... " >&6; } -if ${ac_cv_lib_GeoIP_GeoIP_id_by_addr_v6_gl+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_GeoIP_GeoIP_id_by_addr_gl" >&5 +printf "%s\n" "$ac_cv_lib_GeoIP_GeoIP_id_by_addr_gl" >&6; } +if test "x$ac_cv_lib_GeoIP_GeoIP_id_by_addr_gl" = xyes +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GeoIP_id_by_addr_v6_gl in -lGeoIP" >&5 +printf %s "checking for GeoIP_id_by_addr_v6_gl in -lGeoIP... " >&6; } +if test ${ac_cv_lib_GeoIP_GeoIP_id_by_addr_v6_gl+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lGeoIP $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif -char GeoIP_id_by_addr_v6_gl (); +char GeoIP_id_by_addr_v6_gl (void); int -main () +main (void) { return GeoIP_id_by_addr_v6_gl (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_GeoIP_GeoIP_id_by_addr_v6_gl=yes -else - ac_cv_lib_GeoIP_GeoIP_id_by_addr_v6_gl=no +else case e in #( + e) ac_cv_lib_GeoIP_GeoIP_id_by_addr_v6_gl=no ;; +esac fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_GeoIP_GeoIP_id_by_addr_v6_gl" >&5 -$as_echo "$ac_cv_lib_GeoIP_GeoIP_id_by_addr_v6_gl" >&6; } -if test "x$ac_cv_lib_GeoIP_GeoIP_id_by_addr_v6_gl" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_GeoIP_GeoIP_id_by_addr_v6_gl" >&5 +printf "%s\n" "$ac_cv_lib_GeoIP_GeoIP_id_by_addr_v6_gl" >&6; } +if test "x$ac_cv_lib_GeoIP_GeoIP_id_by_addr_v6_gl" = xyes +then : enable_geoip="yes"; enable_geoip_gl="yes"; @@ -7614,89 +8515,318 @@ if test "x$ac_cv_lib_GeoIP_GeoIP_id_by_addr_v6_gl" = xyes; then : fi -else +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GeoIP_id_by_addr in -lGeoIP" >&5 +printf %s "checking for GeoIP_id_by_addr in -lGeoIP... " >&6; } +if test ${ac_cv_lib_GeoIP_GeoIP_id_by_addr+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS +LIBS="-lGeoIP $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char GeoIP_id_by_addr (void); +int +main (void) +{ +return GeoIP_id_by_addr (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_GeoIP_GeoIP_id_by_addr=yes +else case e in #( + e) ac_cv_lib_GeoIP_GeoIP_id_by_addr=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_GeoIP_GeoIP_id_by_addr" >&5 +printf "%s\n" "$ac_cv_lib_GeoIP_GeoIP_id_by_addr" >&6; } +if test "x$ac_cv_lib_GeoIP_GeoIP_id_by_addr" = xyes +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GeoIP_id_by_addr_v6 in -lGeoIP" >&5 +printf %s "checking for GeoIP_id_by_addr_v6 in -lGeoIP... " >&6; } +if test ${ac_cv_lib_GeoIP_GeoIP_id_by_addr_v6+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS +LIBS="-lGeoIP $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char GeoIP_id_by_addr_v6 (void); +int +main (void) +{ +return GeoIP_id_by_addr_v6 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_GeoIP_GeoIP_id_by_addr_v6=yes +else case e in #( + e) ac_cv_lib_GeoIP_GeoIP_id_by_addr_v6=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_GeoIP_GeoIP_id_by_addr_v6" >&5 +printf "%s\n" "$ac_cv_lib_GeoIP_GeoIP_id_by_addr_v6" >&6; } +if test "x$ac_cv_lib_GeoIP_GeoIP_id_by_addr_v6" = xyes +then : + + enable_geoip="yes"; + GEOIP_LDFLAGS="-lGeoIP" + +fi + + +fi + + ;; +esac +fi + + +fi + +done + + LIBS=$save_LIBS + CFLAGS=$save_CFLAGS + + if test "x$enable_geoip" = xyes; then + +printf "%s\n" "#define USE_GEOIP /**/" >>confdefs.h + + if test "x$enable_geoip_gl" = xyes; then + +printf "%s\n" "#define USE_GEOIP_GL /**/" >>confdefs.h + + fi + LIBS="$LIBS -L$unet_cv_with_geoip_prefix $GEOIP_LDFLAGS" + CFLAGS="$CFLAGS -I$unet_cv_with_geoip_inc_prefix" + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Unable to find GeoIP, GeoIP features will not work without libGeoIP. Disabling GeoIP support." >&5 +printf "%s\n" "$as_me: WARNING: Unable to find GeoIP, GeoIP features will not work without libGeoIP. Disabling GeoIP support." >&2;} + fi +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable MaxMindDB support" >&5 +printf %s "checking whether to enable MaxMindDB support... " >&6; } +# Check whether --enable-mmdb was given. +if test ${enable_mmdb+y} +then : + enableval=$enable_mmdb; unet_cv_enable_mmdb=$enable_mmdb +else case e in #( + e) if test ${unet_cv_enable_mmdb+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) unet_cv_enable_mmdb=yes ;; +esac +fi + ;; +esac +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $unet_cv_enable_mmdb" >&5 +printf "%s\n" "$unet_cv_enable_mmdb" >&6; } + +if test x"$unet_cv_enable_mmdb" = xyes; then + +# Check whether --with-mmdb was given. +if test ${with_mmdb+y} +then : + withval=$with_mmdb; base_mmdb_prefix=$withval +else case e in #( + e) base_mmdb_prefix=/usr/local ;; +esac +fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MaxMindDB includes" >&5 +printf %s "checking for MaxMindDB includes... " >&6; } + +# Check whether --with-mmdb-includes was given. +if test ${with_mmdb_includes+y} +then : + withval=$with_mmdb_includes; base_mmdb_inc=$withval +else case e in #( + e) base_mmdb_inc=$base_mmdb_prefix/include ;; +esac +fi + + unet_cv_with_mmdb_inc_prefix=$base_mmdb_inc + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $unet_cv_with_mmdb_inc_prefix" >&5 +printf "%s\n" "$unet_cv_with_mmdb_inc_prefix" >&6; } + +printf "%s\n" "#define MMDB_INCLUDES_PATH \"$base_mmdb_inc\"" >>confdefs.h + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MaxMindDB libraries" >&5 +printf %s "checking for MaxMindDB libraries... " >&6; } + +# Check whether --with-mmdb-libs was given. +if test ${with_mmdb_libs+y} +then : + withval=$with_mmdb_libs; base_mmdb_lib=$withval +else case e in #( + e) base_mmdb_lib=$base_mmdb_prefix/lib ;; +esac +fi + + unet_cv_with_mmdb_prefix=$base_mmdb_lib + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $unet_cv_with_mmdb_prefix" >&5 +printf "%s\n" "$unet_cv_with_mmdb_prefix" >&6; } + +printf "%s\n" "#define MMDB_LIBS_PATH \"$unet_cv_with_mmdb_prefix\"" >>confdefs.h + + + save_CFLAGS=$CFLAGS + save_LIBS=$LIBS + + CFLAGS="-I$unet_cv_with_mmdb_inc_prefix" + LIBS="-L$unet_cv_with_mmdb_prefix" + + for ac_header in $unet_cv_with_mmdb_inc_prefix/maxminddb.h +do : + as_ac_Header=`printf "%s\n" "ac_cv_header_$ac_header" | sed "$as_sed_sh"` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_$ac_header" | sed "$as_sed_cpp"` 1 +_ACEOF - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GeoIP_id_by_addr in -lGeoIP" >&5 -$as_echo_n "checking for GeoIP_id_by_addr in -lGeoIP... " >&6; } -if ${ac_cv_lib_GeoIP_GeoIP_id_by_addr+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lGeoIP $LIBS" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MMDB_lookup_string in -lmaxminddb" >&5 +printf %s "checking for MMDB_lookup_string in -lmaxminddb... " >&6; } +if test ${ac_cv_lib_maxminddb_MMDB_lookup_string+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS +LIBS="-lmaxminddb $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif -char GeoIP_id_by_addr (); +char MMDB_lookup_string (void); int -main () +main (void) { -return GeoIP_id_by_addr (); +return MMDB_lookup_string (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_GeoIP_GeoIP_id_by_addr=yes -else - ac_cv_lib_GeoIP_GeoIP_id_by_addr=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_maxminddb_MMDB_lookup_string=yes +else case e in #( + e) ac_cv_lib_maxminddb_MMDB_lookup_string=no ;; +esac fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_GeoIP_GeoIP_id_by_addr" >&5 -$as_echo "$ac_cv_lib_GeoIP_GeoIP_id_by_addr" >&6; } -if test "x$ac_cv_lib_GeoIP_GeoIP_id_by_addr" = xyes; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GeoIP_id_by_addr_v6 in -lGeoIP" >&5 -$as_echo_n "checking for GeoIP_id_by_addr_v6 in -lGeoIP... " >&6; } -if ${ac_cv_lib_GeoIP_GeoIP_id_by_addr_v6+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lGeoIP $LIBS" +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_maxminddb_MMDB_lookup_string" >&5 +printf "%s\n" "$ac_cv_lib_maxminddb_MMDB_lookup_string" >&6; } +if test "x$ac_cv_lib_maxminddb_MMDB_lookup_string" = xyes +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MMDB_get_value in -lmaxminddb" >&5 +printf %s "checking for MMDB_get_value in -lmaxminddb... " >&6; } +if test ${ac_cv_lib_maxminddb_MMDB_get_value+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS +LIBS="-lmaxminddb $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif -char GeoIP_id_by_addr_v6 (); +char MMDB_get_value (void); int -main () +main (void) { -return GeoIP_id_by_addr_v6 (); +return MMDB_get_value (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_GeoIP_GeoIP_id_by_addr_v6=yes -else - ac_cv_lib_GeoIP_GeoIP_id_by_addr_v6=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_maxminddb_MMDB_get_value=yes +else case e in #( + e) ac_cv_lib_maxminddb_MMDB_get_value=no ;; +esac fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_GeoIP_GeoIP_id_by_addr_v6" >&5 -$as_echo "$ac_cv_lib_GeoIP_GeoIP_id_by_addr_v6" >&6; } -if test "x$ac_cv_lib_GeoIP_GeoIP_id_by_addr_v6" = xyes; then : - - enable_geoip="yes"; - GEOIP_LDFLAGS="-lGeoIP" - +LIBS=$ac_check_lib_save_LIBS ;; +esac fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_maxminddb_MMDB_get_value" >&5 +printf "%s\n" "$ac_cv_lib_maxminddb_MMDB_get_value" >&6; } +if test "x$ac_cv_lib_maxminddb_MMDB_get_value" = xyes +then : + enable_mmdb="yes"; + MMDB_LDFLAGS="-lmaxminddb" fi @@ -7708,209 +8838,441 @@ fi done - LIBS=$save_LIBS CFLAGS=$save_CFLAGS - if test "x$enable_geoip" = xyes; then - -$as_echo "#define USE_GEOIP /**/" >>confdefs.h - - if test "x$enable_geoip_gl" = xyes; then + if test "x$enable_mmdb" = xyes; then -$as_echo "#define USE_GEOIP_GL /**/" >>confdefs.h +printf "%s\n" "#define USE_MMDB /**/" >>confdefs.h - fi - LIBS="$LIBS -L$unet_cv_with_geoip_prefix $GEOIP_LDFLAGS" - CFLAGS="$CFLAGS -I$unet_cv_with_geoip_inc_prefix" + LIBS="$LIBS -L$unet_cv_with_mmdb_prefix $MMDB_LDFLAGS" + CFLAGS="$CFLAGS -I$unet_cv_with_mmdb_inc_prefix" else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to find GeoIP, GeoIP features will not work without libGeoIP. Disabling GeoIP support." >&5 -$as_echo "$as_me: WARNING: Unable to find GeoIP, GeoIP features will not work without libGeoIP. Disabling GeoIP support." >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Unable to find MaxMindDB, MaxMindDB features will not work without libmaxminddb. Disabling MaxMindDB support." >&5 +printf "%s\n" "$as_me: WARNING: Unable to find MaxMindDB, MaxMindDB features will not work without libmaxminddb. Disabling MaxMindDB support." >&2;} fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable MaxMindDB support" >&5 -$as_echo_n "checking whether to enable MaxMindDB support... " >&6; } -# Check whether --enable-mmdb was given. -if test "${enable_mmdb+set}" = set; then : - enableval=$enable_mmdb; unet_cv_enable_mmdb=$enable_mmdb -else - if ${unet_cv_enable_mmdb+:} false; then : - $as_echo_n "(cached) " >&6 -else - unet_cv_enable_mmdb=yes +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable LMDB/chathistory support" >&5 +printf %s "checking whether to enable LMDB/chathistory support... " >&6; } +# Check whether --enable-lmdb was given. +if test ${enable_lmdb+y} +then : + enableval=$enable_lmdb; unet_cv_enable_lmdb=$enable_lmdb +else case e in #( + e) if test ${unet_cv_enable_lmdb+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) unet_cv_enable_lmdb=yes ;; +esac fi + ;; +esac +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $unet_cv_enable_lmdb" >&5 +printf "%s\n" "$unet_cv_enable_lmdb" >&6; } +if test x"$unet_cv_enable_lmdb" = xyes; then + +# Check whether --with-lmdb was given. +if test ${with_lmdb+y} +then : + withval=$with_lmdb; base_lmdb_prefix=$withval +else case e in #( + e) base_lmdb_prefix=/usr ;; +esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $unet_cv_enable_mmdb" >&5 -$as_echo "$unet_cv_enable_mmdb" >&6; } -if test x"$unet_cv_enable_mmdb" = xyes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for LMDB includes" >&5 +printf %s "checking for LMDB includes... " >&6; } -# Check whether --with-mmdb was given. -if test "${with_mmdb+set}" = set; then : - withval=$with_mmdb; base_mmdb_prefix=$withval -else - base_mmdb_prefix=/usr/local +# Check whether --with-lmdb-includes was given. +if test ${with_lmdb_includes+y} +then : + withval=$with_lmdb_includes; unet_cv_with_lmdb_inc_prefix=$withval +else case e in #( + e) unet_cv_with_lmdb_inc_prefix=$base_lmdb_prefix/include ;; +esac fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $unet_cv_with_lmdb_inc_prefix" >&5 +printf "%s\n" "$unet_cv_with_lmdb_inc_prefix" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MaxMindDB includes" >&5 -$as_echo_n "checking for MaxMindDB includes... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for LMDB libraries" >&5 +printf %s "checking for LMDB libraries... " >&6; } -# Check whether --with-mmdb-includes was given. -if test "${with_mmdb_includes+set}" = set; then : - withval=$with_mmdb_includes; base_mmdb_inc=$withval -else - base_mmdb_inc=$base_mmdb_prefix/include +# Check whether --with-lmdb-libs was given. +if test ${with_lmdb_libs+y} +then : + withval=$with_lmdb_libs; unet_cv_with_lmdb_prefix=$withval +else case e in #( + e) unet_cv_with_lmdb_prefix=$base_lmdb_prefix/lib ;; +esac fi - unet_cv_with_mmdb_inc_prefix=$base_mmdb_inc - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $unet_cv_with_mmdb_inc_prefix" >&5 -$as_echo "$unet_cv_with_mmdb_inc_prefix" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $unet_cv_with_lmdb_prefix" >&5 +printf "%s\n" "$unet_cv_with_lmdb_prefix" >&6; } -cat >>confdefs.h <<_ACEOF -#define MMDB_INCLUDES_PATH "$base_mmdb_inc" + save_CFLAGS=$CFLAGS + save_LIBS=$LIBS + + CFLAGS="-I$unet_cv_with_lmdb_inc_prefix" + LIBS="-L$unet_cv_with_lmdb_prefix -llmdb" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for mdb_env_create in -llmdb" >&5 +printf %s "checking for mdb_env_create in -llmdb... " >&6; } +if test ${ac_cv_lib_lmdb_mdb_env_create+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS +LIBS="-llmdb $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char mdb_env_create (void); +int +main (void) +{ +return mdb_env_create (); + ; + return 0; +} _ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_lmdb_mdb_env_create=yes +else case e in #( + e) ac_cv_lib_lmdb_mdb_env_create=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lmdb_mdb_env_create" >&5 +printf "%s\n" "$ac_cv_lib_lmdb_mdb_env_create" >&6; } +if test "x$ac_cv_lib_lmdb_mdb_env_create" = xyes +then : + for ac_header in $unet_cv_with_lmdb_inc_prefix/lmdb.h +do : + as_ac_Header=`printf "%s\n" "ac_cv_header_$ac_header" | sed "$as_sed_sh"` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_$ac_header" | sed "$as_sed_cpp"` 1 +_ACEOF - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MaxMindDB libraries" >&5 -$as_echo_n "checking for MaxMindDB libraries... " >&6; } + enable_lmdb="yes"; + LMDB_LDFLAGS="-llmdb" -# Check whether --with-mmdb-libs was given. -if test "${with_mmdb_libs+set}" = set; then : - withval=$with_mmdb_libs; base_mmdb_lib=$withval -else - base_mmdb_lib=$base_mmdb_prefix/lib fi - unet_cv_with_mmdb_prefix=$base_mmdb_lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $unet_cv_with_mmdb_prefix" >&5 -$as_echo "$unet_cv_with_mmdb_prefix" >&6; } +done -cat >>confdefs.h <<_ACEOF -#define MMDB_LIBS_PATH "$unet_cv_with_mmdb_prefix" -_ACEOF +fi - save_CFLAGS=$CFLAGS - save_LIBS=$LIBS + LIBS=$save_LIBS + CFLAGS=$save_CFLAGS - CFLAGS="-I$unet_cv_with_mmdb_inc_prefix" - LIBS="-L$unet_cv_with_mmdb_prefix" + if test "x$enable_lmdb" = xyes; then - for ac_header in $unet_cv_with_mmdb_inc_prefix/maxminddb.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +printf "%s\n" "#define USE_LMDB /**/" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MMDB_lookup_string in -lmaxminddb" >&5 -$as_echo_n "checking for MMDB_lookup_string in -lmaxminddb... " >&6; } -if ${ac_cv_lib_maxminddb_MMDB_lookup_string+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lmaxminddb $LIBS" + LIBS="$LIBS -L$unet_cv_with_lmdb_prefix $LMDB_LDFLAGS" + CFLAGS="$CFLAGS -I$unet_cv_with_lmdb_inc_prefix" + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Unable to find LMDB, chathistory features will not work without liblmdb. Disabling LMDB support." >&5 +printf "%s\n" "$as_me: WARNING: Unable to find LMDB, chathistory features will not work without liblmdb. Disabling LMDB support." >&2;} + fi +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable zstd compression support" >&5 +printf %s "checking whether to enable zstd compression support... " >&6; } +# Check whether --enable-zstd was given. +if test ${enable_zstd+y} +then : + enableval=$enable_zstd; unet_cv_enable_zstd=$enable_zstd +else case e in #( + e) if test ${unet_cv_enable_zstd+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) unet_cv_enable_zstd=yes ;; +esac +fi + ;; +esac +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $unet_cv_enable_zstd" >&5 +printf "%s\n" "$unet_cv_enable_zstd" >&6; } + +if test x"$unet_cv_enable_zstd" = xyes; then + +# Check whether --with-zstd was given. +if test ${with_zstd+y} +then : + withval=$with_zstd; base_zstd_prefix=$withval +else case e in #( + e) base_zstd_prefix=/usr ;; +esac +fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for zstd includes" >&5 +printf %s "checking for zstd includes... " >&6; } + +# Check whether --with-zstd-includes was given. +if test ${with_zstd_includes+y} +then : + withval=$with_zstd_includes; unet_cv_with_zstd_inc_prefix=$withval +else case e in #( + e) unet_cv_with_zstd_inc_prefix=$base_zstd_prefix/include ;; +esac +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $unet_cv_with_zstd_inc_prefix" >&5 +printf "%s\n" "$unet_cv_with_zstd_inc_prefix" >&6; } + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for zstd libraries" >&5 +printf %s "checking for zstd libraries... " >&6; } + +# Check whether --with-zstd-libs was given. +if test ${with_zstd_libs+y} +then : + withval=$with_zstd_libs; unet_cv_with_zstd_prefix=$withval +else case e in #( + e) unet_cv_with_zstd_prefix=$base_zstd_prefix/lib ;; +esac +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $unet_cv_with_zstd_prefix" >&5 +printf "%s\n" "$unet_cv_with_zstd_prefix" >&6; } + + save_CFLAGS=$CFLAGS + save_LIBS=$LIBS + + CFLAGS="-I$unet_cv_with_zstd_inc_prefix" + LIBS="-L$unet_cv_with_zstd_prefix -lzstd" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ZSTD_compress in -lzstd" >&5 +printf %s "checking for ZSTD_compress in -lzstd... " >&6; } +if test ${ac_cv_lib_zstd_ZSTD_compress+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS +LIBS="-lzstd $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif -char MMDB_lookup_string (); +char ZSTD_compress (void); int -main () +main (void) { -return MMDB_lookup_string (); +return ZSTD_compress (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_maxminddb_MMDB_lookup_string=yes -else - ac_cv_lib_maxminddb_MMDB_lookup_string=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_zstd_ZSTD_compress=yes +else case e in #( + e) ac_cv_lib_zstd_ZSTD_compress=no ;; +esac fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_maxminddb_MMDB_lookup_string" >&5 -$as_echo "$ac_cv_lib_maxminddb_MMDB_lookup_string" >&6; } -if test "x$ac_cv_lib_maxminddb_MMDB_lookup_string" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_zstd_ZSTD_compress" >&5 +printf "%s\n" "$ac_cv_lib_zstd_ZSTD_compress" >&6; } +if test "x$ac_cv_lib_zstd_ZSTD_compress" = xyes +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MMDB_get_value in -lmaxminddb" >&5 -$as_echo_n "checking for MMDB_get_value in -lmaxminddb... " >&6; } -if ${ac_cv_lib_maxminddb_MMDB_get_value+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lmaxminddb $LIBS" + for ac_header in $unet_cv_with_zstd_inc_prefix/zstd.h +do : + as_ac_Header=`printf "%s\n" "ac_cv_header_$ac_header" | sed "$as_sed_sh"` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_$ac_header" | sed "$as_sed_cpp"` 1 +_ACEOF + + enable_zstd="yes"; + ZSTD_LDFLAGS="-lzstd" + +fi + +done + +fi + + + LIBS=$save_LIBS + CFLAGS=$save_CFLAGS + + if test "x$enable_zstd" = xyes; then + +printf "%s\n" "#define USE_ZSTD /**/" >>confdefs.h + + LIBS="$LIBS -L$unet_cv_with_zstd_prefix $ZSTD_LDFLAGS" + CFLAGS="$CFLAGS -I$unet_cv_with_zstd_inc_prefix" + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Unable to find zstd, compression features will not be available. Disabling zstd support." >&5 +printf "%s\n" "$as_me: WARNING: Unable to find zstd, compression features will not be available. Disabling zstd support." >&2;} + fi +fi + +enable_libgit2="no" + +# Check whether --with-libgit2 was given. +if test ${with_libgit2+y} +then : + withval=$with_libgit2; with_libgit2=$withval +else case e in #( + e) with_libgit2=check ;; +esac +fi + + +if test "x$with_libgit2" != xno; then + +# Check whether --with-libgit2-includes was given. +if test ${with_libgit2_includes+y} +then : + withval=$with_libgit2_includes; unet_cv_with_libgit2_inc_prefix=$withval +else case e in #( + e) unet_cv_with_libgit2_inc_prefix=/usr/include ;; +esac +fi + + + +# Check whether --with-libgit2-libs was given. +if test ${with_libgit2_libs+y} +then : + withval=$with_libgit2_libs; unet_cv_with_libgit2_prefix=$withval +else case e in #( + e) unet_cv_with_libgit2_prefix=/usr/lib ;; +esac +fi + + + save_CFLAGS=$CFLAGS + save_LIBS=$LIBS + + CFLAGS="-I$unet_cv_with_libgit2_inc_prefix" + LIBS="-L$unet_cv_with_libgit2_prefix -lgit2" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for git_libgit2_init in -lgit2" >&5 +printf %s "checking for git_libgit2_init in -lgit2... " >&6; } +if test ${ac_cv_lib_git2_git_libgit2_init+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS +LIBS="-lgit2 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif -char MMDB_get_value (); +char git_libgit2_init (void); int -main () +main (void) { -return MMDB_get_value (); +return git_libgit2_init (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_maxminddb_MMDB_get_value=yes -else - ac_cv_lib_maxminddb_MMDB_get_value=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_git2_git_libgit2_init=yes +else case e in #( + e) ac_cv_lib_git2_git_libgit2_init=no ;; +esac fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_maxminddb_MMDB_get_value" >&5 -$as_echo "$ac_cv_lib_maxminddb_MMDB_get_value" >&6; } -if test "x$ac_cv_lib_maxminddb_MMDB_get_value" = xyes; then : - - enable_mmdb="yes"; - MMDB_LDFLAGS="-lmaxminddb" +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_git2_git_libgit2_init" >&5 +printf "%s\n" "$ac_cv_lib_git2_git_libgit2_init" >&6; } +if test "x$ac_cv_lib_git2_git_libgit2_init" = xyes +then : -fi + for ac_header in git2.h +do : + ac_fn_c_check_header_compile "$LINENO" "git2.h" "ac_cv_header_git2_h" "$ac_includes_default" +if test "x$ac_cv_header_git2_h" = xyes +then : + printf "%s\n" "#define HAVE_GIT2_H 1" >>confdefs.h + enable_libgit2="yes" + LIBGIT2_LDFLAGS="-lgit2" fi +done fi -done - LIBS=$save_LIBS CFLAGS=$save_CFLAGS - if test "x$enable_mmdb" = xyes; then + if test "x$enable_libgit2" = xyes; then -$as_echo "#define USE_MMDB /**/" >>confdefs.h +printf "%s\n" "#define USE_LIBGIT2 /**/" >>confdefs.h - LIBS="$LIBS -L$unet_cv_with_mmdb_prefix $MMDB_LDFLAGS" - CFLAGS="$CFLAGS -I$unet_cv_with_mmdb_inc_prefix" + LIBS="$LIBS -L$unet_cv_with_libgit2_prefix $LIBGIT2_LDFLAGS" + CFLAGS="$CFLAGS -I$unet_cv_with_libgit2_inc_prefix" else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to find MaxMindDB, MaxMindDB features will not work without libmaxminddb. Disabling MaxMindDB support." >&5 -$as_echo "$as_me: WARNING: Unable to find MaxMindDB, MaxMindDB features will not work without libmaxminddb. Disabling MaxMindDB support." >&2;} + if test "x$with_libgit2" = xyes; then + as_fn_error $? "libgit2 requested but not found" "$LINENO" 5 + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libgit2 not found, gitsync feature will not be available" >&5 +printf "%s\n" "$as_me: WARNING: libgit2 not found, gitsync feature will not be available" >&2;} + fi fi fi @@ -7919,19 +9281,23 @@ if test x"$unet_maxcon" = xunlimited; then unet_maxcon=1024 fi unet_maxcon=`expr $unet_maxcon - 4` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking max connections" >&5 -$as_echo_n "checking max connections... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking max connections" >&5 +printf %s "checking max connections... " >&6; } # Check whether --with-maxcon was given. -if test "${with_maxcon+set}" = set; then : +if test ${with_maxcon+y} +then : withval=$with_maxcon; unet_cv_with_maxcon=$with_maxcon -else - if ${unet_cv_with_maxcon+:} false; then : - $as_echo_n "(cached) " >&6 -else - unet_cv_with_maxcon=$unet_maxcon +else case e in #( + e) if test ${unet_cv_with_maxcon+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) unet_cv_with_maxcon=$unet_maxcon ;; +esac fi - + ;; +esac fi @@ -7944,13 +9310,11 @@ elif test "$unet_cv_with_maxcon" -lt 32; then as_fn_error $? "Maximum connections (--with-maxcon) must be at least 32." "$LINENO" 5 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $unet_cv_with_maxcon" >&5 -$as_echo "$unet_cv_with_maxcon" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $unet_cv_with_maxcon" >&5 +printf "%s\n" "$unet_cv_with_maxcon" >&6; } -cat >>confdefs.h <<_ACEOF -#define MAXCONNECTIONS $unet_cv_with_maxcon -_ACEOF +printf "%s\n" "#define MAXCONNECTIONS $unet_cv_with_maxcon" >>confdefs.h ac_config_files="$ac_config_files Makefile ircd/Makefile ircd/test/Makefile" @@ -7967,8 +9331,8 @@ cat >confcache <<\_ACEOF # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the +# 'ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* 'ac_cv_foo' will be assigned the # following values. _ACEOF @@ -7984,8 +9348,8 @@ _ACEOF case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( @@ -7998,14 +9362,14 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes: double-quote + # 'set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) - # `set' quotes correctly as required by POSIX, so do not add quotes. + # 'set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | @@ -8015,15 +9379,15 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; /^ac_cv_env_/b end t clear :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 -$as_echo "$as_me: updating cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +printf "%s\n" "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else @@ -8037,8 +9401,8 @@ $as_echo "$as_me: updating cache $cache_file" >&6;} fi fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 -$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache @@ -8055,7 +9419,7 @@ U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" @@ -8072,8 +9436,8 @@ LTLIBOBJS=$ac_ltlibobjs ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL @@ -8096,63 +9460,65 @@ cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in #( +else case e in #( + e) case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; +esac ;; esac fi + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then +if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || @@ -8161,13 +9527,6 @@ if test "${PATH_SEPARATOR+set}" != set; then fi -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( @@ -8176,43 +9535,27 @@ case $0 in #(( for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS ;; esac -# We did not find ourselves, most probably we were run as `sh COMMAND' +# We did not find ourselves, most probably we were run as 'sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] @@ -8225,9 +9568,9 @@ as_fn_error () as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $2" >&2 + printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error @@ -8258,22 +9601,25 @@ as_fn_unset () { eval $1=; unset $1;} } as_unset=as_fn_unset + # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : eval 'as_fn_append () { eval $1+=\$2 }' -else - as_fn_append () +else case e in #( + e) as_fn_append () { eval $1=\$$1\$2 - } + } ;; +esac fi # as_fn_append # as_fn_arith ARG... @@ -8281,16 +9627,18 @@ fi # as_fn_append # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : eval 'as_fn_arith () { as_val=$(( $* )) }' -else - as_fn_arith () +else case e in #( + e) as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` - } + } ;; +esac fi # as_fn_arith @@ -8317,7 +9665,7 @@ as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | +printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -8339,6 +9687,10 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) @@ -8352,6 +9704,12 @@ case `echo -n x` in #((((( ECHO_N='-n';; esac +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +as_echo='printf %s\n' +as_echo_n='printf %s' + rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file @@ -8363,9 +9721,9 @@ if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. + # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable. + # In both cases, we have to default to 'cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then @@ -8393,7 +9751,7 @@ as_fn_mkdir_p () as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -8402,7 +9760,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | +printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -8446,10 +9804,12 @@ as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" +as_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated # Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" +as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" +as_tr_sh="eval sed '$as_sed_sh'" # deprecated exec 6>&1 @@ -8465,7 +9825,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # values after options handling. ac_log=" This file was extended by $as_me, which was -generated by GNU Autoconf 2.69. Invocation command line was +generated by GNU Autoconf 2.72. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -8497,7 +9857,7 @@ _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ -\`$as_me' instantiates files and other configuration actions +'$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. @@ -8527,14 +9887,16 @@ $config_commands Report bugs to the package provider." _ACEOF +ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` +ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ config.status -configured by $0, generated by GNU Autoconf 2.69, +configured by $0, generated by GNU Autoconf 2.72, with options \\"\$ac_cs_config\\" -Copyright (C) 2012 Free Software Foundation, Inc. +Copyright (C) 2023 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -8573,15 +9935,15 @@ do -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - $as_echo "$ac_cs_version"; exit ;; + printf "%s\n" "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) - $as_echo "$ac_cs_config"; exit ;; + printf "%s\n" "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" @@ -8589,23 +9951,23 @@ do --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header - as_fn_error $? "ambiguous option: \`$1' -Try \`$0 --help' for more information.";; + as_fn_error $? "ambiguous option: '$1' +Try '$0 --help' for more information.";; --help | --hel | -h ) - $as_echo "$ac_cs_usage"; exit ;; + printf "%s\n" "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. - -*) as_fn_error $? "unrecognized option: \`$1' -Try \`$0 --help' for more information." ;; + -*) as_fn_error $? "unrecognized option: '$1' +Try '$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; @@ -8626,7 +9988,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift - \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" @@ -8640,7 +10002,7 @@ exec 5>>config.log sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX - $as_echo "$ac_log" + printf "%s\n" "$ac_log" } >&5 _ACEOF @@ -8659,7 +10021,7 @@ do "ircd/test/Makefile") CONFIG_FILES="$CONFIG_FILES ircd/test/Makefile" ;; "default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; - *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + *) as_fn_error $? "invalid argument: '$ac_config_target'" "$LINENO" 5;; esac done @@ -8669,9 +10031,9 @@ done # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files - test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers - test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands + test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files + test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers + test ${CONFIG_COMMANDS+y} || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree @@ -8679,7 +10041,7 @@ fi # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to `$tmp'. +# after its creation but before its name has been assigned to '$tmp'. $debug || { tmp= ac_tmp= @@ -8703,7 +10065,7 @@ ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. -# This happens for instance with `./config.status config.h'. +# This happens for instance with './config.status config.h'. if test -n "$CONFIG_FILES"; then @@ -8861,13 +10223,13 @@ fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. -# This happens for instance with `./config.status Makefile'. +# This happens for instance with './config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF -# Transform confdefs.h into an awk script `defines.awk', embedded as +# Transform confdefs.h into an awk script 'defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. @@ -8977,7 +10339,7 @@ do esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :L* | :C*:*) as_fn_error $? "invalid tag '$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac @@ -8999,33 +10361,33 @@ do -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain `:'. + # because $ac_f cannot contain ':'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + as_fn_error 1 "cannot find input file: '$ac_f'" "$LINENO" 5;; esac - case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done - # Let's still pretend it is `configure' which instantiates (i.e., don't + # Let's still pretend it is 'configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` - $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 -$as_echo "$as_me: creating $ac_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +printf "%s\n" "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) - ac_sed_conf_input=`$as_echo "$configure_input" | + ac_sed_conf_input=`printf "%s\n" "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac @@ -9042,7 +10404,7 @@ $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$ac_file" | +printf "%s\n" X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -9066,9 +10428,9 @@ $as_echo X"$ac_file" | case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -9125,8 +10487,8 @@ ac_sed_dataroot=' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' @@ -9139,7 +10501,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 esac _ACEOF -# Neutralize VPATH when `$srcdir' = `.'. +# Neutralize VPATH when '$srcdir' = '.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 @@ -9169,9 +10531,9 @@ test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable 'datarootdir' which seems to be undefined. Please make sure it is defined" >&5 -$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable 'datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" @@ -9187,27 +10549,27 @@ which seems to be undefined. Please make sure it is defined" >&2;} # if test x"$ac_file" != x-; then { - $as_echo "/* $configure_input */" \ + printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 -$as_echo "$as_me: $ac_file is unchanged" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +printf "%s\n" "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else - $as_echo "/* $configure_input */" \ + printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi ;; - :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 -$as_echo "$as_me: executing $ac_file commands" >&6;} + :C) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +printf "%s\n" "$as_me: executing $ac_file commands" >&6;} ;; esac @@ -9248,10 +10610,11 @@ if test "$no_create" != yes; then $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi ac_config_commands="$ac_config_commands default-1" + diff --git a/configure.in b/configure.in index 22a51dbd..533dcc17 100644 --- a/configure.in +++ b/configure.in @@ -893,6 +893,165 @@ if test x"$unet_cv_enable_mmdb" = xyes; then fi fi +dnl ** +dnl ** LMDB checks (for chathistory) +dnl ** +AC_MSG_CHECKING([whether to enable LMDB/chathistory support]) +AC_ARG_ENABLE([lmdb], +[ --disable-lmdb Disable LMDB/chathistory support], +[unet_cv_enable_lmdb=$enable_lmdb], +[AC_CACHE_VAL(unet_cv_enable_lmdb, +[unet_cv_enable_lmdb=yes])]) +AC_MSG_RESULT([$unet_cv_enable_lmdb]) + +if test x"$unet_cv_enable_lmdb" = xyes; then + AC_ARG_WITH([lmdb], + AS_HELP_STRING([--with-lmdb=dir], [Specify the installation prefix of LMDB (default: /usr)]), + [base_lmdb_prefix=$withval], + [base_lmdb_prefix=/usr]) + + AC_MSG_CHECKING([for LMDB includes]) + AC_ARG_WITH([lmdb-includes], + AS_HELP_STRING([--with-lmdb-includes=dir], [Specify location of LMDB header files (default: /usr/include)]), + [unet_cv_with_lmdb_inc_prefix=$withval], + [unet_cv_with_lmdb_inc_prefix=$base_lmdb_prefix/include]) + AC_MSG_RESULT([$unet_cv_with_lmdb_inc_prefix]) + + AC_MSG_CHECKING([for LMDB libraries]) + AC_ARG_WITH([lmdb-libs], + AS_HELP_STRING([--with-lmdb-libs=dir], [Specify location of LMDB libs (default: /usr/lib)]), + [unet_cv_with_lmdb_prefix=$withval], + [unet_cv_with_lmdb_prefix=$base_lmdb_prefix/lib]) + AC_MSG_RESULT([$unet_cv_with_lmdb_prefix]) + + save_CFLAGS=$CFLAGS + save_LIBS=$LIBS + + CFLAGS="-I$unet_cv_with_lmdb_inc_prefix" + LIBS="-L$unet_cv_with_lmdb_prefix -llmdb" + + AC_CHECK_LIB(lmdb, mdb_env_create, [ + AC_CHECK_HEADERS($unet_cv_with_lmdb_inc_prefix/lmdb.h, [ + enable_lmdb="yes"; + LMDB_LDFLAGS="-llmdb" + ]) + ]) + + LIBS=$save_LIBS + CFLAGS=$save_CFLAGS + + if test "x$enable_lmdb" = xyes; then + AC_DEFINE([USE_LMDB], , [Define if you are using LMDB for chathistory]) + LIBS="$LIBS -L$unet_cv_with_lmdb_prefix $LMDB_LDFLAGS" + CFLAGS="$CFLAGS -I$unet_cv_with_lmdb_inc_prefix" + else + AC_MSG_WARN([Unable to find LMDB, chathistory features will not work without liblmdb. Disabling LMDB support.]) + fi +fi + +dnl ** +dnl ** Zstd compression checks (for chathistory/metadata compression) +dnl ** +AC_MSG_CHECKING([whether to enable zstd compression support]) +AC_ARG_ENABLE([zstd], +[ --disable-zstd Disable zstd compression support], +[unet_cv_enable_zstd=$enable_zstd], +[AC_CACHE_VAL(unet_cv_enable_zstd, +[unet_cv_enable_zstd=yes])]) +AC_MSG_RESULT([$unet_cv_enable_zstd]) + +if test x"$unet_cv_enable_zstd" = xyes; then + AC_ARG_WITH([zstd], + AS_HELP_STRING([--with-zstd=dir], [Specify the installation prefix of zstd (default: /usr)]), + [base_zstd_prefix=$withval], + [base_zstd_prefix=/usr]) + + AC_MSG_CHECKING([for zstd includes]) + AC_ARG_WITH([zstd-includes], + AS_HELP_STRING([--with-zstd-includes=dir], [Specify location of zstd header files (default: /usr/include)]), + [unet_cv_with_zstd_inc_prefix=$withval], + [unet_cv_with_zstd_inc_prefix=$base_zstd_prefix/include]) + AC_MSG_RESULT([$unet_cv_with_zstd_inc_prefix]) + + AC_MSG_CHECKING([for zstd libraries]) + AC_ARG_WITH([zstd-libs], + AS_HELP_STRING([--with-zstd-libs=dir], [Specify location of zstd libs (default: /usr/lib)]), + [unet_cv_with_zstd_prefix=$withval], + [unet_cv_with_zstd_prefix=$base_zstd_prefix/lib]) + AC_MSG_RESULT([$unet_cv_with_zstd_prefix]) + + save_CFLAGS=$CFLAGS + save_LIBS=$LIBS + + CFLAGS="-I$unet_cv_with_zstd_inc_prefix" + LIBS="-L$unet_cv_with_zstd_prefix -lzstd" + + AC_CHECK_LIB(zstd, ZSTD_compress, [ + AC_CHECK_HEADERS($unet_cv_with_zstd_inc_prefix/zstd.h, [ + enable_zstd="yes"; + ZSTD_LDFLAGS="-lzstd" + ]) + ]) + + LIBS=$save_LIBS + CFLAGS=$save_CFLAGS + + if test "x$enable_zstd" = xyes; then + AC_DEFINE([USE_ZSTD], , [Define if you are using zstd compression]) + LIBS="$LIBS -L$unet_cv_with_zstd_prefix $ZSTD_LDFLAGS" + CFLAGS="$CFLAGS -I$unet_cv_with_zstd_inc_prefix" + else + AC_MSG_WARN([Unable to find zstd, compression features will not be available. Disabling zstd support.]) + fi +fi + +dnl Check for libgit2 (for gitsync feature) +enable_libgit2="no" +AC_ARG_WITH([libgit2], +AS_HELP_STRING([--with-libgit2], [Enable libgit2 for gitsync feature]), +[with_libgit2=$withval], +[with_libgit2=check]) + +if test "x$with_libgit2" != xno; then + AC_ARG_WITH([libgit2-includes], + AS_HELP_STRING([--with-libgit2-includes=dir], [Specify location of libgit2 header files]), + [unet_cv_with_libgit2_inc_prefix=$withval], + [unet_cv_with_libgit2_inc_prefix=/usr/include]) + + AC_ARG_WITH([libgit2-libs], + AS_HELP_STRING([--with-libgit2-libs=dir], [Specify location of libgit2 libs]), + [unet_cv_with_libgit2_prefix=$withval], + [unet_cv_with_libgit2_prefix=/usr/lib]) + + save_CFLAGS=$CFLAGS + save_LIBS=$LIBS + + CFLAGS="-I$unet_cv_with_libgit2_inc_prefix" + LIBS="-L$unet_cv_with_libgit2_prefix -lgit2" + + AC_CHECK_LIB(git2, git_libgit2_init, [ + AC_CHECK_HEADERS(git2.h, [ + enable_libgit2="yes" + LIBGIT2_LDFLAGS="-lgit2" + ]) + ]) + + LIBS=$save_LIBS + CFLAGS=$save_CFLAGS + + if test "x$enable_libgit2" = xyes; then + AC_DEFINE([USE_LIBGIT2], , [Define if you are using libgit2 for gitsync]) + LIBS="$LIBS -L$unet_cv_with_libgit2_prefix $LIBGIT2_LDFLAGS" + CFLAGS="$CFLAGS -I$unet_cv_with_libgit2_inc_prefix" + else + if test "x$with_libgit2" = xyes; then + AC_MSG_ERROR([libgit2 requested but not found]) + else + AC_MSG_WARN([libgit2 not found, gitsync feature will not be available]) + fi + fi +fi + dnl --with-maxcon allows us to set the maximum connections unet_maxcon=`ulimit -Sn` if test x"$unet_maxcon" = xunlimited; then @@ -946,4 +1105,6 @@ ircu is now hopefully configured for your system. kqueue() engine: $unet_cv_enable_kqueue /dev/poll engine: $unet_cv_enable_devpoll epoll() engine: $unet_cv_enable_epoll + + libgit2 (gitsync): $enable_libgit2 "]) diff --git a/include/client.h b/include/client.h index bd6974df..f8e6dfc7 100644 --- a/include/client.h +++ b/include/client.h @@ -111,6 +111,7 @@ enum Priv PRIV_LOCAL_KILL, /**< oper can local KILL */ PRIV_REHASH, /**< oper can REHASH */ PRIV_RESTART, /**< oper can RESTART */ + PRIV_GITSYNC, /**< oper can trigger GITSYNC */ PRIV_DIE, /**< oper can DIE */ PRIV_GLINE, /**< oper can GLINE */ PRIV_LOCAL_GLINE, /**< oper can local GLINE */ @@ -238,6 +239,8 @@ enum Flag FLAG_SERVER_NOOP, /**< Server has been NOOP'ed */ FLAG_SENT_CVERSION, /**< Client's CTCP VERSION reply has been sent out */ + FLAG_DNSBL_EXEMPT, /**< Client is exempt from blocks (native DNSBL whitelist hit) */ + FLAG_LAST_FLAG, /**< number of flags */ FLAG_LOCAL_UMODES = FLAG_LOCOP, /**< First local mode flag */ FLAG_GLOBAL_UMODES = FLAG_OPER /**< First global mode flag */ @@ -811,6 +814,8 @@ struct Client { #define IsServerNoop(x) HasFlag(x, FLAG_SERVER_NOOP) /** Return non-zero if the client's CTCP VERSION reply has been sent out. */ #define IsCVersionSent(x) HasFlag(x, FLAG_SENT_CVERSION) +/** Return non-zero if the client is exempt from blocks (native DNSBL whitelist). */ +#define IsDNSBLExempt(x) HasFlag(x, FLAG_DNSBL_EXEMPT) /** Return non-zero if the client has an active PING request. */ #define IsPingSent(x) HasFlag(x, FLAG_PINGSENT) @@ -931,6 +936,8 @@ struct Client { #define SetServerNoop(x) SetFlag(x, FLAG_SERVER_NOOP) /** Mark a client as having had it's CTCP VERSION sent out. */ #define SetCVersionSent(x) SetFlag(x, FLAG_SENT_CVERSION) +/** Mark a client as exempt from blocks (native DNSBL whitelist). */ +#define SetDNSBLExempt(x) SetFlag(x, FLAG_DNSBL_EXEMPT) /** Mark a client as having a pending PING. */ #define SetPingSent(x) SetFlag(x, FLAG_PINGSENT) diff --git a/include/dnsbl.h b/include/dnsbl.h new file mode 100644 index 00000000..21c32ce7 --- /dev/null +++ b/include/dnsbl.h @@ -0,0 +1,175 @@ +/* + * IRC - Internet Relay Chat, include/dnsbl.h + * Copyright (C) 2025 Nefarious Development + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +/** @file + * @brief Native DNSBL checking support. + */ +#ifndef INCLUDED_dnsbl_h +#define INCLUDED_dnsbl_h + +#ifndef INCLUDED_ircd_defs_h +#include "ircd_defs.h" +#endif +#ifndef INCLUDED_res_h +#include "res.h" +#endif + +struct Client; +struct StatDesc; + +/** DNSBL action types */ +enum DNSBLAction { + DNSBL_ACT_NONE, /**< No action (for whitelists that didn't hit) */ + DNSBL_ACT_MARK, /**< Mark the client with a string */ + DNSBL_ACT_BLOCK_ANON, /**< Block anonymous (non-authed) users */ + DNSBL_ACT_BLOCK_ALL, /**< Block all users */ + DNSBL_ACT_WHITELIST /**< Whitelist - exempt from other DNSBL blocks */ +}; + +/** Structure representing a configured DNSBL server */ +struct DNSBLServer { + struct DNSBLServer *next; /**< Linked list next */ + char *domain; /**< DNSBL domain (e.g., "dnsbl.dronebl.org") */ + char *index; /**< Comma-separated indexes (e.g., "2,3,5,6") */ + unsigned int bitmask; /**< Bitmask of reply values to match (alternative to index) */ + enum DNSBLAction action; /**< Action to take on match */ + char *mark; /**< Mark string (for DNSBL_ACT_MARK) */ + int score; /**< Score value (for scoring mode) */ + /* Statistics */ + unsigned long queries; /**< Total queries sent */ + unsigned long hits; /**< Total positive hits */ + unsigned long blocks; /**< Total blocks performed */ +}; + +/** Structure for caching DNSBL lookup results */ +struct DNSBLCacheEntry { + struct DNSBLCacheEntry *next; /**< Hash table chain */ + struct irc_in_addr addr; /**< IP address */ + time_t expire; /**< Expiration timestamp */ + unsigned int result; /**< Cached result bitmask */ + char *server; /**< Which DNSBL server */ + enum DNSBLAction action; /**< Action determined */ + char *mark; /**< Mark string if applicable */ +}; + +/** DNSBL lookup request tracking */ +struct DNSBLRequest { + struct Client *client; /**< Associated client */ + struct DNSBLRequest *next; /**< Next pending request */ + int pending_count; /**< Number of pending lookups */ + unsigned int result; /**< Accumulated result */ + int whitelisted; /**< Set if whitelist hit */ + int cancelled; /**< Set if request was cancelled (client disconnected) */ + enum DNSBLAction action; /**< Highest priority action */ + char *mark; /**< Mark string to apply */ +}; + +/** Global DNSBL statistics */ +struct DNSBLStats { + unsigned long cache_size; /**< Current cache entries */ + unsigned long cache_hits; /**< Cache lookup hits */ + unsigned long cache_misses; /**< Cache lookup misses */ + unsigned long total_lookups; /**< Total DNSBL lookups started */ + unsigned long total_blocks; /**< Total clients blocked */ + unsigned long total_marks; /**< Total clients marked */ + unsigned long total_whitelists;/**< Total whitelist hits */ +}; + +/* Function prototypes */ + +/** Initialize the DNSBL subsystem */ +extern void dnsbl_init(void); + +/** Add a DNSBL server configuration + * @param domain DNSBL domain name + * @param index Comma-separated reply indexes to match (or NULL) + * @param bitmask Bitmask of reply values (alternative to index) + * @param action Action to take on match + * @param mark Mark string (for DNSBL_ACT_MARK) + * @param score Score value (for scoring mode) + * @return Pointer to created server config, or NULL on error + */ +extern struct DNSBLServer *dnsbl_add_server(const char *domain, const char *index, + unsigned int bitmask, enum DNSBLAction action, + const char *mark, int score); + +/** Remove all DNSBL server configurations */ +extern void dnsbl_clear_servers(void); + +/** Start DNSBL check for a client + * @param cptr Client to check + * @param request Pointer to store the DNSBL request + * @return 1 if check started, 0 if no DNSBLs configured or disabled + */ +extern int dnsbl_check(struct Client *cptr, struct DNSBLRequest **request); + +/** Cancel any pending DNSBL lookups for a client + * @param request DNSBL request to cancel + */ +extern void dnsbl_cancel(struct DNSBLRequest *request); + +/** Check if DNSBL lookups are complete + * @param request DNSBL request to check + * @return 1 if complete (or none pending), 0 if still waiting + */ +extern int dnsbl_complete(struct DNSBLRequest *request); + +/** Get the result of DNSBL checks + * @param cptr Client to get result for + * @param request DNSBL request + * @param[out] action Pointer to store action + * @param[out] mark Pointer to store mark string (may be NULL) + * @return 1 if blocked, 0 if allowed + */ +extern int dnsbl_result(struct Client *cptr, struct DNSBLRequest *request, + enum DNSBLAction *action, const char **mark); + +/** Format an IPv4 address for DNSBL lookup + * @param addr IPv4 address (last 32 bits of irc_in_addr) + * @param domain DNSBL domain + * @param buf Output buffer + * @param buflen Size of output buffer + */ +extern void dnsbl_format_ipv4(unsigned int addr, const char *domain, char *buf, size_t buflen); + +/** Format an IPv6 address for DNSBL lookup (RFC 5782 nibble format) + * @param addr IPv6 address + * @param domain DNSBL domain + * @param buf Output buffer + * @param buflen Size of output buffer + */ +extern void dnsbl_format_ipv6(const struct irc_in_addr *addr, const char *domain, + char *buf, size_t buflen); + +/** Expire old cache entries */ +extern void dnsbl_cache_expire(void); + +/** Get DNSBL statistics */ +extern const struct DNSBLStats *dnsbl_get_stats(void); + +/** Report DNSBL statistics for /STATS D + * @param to Client requesting stats + * @param sd Stats descriptor + * @param param Extra parameter (unused) + */ +extern void dnsbl_report_stats(struct Client *to, const struct StatDesc *sd, char *param); + +/** Get first DNSBL server (for iteration) */ +extern struct DNSBLServer *dnsbl_first_server(void); + +#endif /* INCLUDED_dnsbl_h */ diff --git a/include/gitsync.h b/include/gitsync.h new file mode 100644 index 00000000..b6980ed1 --- /dev/null +++ b/include/gitsync.h @@ -0,0 +1,110 @@ +/* + * IRC - Internet Relay Chat, include/gitsync.h + * Copyright (C) 2025 Nefarious Development + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +/** @file + * @brief GitSync - centralized config distribution via git. + * + * GitSync provides automated synchronization of network configuration + * (K-lines, G-lines, Jupes, etc.) from a central git repository. + * This replaces the older HTTP-based linesync with a more robust + * git-based approach using libgit2. + */ +#ifndef INCLUDED_gitsync_h +#define INCLUDED_gitsync_h + +#include "config.h" +#include + +#ifdef USE_LIBGIT2 + +struct Client; +struct StatDesc; + +/** GitSync status codes */ +enum GitsyncStatus { + GITSYNC_OK, /**< Success */ + GITSYNC_DISABLED, /**< Feature disabled */ + GITSYNC_NO_REPO, /**< No repository configured */ + GITSYNC_CLONE_ERROR, /**< Git clone failed */ + GITSYNC_FETCH_ERROR, /**< Git fetch failed */ + GITSYNC_CHECKOUT_ERROR, /**< Git checkout failed */ + GITSYNC_SSH_ERROR, /**< SSH authentication error */ + GITSYNC_VALIDATION_ERROR,/**< Content validation failed */ + GITSYNC_APPLY_ERROR /**< Failed to apply config */ +}; + +/** GitSync statistics */ +struct GitsyncStats { + time_t last_sync; /**< Timestamp of last successful sync */ + time_t last_attempt; /**< Timestamp of last sync attempt */ + unsigned long syncs; /**< Total successful syncs */ + unsigned long failures; /**< Total failed syncs */ + enum GitsyncStatus last_status; /**< Status of last sync */ + char last_error[256]; /**< Last error message */ + char last_commit[64]; /**< Last synced commit hash */ +}; + +/** Initialize gitsync subsystem */ +extern void gitsync_init(void); + +/** Start the gitsync timer after config is loaded */ +extern void gitsync_start_timer(void); + +/** Trigger a gitsync + * @param sptr Client triggering the sync (NULL for timer) + * @param force Force sync even if interval not elapsed + * @return GITSYNC_OK on success, error code otherwise + */ +extern enum GitsyncStatus gitsync_trigger(struct Client *sptr, int force); + +/** Get gitsync status as string + * @param status Status code + * @return Human-readable status string + */ +extern const char *gitsync_status_str(enum GitsyncStatus status); + +/** Get gitsync statistics */ +extern const struct GitsyncStats *gitsync_get_stats(void); + +/** Report gitsync statistics for /STATS + * @param to Client requesting stats + * @param sd Stats descriptor + * @param param Extra parameter (unused) + */ +extern void gitsync_report_stats(struct Client *to, const struct StatDesc *sd, char *param); + +/** Get current SSH host fingerprint + * @param[out] host Buffer for host name (may be NULL) + * @param hostlen Host buffer size + * @return Fingerprint string, or NULL if not established + */ +extern const char *gitsync_get_host_fingerprint(char *host, size_t hostlen); + +/** Clear runtime SSH host fingerprint (for TOFU reset) + */ +extern void gitsync_clear_host_fingerprint(void); + +/** Generate an Ed25519 SSH key for GitSync authentication + * @param key_path Path to save the private key (OpenSSH format) + * @return 1 on success, 0 on failure + */ +extern int gitsync_generate_ssh_key(const char *key_path); + +#endif /* USE_LIBGIT2 */ + +#endif /* INCLUDED_gitsync_h */ diff --git a/include/handlers.h b/include/handlers.h index 3ea127a7..eab210c0 100644 --- a/include/handlers.h +++ b/include/handlers.h @@ -167,6 +167,9 @@ extern int mo_gline(struct Client*, struct Client*, int, char*[]); extern int mo_info(struct Client*, struct Client*, int, char*[]); extern int mo_jupe(struct Client*, struct Client*, int, char*[]); extern int mo_kill(struct Client*, struct Client*, int, char*[]); +#ifdef USE_LIBGIT2 +extern int mo_gitsync(struct Client*, struct Client*, int, char*[]); +#endif extern int mo_notice(struct Client*, struct Client*, int, char*[]); extern int mo_oper(struct Client*, struct Client*, int, char*[]); extern int mo_opmode(struct Client*, struct Client*, int, char*[]); @@ -218,6 +221,9 @@ extern int ms_jupe(struct Client*, struct Client*, int, char*[]); extern int ms_kick(struct Client*, struct Client*, int, char*[]); extern int ms_kill(struct Client*, struct Client*, int, char*[]); extern int ms_links(struct Client*, struct Client*, int, char*[]); +#ifdef USE_LIBGIT2 +extern int ms_gitsync(struct Client*, struct Client*, int, char*[]); +#endif extern int ms_lusers(struct Client*, struct Client*, int, char*[]); extern int ms_mark(struct Client*, struct Client*, int, char*[]); extern int ms_mode(struct Client*, struct Client*, int, char*[]); diff --git a/include/ircd_features.h b/include/ircd_features.h index f79e26d6..37eb1add 100644 --- a/include/ircd_features.h +++ b/include/ircd_features.h @@ -320,6 +320,26 @@ enum Feature { FEAT_UPING_ENABLE, FEAT_UPING_PORT, + /* Native DNSBL FEAT_'s */ + FEAT_NATIVE_DNSBL, + FEAT_DNSBL_TIMEOUT, + FEAT_DNSBL_CACHETIME, + FEAT_DNSBL_BLOCKMSG, + +#ifdef USE_LIBGIT2 + /* GitSync FEAT_'s */ + FEAT_GITSYNC_ENABLE, + FEAT_GITSYNC_INTERVAL, + FEAT_GITSYNC_REPOSITORY, + FEAT_GITSYNC_BRANCH, + FEAT_GITSYNC_SSH_KEY, + FEAT_GITSYNC_LOCAL_PATH, + FEAT_GITSYNC_CONF_FILE, + FEAT_GITSYNC_CERT_TAG, + FEAT_GITSYNC_CERT_FILE, + FEAT_GITSYNC_HOST_FINGERPRINT, +#endif + FEAT_LAST_F }; diff --git a/include/msg.h b/include/msg.h index 1c3b50e9..4168440d 100644 --- a/include/msg.h +++ b/include/msg.h @@ -264,6 +264,10 @@ struct Client; #define TOK_REHASH "RH" #define CMD_REHASH MSG_REHASH, TOK_REHASH +#define MSG_GITSYNC "GITSYNC" /* GS */ +#define TOK_GITSYNC "GS" +#define CMD_GITSYNC MSG_GITSYNC, TOK_GITSYNC + #define MSG_RESTART "RESTART" /* REST */ #define TOK_RESTART "RESTART" #define CMD_RESTART MSG_RESTART, TOK_RESTART diff --git a/include/s_auth.h b/include/s_auth.h index b0dd56dc..fe7d4f4b 100644 --- a/include/s_auth.h +++ b/include/s_auth.h @@ -51,6 +51,7 @@ extern int auth_cap_start(struct AuthRequest *auth); extern int auth_cap_done(struct AuthRequest *auth); extern void auth_end_loc(struct AuthRequest *auth); extern void destroy_auth_request(struct AuthRequest *req); +extern void auth_dnsbl_complete(struct AuthRequest *auth); extern int auth_restart(void); extern int auth_spawn(int argc, char *argv[]); diff --git a/include/s_conf.h b/include/s_conf.h index 28a9aef0..06a883e3 100644 --- a/include/s_conf.h +++ b/include/s_conf.h @@ -291,4 +291,6 @@ extern int find_mark_match(struct Client* sptr, const char* mask); extern int add_mark(struct Client* sptr, const char* dnsbl); extern int del_marks(struct Client* sptr); +extern int conf_get_error_flag(void); + #endif /* INCLUDED_s_conf_h */ diff --git a/ircd/Makefile.in b/ircd/Makefile.in index 6ac98428..2a2f7165 100644 --- a/ircd/Makefile.in +++ b/ircd/Makefile.in @@ -77,8 +77,7 @@ CRYPTO_SRC = \ ircd_md5.c \ ircd_crypt_plain.c \ ircd_crypt_smd5.c \ - ircd_crypt_native.c \ - ircd_crypt_bcrypt.c + ircd_crypt_native.c UMKPASSWD_SRC = ${CRYPTO_SRC} \ ircd_alloc.c \ @@ -94,8 +93,10 @@ IRCD_SRC = \ crule.c \ dbuf.c \ destruct_event.c \ + dnsbl.c \ fileio.c \ gline.c \ + gitsync.c \ hash.c \ ircd.c \ ircd_alloc.c \ @@ -139,6 +140,7 @@ IRCD_SRC = \ m_fingerprint.c \ m_get.c \ m_gline.c \ + m_gitsync.c \ m_help.c \ m_info.c \ m_invite.c \ @@ -487,7 +489,7 @@ ircd_crypt.o: ircd_crypt.c ../config.h ../include/ircd_crypt.h \ ../include/ircd_alloc.h ../include/ircd_features.h ../include/ircd_log.h \ ../include/ircd_string.h ../include/s_debug.h \ ../include/ircd_crypt_native.h ../include/ircd_crypt_plain.h \ - ../include/ircd_crypt_smd5.h ../include/ircd_crypt_bcrypt.h + ../include/ircd_crypt_smd5.h ircd_crypt_native.o: ircd_crypt_native.c ../config.h \ ../include/ircd_crypt.h ../include/ircd_crypt_native.h \ ../include/ircd_log.h ../include/s_debug.h ../include/ircd_alloc.h @@ -497,9 +499,6 @@ ircd_crypt_plain.o: ircd_crypt_plain.c ../config.h ../include/ircd_crypt.h \ ircd_crypt_smd5.o: ircd_crypt_smd5.c ../config.h ../include/ircd_crypt.h \ ../include/ircd_crypt_smd5.h ../include/ircd_log.h ../include/ircd_md5.h \ ../include/s_debug.h ../include/ircd_alloc.h -ircd_crypt_bcrypt.o: ircd_crypt_bcrypt.c ../config.h ../include/ircd_crypt.h \ - ../include/ircd_crypt_bcrypt.h ../include/ircd_log.h ../include/s_debug.h \ - ../include/ircd_alloc.h ircd_events.o: ircd_events.c ../config.h ../include/ircd_events.h \ ../include/ircd.h ../include/ircd_alloc.h ../include/ircd_log.h \ ../include/ircd_snprintf.h ../include/s_debug.h @@ -1310,7 +1309,7 @@ umkpasswd.o: umkpasswd.c ../config.h ../include/ircd_alloc.h \ ../include/ircd_log.h ../include/ircd_string.h ../include/umkpasswd.h \ ../include/s_debug.h ../include/ircd_md5.h ../include/ircd_crypt.h \ ../include/ircd_crypt_smd5.h ../include/ircd_crypt_native.h \ - ../include/ircd_crypt_plain.h ../include/ircd_crypt_bcrypt.h + ../include/ircd_crypt_plain.h uping.o: uping.c ../config.h ../include/uping.h ../include/client.h \ ../include/ircd.h ../include/ircd_alloc.h ../include/ircd_events.h \ ../include/ircd_log.h ../include/ircd_osdep.h ../include/ircd_string.h \ diff --git a/ircd/dnsbl.c b/ircd/dnsbl.c new file mode 100644 index 00000000..1a4871a7 --- /dev/null +++ b/ircd/dnsbl.c @@ -0,0 +1,644 @@ +/* + * IRC - Internet Relay Chat, ircd/dnsbl.c + * Copyright (C) 2025 Nefarious Development + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +/** @file + * @brief Native DNSBL checking implementation. + */ +#include "config.h" + +#include "dnsbl.h" +#include "client.h" +#include "ircd.h" +#include "ircd_alloc.h" +#include "ircd_features.h" +#include "ircd_log.h" +#include "ircd_reply.h" +#include "ircd_snprintf.h" +#include "ircd_string.h" +#include "msg.h" +#include "numeric.h" +#include "res.h" +#include "s_auth.h" +#include "s_bsd.h" +#include "s_debug.h" +#include "s_stats.h" +#include "send.h" +#include "ircd_events.h" + +#include +#include +#include + +/** Hash table size for DNSBL cache */ +#define DNSBL_CACHE_SIZE 4096 + +/** Maximum DNSBL query hostname length */ +#define DNSBL_QUERY_MAXLEN 512 + +/** Linked list of configured DNSBL servers */ +static struct DNSBLServer *dnsbl_servers = NULL; + +/** Hash table for DNSBL cache */ +static struct DNSBLCacheEntry *dnsbl_cache[DNSBL_CACHE_SIZE]; + +/** Global DNSBL statistics */ +static struct DNSBLStats dnsbl_stats; + +/** Timer for cache expiration */ +static struct Timer dnsbl_cache_timer; + +/** Timer callback for cache expiration + * @param ev Timer event + */ +static void +dnsbl_cache_timer_callback(struct Event *ev) +{ + if (ev_type(ev) == ET_EXPIRE) + dnsbl_cache_expire(); +} + +/** Hash function for IP addresses */ +static unsigned int +dnsbl_hash_addr(const struct irc_in_addr *addr) +{ + unsigned int hash = 0; + int i; + + for (i = 0; i < 8; i++) { + hash ^= addr->in6_16[i]; + hash = (hash << 5) | (hash >> 27); + } + + return hash % DNSBL_CACHE_SIZE; +} + +/** Compare two IP addresses for equality */ +static int +dnsbl_addr_equal(const struct irc_in_addr *a, const struct irc_in_addr *b) +{ + return memcmp(a, b, sizeof(struct irc_in_addr)) == 0; +} + +/** Parse a comma-separated index string into a bitmask + * @param index String like "2,3,5,6" + * @return Bitmask of indexes + */ +static unsigned int +dnsbl_parse_index(const char *index) +{ + unsigned int mask = 0; + const char *p = index; + char *endp; + long val; + + if (!index || !*index) + return 0xFFFFFFFF; /* match all by default */ + + while (*p) { + while (*p && (isspace((unsigned char)*p) || *p == ',')) + p++; + if (!*p) + break; + + val = strtol(p, &endp, 10); + if (val >= 0 && val < 32) + mask |= (1 << val); + + p = endp; + } + + return mask ? mask : 0xFFFFFFFF; +} + +void +dnsbl_init(void) +{ + memset(dnsbl_cache, 0, sizeof(dnsbl_cache)); + memset(&dnsbl_stats, 0, sizeof(dnsbl_stats)); + + /* Set up cache expiration timer - run every 5 minutes */ + timer_add(timer_init(&dnsbl_cache_timer), dnsbl_cache_timer_callback, + NULL, TT_PERIODIC, 300); +} + +struct DNSBLServer * +dnsbl_add_server(const char *domain, const char *index, + unsigned int bitmask, enum DNSBLAction action, + const char *mark, int score) +{ + struct DNSBLServer *server; + + if (!domain || !*domain) + return NULL; + + server = (struct DNSBLServer *)MyCalloc(1, sizeof(struct DNSBLServer)); + if (!server) + return NULL; + + DupString(server->domain, domain); + + if (index && *index) { + DupString(server->index, index); + server->bitmask = dnsbl_parse_index(index); + } else if (bitmask) { + server->bitmask = bitmask; + } else { + server->bitmask = 0xFFFFFFFF; /* match all */ + } + + server->action = action; + if (mark && *mark) + DupString(server->mark, mark); + server->score = score; + + /* Add to list */ + server->next = dnsbl_servers; + dnsbl_servers = server; + + Debug((DEBUG_DNS, "DNSBL: Added server %s action=%d bitmask=0x%x", + domain, action, server->bitmask)); + + return server; +} + +void +dnsbl_clear_servers(void) +{ + struct DNSBLServer *server, *next; + + for (server = dnsbl_servers; server; server = next) { + next = server->next; + MyFree(server->domain); + if (server->index) + MyFree(server->index); + if (server->mark) + MyFree(server->mark); + MyFree(server); + } + dnsbl_servers = NULL; +} + +void +dnsbl_format_ipv4(unsigned int addr, const char *domain, char *buf, size_t buflen) +{ + /* Reverse the octets and append the domain */ + ircd_snprintf(NULL, buf, buflen, "%u.%u.%u.%u.%s", + (addr & 0xFF), + (addr >> 8) & 0xFF, + (addr >> 16) & 0xFF, + (addr >> 24) & 0xFF, + domain); +} + +void +dnsbl_format_ipv6(const struct irc_in_addr *addr, const char *domain, + char *buf, size_t buflen) +{ + char *p = buf; + int i; + size_t remaining = buflen; + int written; + + /* RFC 5782: Nibble-reverse the IPv6 address + * For 2001:db8::1, this becomes: + * 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.domain + * + * We iterate from the last 16-bit word to the first, + * outputting each nibble in reverse order within each word. + */ + for (i = 7; i >= 0; i--) { + unsigned short word = addr->in6_16[i]; + written = ircd_snprintf(NULL, p, remaining, "%x.%x.%x.%x.", + (word >> 0) & 0xF, + (word >> 4) & 0xF, + (word >> 8) & 0xF, + (word >> 12) & 0xF); + if (written < 0 || (size_t)written >= remaining) + return; + p += written; + remaining -= written; + } + + /* Append the domain */ + ircd_snprintf(NULL, p, remaining, "%s", domain); +} + +/** Look up a cached DNSBL result */ +static struct DNSBLCacheEntry * +dnsbl_cache_lookup(const struct irc_in_addr *addr) +{ + unsigned int hash = dnsbl_hash_addr(addr); + struct DNSBLCacheEntry *entry; + time_t now = CurrentTime; + + for (entry = dnsbl_cache[hash]; entry; entry = entry->next) { + if (dnsbl_addr_equal(&entry->addr, addr)) { + if (entry->expire > now) { + dnsbl_stats.cache_hits++; + return entry; + } + /* Entry expired - will be cleaned up later */ + break; + } + } + + dnsbl_stats.cache_misses++; + return NULL; +} + +/** Add a result to the DNSBL cache */ +static void +dnsbl_cache_add(const struct irc_in_addr *addr, const char *server, + unsigned int result, enum DNSBLAction action, const char *mark) +{ + unsigned int hash = dnsbl_hash_addr(addr); + struct DNSBLCacheEntry *entry; + + entry = (struct DNSBLCacheEntry *)MyCalloc(1, sizeof(struct DNSBLCacheEntry)); + if (!entry) + return; + + memcpy(&entry->addr, addr, sizeof(struct irc_in_addr)); + entry->expire = CurrentTime + feature_int(FEAT_DNSBL_CACHETIME); + entry->result = result; + entry->action = action; + if (server) + DupString(entry->server, server); + if (mark) + DupString(entry->mark, mark); + + entry->next = dnsbl_cache[hash]; + dnsbl_cache[hash] = entry; + dnsbl_stats.cache_size++; +} + +void +dnsbl_cache_expire(void) +{ + int i; + struct DNSBLCacheEntry *entry, *prev, *next; + time_t now = CurrentTime; + + for (i = 0; i < DNSBL_CACHE_SIZE; i++) { + prev = NULL; + for (entry = dnsbl_cache[i]; entry; entry = next) { + next = entry->next; + if (entry->expire <= now) { + /* Remove expired entry */ + if (prev) + prev->next = next; + else + dnsbl_cache[i] = next; + + if (entry->server) + MyFree(entry->server); + if (entry->mark) + MyFree(entry->mark); + MyFree(entry); + dnsbl_stats.cache_size--; + } else { + prev = entry; + } + } + } +} + +/** Per-query context for DNSBL DNS lookups + * Each DNS query gets its own context to avoid race conditions + * with the server pointer being overwritten. + */ +struct DNSBLQueryContext { + struct DNSBLRequest *request; /**< Parent request */ + struct DNSBLServer *server; /**< Server this query is for */ +}; + +/** Free a DNSBL request and all its resources */ +static void +dnsbl_request_free(struct DNSBLRequest *req) +{ + if (!req) + return; + + if (req->mark) + MyFree(req->mark); + MyFree(req); +} + +/** Callback for DNSBL DNS lookup completion */ +static void +dnsbl_dns_callback(void *vptr, const struct irc_in_addr *addr, const char *h) +{ + struct DNSBLQueryContext *ctx = (struct DNSBLQueryContext *)vptr; + struct DNSBLRequest *req; + struct DNSBLServer *server; + unsigned int result_byte; + + if (!ctx) { + return; + } + + req = ctx->request; + server = ctx->server; + + /* Free the per-query context */ + MyFree(ctx); + + if (!req) { + return; + } + + req->pending_count--; + + /* Check if request was cancelled (client disconnected) */ + if (req->cancelled) { + /* If this was the last pending query, free the request */ + if (req->pending_count == 0) { + dnsbl_request_free(req); + } + return; + } + + if (!req->client) { + /* Client gone but not properly cancelled - clean up */ + if (req->pending_count == 0) { + dnsbl_request_free(req); + } + return; + } + + if (addr && server) { + /* We got a response - extract the last octet as the result */ + result_byte = addr->in6_16[7] & 0xFF; + + /* Clamp result_byte to valid bitmask range (0-31) to avoid UB */ + if (result_byte >= 32) { + Debug((DEBUG_DNS, "DNSBL: Result byte %u from %s out of bitmask range, ignoring", + result_byte, server->domain)); + } else { + Debug((DEBUG_DNS, "DNSBL: Got response for %s, result byte=%u, bitmask=0x%x", + server->domain, result_byte, server->bitmask)); + + /* Check if this result matches our bitmask */ + if (server->bitmask & (1U << result_byte)) { + server->hits++; + req->result |= (1U << result_byte); + + /* Process the action based on priority */ + switch (server->action) { + case DNSBL_ACT_WHITELIST: + req->whitelisted = 1; + dnsbl_stats.total_whitelists++; + Debug((DEBUG_DNS, "DNSBL: Whitelist hit from %s", server->domain)); + break; + + case DNSBL_ACT_BLOCK_ALL: + if (req->action < DNSBL_ACT_BLOCK_ALL && !req->whitelisted) { + req->action = DNSBL_ACT_BLOCK_ALL; + server->blocks++; + dnsbl_stats.total_blocks++; + } + break; + + case DNSBL_ACT_BLOCK_ANON: + if (req->action < DNSBL_ACT_BLOCK_ANON && !req->whitelisted) { + req->action = DNSBL_ACT_BLOCK_ANON; + server->blocks++; + } + break; + + case DNSBL_ACT_MARK: + if (req->action < DNSBL_ACT_MARK && !req->whitelisted) { + req->action = DNSBL_ACT_MARK; + if (server->mark) { + if (req->mark) + MyFree(req->mark); + DupString(req->mark, server->mark); + } + dnsbl_stats.total_marks++; + } + break; + + default: + break; + } + } + } + } + + /* Check if all lookups are complete */ + if (req->pending_count == 0) { + /* Cache the result */ + dnsbl_cache_add(&cli_ip(req->client), NULL, req->result, req->action, req->mark); + + /* Signal auth to continue */ + if (cli_auth(req->client)) + auth_dnsbl_complete(cli_auth(req->client)); + } +} + +int +dnsbl_check(struct Client *cptr, struct DNSBLRequest **request) +{ + struct DNSBLServer *server; + struct DNSBLRequest *req; + struct DNSBLCacheEntry *cached; + struct DNSBLQueryContext *ctx; + char query[DNSBL_QUERY_MAXLEN]; + int started = 0; + + if (!feature_bool(FEAT_NATIVE_DNSBL)) + return 0; + + if (!dnsbl_servers) + return 0; + + if (!cptr) + return 0; + + /* Check cache first */ + cached = dnsbl_cache_lookup(&cli_ip(cptr)); + if (cached) { + /* Use cached result */ + Debug((DEBUG_DNS, "DNSBL: Cache hit for client")); + return 0; /* Already have result, no lookup needed */ + } + + /* Create request structure */ + req = (struct DNSBLRequest *)MyCalloc(1, sizeof(struct DNSBLRequest)); + if (!req) + return 0; + + req->client = cptr; + req->action = DNSBL_ACT_NONE; + req->cancelled = 0; + + /* Return the request to the caller */ + if (request) + *request = req; + + /* Start lookups for each configured DNSBL */ + for (server = dnsbl_servers; server; server = server->next) { + /* Create per-query context to avoid stale server pointer issue */ + ctx = (struct DNSBLQueryContext *)MyCalloc(1, sizeof(struct DNSBLQueryContext)); + if (!ctx) + continue; + + ctx->request = req; + ctx->server = server; + + /* Format the query based on IP version */ + if (irc_in_addr_is_ipv4(&cli_ip(cptr))) { + unsigned int ipv4 = (cli_ip(cptr).in6_16[6] << 16) | + cli_ip(cptr).in6_16[7]; + dnsbl_format_ipv4(ipv4, server->domain, query, sizeof(query)); + } else { + dnsbl_format_ipv6(&cli_ip(cptr), server->domain, query, sizeof(query)); + } + + Debug((DEBUG_DNS, "DNSBL: Starting lookup for %s", query)); + + server->queries++; + req->pending_count++; + dnsbl_stats.total_lookups++; + + /* Start the DNS lookup with per-query context */ + gethost_byname(query, dnsbl_dns_callback, ctx); + started++; + } + + /* If no queries started, clean up the request */ + if (started == 0) { + MyFree(req); + if (request) + *request = NULL; + } + + return started > 0 ? 1 : 0; +} + +void +dnsbl_cancel(struct DNSBLRequest *request) +{ + if (!request) + return; + + /* Mark request as cancelled - don't free it here! + * The DNS callbacks will complete asynchronously and check the + * cancelled flag. The last callback to complete will free the request. + * This prevents use-after-free when a malicious/slow DNS server + * delays responses until after the client disconnects. + */ + request->cancelled = 1; + request->client = NULL; + + /* If no queries are pending, we can free immediately */ + if (request->pending_count == 0) { + dnsbl_request_free(request); + } + /* Otherwise, the last callback will free it */ +} + +int +dnsbl_complete(struct DNSBLRequest *request) +{ + if (!request) + return 1; /* No DNSBL check in progress */ + + return request->pending_count == 0; +} + +int +dnsbl_result(struct Client *cptr, struct DNSBLRequest *request, + enum DNSBLAction *action, const char **mark) +{ + struct DNSBLCacheEntry *cached; + + /* Check if we have a pending request with results */ + if (request) { + if (action) + *action = request->whitelisted ? DNSBL_ACT_WHITELIST : request->action; + if (mark) + *mark = request->mark; + + return request->action >= DNSBL_ACT_BLOCK_ANON && !request->whitelisted; + } + + /* Check cache */ + if (cptr) { + cached = dnsbl_cache_lookup(&cli_ip(cptr)); + if (cached) { + if (action) + *action = cached->action; + if (mark) + *mark = cached->mark; + + return cached->action >= DNSBL_ACT_BLOCK_ANON; + } + } + + if (action) + *action = DNSBL_ACT_NONE; + if (mark) + *mark = NULL; + + return 0; +} + +const struct DNSBLStats * +dnsbl_get_stats(void) +{ + return &dnsbl_stats; +} + +struct DNSBLServer * +dnsbl_first_server(void) +{ + return dnsbl_servers; +} + +void +dnsbl_report_stats(struct Client *to, const struct StatDesc *sd, char *param) +{ + struct DNSBLServer *server; + + send_reply(to, SND_EXPLICIT | RPL_STATSDEBUG, + "D :DNSBL Statistics"); + send_reply(to, SND_EXPLICIT | RPL_STATSDEBUG, + "D : Enabled: %s", + feature_bool(FEAT_NATIVE_DNSBL) ? "YES" : "NO"); + send_reply(to, SND_EXPLICIT | RPL_STATSDEBUG, + "D : Cache size: %lu entries", + dnsbl_stats.cache_size); + send_reply(to, SND_EXPLICIT | RPL_STATSDEBUG, + "D : Cache hits: %lu, misses: %lu", + dnsbl_stats.cache_hits, dnsbl_stats.cache_misses); + send_reply(to, SND_EXPLICIT | RPL_STATSDEBUG, + "D : Total lookups: %lu", + dnsbl_stats.total_lookups); + send_reply(to, SND_EXPLICIT | RPL_STATSDEBUG, + "D : Total blocks: %lu, marks: %lu, whitelists: %lu", + dnsbl_stats.total_blocks, dnsbl_stats.total_marks, + dnsbl_stats.total_whitelists); + + /* Per-server stats */ + for (server = dnsbl_servers; server; server = server->next) { + send_reply(to, SND_EXPLICIT | RPL_STATSDEBUG, + "D : %s: %lu queries, %lu hits, %lu blocks", + server->domain, server->queries, server->hits, server->blocks); + } +} diff --git a/ircd/gitsync.c b/ircd/gitsync.c new file mode 100644 index 00000000..c00d1db7 --- /dev/null +++ b/ircd/gitsync.c @@ -0,0 +1,1310 @@ +/* + * IRC - Internet Relay Chat, ircd/gitsync.c + * Copyright (C) 2025 Nefarious Development + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +/** @file + * @brief GitSync - centralized config distribution via git. + */ +#include "config.h" + +#ifdef USE_LIBGIT2 + +#include "gitsync.h" +#include "client.h" +#include "ircd.h" +#include "ircd_alloc.h" +#include "ircd_events.h" +#include "ircd_features.h" +#include "ircd_log.h" +#include "ircd_reply.h" +#include "ircd_snprintf.h" +#include "ircd_string.h" +#include "msg.h" +#include "numeric.h" +#include "s_conf.h" +#include "s_debug.h" +#include "s_misc.h" +#include "s_stats.h" +#include "send.h" +#ifdef USE_SSL +#include "ssl.h" +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/** Maximum size of linesync.data file (1 MB) */ +#define GITSYNC_MAX_SIZE (1024 * 1024) + +/** Global gitsync statistics */ +static struct GitsyncStats gitsync_stats; + +/** Timer for periodic gitsync */ +static struct Timer gitsync_timer; + +/** libgit2 initialized flag */ +static int git_initialized = 0; + +/** Runtime storage for TOFU host fingerprint */ +static char gitsync_runtime_fingerprint[128]; +static char gitsync_runtime_host[256]; + +/** Status code to string mapping */ +static const char *status_strings[] = { + "OK", + "Disabled", + "No repository configured", + "Clone error", + "Fetch error", + "Checkout error", + "SSH authentication error", + "Validation error", + "Apply error" +}; + +/** Validate a file path contains only safe characters. + * Allowed: alphanumeric, underscore, hyphen, dot, forward slash + * @param path Path to validate + * @return 1 if valid, 0 if contains unsafe characters + */ +static int +validate_safe_path(const char *path) +{ + const char *p; + if (!path || !*path) + return 0; + for (p = path; *p; p++) { + if (!isalnum((unsigned char)*p) && + *p != '_' && *p != '-' && *p != '.' && *p != '/') { + return 0; + } + } + /* Reject paths with .. to prevent directory traversal */ + if (strstr(path, "..")) + return 0; + return 1; +} + +/** Generate an Ed25519 SSH key for GitSync authentication using ssh-keygen + * Uses fork/exec to avoid shell command injection vulnerabilities. + * Uses atomic file creation to prevent TOCTOU race conditions. + * @param key_path Path to save the private key (OpenSSH format) + * @return 1 on success (including if key already exists), 0 on failure + */ +int +gitsync_generate_ssh_key(const char *key_path) +{ + char pubkey_path[512]; + char pubkey_line[512]; + FILE *fp; + pid_t pid; + int status; + int fd; + struct stat st; + + /* Validate path contains only safe characters */ + if (!validate_safe_path(key_path)) { + log_write(LS_SYSTEM, L_ERROR, 0, + "GitSync: Invalid characters in key path: %s", key_path); + return 0; + } + + /* Atomic check: try to create the file with O_CREAT | O_EXCL | O_NOFOLLOW + * This prevents TOCTOU race conditions and symlink attacks */ + fd = open(key_path, O_CREAT | O_EXCL | O_NOFOLLOW | O_WRONLY, 0600); + if (fd < 0) { + if (errno == EEXIST) { + /* File already exists - check if it's a regular file (not a symlink) */ + if (lstat(key_path, &st) == 0) { + if (S_ISLNK(st.st_mode)) { + log_write(LS_SYSTEM, L_ERROR, 0, + "GitSync: SSH key path is a symlink (possible attack): %s", key_path); + return 0; + } + if (S_ISREG(st.st_mode)) { + /* Regular file exists - key already generated */ + return 1; + } + } + log_write(LS_SYSTEM, L_ERROR, 0, + "GitSync: SSH key path exists but is not a regular file: %s", key_path); + return 0; + } +#ifdef ELOOP + if (errno == ELOOP) { + log_write(LS_SYSTEM, L_ERROR, 0, + "GitSync: SSH key path is a symlink (possible attack): %s", key_path); + return 0; + } +#endif + log_write(LS_SYSTEM, L_ERROR, 0, + "GitSync: Cannot create SSH key file: %s: %s", key_path, strerror(errno)); + return 0; + } + + /* We successfully created a placeholder file atomically - remove it before ssh-keygen */ + close(fd); + unlink(key_path); + + /* Use fork/exec to run ssh-keygen safely without shell */ + pid = fork(); + if (pid < 0) { + log_write(LS_SYSTEM, L_ERROR, 0, + "GitSync: fork() failed: %s", strerror(errno)); + return 0; + } + + if (pid == 0) { + /* Child process - exec ssh-keygen */ + /* Close stdin, redirect stdout/stderr to /dev/null for -q behavior */ + int devnull = open("/dev/null", O_RDWR); + if (devnull >= 0) { + dup2(devnull, STDIN_FILENO); + dup2(devnull, STDOUT_FILENO); + dup2(devnull, STDERR_FILENO); + if (devnull > STDERR_FILENO) + close(devnull); + } + + execlp("ssh-keygen", "ssh-keygen", + "-t", "ed25519", + "-f", key_path, + "-N", "", + "-C", "gitsync@nefarious", + "-q", + (char *)NULL); + + /* If exec fails, exit with error */ + _exit(127); + } + + /* Parent process - wait for child */ + if (waitpid(pid, &status, 0) < 0) { + log_write(LS_SYSTEM, L_ERROR, 0, + "GitSync: waitpid() failed: %s", strerror(errno)); + return 0; + } + + if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) { + log_write(LS_SYSTEM, L_ERROR, 0, + "GitSync: ssh-keygen failed with exit code %d", + WIFEXITED(status) ? WEXITSTATUS(status) : -1); + return 0; + } + + /* Log the public key for reference */ + ircd_snprintf(0, pubkey_path, sizeof(pubkey_path), "%s.pub", key_path); + fp = fopen(pubkey_path, "r"); + if (fp) { + if (fgets(pubkey_line, sizeof(pubkey_line), fp)) { + /* Remove trailing newline */ + char *nl = strchr(pubkey_line, '\n'); + if (nl) *nl = '\0'; + + log_write(LS_SYSTEM, L_INFO, 0, + "GitSync: Generated SSH key at %s, public key: %s", key_path, pubkey_line); + } + fclose(fp); + } + + return 1; +} + +/** SSH credentials callback for libgit2 + * @param out Credential output + * @param url URL being accessed + * @param username_from_url Username from URL + * @param allowed_types Allowed credential types + * @param payload User payload (unused) + * @return 0 on success, negative on error + */ +static int +gitsync_cred_callback(git_credential **out, const char *url, + const char *username_from_url, + unsigned int allowed_types, void *payload) +{ + const char *ssh_key; + const char *pubkey_path; + struct stat st; + + (void)url; + (void)payload; + + if (!(allowed_types & GIT_CREDENTIAL_SSH_KEY)) + return GIT_PASSTHROUGH; + + ssh_key = feature_str(FEAT_GITSYNC_SSH_KEY); + if (ssh_key && *ssh_key) { + /* GITSYNC_SSH_KEY is set - use dedicated gitsync key */ + if (stat(ssh_key, &st) != 0) { + /* Key file doesn't exist - generate it using ssh-keygen */ + Debug((DEBUG_INFO, "GitSync: SSH key %s not found, generating...", ssh_key)); + if (!gitsync_generate_ssh_key(ssh_key)) { + ircd_snprintf(0, gitsync_stats.last_error, sizeof(gitsync_stats.last_error), + "Failed to generate SSH key at %s", ssh_key); + return GIT_EAUTH; + } + } + } else { + /* Fall back to SSL certificate (contains private key) */ + ssh_key = feature_str(FEAT_SSL_CERTFILE); + if (!ssh_key || !*ssh_key) + ssh_key = "ssl/ircd.pem"; /* Default location */ + } + + /* For PEM files, we don't have a separate .pub file - libgit2 can extract it */ + pubkey_path = NULL; + + Debug((DEBUG_INFO, "GitSync: Using SSH key from %s", ssh_key)); + + return git_credential_ssh_key_new(out, + username_from_url ? username_from_url : "git", + pubkey_path, + ssh_key, + NULL); /* No passphrase */ +} + +/** Format SSH host key fingerprint as hex string + * @param hash Raw hash bytes + * @param hash_len Length of hash + * @param buf Output buffer + * @param buflen Buffer size + */ +static void +gitsync_format_fingerprint(const unsigned char *hash, size_t hash_len, + char *buf, size_t buflen) +{ + size_t i; + size_t pos = 0; + + for (i = 0; i < hash_len && pos + 3 < buflen; i++) { + if (i > 0) + buf[pos++] = ':'; + ircd_snprintf(0, buf + pos, buflen - pos, "%02x", hash[i]); + pos += 2; + } + buf[pos] = '\0'; +} + +/** Certificate check callback with TOFU (Trust On First Use) + * @param cert Certificate + * @param valid Validity flag from libgit2 + * @param host Host being accessed + * @param payload User payload + * @return 0 to accept, -1 to reject + */ +static int +gitsync_cert_callback(git_cert *cert, int valid, const char *host, void *payload) +{ + git_cert_hostkey *hostkey; + char fingerprint[128]; + const char *configured_fp; + const char *trusted_fp; + + (void)valid; + (void)payload; + + /* Only handle SSH host keys */ + if (cert->cert_type != GIT_CERT_HOSTKEY_LIBSSH2) { + Debug((DEBUG_INFO, "GitSync: Non-SSH certificate type %d", cert->cert_type)); + return 0; /* Accept non-SSH certs (e.g., HTTPS) */ + } + + hostkey = (git_cert_hostkey *)cert; + + /* Format the fingerprint - prefer SHA256, fallback to SHA1 */ + if (hostkey->type & GIT_CERT_SSH_SHA256) { + gitsync_format_fingerprint(hostkey->hash_sha256, 32, fingerprint, sizeof(fingerprint)); + } else if (hostkey->type & GIT_CERT_SSH_SHA1) { + gitsync_format_fingerprint(hostkey->hash_sha1, 20, fingerprint, sizeof(fingerprint)); + } else if (hostkey->type & GIT_CERT_SSH_MD5) { + gitsync_format_fingerprint(hostkey->hash_md5, 16, fingerprint, sizeof(fingerprint)); + } else { + Debug((DEBUG_INFO, "GitSync: Unknown host key hash type")); + return -1; /* Reject unknown hash type */ + } + + /* Check configured fingerprint first */ + configured_fp = feature_str(FEAT_GITSYNC_HOST_FINGERPRINT); + + /* Determine which fingerprint to trust */ + if (configured_fp && *configured_fp) { + trusted_fp = configured_fp; + } else if (gitsync_runtime_fingerprint[0]) { + trusted_fp = gitsync_runtime_fingerprint; + } else { + trusted_fp = NULL; + } + + if (!trusted_fp) { + /* TOFU: First connection, trust and store this fingerprint */ + ircd_strncpy(gitsync_runtime_fingerprint, fingerprint, + sizeof(gitsync_runtime_fingerprint) - 1); + ircd_strncpy(gitsync_runtime_host, host, + sizeof(gitsync_runtime_host) - 1); + + sendto_opmask_butone(0, SNO_OLDSNO, + "GitSync: TOFU - Trusting host %s with fingerprint %s", host, fingerprint); + log_write(LS_SYSTEM, L_INFO, 0, + "GitSync: TOFU - Trusting host %s with fingerprint %s", host, fingerprint); + sendto_opmask_butone(0, SNO_OLDSNO, + "GitSync: To persist, add to config: Set GITSYNC_HOST_FINGERPRINT \"%s\"", + fingerprint); + + return 0; /* Accept */ + } + + /* Verify fingerprint matches */ + if (ircd_strcmp(fingerprint, trusted_fp) != 0) { + /* FINGERPRINT MISMATCH - possible MITM attack! */ + sendto_opmask_butone(0, SNO_OLDSNO, + "GitSync: WARNING! Host key for %s has CHANGED!", host); + sendto_opmask_butone(0, SNO_OLDSNO, + "GitSync: Expected: %s", trusted_fp); + sendto_opmask_butone(0, SNO_OLDSNO, + "GitSync: Got: %s", fingerprint); + sendto_opmask_butone(0, SNO_OLDSNO, + "GitSync: Rejecting connection - possible MITM attack!"); + log_write(LS_SYSTEM, L_CRIT, 0, + "GitSync: HOST KEY MISMATCH for %s! Expected %s, got %s", + host, trusted_fp, fingerprint); + + return -1; /* REJECT */ + } + + Debug((DEBUG_INFO, "GitSync: Host key verified for %s", host)); + return 0; /* Accept - fingerprint matches */ +} + +/** Get full path to local repository + * @param buf Buffer to store path + * @param bufsize Buffer size + * @return Pointer to buf + */ +static char * +gitsync_get_repo_path(char *buf, size_t bufsize) +{ + const char *local_path = feature_str(FEAT_GITSYNC_LOCAL_PATH); + + if (!local_path || !*local_path) + local_path = "gitsync"; + + ircd_strncpy(buf, local_path, bufsize - 1); + buf[bufsize - 1] = '\0'; + return buf; +} + +/** Check if directory exists + * @param path Path to check + * @return 1 if exists and is directory, 0 otherwise + */ +static int +dir_exists(const char *path) +{ + struct stat st; + return (stat(path, &st) == 0 && S_ISDIR(st.st_mode)); +} + +/** Clone repository if it doesn't exist + * @param repo_url Repository URL + * @param local_path Local path to clone to + * @param[out] repo Opened repository + * @return GITSYNC_OK on success, error code otherwise + */ +static enum GitsyncStatus +gitsync_clone(const char *repo_url, const char *local_path, git_repository **repo) +{ + git_clone_options clone_opts; + int error; + + /* Initialize clone options - use runtime init for ABI compatibility */ + git_clone_options_init(&clone_opts, GIT_CLONE_OPTIONS_VERSION); + git_fetch_options_init(&clone_opts.fetch_opts, GIT_FETCH_OPTIONS_VERSION); + + clone_opts.fetch_opts.callbacks.credentials = gitsync_cred_callback; + clone_opts.fetch_opts.callbacks.certificate_check = gitsync_cert_callback; + + Debug((DEBUG_INFO, "GitSync: Cloning %s to %s", repo_url, local_path)); + + error = git_clone(repo, repo_url, local_path, &clone_opts); + if (error < 0) { + const git_error *e = git_error_last(); + ircd_snprintf(0, gitsync_stats.last_error, sizeof(gitsync_stats.last_error), + "Clone failed: %s", e ? e->message : "unknown error"); + + if (e && (strstr(e->message, "authentication") || + strstr(e->message, "SSH") || + strstr(e->message, "key"))) { + return GITSYNC_SSH_ERROR; + } + return GITSYNC_CLONE_ERROR; + } + + return GITSYNC_OK; +} + +/** Fetch and reset to remote branch + * @param repo Repository + * @param branch Branch name + * @return GITSYNC_OK on success, error code otherwise + */ +static enum GitsyncStatus +gitsync_fetch_and_reset(git_repository *repo, const char *branch) +{ + git_remote *remote = NULL; + git_fetch_options fetch_opts; + git_reference *ref = NULL; + git_object *target = NULL; + char refspec[256]; + int error; + + /* Initialize fetch options - use runtime init for ABI compatibility */ + git_fetch_options_init(&fetch_opts, GIT_FETCH_OPTIONS_VERSION); + + fetch_opts.callbacks.credentials = gitsync_cred_callback; + fetch_opts.callbacks.certificate_check = gitsync_cert_callback; + /* Fetch all tags (equivalent to git fetch --tags) */ + fetch_opts.download_tags = GIT_REMOTE_DOWNLOAD_TAGS_ALL; + + /* Get origin remote */ + error = git_remote_lookup(&remote, repo, "origin"); + if (error < 0) { + const git_error *e = git_error_last(); + ircd_snprintf(0, gitsync_stats.last_error, sizeof(gitsync_stats.last_error), + "Remote lookup failed: %s", e ? e->message : "unknown error"); + return GITSYNC_FETCH_ERROR; + } + + /* Fetch from origin with tags */ + Debug((DEBUG_INFO, "GitSync: Fetching from origin (with tags)")); + error = git_remote_fetch(remote, NULL, &fetch_opts, "gitsync fetch"); + git_remote_free(remote); + + if (error < 0) { + const git_error *e = git_error_last(); + ircd_snprintf(0, gitsync_stats.last_error, sizeof(gitsync_stats.last_error), + "Fetch failed: %s", e ? e->message : "unknown error"); + + if (e && (strstr(e->message, "authentication") || + strstr(e->message, "SSH") || + strstr(e->message, "key"))) { + return GITSYNC_SSH_ERROR; + } + return GITSYNC_FETCH_ERROR; + } + + /* Get reference to origin/branch */ + ircd_snprintf(0, refspec, sizeof(refspec), "refs/remotes/origin/%s", branch); + error = git_reference_lookup(&ref, repo, refspec); + if (error < 0) { + const git_error *e = git_error_last(); + ircd_snprintf(0, gitsync_stats.last_error, sizeof(gitsync_stats.last_error), + "Branch lookup failed: %s", e ? e->message : "unknown error"); + return GITSYNC_CHECKOUT_ERROR; + } + + /* Get the commit object */ + error = git_reference_peel(&target, ref, GIT_OBJECT_COMMIT); + git_reference_free(ref); + + if (error < 0) { + const git_error *e = git_error_last(); + ircd_snprintf(0, gitsync_stats.last_error, sizeof(gitsync_stats.last_error), + "Peel failed: %s", e ? e->message : "unknown error"); + return GITSYNC_CHECKOUT_ERROR; + } + + /* Store commit hash */ + git_oid_tostr(gitsync_stats.last_commit, sizeof(gitsync_stats.last_commit), + git_object_id(target)); + + /* Hard reset to origin/branch */ + Debug((DEBUG_INFO, "GitSync: Resetting to %s", gitsync_stats.last_commit)); + error = git_reset(repo, target, GIT_RESET_HARD, NULL); + git_object_free(target); + + if (error < 0) { + const git_error *e = git_error_last(); + ircd_snprintf(0, gitsync_stats.last_error, sizeof(gitsync_stats.last_error), + "Reset failed: %s", e ? e->message : "unknown error"); + return GITSYNC_CHECKOUT_ERROR; + } + + return GITSYNC_OK; +} + +/** Read linesync.data file from repository + * @param repo_path Path to repository + * @param[out] content Content buffer (caller must free) + * @param[out] len Content length + * @return GITSYNC_OK on success, error code otherwise + */ +static enum GitsyncStatus +gitsync_read_data(const char *repo_path, char **content, size_t *len) +{ + char filepath[512]; + FILE *fp; + struct stat st; + char *buf; + + ircd_snprintf(0, filepath, sizeof(filepath), "%s/linesync.data", repo_path); + + if (stat(filepath, &st) != 0) { + ircd_snprintf(0, gitsync_stats.last_error, sizeof(gitsync_stats.last_error), + "linesync.data not found in repository"); + return GITSYNC_VALIDATION_ERROR; + } + + if (st.st_size > GITSYNC_MAX_SIZE) { + ircd_snprintf(0, gitsync_stats.last_error, sizeof(gitsync_stats.last_error), + "linesync.data too large (%ld bytes)", (long)st.st_size); + return GITSYNC_VALIDATION_ERROR; + } + + fp = fopen(filepath, "r"); + if (!fp) { + ircd_snprintf(0, gitsync_stats.last_error, sizeof(gitsync_stats.last_error), + "Cannot open linesync.data"); + return GITSYNC_VALIDATION_ERROR; + } + + buf = (char *)MyMalloc(st.st_size + 1); + if (!buf) { + fclose(fp); + ircd_snprintf(0, gitsync_stats.last_error, sizeof(gitsync_stats.last_error), + "Memory allocation failed"); + return GITSYNC_APPLY_ERROR; + } + + *len = fread(buf, 1, st.st_size, fp); + fclose(fp); + + buf[*len] = '\0'; + *content = buf; + + return GITSYNC_OK; +} + +/** Check for dangerous include directives + * Allows relative includes (e.g., include "klines.conf";) + * Blocks absolute paths and path traversal + * @param content Content to search + * @return 1 if dangerous include found, 0 if safe + */ +static int +gitsync_has_dangerous_include(const char *content) +{ + const char *p = content; + + while (*p) { + /* Check for "include" keyword (case-insensitive) */ + if ((*p == 'i' || *p == 'I') && + (p[1] == 'n' || p[1] == 'N') && + (p[2] == 'c' || p[2] == 'C') && + (p[3] == 'l' || p[3] == 'L') && + (p[4] == 'u' || p[4] == 'U') && + (p[5] == 'd' || p[5] == 'D') && + (p[6] == 'e' || p[6] == 'E')) { + /* Check it's at start of line or after whitespace */ + if (p == content || isspace((unsigned char)p[-1])) { + const char *q = p + 7; + /* Skip whitespace after "include" */ + while (*q && isspace((unsigned char)*q)) + q++; + /* Check for quoted path */ + if (*q == '"') { + q++; + /* Check for absolute path */ + if (*q == '/') { + return 1; /* Absolute path - dangerous */ + } + /* Check for path traversal */ + if (q[0] == '.' && q[1] == '.') { + return 1; /* Path traversal - dangerous */ + } + } + } + } + p++; + } + return 0; +} + +/** Validate downloaded content + * @param content Downloaded content + * @param len Length of content + * @return 1 if valid, 0 if invalid + */ +static int +gitsync_validate_content(const char *content, size_t len) +{ + const char *p; + int brace_depth = 0; + + if (!content || len == 0) + return 0; + + /* Reject dangerous include directives (absolute paths, path traversal) */ + if (gitsync_has_dangerous_include(content)) { + ircd_strncpy(gitsync_stats.last_error, + "Content contains dangerous include (absolute path or ../)", + sizeof(gitsync_stats.last_error) - 1); + sendto_opmask_butone(0, SNO_OLDSNO, + "GitSync: Rejected content with dangerous include directive"); + return 0; + } + + /* Basic validation: check for balanced braces and no dangerous patterns */ + for (p = content; *p; p++) { + if (*p == '{') { + brace_depth++; + } else if (*p == '}') { + brace_depth--; + if (brace_depth < 0) + return 0; /* Unbalanced braces */ + } + } + + if (brace_depth != 0) + return 0; /* Unbalanced braces */ + + /* Reject content with shell metacharacters that could be dangerous */ + if (strstr(content, "$(") || strstr(content, "`")) + return 0; + + /* Reject path traversal anywhere in content */ + if (strstr(content, "../") || strstr(content, "..\\")) + return 0; + + return 1; +} + +/** Check if content matches last applied content + * We store a hash of the last applied content to detect changes. + */ +static char gitsync_last_content_hash[64]; + +/** Simple hash of content for change detection */ +static void +gitsync_hash_content(const char *content, size_t len, char *hash, size_t hashlen) +{ + /* Simple checksum - just use first 8 bytes of content + length */ + unsigned long h = len; + size_t i; + for (i = 0; i < len && i < 1024; i++) { + h = h * 31 + (unsigned char)content[i]; + } + ircd_snprintf(0, hash, hashlen, "%08lx%08lx", (unsigned long)len, h); +} + +/** Apply downloaded configuration + * Writes to gitsync.conf and triggers a rehash only if content changed. + * Uses safe write: writes to .new, backs up old to .bak, then renames. + * If rehash fails, restores from backup. + * @param content Configuration content + * @param len Content length + * @return GITSYNC_OK on success, error code otherwise + */ +static enum GitsyncStatus +gitsync_apply(const char *content, size_t len) +{ + const char *conf_file; + FILE *fp; + size_t written; + char content_hash[64]; + char new_file[512]; + char bak_file[512]; + struct stat st; + int had_backup = 0; + + conf_file = feature_str(FEAT_GITSYNC_CONF_FILE); + if (!conf_file || !*conf_file) + conf_file = "gitsync.conf"; + + /* Check if content has changed */ + gitsync_hash_content(content, len, content_hash, sizeof(content_hash)); + if (gitsync_last_content_hash[0] && + strcmp(content_hash, gitsync_last_content_hash) == 0) { + Debug((DEBUG_INFO, "GitSync: Content unchanged, skipping write")); + return GITSYNC_OK; + } + + /* Build temp and backup filenames */ + ircd_snprintf(0, new_file, sizeof(new_file), "%s.new", conf_file); + ircd_snprintf(0, bak_file, sizeof(bak_file), "%s.bak", conf_file); + + Debug((DEBUG_INFO, "GitSync: Writing %zu bytes to %s", len, conf_file)); + + /* Write content to temp file first */ + fp = fopen(new_file, "w"); + if (!fp) { + ircd_snprintf(0, gitsync_stats.last_error, sizeof(gitsync_stats.last_error), + "Cannot open %s for writing: %s", new_file, strerror(errno)); + log_write(LS_SYSTEM, L_ERROR, 0, "GitSync: %s", gitsync_stats.last_error); + return GITSYNC_APPLY_ERROR; + } + + /* Write header comment */ + fprintf(fp, "# GitSync configuration - DO NOT EDIT\n"); + fprintf(fp, "# Auto-generated from git commit %.8s\n", gitsync_stats.last_commit); + fprintf(fp, "# Last sync: %s\n\n", myctime(CurrentTime)); + + /* Write the actual content */ + written = fwrite(content, 1, len, fp); + fclose(fp); + + if (written != len) { + ircd_snprintf(0, gitsync_stats.last_error, sizeof(gitsync_stats.last_error), + "Short write to %s: wrote %zu of %zu bytes", + new_file, written, len); + log_write(LS_SYSTEM, L_ERROR, 0, "GitSync: %s", gitsync_stats.last_error); + unlink(new_file); + return GITSYNC_APPLY_ERROR; + } + + /* Backup existing config file if it exists */ + if (stat(conf_file, &st) == 0) { + unlink(bak_file); /* Remove old backup */ + if (rename(conf_file, bak_file) == 0) { + had_backup = 1; + Debug((DEBUG_INFO, "GitSync: Backed up %s to %s", conf_file, bak_file)); + } + } + + /* Rename new file to config file (atomic on most filesystems) */ + if (rename(new_file, conf_file) != 0) { + ircd_snprintf(0, gitsync_stats.last_error, sizeof(gitsync_stats.last_error), + "Cannot rename %s to %s: %s", new_file, conf_file, strerror(errno)); + log_write(LS_SYSTEM, L_ERROR, 0, "GitSync: %s", gitsync_stats.last_error); + /* Try to restore backup */ + if (had_backup) + rename(bak_file, conf_file); + return GITSYNC_APPLY_ERROR; + } + + sendto_opmask_butone(0, SNO_OLDSNO, + "GitSync: Wrote %zu bytes to %s (commit %.8s), rehashing", + len, conf_file, gitsync_stats.last_commit); + + /* Trigger a rehash to load the new configuration */ + rehash(&me, 0); + + /* Check if config parsing failed */ + if (conf_get_error_flag()) { + sendto_opmask_butone(0, SNO_OLDSNO, + "GitSync: Config parse error detected, restoring backup"); + log_write(LS_SYSTEM, L_ERROR, 0, + "GitSync: Config parse error, restoring %s from backup", conf_file); + + if (had_backup && rename(bak_file, conf_file) == 0) { + /* Rehash again with restored config */ + rehash(&me, 0); + ircd_snprintf(0, gitsync_stats.last_error, sizeof(gitsync_stats.last_error), + "Config parse error - restored from backup"); + } else { + ircd_snprintf(0, gitsync_stats.last_error, sizeof(gitsync_stats.last_error), + "Config parse error - no backup to restore"); + } + return GITSYNC_VALIDATION_ERROR; + } + + /* Success - remember hash and clean up backup */ + ircd_strncpy(gitsync_last_content_hash, content_hash, + sizeof(gitsync_last_content_hash) - 1); + + /* Keep backup for safety, but could optionally delete it here */ + /* unlink(bak_file); */ + + return GITSYNC_OK; +} + +#ifdef USE_SSL +/** Update TLS certificate from git tag + * @param repo Repository + * @param tag_name Name of tag containing certificate + * @return 1 if certificate was updated, 0 otherwise + */ +static int +gitsync_update_cert(git_repository *repo, const char *tag_name) +{ + git_object *obj = NULL; + const git_blob *blob = NULL; + const char *cert_content; + size_t cert_size; + const char *cert_file; + FILE *fp; + char *old_content = NULL; + size_t old_size = 0; + struct stat st; + int changed = 0; + int error; + char refspec[256]; + + cert_file = feature_str(FEAT_GITSYNC_CERT_FILE); + if (!cert_file || !*cert_file) + cert_file = feature_str(FEAT_SSL_CERTFILE); /* Use IRCd's SSL cert file */ + + /* Look up the tag */ + ircd_snprintf(0, refspec, sizeof(refspec), "refs/tags/%s", tag_name); + error = git_revparse_single(&obj, repo, refspec); + if (error < 0) { + /* Try without refs/tags prefix */ + error = git_revparse_single(&obj, repo, tag_name); + if (error < 0) { + Debug((DEBUG_INFO, "GitSync: Tag %s not found", tag_name)); + return 0; + } + } + + /* Peel to blob if it's an annotated tag */ + if (git_object_type(obj) == GIT_OBJECT_TAG) { + git_object *target = NULL; + error = git_tag_peel(&target, (git_tag *)obj); + git_object_free(obj); + if (error < 0) { + Debug((DEBUG_INFO, "GitSync: Cannot peel tag %s", tag_name)); + return 0; + } + obj = target; + } + + /* Check if it's a blob */ + if (git_object_type(obj) != GIT_OBJECT_BLOB) { + Debug((DEBUG_INFO, "GitSync: Tag %s is not a blob (type %d)", + tag_name, git_object_type(obj))); + git_object_free(obj); + return 0; + } + + blob = (const git_blob *)obj; + cert_content = (const char *)git_blob_rawcontent(blob); + cert_size = git_blob_rawsize(blob); + + /* Read existing cert file for comparison */ + if (stat(cert_file, &st) == 0 && st.st_size > 0) { + fp = fopen(cert_file, "r"); + if (fp) { + old_content = (char *)MyMalloc(st.st_size + 1); + if (old_content) { + old_size = fread(old_content, 1, st.st_size, fp); + old_content[old_size] = '\0'; + } + fclose(fp); + } + } + + /* Check if content changed */ + if (old_content == NULL || old_size != cert_size || + memcmp(old_content, cert_content, cert_size) != 0) { + /* Backup old cert */ + if (stat(cert_file, &st) == 0) { + char backup_path[512]; + ircd_snprintf(0, backup_path, sizeof(backup_path), "%s.backup", cert_file); + rename(cert_file, backup_path); + } + + /* Write new cert */ + fp = fopen(cert_file, "w"); + if (fp) { + if (fwrite(cert_content, 1, cert_size, fp) == cert_size) { + changed = 1; + sendto_opmask_butone(0, SNO_OLDSNO, + "GitSync: Updated TLS certificate from tag %s", tag_name); + log_write(LS_SYSTEM, L_INFO, 0, + "GitSync: Updated TLS certificate from tag %s", tag_name); + } else { + log_write(LS_SYSTEM, L_ERROR, 0, + "GitSync: Failed to write certificate to %s", cert_file); + } + fclose(fp); + + /* Reload SSL certificates */ + if (changed) { + ssl_reinit(1); + } + } else { + log_write(LS_SYSTEM, L_ERROR, 0, + "GitSync: Cannot open %s for writing: %s", + cert_file, strerror(errno)); + } + } + + if (old_content) + MyFree(old_content); + git_object_free(obj); + + return changed; +} +#endif /* USE_SSL */ + +/** Timer callback for periodic gitsync + * @param ev Timer event + */ +static void +gitsync_timer_callback(struct Event *ev) +{ + if (ev_type(ev) == ET_EXPIRE) { + gitsync_trigger(NULL, 0); + } +} + +void +gitsync_init(void) +{ + memset(&gitsync_stats, 0, sizeof(gitsync_stats)); + + if (!git_initialized) { + git_libgit2_init(); + git_initialized = 1; + } +} + +void +gitsync_start_timer(void) +{ + int interval; + const char *conf_file; + struct stat st; + FILE *fp; + + if (!feature_bool(FEAT_GITSYNC_ENABLE)) + return; + + /* Ensure gitsync.conf exists so include directive doesn't fail */ + conf_file = feature_str(FEAT_GITSYNC_CONF_FILE); + if (!conf_file || !*conf_file) + conf_file = "gitsync.conf"; + + if (stat(conf_file, &st) != 0) { + /* File doesn't exist, create empty placeholder */ + fp = fopen(conf_file, "w"); + if (fp) { + fprintf(fp, "# GitSync configuration placeholder\n"); + fprintf(fp, "# This file will be populated when gitsync runs\n"); + fclose(fp); + Debug((DEBUG_INFO, "GitSync: Created empty %s", conf_file)); + } + } + + interval = feature_int(FEAT_GITSYNC_INTERVAL); + if (interval < 60) + interval = 60; /* Minimum 1 minute */ + + timer_add(timer_init(&gitsync_timer), gitsync_timer_callback, + NULL, TT_PERIODIC, interval); + + Debug((DEBUG_INFO, "GitSync: Timer started with interval %d seconds", interval)); +} + +enum GitsyncStatus +gitsync_trigger(struct Client *sptr, int force) +{ + const char *repo_url; + const char *branch; + char repo_path[512]; + git_repository *repo = NULL; + char *content = NULL; + size_t len = 0; + enum GitsyncStatus status; + time_t now = CurrentTime; + int interval; + int error; + + gitsync_stats.last_attempt = now; + + /* Check if enabled */ + if (!feature_bool(FEAT_GITSYNC_ENABLE)) { + gitsync_stats.last_status = GITSYNC_DISABLED; + return GITSYNC_DISABLED; + } + + /* Check if repository is configured */ + repo_url = feature_str(FEAT_GITSYNC_REPOSITORY); + if (!repo_url || !*repo_url) { + ircd_snprintf(0, gitsync_stats.last_error, sizeof(gitsync_stats.last_error), + "No repository configured"); + gitsync_stats.last_status = GITSYNC_NO_REPO; + return GITSYNC_NO_REPO; + } + + /* Check interval (unless forced) */ + if (!force) { + interval = feature_int(FEAT_GITSYNC_INTERVAL); + if (gitsync_stats.last_sync > 0 && + (now - gitsync_stats.last_sync) < interval) { + /* Not time yet */ + return GITSYNC_OK; + } + } + + /* Notify if triggered by oper */ + if (sptr) { + sendto_opmask_butone(0, SNO_OLDSNO, + "GitSync triggered by %s", cli_name(sptr)); + } + + /* Get paths */ + gitsync_get_repo_path(repo_path, sizeof(repo_path)); + branch = feature_str(FEAT_GITSYNC_BRANCH); + if (!branch || !*branch) + branch = "master"; + + /* Initialize libgit2 if needed */ + if (!git_initialized) { + git_libgit2_init(); + git_initialized = 1; + } + + /* Clone or open repository */ + if (!dir_exists(repo_path)) { + /* Need to clone */ + status = gitsync_clone(repo_url, repo_path, &repo); + if (status != GITSYNC_OK) { + gitsync_stats.failures++; + gitsync_stats.last_status = status; + if (sptr) { + sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :GitSync failed: %s", + sptr, gitsync_stats.last_error); + } + return status; + } + /* Get HEAD commit hash after clone */ + { + git_reference *head_ref = NULL; + git_object *head_obj = NULL; + if (git_repository_head(&head_ref, repo) == 0 && + git_reference_peel(&head_obj, head_ref, GIT_OBJECT_COMMIT) == 0) { + git_oid_tostr(gitsync_stats.last_commit, sizeof(gitsync_stats.last_commit), + git_object_id(head_obj)); + git_object_free(head_obj); + } + if (head_ref) + git_reference_free(head_ref); + } + } else { + /* Open existing repository */ + error = git_repository_open(&repo, repo_path); + if (error < 0) { + const git_error *e = git_error_last(); + ircd_snprintf(0, gitsync_stats.last_error, sizeof(gitsync_stats.last_error), + "Cannot open repository: %s", e ? e->message : "unknown error"); + gitsync_stats.failures++; + gitsync_stats.last_status = GITSYNC_CLONE_ERROR; + if (sptr) { + sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :GitSync failed: %s", + sptr, gitsync_stats.last_error); + } + return GITSYNC_CLONE_ERROR; + } + + /* Fetch and reset */ + status = gitsync_fetch_and_reset(repo, branch); + if (status != GITSYNC_OK) { + git_repository_free(repo); + gitsync_stats.failures++; + gitsync_stats.last_status = status; + if (sptr) { + sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :GitSync failed: %s", + sptr, gitsync_stats.last_error); + } + return status; + } + } + + /* Check for certificate update from git tag */ +#ifdef USE_SSL + { + const char *cert_tag = feature_str(FEAT_GITSYNC_CERT_TAG); + if (cert_tag && *cert_tag) { + gitsync_update_cert(repo, cert_tag); + } + } +#endif + + /* Read linesync.data */ + status = gitsync_read_data(repo_path, &content, &len); + git_repository_free(repo); + + if (status != GITSYNC_OK) { + gitsync_stats.failures++; + gitsync_stats.last_status = status; + if (sptr) { + sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :GitSync failed: %s", + sptr, gitsync_stats.last_error); + } + return status; + } + + /* Validate content */ + if (!gitsync_validate_content(content, len)) { + MyFree(content); + ircd_snprintf(0, gitsync_stats.last_error, sizeof(gitsync_stats.last_error), + "Content validation failed"); + gitsync_stats.failures++; + gitsync_stats.last_status = GITSYNC_VALIDATION_ERROR; + if (sptr) { + sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :GitSync failed: validation error", + sptr); + } + return GITSYNC_VALIDATION_ERROR; + } + + /* Apply configuration */ + status = gitsync_apply(content, len); + MyFree(content); + + if (status == GITSYNC_OK) { + gitsync_stats.last_sync = now; + gitsync_stats.syncs++; + gitsync_stats.last_error[0] = '\0'; + if (sptr) { + sendcmdto_one(&me, CMD_NOTICE, sptr, + "%C :GitSync completed successfully (commit %.8s)", + sptr, gitsync_stats.last_commit); + } + } else { + gitsync_stats.failures++; + if (sptr) { + sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :GitSync failed: %s", + sptr, gitsync_stats.last_error); + } + } + + gitsync_stats.last_status = status; + return status; +} + +const char * +gitsync_status_str(enum GitsyncStatus status) +{ + if (status >= 0 && status < sizeof(status_strings) / sizeof(status_strings[0])) + return status_strings[status]; + return "Unknown"; +} + +const struct GitsyncStats * +gitsync_get_stats(void) +{ + return &gitsync_stats; +} + +void +gitsync_report_stats(struct Client *to, const struct StatDesc *sd, char *param) +{ + const struct GitsyncStats *stats = &gitsync_stats; + char timebuf[64]; + + (void)sd; + (void)param; + + send_reply(to, SND_EXPLICIT | RPL_STATSDEBUG, ":GitSync Statistics:"); + + if (feature_bool(FEAT_GITSYNC_ENABLE)) { + const char *cert_tag; + send_reply(to, SND_EXPLICIT | RPL_STATSDEBUG, ": Status: Enabled"); + send_reply(to, SND_EXPLICIT | RPL_STATSDEBUG, ": Repository: %s", + feature_str(FEAT_GITSYNC_REPOSITORY)); + send_reply(to, SND_EXPLICIT | RPL_STATSDEBUG, ": Branch: %s", + feature_str(FEAT_GITSYNC_BRANCH)); + send_reply(to, SND_EXPLICIT | RPL_STATSDEBUG, ": Interval: %d seconds", + feature_int(FEAT_GITSYNC_INTERVAL)); + cert_tag = feature_str(FEAT_GITSYNC_CERT_TAG); + if (cert_tag && *cert_tag) { + const char *cert_file = feature_str(FEAT_GITSYNC_CERT_FILE); + if (!cert_file || !*cert_file) + cert_file = feature_str(FEAT_SSL_CERTFILE); + send_reply(to, SND_EXPLICIT | RPL_STATSDEBUG, ": Cert Tag: %s", + cert_tag); + send_reply(to, SND_EXPLICIT | RPL_STATSDEBUG, ": Cert File: %s", + cert_file); + } + } else { + send_reply(to, SND_EXPLICIT | RPL_STATSDEBUG, ": Status: Disabled"); + } + + send_reply(to, SND_EXPLICIT | RPL_STATSDEBUG, ": Successful syncs: %lu", + stats->syncs); + send_reply(to, SND_EXPLICIT | RPL_STATSDEBUG, ": Failed syncs: %lu", + stats->failures); + + if (stats->last_sync > 0) { + struct tm *tm = localtime(&stats->last_sync); + strftime(timebuf, sizeof(timebuf), "%Y-%m-%d %H:%M:%S", tm); + send_reply(to, SND_EXPLICIT | RPL_STATSDEBUG, ": Last sync: %s", timebuf); + } else { + send_reply(to, SND_EXPLICIT | RPL_STATSDEBUG, ": Last sync: Never"); + } + + if (stats->last_commit[0]) { + send_reply(to, SND_EXPLICIT | RPL_STATSDEBUG, ": Last commit: %.8s", + stats->last_commit); + } + + send_reply(to, SND_EXPLICIT | RPL_STATSDEBUG, ": Last status: %s", + gitsync_status_str(stats->last_status)); + + if (stats->last_error[0]) { + send_reply(to, SND_EXPLICIT | RPL_STATSDEBUG, ": Last error: %s", + stats->last_error); + } +} + +const char * +gitsync_get_host_fingerprint(char *host, size_t hostlen) +{ + const char *configured_fp; + + /* Return configured fingerprint if set */ + configured_fp = feature_str(FEAT_GITSYNC_HOST_FINGERPRINT); + if (configured_fp && *configured_fp) { + if (host && hostlen > 0) + ircd_strncpy(host, "(configured)", hostlen - 1); + return configured_fp; + } + + /* Return runtime TOFU fingerprint if established */ + if (gitsync_runtime_fingerprint[0]) { + if (host && hostlen > 0) + ircd_strncpy(host, gitsync_runtime_host, hostlen - 1); + return gitsync_runtime_fingerprint; + } + + return NULL; +} + +void +gitsync_clear_host_fingerprint(void) +{ + if (gitsync_runtime_fingerprint[0]) { + sendto_opmask_butone(0, SNO_OLDSNO, + "GitSync: Cleared TOFU host fingerprint for %s", gitsync_runtime_host); + log_write(LS_SYSTEM, L_INFO, 0, + "GitSync: Cleared TOFU host fingerprint for %s", gitsync_runtime_host); + } + gitsync_runtime_fingerprint[0] = '\0'; + gitsync_runtime_host[0] = '\0'; +} + +#endif /* USE_LIBGIT2 */ diff --git a/ircd/ircd.c b/ircd/ircd.c index 39f897ad..54633610 100644 --- a/ircd/ircd.c +++ b/ircd/ircd.c @@ -51,6 +51,8 @@ #include "querycmds.h" #include "res.h" #include "s_auth.h" +#include "dnsbl.h" +#include "gitsync.h" #include "s_bsd.h" #include "s_conf.h" #include "s_debug.h" @@ -744,6 +746,12 @@ int main(int argc, char **argv) { stats_init(); + dnsbl_init(); + +#ifdef USE_LIBGIT2 + gitsync_init(); +#endif + IPcheck_init(); timer_add(timer_init(&connect_timer), try_connections, 0, TT_RELATIVE, 1); timer_add(timer_init(&ping_timer), check_pings, 0, TT_RELATIVE, 1); diff --git a/ircd/ircd_features.c b/ircd/ircd_features.c index adf32201..b7b9b754 100644 --- a/ircd/ircd_features.c +++ b/ircd/ircd_features.c @@ -803,6 +803,26 @@ static struct FeatureDesc { F_B(UPING_ENABLE, FEAT_READ, 1, 0), F_I(UPING_PORT, FEAT_READ, UDP_PORT, 0), + /* Native DNSBL FEAT_'s */ + F_B(NATIVE_DNSBL, 0, 0, 0), + F_I(DNSBL_TIMEOUT, 0, 5, 0), + F_I(DNSBL_CACHETIME, 0, 86400, 0), + F_S(DNSBL_BLOCKMSG, 0, "Your IP is listed in a DNS blacklist", 0), + +#ifdef USE_LIBGIT2 + /* GitSync FEAT_'s */ + F_B(GITSYNC_ENABLE, 0, 0, 0), + F_I(GITSYNC_INTERVAL, 0, 300, 0), + F_S(GITSYNC_REPOSITORY, 0, "", 0), + F_S(GITSYNC_BRANCH, 0, "master", 0), + F_S(GITSYNC_SSH_KEY, 0, "", 0), + F_S(GITSYNC_LOCAL_PATH, 0, "gitsync", 0), + F_S(GITSYNC_CONF_FILE, 0, "gitsync.conf", 0), + F_S(GITSYNC_CERT_TAG, 0, "", 0), + F_S(GITSYNC_CERT_FILE, 0, "", 0), /* Empty = use SSL_CERTFILE */ + F_S(GITSYNC_HOST_FINGERPRINT, 0, "", 0), /* SSH host key fingerprint (TOFU) */ +#endif + #undef F_S #undef F_B #undef F_I diff --git a/ircd/ircd_lexer.l b/ircd/ircd_lexer.l index 7c2e96c7..7ea09a9b 100644 --- a/ircd/ircd_lexer.l +++ b/ircd/ircd_lexer.l @@ -115,6 +115,13 @@ static struct lexer_token { TOKEN(DNS), TOKEN(FORWARDS), TOKEN(WEBIRC), + TOKEN(DNSBL), + TOKEN(BITMASK), + TOKEN(SCORE), + TOKEN(ACTION), + TOKEN(BLOCK_ALL), + TOKEN(BLOCK_ANON), + TOKEN(WHITELIST), TOKEN(IDENT), TOKEN(USERIDENT), TOKEN(IGNOREIDENT), @@ -183,6 +190,7 @@ static struct lexer_token { { "kb", KBYTES }, { "kilobytes", KBYTES }, { "list_chan", TPRIV_LIST_CHAN }, + { "gitsync", TPRIV_GITSYNC }, { "local_badchan", TPRIV_LOCAL_BADCHAN }, { "local_gline", TPRIV_LOCAL_GLINE }, { "local_jupe", TPRIV_LOCAL_JUPE }, diff --git a/ircd/ircd_parser.y b/ircd/ircd_parser.y index 41b18129..207ed218 100644 --- a/ircd/ircd_parser.y +++ b/ircd/ircd_parser.y @@ -50,6 +50,7 @@ #include "s_bsd.h" #include "s_conf.h" #include "s_debug.h" +#include "dnsbl.h" #include "s_misc.h" #include "send.h" #include "struct.h" @@ -95,6 +96,10 @@ extern int init_lexer_file(char* file); struct Privs privs_dirty; struct WebIRCFlags wflags; struct ClassRestrictFlags crestrict; + /* DNSBL block parsing globals */ + char *dnsbl_domain, *dnsbl_index, *dnsbl_mark; + unsigned int dnsbl_bitmask; + int dnsbl_action, dnsbl_score; static void parse_error(char *pattern,...) { static char error_buffer[1024]; @@ -191,6 +196,13 @@ static void free_slist(struct SLink **link) { %token DNS %token FORWARDS %token WEBIRC +%token DNSBL +%token BITMASK +%token SCORE +%token ACTION +%token BLOCK_ALL +%token BLOCK_ANON +%token WHITELIST %token IDENT %token USERIDENT %token IGNOREIDENT @@ -236,7 +248,7 @@ static void free_slist(struct SLink **link) { %token TRUSTACCOUNT /* and now a lot of privileges... */ %token TPRIV_CHAN_LIMIT TPRIV_MODE_LCHAN TPRIV_DEOP_LCHAN TPRIV_WALK_LCHAN -%token TPRIV_LOCAL_KILL TPRIV_REHASH TPRIV_RESTART TPRIV_DIE +%token TPRIV_LOCAL_KILL TPRIV_REHASH TPRIV_RESTART TPRIV_GITSYNC TPRIV_DIE %token TPRIV_LOCAL_GLINE TPRIV_LOCAL_JUPE TPRIV_LOCAL_BADCHAN %token TPRIV_LOCAL_OPMODE TPRIV_OPMODE TPRIV_SET TPRIV_WHOX TPRIV_BADCHAN %token TPRIV_SEE_CHAN TPRIV_SHOW_INVIS TPRIV_SHOW_ALL_INVIS TPRIV_PROPAGATE @@ -266,7 +278,7 @@ block: adminblock | generalblock | classblock | connectblock | uworldblock | operblock | portblock | jupeblock | clientblock | killblock | cruleblock | motdblock | featuresblock | quarantineblock | pseudoblock | iauthblock | forwardsblock | webircblock | spoofhostblock | - exceptblock | include | error ';'; + exceptblock | dnsblblock | include | error ';'; /* The timespec, sizespec and expr was ripped straight from * ircd-hybrid-7. */ @@ -883,6 +895,7 @@ privtype: TPRIV_CHAN_LIMIT { $$ = PRIV_CHAN_LIMIT; } | TPRIV_LOCAL_KILL { $$ = PRIV_LOCAL_KILL; } | TPRIV_REHASH { $$ = PRIV_REHASH; } | TPRIV_RESTART { $$ = PRIV_RESTART; } | + TPRIV_GITSYNC { $$ = PRIV_GITSYNC; } | TPRIV_DIE { $$ = PRIV_DIE; } | GLINE { $$ = PRIV_GLINE; } | TPRIV_LOCAL_GLINE { $$ = PRIV_LOCAL_GLINE; } | @@ -1899,6 +1912,69 @@ exceptlistdelay: LISTDELAY '=' YES ';' flags &= ~EFLAG_LISTDELAY; }; +dnsblblock: DNSBL +{ + dnsbl_domain = dnsbl_index = dnsbl_mark = NULL; + dnsbl_bitmask = 0; + dnsbl_action = DNSBL_ACT_MARK; + dnsbl_score = 0; +} '{' dnsblitems '}' ';' +{ + if (dnsbl_domain == NULL) + parse_error("Missing name in DNSBL block"); + else { + dnsbl_add_server(dnsbl_domain, dnsbl_index, dnsbl_bitmask, + dnsbl_action, dnsbl_mark, dnsbl_score); + } + MyFree(dnsbl_domain); + MyFree(dnsbl_index); + MyFree(dnsbl_mark); + dnsbl_domain = dnsbl_index = dnsbl_mark = NULL; + dnsbl_bitmask = 0; + dnsbl_action = DNSBL_ACT_MARK; + dnsbl_score = 0; +}; +dnsblitems: dnsblitem dnsblitems | dnsblitem; +dnsblitem: dnsblname | dnsblindex | dnsblbitmask | dnsblaction | dnsblmark | dnsblscore; +dnsblname: NAME '=' QSTRING ';' +{ + MyFree(dnsbl_domain); + dnsbl_domain = $3; +}; +dnsblindex: HOST '=' QSTRING ';' +{ + /* HOST used as "index" for reply values, e.g., "2,3,5" */ + MyFree(dnsbl_index); + dnsbl_index = $3; +}; +dnsblbitmask: BITMASK '=' expr ';' +{ + dnsbl_bitmask = $3; +}; +dnsblaction: ACTION '=' MARK ';' +{ + dnsbl_action = DNSBL_ACT_MARK; +} | ACTION '=' BLOCK_ALL ';' +{ + dnsbl_action = DNSBL_ACT_BLOCK_ALL; +} | ACTION '=' BLOCK_ANON ';' +{ + dnsbl_action = DNSBL_ACT_BLOCK_ANON; +} | ACTION '=' WHITELIST ';' +{ + dnsbl_action = DNSBL_ACT_WHITELIST; +}; +dnsblmark: REASON '=' QSTRING ';' +{ + /* REASON is used as the mark string */ + MyFree(dnsbl_mark); + dnsbl_mark = $3; +}; +dnsblscore: SCORE '=' expr ';' +{ + dnsbl_score = $3; +}; + include: INCLUDE QSTRING ';' { init_lexer_file($2); diff --git a/ircd/m_check.c b/ircd/m_check.c index 0b69e615..36ec07a3 100644 --- a/ircd/m_check.c +++ b/ircd/m_check.c @@ -722,25 +722,25 @@ signed int checkHostmask(struct Client *sptr, char *hoststr, int flags) { strcpy(hostm,"*"); if (!strchr(hoststr, '!') && !strchr(hoststr, '@')) - ircd_strncpy(hostm,hoststr,sizeof(hostm)); + ircd_strncpy(hostm,hoststr,HOSTLEN + 1); else { if ((p = strchr(hoststr, '@'))) { *p++ = '\0'; - if (*p) ircd_strncpy(hostm,p, sizeof(hostm)); + if (*p) ircd_strncpy(hostm,p, HOSTLEN + 1); } /* Get the nick!user mask */ if ((p = strchr(hoststr, '!'))) { *p++ = '\0'; - if (*p) ircd_strncpy(userm,p,sizeof(userm)); - if (*hoststr) ircd_strncpy(nickm,hoststr,sizeof(nickm)); + if (*p) ircd_strncpy(userm,p,USERLEN + 1); + if (*hoststr) ircd_strncpy(nickm,hoststr,NICKLEN + 1); } else if (*hoststr) { /* Durz: We should only do the following *IF* the hoststr has not already been * copied into hostm (ie. neither ! or @ specified).. otherwise, when we do * /quote check *.barrysworld.com - we end up with targhost as: *!*.barryswo@*.barrysworld.com */ - ircd_strncpy(userm,hoststr,sizeof(userm)); + ircd_strncpy(userm,hoststr,USERLEN + 1); } } diff --git a/ircd/m_gitsync.c b/ircd/m_gitsync.c new file mode 100644 index 00000000..17071cc7 --- /dev/null +++ b/ircd/m_gitsync.c @@ -0,0 +1,921 @@ +/* + * IRC - Internet Relay Chat, ircd/m_gitsync.c + * Copyright (C) 2025 Nefarious Development + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +/** @file + * @brief Handlers for GITSYNC command. + */ +#include "config.h" + +#include "client.h" +#include "hash.h" +#include "ircd.h" +#include "ircd_features.h" +#include "ircd_log.h" +#include "ircd_reply.h" +#include "ircd_snprintf.h" +#include "ircd_string.h" +#include "msg.h" +#include "numeric.h" +#include "numnicks.h" +#include "s_conf.h" +#include "s_user.h" +#include "send.h" + +#ifdef USE_LIBGIT2 +#include "gitsync.h" +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/** Validate that a path contains only safe characters. + * Allows alphanumeric, underscore, hyphen, dot, and forward slash. + * Rejects paths containing ".." to prevent directory traversal. + * @param path Path to validate + * @return 1 if safe, 0 if unsafe + */ +static int +validate_safe_path(const char *path) +{ + const char *p; + + if (!path || !*path) + return 0; + + for (p = path; *p; p++) { + if (!isalnum((unsigned char)*p) && + *p != '_' && *p != '-' && *p != '.' && *p != '/') { + return 0; + } + } + + /* Reject directory traversal attempts */ + if (strstr(path, "..")) + return 0; + + return 1; +} + +/** Run ssh-keygen -y to extract public key from private key file. + * Uses fork/exec instead of popen for security. + * @param key_path Path to private key file + * @param output Buffer to store output + * @param output_size Size of output buffer + * @return Number of bytes read, or -1 on error + */ +static int +run_ssh_keygen_pubkey(const char *key_path, char *output, size_t output_size) +{ + pid_t pid; + int pipefd[2]; + int status; + ssize_t total = 0; + + if (!validate_safe_path(key_path)) + return -1; + + if (pipe(pipefd) < 0) + return -1; + + pid = fork(); + if (pid < 0) { + close(pipefd[0]); + close(pipefd[1]); + return -1; + } + + if (pid == 0) { + /* Child process */ + int devnull; + + close(pipefd[0]); /* Close read end */ + + /* Redirect stdout to pipe */ + if (dup2(pipefd[1], STDOUT_FILENO) < 0) + _exit(127); + close(pipefd[1]); + + /* Redirect stderr to /dev/null */ + devnull = open("/dev/null", O_WRONLY); + if (devnull >= 0) { + dup2(devnull, STDERR_FILENO); + close(devnull); + } + + /* Redirect stdin from /dev/null */ + devnull = open("/dev/null", O_RDONLY); + if (devnull >= 0) { + dup2(devnull, STDIN_FILENO); + close(devnull); + } + + execlp("ssh-keygen", "ssh-keygen", "-y", "-f", key_path, (char *)NULL); + _exit(127); + } + + /* Parent process */ + close(pipefd[1]); /* Close write end */ + + /* Read output */ + while (total < (ssize_t)(output_size - 1)) { + ssize_t n = read(pipefd[0], output + total, output_size - 1 - total); + if (n <= 0) + break; + total += n; + } + output[total] = '\0'; + + close(pipefd[0]); + + /* Wait for child */ + waitpid(pid, &status, 0); + + if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) + return -1; + + return total; +} + +/** Extract public key from X509 certificate and convert to SSH format. + * Uses OpenSSL library APIs to extract the public key, then fork/exec + * ssh-keygen to convert to SSH format. + * @param pem_path Path to PEM certificate file + * @param output Buffer to store SSH public key + * @param output_size Size of output buffer + * @return Number of bytes read, or -1 on error + */ +static int +extract_pubkey_from_pem(const char *pem_path, char *output, size_t output_size) +{ + FILE *pem_fp = NULL; + X509 *cert = NULL; + EVP_PKEY *pkey = NULL; + BIO *bio = NULL; + char *pubkey_pem = NULL; + long pubkey_len; + char tmpfile[256]; + int tmpfd = -1; + pid_t pid; + int pipefd[2]; + int status; + ssize_t total = 0; + int result = -1; + + if (!validate_safe_path(pem_path)) + return -1; + + /* Open and read the certificate */ + pem_fp = fopen(pem_path, "r"); + if (!pem_fp) + goto cleanup; + + /* Read X509 certificate */ + cert = PEM_read_X509(pem_fp, NULL, NULL, NULL); + if (!cert) { + /* Try reading from start again in case file has private key first */ + rewind(pem_fp); + /* Skip past any private key */ + while (fgets(output, output_size, pem_fp)) { + if (strstr(output, "-----BEGIN CERTIFICATE-----") || + strstr(output, "-----BEGIN X509 CERTIFICATE-----")) { + /* Found certificate start, seek back */ + fseek(pem_fp, -(long)strlen(output), SEEK_CUR); + break; + } + } + cert = PEM_read_X509(pem_fp, NULL, NULL, NULL); + } + fclose(pem_fp); + pem_fp = NULL; + + if (!cert) + goto cleanup; + + /* Extract public key from certificate */ + pkey = X509_get_pubkey(cert); + if (!pkey) + goto cleanup; + + /* Write public key to memory BIO in PEM format */ + bio = BIO_new(BIO_s_mem()); + if (!bio) + goto cleanup; + + if (!PEM_write_bio_PUBKEY(bio, pkey)) + goto cleanup; + + pubkey_len = BIO_get_mem_data(bio, &pubkey_pem); + if (pubkey_len <= 0) + goto cleanup; + + /* Write public key to temp file for ssh-keygen */ + ircd_strncpy(tmpfile, "/tmp/gitsync_pubkey.XXXXXX", sizeof(tmpfile) - 1); + tmpfd = mkstemp(tmpfile); + if (tmpfd < 0) + goto cleanup; + + if (write(tmpfd, pubkey_pem, pubkey_len) != pubkey_len) { + close(tmpfd); + unlink(tmpfile); + goto cleanup; + } + close(tmpfd); + tmpfd = -1; + + /* Run ssh-keygen to convert to SSH format */ + if (pipe(pipefd) < 0) { + unlink(tmpfile); + goto cleanup; + } + + pid = fork(); + if (pid < 0) { + close(pipefd[0]); + close(pipefd[1]); + unlink(tmpfile); + goto cleanup; + } + + if (pid == 0) { + /* Child process */ + int devnull; + + close(pipefd[0]); + + if (dup2(pipefd[1], STDOUT_FILENO) < 0) + _exit(127); + close(pipefd[1]); + + devnull = open("/dev/null", O_WRONLY); + if (devnull >= 0) { + dup2(devnull, STDERR_FILENO); + close(devnull); + } + + devnull = open("/dev/null", O_RDONLY); + if (devnull >= 0) { + dup2(devnull, STDIN_FILENO); + close(devnull); + } + + execlp("ssh-keygen", "ssh-keygen", "-i", "-m", "PKCS8", "-f", tmpfile, (char *)NULL); + _exit(127); + } + + /* Parent process */ + close(pipefd[1]); + + while (total < (ssize_t)(output_size - 1)) { + ssize_t n = read(pipefd[0], output + total, output_size - 1 - total); + if (n <= 0) + break; + total += n; + } + output[total] = '\0'; + + close(pipefd[0]); + waitpid(pid, &status, 0); + + unlink(tmpfile); + + if (WIFEXITED(status) && WEXITSTATUS(status) == 0 && total > 0) + result = total; + +cleanup: + if (pem_fp) + fclose(pem_fp); + if (cert) + X509_free(cert); + if (pkey) + EVP_PKEY_free(pkey); + if (bio) + BIO_free(bio); + + return result; +} + +/** Handle GITSYNC command from an operator. + * parv[0] = sender prefix + * parv[1] = action (force|status|pubkey|hostkey) or target server + * parv[2] = action if parv[1] is target, or "pem"/"reset" for pubkey/hostkey + * parv[3] = "pem"/"reset" if parv[2] is pubkey/hostkey + * + * All subcommands are remotable (can target specific servers or broadcast). + * + * Usage: + * /GITSYNC force - Trigger immediate sync + * /GITSYNC status - Show sync status + * /GITSYNC pubkey - Show SSH public key (from GITSYNC_SSH_KEY) + * /GITSYNC pubkey pem - Extract SSH public key from SSL certificate + * /GITSYNC hostkey - Show SSH host key fingerprint (TOFU) + * /GITSYNC hostkey reset - Clear stored fingerprint for re-verification + * /GITSYNC server - Run command on specific server + * /GITSYNC * - Run command on all servers + * + * Examples: + * /GITSYNC * force - Sync all servers + * /GITSYNC * pubkey - Show public keys from all servers + * /GITSYNC server.name hostkey reset - Reset fingerprint on specific server + */ +int mo_gitsync(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) +{ +#ifdef USE_LIBGIT2 + const char *action; + const char *target = NULL; + struct Client *acptr; + int is_force = 0; + int is_status = 0; + int is_pubkey = 0; + int is_hostkey = 0; + + /* Check privilege */ + if (!HasPriv(sptr, PRIV_GITSYNC)) + return send_reply(sptr, ERR_NOPRIVILEGES); + + /* Parse arguments */ + if (parc < 2) { + /* No args - show usage */ + send_reply(sptr, SND_EXPLICIT | RPL_STATSCONN, + ":Usage: /GITSYNC [server] "); + return 0; + } + + /* Check if first arg is action or target */ + if (ircd_strcmp(parv[1], "force") == 0) { + is_force = 1; + } else if (ircd_strcmp(parv[1], "status") == 0) { + is_status = 1; + } else if (ircd_strcmp(parv[1], "pubkey") == 0) { + is_pubkey = 1; + } else if (ircd_strcmp(parv[1], "hostkey") == 0) { + is_hostkey = 1; + } else { + /* First arg is target server */ + target = parv[1]; + if (parc > 2) { + if (ircd_strcmp(parv[2], "force") == 0) + is_force = 1; + else if (ircd_strcmp(parv[2], "status") == 0) + is_status = 1; + else if (ircd_strcmp(parv[2], "pubkey") == 0) + is_pubkey = 1; + else if (ircd_strcmp(parv[2], "hostkey") == 0) + is_hostkey = 1; + } + if (!is_force && !is_status && !is_pubkey && !is_hostkey) { + send_reply(sptr, SND_EXPLICIT | RPL_STATSCONN, + ":Usage: /GITSYNC [server] "); + return 0; + } + } + + action = is_force ? "force" : (is_status ? "status" : (is_pubkey ? "pubkey" : "hostkey")); + + /* Handle remote target */ + if (target) { + const char *subarg = NULL; + + /* Determine sub-argument for pubkey/hostkey */ + if (is_pubkey && parc > 3 && ircd_strcmp(parv[3], "pem") == 0) { + subarg = "pem"; + } else if (is_hostkey && parc > 3 && ircd_strcmp(parv[3], "reset") == 0) { + subarg = "reset"; + } + + if (strcmp(target, "*") == 0) { + /* Broadcast to all servers */ + if (subarg) + sendcmdto_serv_butone(sptr, CMD_GITSYNC, cptr, "* %s %s", action, subarg); + else + sendcmdto_serv_butone(sptr, CMD_GITSYNC, cptr, "* %s", action); + /* Also do local */ + } else { + /* Find target server */ + acptr = find_match_server(target); + if (!acptr) { + return send_reply(sptr, ERR_NOSUCHSERVER, target); + } + if (!IsMe(acptr)) { + /* Forward to remote server */ + if (subarg) + sendcmdto_one(sptr, CMD_GITSYNC, acptr, "%C %s %s", acptr, action, subarg); + else + sendcmdto_one(sptr, CMD_GITSYNC, acptr, "%C %s", acptr, action); + return 0; + } + /* Target is us, fall through to local handling */ + } + } + + /* Handle local action */ + if (is_force) { + enum GitsyncStatus status; + + if (!feature_bool(FEAT_GITSYNC_ENABLE)) { + sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :GitSync is disabled", sptr); + return 0; + } + + sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :Triggering GitSync...", sptr); + /* gitsync_trigger sends its own success/failure messages */ + gitsync_trigger(sptr, 1); + } else if (is_status) { + const struct GitsyncStats *stats = gitsync_get_stats(); + char timebuf[64]; + + if (feature_bool(FEAT_GITSYNC_ENABLE)) { + const char *fingerprint; + char fphost[256]; + + sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :GitSync Status: Enabled", sptr); + sendcmdto_one(&me, CMD_NOTICE, sptr, "%C : Repository: %s", + sptr, feature_str(FEAT_GITSYNC_REPOSITORY)); + sendcmdto_one(&me, CMD_NOTICE, sptr, "%C : Branch: %s", + sptr, feature_str(FEAT_GITSYNC_BRANCH)); + sendcmdto_one(&me, CMD_NOTICE, sptr, "%C : Interval: %d seconds", + sptr, feature_int(FEAT_GITSYNC_INTERVAL)); + + /* Show host key fingerprint status */ + fingerprint = gitsync_get_host_fingerprint(fphost, sizeof(fphost)); + if (fingerprint) { + sendcmdto_one(&me, CMD_NOTICE, sptr, "%C : Host key: %s (%s)", + sptr, fingerprint, fphost); + } else { + sendcmdto_one(&me, CMD_NOTICE, sptr, "%C : Host key: (not established)", + sptr); + } + } else { + sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :GitSync Status: Disabled", sptr); + } + + sendcmdto_one(&me, CMD_NOTICE, sptr, "%C : Successful syncs: %lu", + sptr, stats->syncs); + sendcmdto_one(&me, CMD_NOTICE, sptr, "%C : Failed syncs: %lu", + sptr, stats->failures); + + if (stats->last_sync > 0) { + struct tm *tm = localtime(&stats->last_sync); + strftime(timebuf, sizeof(timebuf), "%Y-%m-%d %H:%M:%S", tm); + sendcmdto_one(&me, CMD_NOTICE, sptr, "%C : Last sync: %s", sptr, timebuf); + } else { + sendcmdto_one(&me, CMD_NOTICE, sptr, "%C : Last sync: Never", sptr); + } + + if (stats->last_commit[0]) { + sendcmdto_one(&me, CMD_NOTICE, sptr, "%C : Last commit: %.8s", + sptr, stats->last_commit); + } + + sendcmdto_one(&me, CMD_NOTICE, sptr, "%C : Last status: %s", + sptr, gitsync_status_str(stats->last_status)); + + if (stats->last_error[0]) { + sendcmdto_one(&me, CMD_NOTICE, sptr, "%C : Last error: %s", + sptr, stats->last_error); + } + } else if (is_pubkey) { + /* Show the public key for GitLab/GitHub setup + * Usage: + * /GITSYNC pubkey - Use configured SSH key (GITSYNC_SSH_KEY) + * /GITSYNC pubkey pem - Extract from PEM certificate (SSL_CERTFILE) + */ + const char *ssh_key_path; + const char *pem_path; + char pubkey_path[512]; + FILE *fp; + char output[2048]; + int from_pem = 0; + int result; + + /* Check if user requested PEM mode */ + if (parc > 2 && ircd_strcmp(parv[2], "pem") == 0) { + from_pem = 1; + } else if (target && parc > 2 && ircd_strcmp(parv[2], "pubkey") == 0 && + parc > 3 && ircd_strcmp(parv[3], "pem") == 0) { + from_pem = 1; + } + + if (from_pem) { + /* PEM mode: Extract SSH key from SSL certificate using OpenSSL APIs */ + pem_path = feature_str(FEAT_SSL_CERTFILE); + if (!pem_path || !*pem_path) { + sendcmdto_one(&me, CMD_NOTICE, sptr, + "%C :No SSL certificate configured (SSL_CERTFILE not set)", sptr); + return 0; + } + + result = extract_pubkey_from_pem(pem_path, output, sizeof(output)); + if (result < 0) { + sendcmdto_one(&me, CMD_NOTICE, sptr, + "%C :Cannot extract public key from PEM %s", sptr, pem_path); + return 0; + } + + sendcmdto_one(&me, CMD_NOTICE, sptr, + "%C :Public key extracted from PEM (add to GitLab/GitHub):", sptr); + + /* Output the key, splitting long lines for IRC */ + { + char *p = output; + size_t len = strlen(output); + /* Remove trailing newline */ + if (len > 0 && output[len-1] == '\n') { + output[len-1] = '\0'; + len--; + } + while (len > 0) { + size_t chunk = (len > 400) ? 400 : len; + char save = p[chunk]; + p[chunk] = '\0'; + sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :%s", sptr, p); + p[chunk] = save; + p += chunk; + len -= chunk; + } + } + } else { + /* Standard SSH key mode */ + ssh_key_path = feature_str(FEAT_GITSYNC_SSH_KEY); + if (!ssh_key_path || !*ssh_key_path) { + sendcmdto_one(&me, CMD_NOTICE, sptr, + "%C :No SSH key configured (GITSYNC_SSH_KEY not set)", sptr); + sendcmdto_one(&me, CMD_NOTICE, sptr, + "%C :Tip: Use '/GITSYNC pubkey pem' to extract from SSL certificate", sptr); + return 0; + } + + /* Ensure SSH key exists (gitsync_generate_ssh_key handles both + * generation and detection of existing key atomically to prevent TOCTOU) */ + if (!gitsync_generate_ssh_key(ssh_key_path)) { + sendcmdto_one(&me, CMD_NOTICE, sptr, + "%C :Failed to generate or validate SSH key", sptr); + return 0; + } + + /* Try to read existing .pub file first */ + ircd_snprintf(0, pubkey_path, sizeof(pubkey_path), "%s.pub", ssh_key_path); + fp = fopen(pubkey_path, "r"); + if (fp) { + char line[1024]; + sendcmdto_one(&me, CMD_NOTICE, sptr, + "%C :Public key for GitSync (add to GitLab/GitHub):", sptr); + while (fgets(line, sizeof(line), fp)) { + size_t len = strlen(line); + char *p; + if (len > 0 && line[len-1] == '\n') + line[len-1] = '\0'; + len = strlen(line); + p = line; + while (len > 0) { + size_t chunk = (len > 400) ? 400 : len; + char save = p[chunk]; + p[chunk] = '\0'; + sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :%s", sptr, p); + p[chunk] = save; + p += chunk; + len -= chunk; + } + } + fclose(fp); + } else { + /* Generate public key from private key using ssh-keygen (secure fork/exec) */ + result = run_ssh_keygen_pubkey(ssh_key_path, output, sizeof(output)); + if (result < 0) { + sendcmdto_one(&me, CMD_NOTICE, sptr, + "%C :Cannot read or generate public key from %s", sptr, ssh_key_path); + sendcmdto_one(&me, CMD_NOTICE, sptr, + "%C :Tip: Use '/GITSYNC pubkey pem' to extract from SSL certificate", sptr); + return 0; + } + + sendcmdto_one(&me, CMD_NOTICE, sptr, + "%C :Public key for GitSync (add to GitLab/GitHub):", sptr); + + /* Output the key, splitting long lines for IRC */ + { + char *p = output; + size_t len = strlen(output); + if (len > 0 && output[len-1] == '\n') { + output[len-1] = '\0'; + len--; + } + while (len > 0) { + size_t chunk = (len > 400) ? 400 : len; + char save = p[chunk]; + p[chunk] = '\0'; + sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :%s", sptr, p); + p[chunk] = save; + p += chunk; + len -= chunk; + } + } + } + } + } else if (is_hostkey) { + /* Show or reset SSH host key fingerprint */ + const char *fingerprint; + char host[256]; + int do_reset = 0; + + /* Check for reset subcommand */ + if (parc > 2 && ircd_strcmp(parv[2], "reset") == 0) { + do_reset = 1; + } + + if (do_reset) { + /* Clear the TOFU fingerprint */ + gitsync_clear_host_fingerprint(); + sendcmdto_one(&me, CMD_NOTICE, sptr, + "%C :GitSync host fingerprint cleared - next sync will TOFU", sptr); + } else { + /* Show current fingerprint */ + fingerprint = gitsync_get_host_fingerprint(host, sizeof(host)); + if (fingerprint) { + sendcmdto_one(&me, CMD_NOTICE, sptr, + "%C :GitSync SSH Host Key:", sptr); + sendcmdto_one(&me, CMD_NOTICE, sptr, + "%C : Host: %s", sptr, host); + sendcmdto_one(&me, CMD_NOTICE, sptr, + "%C : Fingerprint: %s", sptr, fingerprint); + sendcmdto_one(&me, CMD_NOTICE, sptr, + "%C :Use '/GITSYNC hostkey reset' to clear and re-establish", sptr); + } else { + sendcmdto_one(&me, CMD_NOTICE, sptr, + "%C :GitSync: No host fingerprint established yet", sptr); + sendcmdto_one(&me, CMD_NOTICE, sptr, + "%C : First sync will use TOFU (Trust On First Use)", sptr); + } + } + } + + return 0; +#else + return send_reply(sptr, ERR_DISABLED, "GITSYNC"); +#endif +} + +/** Handle GITSYNC command from a server. + * parv[0] = sender prefix (oper numnick) + * parv[1] = target server or "*" + * parv[2] = action (force|status|pubkey|hostkey) + * parv[3] = optional sub-argument (pem|reset) + */ +int ms_gitsync(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) +{ +#ifdef USE_LIBGIT2 + const char *target; + const char *action; + const char *subarg = NULL; + struct Client *acptr; + + if (parc < 3) + return 0; + + target = parv[1]; + action = parv[2]; + if (parc > 3) + subarg = parv[3]; + + /* Check if this is for us */ + if (strcmp(target, "*") == 0) { + /* Broadcast - forward to other servers and handle locally */ + if (subarg) + sendcmdto_serv_butone(sptr, CMD_GITSYNC, cptr, "* %s %s", action, subarg); + else + sendcmdto_serv_butone(sptr, CMD_GITSYNC, cptr, "* %s", action); + } else { + acptr = FindNServer(target); + if (!acptr) + acptr = find_match_server(target); + + if (!acptr || !IsMe(acptr)) { + /* Not for us, forward */ + if (acptr) { + if (subarg) + sendcmdto_one(sptr, CMD_GITSYNC, acptr, "%C %s %s", acptr, action, subarg); + else + sendcmdto_one(sptr, CMD_GITSYNC, acptr, "%C %s", acptr, action); + } + return 0; + } + /* Fall through to handle locally */ + } + + /* Handle local action */ + if (ircd_strcmp(action, "force") == 0) { + if (!feature_bool(FEAT_GITSYNC_ENABLE)) { + if (IsOper(sptr)) + sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :GitSync is disabled on %s", + sptr, cli_name(&me)); + return 0; + } + + gitsync_trigger(sptr, 1); + + if (IsOper(sptr)) { + const struct GitsyncStats *stats = gitsync_get_stats(); + sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :GitSync on %s: %s (commit %.8s)", + sptr, cli_name(&me), gitsync_status_str(stats->last_status), + stats->last_commit); + } + } else if (ircd_strcmp(action, "status") == 0) { + if (IsOper(sptr)) { + const struct GitsyncStats *stats = gitsync_get_stats(); + char timebuf[64]; + + if (feature_bool(FEAT_GITSYNC_ENABLE)) { + sendcmdto_one(&me, CMD_NOTICE, sptr, + "%C :%s GitSync: Enabled, %lu syncs, %lu failures", + sptr, cli_name(&me), stats->syncs, stats->failures); + } else { + sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :%s GitSync: Disabled", + sptr, cli_name(&me)); + } + + if (stats->last_sync > 0) { + struct tm *tm = localtime(&stats->last_sync); + strftime(timebuf, sizeof(timebuf), "%Y-%m-%d %H:%M:%S", tm); + sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :%s Last sync: %s (%s, %.8s)", + sptr, cli_name(&me), timebuf, + gitsync_status_str(stats->last_status), + stats->last_commit); + } + } + } else if (ircd_strcmp(action, "hostkey") == 0) { + if (IsOper(sptr)) { + if (subarg && ircd_strcmp(subarg, "reset") == 0) { + /* Reset the TOFU fingerprint */ + gitsync_clear_host_fingerprint(); + sendcmdto_one(&me, CMD_NOTICE, sptr, + "%C :%s GitSync: Host fingerprint cleared", + sptr, cli_name(&me)); + } else { + /* Show current fingerprint */ + const char *fingerprint; + char host[256]; + + fingerprint = gitsync_get_host_fingerprint(host, sizeof(host)); + if (fingerprint) { + sendcmdto_one(&me, CMD_NOTICE, sptr, + "%C :%s GitSync Host Key: %s (%s)", + sptr, cli_name(&me), fingerprint, host); + } else { + sendcmdto_one(&me, CMD_NOTICE, sptr, + "%C :%s GitSync: No host fingerprint established", + sptr, cli_name(&me)); + } + } + } + } else if (ircd_strcmp(action, "pubkey") == 0) { + if (IsOper(sptr)) { + const char *ssh_key_path; + const char *pem_path; + char pubkey_path[512]; + FILE *fp; + char output[2048]; + int from_pem = (subarg && ircd_strcmp(subarg, "pem") == 0); + int result; + + if (from_pem) { + /* PEM mode: Extract SSH key from SSL certificate using OpenSSL APIs */ + pem_path = feature_str(FEAT_SSL_CERTFILE); + if (!pem_path || !*pem_path) { + sendcmdto_one(&me, CMD_NOTICE, sptr, + "%C :%s GitSync: No SSL certificate configured", + sptr, cli_name(&me)); + return 0; + } + + result = extract_pubkey_from_pem(pem_path, output, sizeof(output)); + if (result < 0) { + sendcmdto_one(&me, CMD_NOTICE, sptr, + "%C :%s GitSync: Cannot extract public key from PEM", + sptr, cli_name(&me)); + return 0; + } + + sendcmdto_one(&me, CMD_NOTICE, sptr, + "%C :%s GitSync Public Key (from PEM):", + sptr, cli_name(&me)); + + /* Output the key, splitting long lines for IRC */ + { + char *p = output; + size_t len = strlen(output); + if (len > 0 && output[len-1] == '\n') { + output[len-1] = '\0'; + len--; + } + while (len > 0) { + size_t chunk = (len > 350) ? 350 : len; + char save = p[chunk]; + p[chunk] = '\0'; + sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :%s %s", + sptr, cli_name(&me), p); + p[chunk] = save; + p += chunk; + len -= chunk; + } + } + } else { + /* Standard SSH key mode */ + ssh_key_path = feature_str(FEAT_GITSYNC_SSH_KEY); + if (!ssh_key_path || !*ssh_key_path) { + sendcmdto_one(&me, CMD_NOTICE, sptr, + "%C :%s GitSync: No SSH key configured", + sptr, cli_name(&me)); + return 0; + } + + ircd_snprintf(0, pubkey_path, sizeof(pubkey_path), "%s.pub", ssh_key_path); + fp = fopen(pubkey_path, "r"); + if (fp) { + char line[1024]; + sendcmdto_one(&me, CMD_NOTICE, sptr, + "%C :%s GitSync Public Key:", + sptr, cli_name(&me)); + while (fgets(line, sizeof(line), fp)) { + size_t len = strlen(line); + char *p; + if (len > 0 && line[len-1] == '\n') + line[len-1] = '\0'; + len = strlen(line); + p = line; + while (len > 0) { + size_t chunk = (len > 350) ? 350 : len; + char save = p[chunk]; + p[chunk] = '\0'; + sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :%s %s", + sptr, cli_name(&me), p); + p[chunk] = save; + p += chunk; + len -= chunk; + } + } + fclose(fp); + } else { + /* Generate public key from private key using ssh-keygen (secure fork/exec) */ + result = run_ssh_keygen_pubkey(ssh_key_path, output, sizeof(output)); + if (result < 0) { + sendcmdto_one(&me, CMD_NOTICE, sptr, + "%C :%s GitSync: Cannot read public key", + sptr, cli_name(&me)); + return 0; + } + + sendcmdto_one(&me, CMD_NOTICE, sptr, + "%C :%s GitSync Public Key:", + sptr, cli_name(&me)); + + /* Output the key, splitting long lines for IRC */ + { + char *p = output; + size_t len = strlen(output); + if (len > 0 && output[len-1] == '\n') { + output[len-1] = '\0'; + len--; + } + while (len > 0) { + size_t chunk = (len > 350) ? 350 : len; + char save = p[chunk]; + p[chunk] = '\0'; + sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :%s %s", + sptr, cli_name(&me), p); + p[chunk] = save; + p += chunk; + len -= chunk; + } + } + } + } + } + } + + return 0; +#else + return 0; +#endif +} diff --git a/ircd/m_list.c b/ircd/m_list.c index 09066007..cacc905f 100644 --- a/ircd/m_list.c +++ b/ircd/m_list.c @@ -320,7 +320,7 @@ param_parse(struct Client *sptr, const char *param, struct ListingArgs *args, if (tmp1) *tmp1++ = 0; - ircd_strncpy(args->wildcard, param, sizeof(args->wildcard)); + ircd_strncpy(args->wildcard, param, CHANNELLEN + 1); if (tmp1 == NULL) return LPARAM_SUCCESS; diff --git a/ircd/parse.c b/ircd/parse.c index 8a5c8e4f..b5840245 100644 --- a/ircd/parse.c +++ b/ircd/parse.c @@ -620,6 +620,16 @@ struct Message msgtab[] = { { m_unregistered, m_not_oper, ms_rehash, mo_rehash, m_ignore }, "- Reloads the server's configuration" }, +#ifdef USE_LIBGIT2 + { + MSG_GITSYNC, + TOK_GITSYNC, + 0, MAXPARA, MFLG_SLOW, 0, NULL, + /* UNREG, CLIENT, SERVER, OPER, SERVICE */ + { m_unregistered, m_not_oper, ms_gitsync, mo_gitsync, m_ignore }, + "- Triggers or shows status of gitsync" + }, +#endif { MSG_RESTART, TOK_RESTART, diff --git a/ircd/s_auth.c b/ircd/s_auth.c index cb37cf9e..2b6afe04 100644 --- a/ircd/s_auth.c +++ b/ircd/s_auth.c @@ -37,6 +37,7 @@ #include "s_auth.h" #include "class.h" +#include "dnsbl.h" #include "client.h" #include "hash.h" #include "IPcheck.h" @@ -91,6 +92,7 @@ enum AuthRequestFlag { AR_IAUTH_SOFT_DONE, /**< iauth has no objection to client */ AR_PASSWORD_CHECKED, /**< client password already checked */ AR_LOC_DONE, /**< loc messages have been sent */ + AR_DNSBL_PENDING, /**< native DNSBL check pending */ AR_NUM_FLAGS }; @@ -109,6 +111,7 @@ struct AuthRequest { struct AuthRequestFlags flags; /**< current state of request */ unsigned int cookie; /**< cookie the user must PONG */ unsigned short port; /**< client's remote port number */ + struct DNSBLRequest *dnsbl_request; /**< native DNSBL check request */ }; /** Array of message text (with length) pairs for AUTH status @@ -566,6 +569,61 @@ static int check_auth_finished(struct AuthRequest *auth) FlagSet(&auth->flags, AR_PASSWORD_CHECKED); } + /* Check if native DNSBL lookup is done. */ + if (FlagHas(&auth->flags, AR_DNSBL_PENDING)) + { + Debug((DEBUG_INFO, "Auth %p [%d] still has flag AR_DNSBL_PENDING", auth, + cli_fd(auth->client))); + return 0; + } + + /* Check DNSBL result and reject if blocked. */ + if (IsUserPort(auth->client) && auth->dnsbl_request) + { + enum DNSBLAction action; + const char *mark; + int blocked = dnsbl_result(auth->client, auth->dnsbl_request, &action, &mark); + + if (action == DNSBL_ACT_WHITELIST) + { + /* Native DNSBL whitelist hit - exempt client from all connection blocks */ + SetDNSBLExempt(auth->client); + Debug((DEBUG_DNS, "DNSBL: Client %s whitelisted, setting exempt flag", + cli_name(auth->client))); + } + else if (blocked && action == DNSBL_ACT_BLOCK_ALL) + { + ServerStats->is_ref++; + sendto_opmask_butone(0, SNO_GLINE, "DNSBL blocked connection from %s (%s@%s) [%s]", + cli_name(auth->client), + IsIdented(auth->client) ? cli_username(auth->client) : "unknown", + cli_sockhost(auth->client), + ircd_ntoa(&cli_ip(auth->client))); + send_reply(auth->client, SND_EXPLICIT | ERR_YOUREBANNEDCREEP, + ":%s", feature_str(FEAT_DNSBL_BLOCKMSG)); + return exit_client(auth->client, auth->client, &me, "DNSBL blocked"); + } + else if (blocked && action == DNSBL_ACT_BLOCK_ANON && EmptyString(cli_user(auth->client)->account)) + { + /* Block anonymous - will be checked again after auth */ + ServerStats->is_ref++; + sendto_opmask_butone(0, SNO_GLINE, "DNSBL blocked anonymous connection from %s (%s@%s) [%s]", + cli_name(auth->client), + IsIdented(auth->client) ? cli_username(auth->client) : "unknown", + cli_sockhost(auth->client), + ircd_ntoa(&cli_ip(auth->client))); + send_reply(auth->client, SND_EXPLICIT | ERR_YOUREBANNEDCREEP, + ":%s (Log in to connect)", feature_str(FEAT_DNSBL_BLOCKMSG)); + return exit_client(auth->client, auth->client, &me, "DNSBL blocked (anonymous)"); + } + else if (action == DNSBL_ACT_MARK && mark) + { + /* Apply the mark to the client */ + add_mark(auth->client, mark); + SetMarked(auth->client); + } + } + /* Check if iauth is done. */ if (FlagHas(&auth->flags, AR_IAUTH_PENDING)) { @@ -911,6 +969,11 @@ void destroy_auth_request(struct AuthRequest* auth) delete_resolver_queries(auth); } + if (FlagHas(&auth->flags, AR_DNSBL_PENDING) || auth->dnsbl_request) { + dnsbl_cancel(auth->dnsbl_request); + auth->dnsbl_request = NULL; + } + if (-1 < s_fd(&auth->socket)) { close(s_fd(&auth->socket)); socket_del(&auth->socket); @@ -928,6 +991,19 @@ void destroy_auth_request(struct AuthRequest* auth) auth_freelist = auth; } +/** Called when DNSBL lookup completes for a client. + * @param[in] auth The auth request whose DNSBL lookup is complete. + */ +void auth_dnsbl_complete(struct AuthRequest *auth) +{ + if (!auth || !auth->client) + return; + + Debug((DEBUG_DNS, "DNSBL: Lookup complete for client %p", auth->client)); + FlagClr(&auth->flags, AR_DNSBL_PENDING); + check_auth_finished(auth); +} + /** Handle a 'ping' (authorization) timeout for a client. * @param[in] cptr The client whose session authorization has timed out. * @return Zero if client is kept, CPTR_KILLED if client rejected. @@ -1221,6 +1297,12 @@ void start_auth(struct Client* client) /* Try to start ident lookup. */ start_auth_query(auth); + /* Try to start native DNSBL lookup. */ + if (IsUserPort(client) && dnsbl_check(client, &auth->dnsbl_request)) { + Debug((DEBUG_DNS, "DNSBL: Started check for client %p", client)); + FlagSet(&auth->flags, AR_DNSBL_PENDING); + } + /* Add client to GlobalClientList. */ add_client_to_list(client); @@ -2356,6 +2438,19 @@ static int iauth_cmd_done_account(struct IAuth *iauth, struct Client *cli, static int iauth_cmd_kill(struct IAuth *iauth, struct Client *cli, int parc, char **params) { + /* Check if client is exempt due to native DNSBL whitelist */ + if (IsDNSBLExempt(cli)) + { + Debug((DEBUG_INFO, "IAuth kill for %s blocked by DNSBL whitelist exemption", + cli_name(cli))); + sendto_opmask_butone(0, SNO_AUTH, + "IAuth kill for %s blocked (DNSBL whitelisted)", + cli_name(cli)); + if (cli_auth(cli)) + FlagClr(&cli_auth(cli)->flags, AR_IAUTH_PENDING); + return 0; + } + if (cli_auth(cli)) FlagClr(&cli_auth(cli)->flags, AR_IAUTH_PENDING); if (EmptyString(params[0])) diff --git a/ircd/s_conf.c b/ircd/s_conf.c index 13e88527..3bf9b261 100644 --- a/ircd/s_conf.c +++ b/ircd/s_conf.c @@ -24,6 +24,7 @@ #include "config.h" #include "s_conf.h" +#include "dnsbl.h" #include "IPcheck.h" #include "class.h" #include "client.h" @@ -1189,6 +1190,15 @@ yyerror(const char *msg) conf_error = 1; } +/** Get the configuration error flag. + * @return Non-zero if a parse error occurred during last config read. + */ +int +conf_get_error_flag(void) +{ + return conf_error; +} + /** Attach CONF_UWORLD items to a server and everything attached to it. */ static void attach_conf_uworld(struct Client *cptr) @@ -1285,6 +1295,7 @@ int rehash(struct Client *cptr, int sig) clearNickJupes(); clear_quarantines(); + dnsbl_clear_servers(); class_mark_delete(); mark_listeners_closing(); diff --git a/ircd/s_stats.c b/ircd/s_stats.c index 66861bc4..b07f30cb 100644 --- a/ircd/s_stats.c +++ b/ircd/s_stats.c @@ -56,6 +56,8 @@ #include "struct.h" #include "userload.h" #include "zline.h" +#include "dnsbl.h" +#include "gitsync.h" #include #include @@ -726,6 +728,14 @@ struct StatDesc statsinfo[] = { { ' ', "iauth", STAT_FLAG_OPERFEAT, FEAT_HIS_STATS_IAUTH, report_iauth_stats, 0, "IAuth statistics." }, + { ' ', "dnsbl", STAT_FLAG_OPERFEAT, FEAT_LAST_F, + dnsbl_report_stats, 0, + "DNSBL statistics and configuration." }, +#ifdef USE_LIBGIT2 + { ' ', "gitsync", STAT_FLAG_OPERFEAT, FEAT_LAST_F, + gitsync_report_stats, 0, + "GitSync statistics and configuration." }, +#endif { ' ', "iauthconf", STAT_FLAG_OPERFEAT, FEAT_HIS_STATS_IAUTH, report_iauth_conf, 0, "IAuth configuration." }, diff --git a/tools/docker/gitsync.conf b/tools/docker/gitsync.conf new file mode 100644 index 00000000..ddce1ebe --- /dev/null +++ b/tools/docker/gitsync.conf @@ -0,0 +1,2 @@ +# GitSync managed configuration +# This file is populated by the native gitsync process diff --git a/tools/docker/ircd.conf b/tools/docker/ircd.conf index e69de29b..8b747ae4 100644 --- a/tools/docker/ircd.conf +++ b/tools/docker/ircd.conf @@ -0,0 +1,5 @@ +include "base.conf"; + +include "local.conf"; + +include "gitsync/gitsync.conf";