logrotate-3.21.0/0000755000175000017500000000000014346133605010603 500000000000000logrotate-3.21.0/Makefile.am0000644000175000017500000000233713551062667012572 00000000000000# # 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, version 2 of the License. # # 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. # AM_CPPFLAGS = -include config.h sbin_PROGRAMS = logrotate logrotate_SOURCES = config.c log.c logrotate.c \ log.h logrotate.h queue.h dist_man_MANS = logrotate.8 logrotate.conf.5 dist_noinst_DATA = logrotate.spec EXTRA_DIST = ChangeLog.md README.md autogen.sh build-aux examples # the dot ensures that logrotate is built before it is tested SUBDIRS = . test # for compatibility with older releases of logrotate test: check .PHONY: srpm rpm rpm: srpm rpmbuild $(RPM_FLAGS) -ta $(distdir).tar.gz srpm: dist rpmbuild $(RPM_FLAGS) -ts $(distdir).tar.gz # taken from build-aux/git-version-gen EXTRA_DIST += $(top_srcdir)/.version BUILT_SOURCES = $(top_srcdir)/.version $(top_srcdir)/.version: echo $(VERSION) > $@-t && mv $@-t $@ dist-hook: echo $(VERSION) > $(distdir)/.tarball-version logrotate-3.21.0/configure0000755000175000017500000067504214346133573012454 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.71 for logrotate 3.21.0. # # # Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, # Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh as_nop=: 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 $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; 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 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 ${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 || PATH_SEPARATOR=';' } fi # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) 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 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' # 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 printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; 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'. 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="as_nop=: 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 \$as_nop case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 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 : else \$as_nop exitcode=1; echo positional parameters were not saved. 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" if (eval "$as_required") 2>/dev/null then : as_have_required=yes else $as_nop as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null then : else $as_nop 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 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 if { test -f "$as_shell" || test -f "$as_shell.exe"; } && 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_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null then : break 2 fi fi done;; esac as_found=false done IFS=$as_save_IFS if $as_found then : else $as_nop 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 fi 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 # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; 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'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi 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 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 fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_nop # --------- # Do nothing but, unlike ":", preserve the value of $?. as_fn_nop () { return $? } as_nop=as_fn_nop # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # 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 : eval 'as_fn_append () { eval $1+=\$2 }' else $as_nop as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # 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 : eval 'as_fn_arith () { as_val=$(( $* )) }' else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_nop # --------- # Do nothing but, unlike ":", preserve the value of $?. as_fn_nop () { return $? } as_nop=as_fn_nop # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. 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 printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO 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'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { 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 # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. 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*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) 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 else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi 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'. 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 as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi 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'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='logrotate' PACKAGE_TARNAME='logrotate' PACKAGE_VERSION='3.21.0' PACKAGE_STRING='logrotate 3.21.0' PACKAGE_BUGREPORT='' PACKAGE_URL='https://github.com/logrotate/logrotate' # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_STDIO_H # include #endif #ifdef HAVE_STDLIB_H # include #endif #ifdef HAVE_STRING_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_header_c_list= ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS AM_CFLAGS ROOT_UID COMPRESS_EXT UNCOMPRESS_COMMAND COMPRESS_COMMAND DEFAULT_MAIL_COMMAND STATE_FILE_PATH host_os host_vendor host_cpu host build_os build_vendor build_cpu build LIBOBJS am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V CSCOPE ETAGS CTAGS am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir runstatedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL am__quote' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_dependency_tracking enable_largefile with_selinux with_acl with_state_file_path with_default_mail_command with_compress_command with_uncompress_command with_compress_extension enable_werror ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # 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'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) 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'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -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=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) 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'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) 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'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --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" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # 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'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. 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 runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac 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' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi 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_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # 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 logrotate 3.21.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --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 --cache-file=FILE cache test results in FILE [disabled] -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 \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --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'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --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] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/logrotate] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of logrotate 3.21.0:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --disable-largefile omit support for large files --enable-werror Treat warnings as errors (default: warnings are not errors) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-selinux support handling SELinux contexts (yes,no,check) [default=check] --with-acl support handling ACL (yes,no,check) [default=check] --with-state-file-path=PATH path to state file (/var/lib/logrotate.status by default) --with-default-mail-command=COMMAND default mail command (e.g. /bin/mail) --with-compress-command=COMMAND compress command (default: /bin/gzip) --with-uncompress-command=COMMAND uncompress command (default: /bin/gunzip) --with-compress-extension=EXTENSION compress extension (default: .gz) Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory 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 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. logrotate home page: . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. 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/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # 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 elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF logrotate configure 3.21.0 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack 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\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 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 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 : ac_retval=0 else $as_nop printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # 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 { 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 $as_nop 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 $as_nop eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext 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 } # ac_fn_c_check_header_compile # ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES # ---------------------------------------------------- # Tries to find if the field MEMBER exists in type AGGR, after including # INCLUDES, setting cache variable VAR accordingly. ac_fn_c_check_member () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 printf %s "checking for $2.$3... " >&6; } if eval test \${$4+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int main (void) { static $2 ac_aggr; if (ac_aggr.$3) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$4=yes" else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int main (void) { static $2 ac_aggr; if (sizeof ac_aggr.$3) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$4=yes" else $as_nop eval "$4=no" fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi eval ac_res=\$$4 { 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_member # ac_fn_c_find_uintX_t LINENO BITS VAR # ------------------------------------ # Finds an unsigned integer type with width BITS, setting cache variable VAR # accordingly. ac_fn_c_find_uintX_t () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5 printf %s "checking for uint$2_t... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else $as_nop eval "$3=no" # Order is important - never check a type that is potentially smaller # than half of the expected target width. for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \ 'unsigned long long int' 'unsigned short int' 'unsigned char'; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main (void) { static int test_array [1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : case $ac_type in #( uint$2_t) : eval "$3=yes" ;; #( *) : eval "$3=\$ac_type" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext if eval test \"x\$"$3"\" = x"no" then : else $as_nop break fi done 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 } # ac_fn_c_find_uintX_t # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. 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.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\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 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 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 : ac_retval=0 else $as_nop printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { 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 $as_nop 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 (void); below. */ #include #undef $2 /* 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. */ #ifdef __cplusplus extern "C" #endif 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. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main (void) { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$3=yes" else $as_nop eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext 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 } # ac_fn_c_check_func ac_configure_args_raw= for ac_arg do case $ac_arg in *\'*) ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append ac_configure_args_raw " '$ac_arg'" done case $ac_configure_args_raw in *$as_nl*) ac_safe_unquote= ;; *) ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab. ac_unsafe_a="$ac_unsafe_z#~" ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; esac cat >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 logrotate $as_me 3.21.0, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME 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 printf "%s\n" "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # 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 printf "%s\n" "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_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) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo printf "%s\n" "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then printf "%s\n" "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then printf "%s\n" "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && 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 && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h printf "%s\n" "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h 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. if test -n "$CONFIG_SITE"; then ac_site_files="$CONFIG_SITE" elif test "x$prefix" != xNONE; then ac_site_files="$prefix/share/config.site $prefix/etc/config.site" else ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi for ac_site_file in $ac_site_files do 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" \ || { { 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; } fi done 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 { 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 { 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 as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" # 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; } /* 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 #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) { // 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 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; // 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 " 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 " wchar.h wchar_h HAVE_WCHAR_H" as_fn_append ac_header_c_list " minix/config.h minix_config_h HAVE_MINIX_CONFIG_H" # Auxiliary files required by this configure script. ac_aux_files="config.guess config.sub compile missing install-sh" # 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 $as_nop as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$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. 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=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { 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. ## ## -------------------- ## 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__api_version='1.16' # 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 # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # 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. { 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 test ${ac_cv_path_install+y} then : printf %s "(cached) " >&6 else $as_nop 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 # 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/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # 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 test $ac_prog = install && 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 # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir 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/" && 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" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi 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 # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { 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. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 printf %s "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`printf "%s\n" "$program_transform_name" | sed "$ac_script"` # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then MISSING="\${SHELL} '$am_aux_dir/missing'" fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 printf "%s\n" "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; 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_STRIP+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # 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_STRIP="${ac_tool_prefix}strip" 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 STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 printf "%s\n" "$STRIP" >&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_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; 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_STRIP+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # 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_STRIP="strip" 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 ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 printf "%s\n" "$ac_ct_STRIP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" 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 STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a race-free mkdir -p" >&5 printf %s "checking for a race-free mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if test ${ac_cv_path_mkdir+y} then : printf %s "(cached) " >&6 else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext" || continue case `"$as_dir$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir ('*'coreutils) '* | \ 'BusyBox '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test ${ac_cv_path_mkdir+y}; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 printf "%s\n" "$MKDIR_P" >&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 { 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 $as_nop 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 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_AWK="$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 fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 printf "%s\n" "$AWK" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$AWK" && break done { 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=`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 $as_nop cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } SET_MAKE= else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. if test ${enable_silent_rules+y} then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 printf %s "checking whether $am_make supports nested variables... " >&6; } if test ${am_cv_make_support_nested_variables+y} then : printf %s "(cached) " >&6 else $as_nop if printf "%s\n" 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 printf "%s\n" "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='logrotate' VERSION='3.21.0' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h printf "%s\n" "#define VERSION \"$VERSION\"" >>confdefs.h # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' # Variables for tags utilities; see am/tags.am if test -z "$CTAGS"; then CTAGS=ctags fi if test -z "$ETAGS"; then ETAGS=etags fi if test -z "$CSCOPE"; then CSCOPE=cscope fi # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi # --enable-silent-rules # Check whether --enable-silent-rules was given. if test ${enable_silent_rules+y} then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=0;; esac am_make=${MAKE-make} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 printf %s "checking whether $am_make supports nested variables... " >&6; } if test ${am_cv_make_support_nested_variables+y} then : printf %s "(cached) " >&6 else $as_nop if printf "%s\n" 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 printf "%s\n" "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 printf %s "checking whether ${MAKE-make} supports the include directive... " >&6; } cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out .PHONY: am__doit END am__include="#" am__quote= # BSD make does it like this. echo '.include "confinc.mk" # ignored' > confmf.BSD # Other make implementations (GNU, Solaris 10, AIX) do it like this. echo 'include confinc.mk # ignored' > confmf.GNU _am_result=no for s in GNU BSD; do { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } case $?:`cat confinc.out 2>/dev/null` in #( '0:this is the am__doit target') : case $s in #( BSD) : am__include='.include' am__quote='"' ;; #( *) : am__include='include' am__quote='' ;; esac ;; #( *) : ;; esac if test "$am__include" != "#"; then _am_result="yes ($s style)" break fi done rm -f confinc.* confmf.* { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 printf "%s\n" "${_am_result}" >&6; } # Check whether --enable-dependency-tracking was given. if test ${enable_dependency_tracking+y} then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= 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 -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 { 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 $as_nop 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}gcc" 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 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 "gcc", so it can be a program name with args. set dummy gcc; 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 $as_nop 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="gcc" 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 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 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 { 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 $as_nop 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}cc" 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 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 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 { 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 $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no 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 if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" 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 if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # 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+' '}$@" fi fi fi 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 $as_nop 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 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 $as_nop 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 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 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 # 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 $as_nop 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 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 $as_nop 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 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" && { { 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; } # Provide some information about the compiler. 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 -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\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files 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. { 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.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" 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\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? 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. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) 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' # 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. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else $as_nop ac_file='' fi 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 { { 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_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } fi { 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 { 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\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? 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 *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else $as_nop { { 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; } fi rm -f conftest conftest$ac_cv_exeext { 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 ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _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. { 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 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? 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 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? 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 { { 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 { 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 ac_clean_files=$ac_clean_files_save { 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 $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF rm -f conftest.o conftest.obj 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\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? 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 *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_nop printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&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 $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { 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 { 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 $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_compiler_gnu=yes else $as_nop ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { 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+y} ac_save_CFLAGS=$CFLAGS { 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 $as_nop ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes else $as_nop CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else $as_nop ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; 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.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag 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 $as_nop 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 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 $as_nop 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 $as_nop { 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" fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 ac_prog_cc_stdc=c11 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 $as_nop 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 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 $as_nop 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 $as_nop { 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" fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 ac_prog_cc_stdc=c99 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 $as_nop 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 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 $as_nop 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 $as_nop { 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" fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 ac_prog_cc_stdc=c89 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 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 printf %s "checking whether $CC understands -c and -o together... " >&6; } if test ${am_cv_prog_cc_c_o+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 printf "%s\n" "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" 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 depcc="$CC" am_compiler_list= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 printf %s "checking dependency style of $depcc... " >&6; } if test ${am_cv_CC_dependencies_compiler_type+y} then : printf %s "(cached) " >&6 else $as_nop if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 printf "%s\n" "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi ac_header= ac_cache= for ac_item in $ac_header_c_list do 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 if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes then : printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 printf %s "checking whether it is safe to define __EXTENSIONS__... " >&6; } if test ${ac_cv_safe_to_define___extensions__+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # define __EXTENSIONS__ 1 $ac_includes_default int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_safe_to_define___extensions__=yes else $as_nop ac_cv_safe_to_define___extensions__=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 printf "%s\n" "$ac_cv_safe_to_define___extensions__" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether _XOPEN_SOURCE should be defined" >&5 printf %s "checking whether _XOPEN_SOURCE should be defined... " >&6; } if test ${ac_cv_should_define__xopen_source+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_should_define__xopen_source=no if test $ac_cv_header_wchar_h = yes then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include mbstate_t x; int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _XOPEN_SOURCE 500 #include mbstate_t x; int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_should_define__xopen_source=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_should_define__xopen_source" >&5 printf "%s\n" "$ac_cv_should_define__xopen_source" >&6; } printf "%s\n" "#define _ALL_SOURCE 1" >>confdefs.h printf "%s\n" "#define _DARWIN_C_SOURCE 1" >>confdefs.h printf "%s\n" "#define _GNU_SOURCE 1" >>confdefs.h printf "%s\n" "#define _HPUX_ALT_XOPEN_SOCKET_API 1" >>confdefs.h printf "%s\n" "#define _NETBSD_SOURCE 1" >>confdefs.h printf "%s\n" "#define _OPENBSD_SOURCE 1" >>confdefs.h printf "%s\n" "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h printf "%s\n" "#define __STDC_WANT_IEC_60559_ATTRIBS_EXT__ 1" >>confdefs.h printf "%s\n" "#define __STDC_WANT_IEC_60559_BFP_EXT__ 1" >>confdefs.h printf "%s\n" "#define __STDC_WANT_IEC_60559_DFP_EXT__ 1" >>confdefs.h printf "%s\n" "#define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1" >>confdefs.h printf "%s\n" "#define __STDC_WANT_IEC_60559_TYPES_EXT__ 1" >>confdefs.h printf "%s\n" "#define __STDC_WANT_LIB_EXT2__ 1" >>confdefs.h printf "%s\n" "#define __STDC_WANT_MATH_SPEC_FUNCS__ 1" >>confdefs.h printf "%s\n" "#define _TANDEM_SOURCE 1" >>confdefs.h if test $ac_cv_header_minix_config_h = yes then : MINIX=yes printf "%s\n" "#define _MINIX 1" >>confdefs.h printf "%s\n" "#define _POSIX_SOURCE 1" >>confdefs.h printf "%s\n" "#define _POSIX_1_SOURCE 2" >>confdefs.h else $as_nop MINIX= fi if test $ac_cv_safe_to_define___extensions__ = yes then : printf "%s\n" "#define __EXTENSIONS__ 1" >>confdefs.h fi if test $ac_cv_should_define__xopen_source = yes then : printf "%s\n" "#define _XOPEN_SOURCE 500" >>confdefs.h 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 -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 { 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 $as_nop 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}gcc" 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 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 "gcc", so it can be a program name with args. set dummy gcc; 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 $as_nop 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="gcc" 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 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 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 { 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 $as_nop 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}cc" 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 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 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 { 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 $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no 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 if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" 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 if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # 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+' '}$@" fi fi fi 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 $as_nop 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 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 $as_nop 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 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 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 # 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 $as_nop 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 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 $as_nop 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 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" && { { 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; } # Provide some information about the compiler. 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 -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\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { 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 $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_compiler_gnu=yes else $as_nop ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { 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+y} ac_save_CFLAGS=$CFLAGS { 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 $as_nop ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes else $as_nop CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else $as_nop ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; 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.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag 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 $as_nop 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 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 $as_nop 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 $as_nop { 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" fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 ac_prog_cc_stdc=c11 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 $as_nop 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 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 $as_nop 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 $as_nop { 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" fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 ac_prog_cc_stdc=c99 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 $as_nop 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 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 $as_nop 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 $as_nop { 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" fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 ac_prog_cc_stdc=c89 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 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 printf %s "checking whether $CC understands -c and -o together... " >&6; } if test ${am_cv_prog_cc_c_o+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 printf "%s\n" "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" 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 depcc="$CC" am_compiler_list= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 printf %s "checking dependency style of $depcc... " >&6; } if test ${am_cv_CC_dependencies_compiler_type+y} then : printf %s "(cached) " >&6 else $as_nop if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 printf "%s\n" "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi ac_fn_c_check_member "$LINENO" "struct stat" "st_blksize" "ac_cv_member_struct_stat_st_blksize" "$ac_includes_default" if test "x$ac_cv_member_struct_stat_st_blksize" = xyes then : printf "%s\n" "#define HAVE_STRUCT_STAT_ST_BLKSIZE 1" >>confdefs.h fi ac_fn_c_check_member "$LINENO" "struct stat" "st_blocks" "ac_cv_member_struct_stat_st_blocks" "$ac_includes_default" if test "x$ac_cv_member_struct_stat_st_blocks" = xyes then : printf "%s\n" "#define HAVE_STRUCT_STAT_ST_BLOCKS 1" >>confdefs.h printf "%s\n" "#define HAVE_ST_BLOCKS 1" >>confdefs.h else $as_nop case " $LIBOBJS " in *" fileblocks.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS fileblocks.$ac_objext" ;; esac fi # 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 { 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 $as_nop ac_build_alias=$build_alias test "x$ac_build_alias" = x && 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 fi { 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;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { 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 $as_nop 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 fi fi { 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;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t" case $ac_cv_c_uint32_t in #( no|yes) ;; #( *) printf "%s\n" "#define _UINT32_T 1" >>confdefs.h printf "%s\n" "#define uint32_t $ac_cv_c_uint32_t" >>confdefs.h ;; esac # Check whether --enable-largefile was given. if test ${enable_largefile+y} then : enableval=$enable_largefile; fi if test "$enable_largefile" != no; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 printf %s "checking for special C compiler options needed for large files... " >&6; } if test ${ac_cv_sys_largefile_CC+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_sys_largefile_CC=no if test "$GCC" != yes; then ac_save_CC=$CC while :; do # IRIX 6.2 and later do not support large files by default, # so use the C compiler's -n32 option if that helps. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : break fi rm -f core conftest.err conftest.$ac_objext conftest.beam CC="$CC -n32" if ac_fn_c_try_compile "$LINENO" then : ac_cv_sys_largefile_CC=' -n32'; break fi rm -f core conftest.err conftest.$ac_objext conftest.beam break done CC=$ac_save_CC rm -f conftest.$ac_ext fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 printf "%s\n" "$ac_cv_sys_largefile_CC" >&6; } if test "$ac_cv_sys_largefile_CC" != no; then CC=$CC$ac_cv_sys_largefile_CC fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 printf %s "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } if test ${ac_cv_sys_file_offset_bits+y} then : printf %s "(cached) " >&6 else $as_nop while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_sys_file_offset_bits=no; break fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _FILE_OFFSET_BITS 64 #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_sys_file_offset_bits=64; break fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_sys_file_offset_bits=unknown break done fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 printf "%s\n" "$ac_cv_sys_file_offset_bits" >&6; } case $ac_cv_sys_file_offset_bits in #( no | unknown) ;; *) printf "%s\n" "#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits" >>confdefs.h ;; esac rm -rf conftest* if test $ac_cv_sys_file_offset_bits = unknown; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 printf %s "checking for _LARGE_FILES value needed for large files... " >&6; } if test ${ac_cv_sys_large_files+y} then : printf %s "(cached) " >&6 else $as_nop while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_sys_large_files=no; break fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _LARGE_FILES 1 #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_sys_large_files=1; break fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_sys_large_files=unknown break done fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 printf "%s\n" "$ac_cv_sys_large_files" >&6; } case $ac_cv_sys_large_files in #( no | unknown) ;; *) printf "%s\n" "#define _LARGE_FILES $ac_cv_sys_large_files" >>confdefs.h ;; esac rm -rf conftest* fi fi ac_fn_c_check_header_compile "$LINENO" "libgen.h" "ac_cv_header_libgen_h" "$ac_includes_default" if test "x$ac_cv_header_libgen_h" = xyes then : printf "%s\n" "#define HAVE_LIBGEN_H 1" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for poptParseArgvString in -lpopt" >&5 printf %s "checking for poptParseArgvString in -lpopt... " >&6; } if test ${ac_cv_lib_popt_poptParseArgvString+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lpopt $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 poptParseArgvString (void); int main (void) { return poptParseArgvString (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_popt_poptParseArgvString=yes else $as_nop ac_cv_lib_popt_poptParseArgvString=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_popt_poptParseArgvString" >&5 printf "%s\n" "$ac_cv_lib_popt_poptParseArgvString" >&6; } if test "x$ac_cv_lib_popt_poptParseArgvString" = xyes then : printf "%s\n" "#define HAVE_LIBPOPT 1" >>confdefs.h LIBS="-lpopt $LIBS" else $as_nop as_fn_error $? "libpopt required but not found" "$LINENO" 5 fi mkdir -p test WITH_SELINUX="no" # Check whether --with-selinux was given. if test ${with_selinux+y} then : withval=$with_selinux; else $as_nop with_selinux=check fi case "$with_selinux" in #( yes) : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for getfscreatecon_raw in -lselinux" >&5 printf %s "checking for getfscreatecon_raw in -lselinux... " >&6; } if test ${ac_cv_lib_selinux_getfscreatecon_raw+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lselinux $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 getfscreatecon_raw (void); int main (void) { return getfscreatecon_raw (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_selinux_getfscreatecon_raw=yes else $as_nop ac_cv_lib_selinux_getfscreatecon_raw=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_selinux_getfscreatecon_raw" >&5 printf "%s\n" "$ac_cv_lib_selinux_getfscreatecon_raw" >&6; } if test "x$ac_cv_lib_selinux_getfscreatecon_raw" = xyes then : printf "%s\n" "#define HAVE_LIBSELINUX 1" >>confdefs.h LIBS="-lselinux $LIBS" fi ;; #( no) : ;; #( *) : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for getfscreatecon_raw in -lselinux" >&5 printf %s "checking for getfscreatecon_raw in -lselinux... " >&6; } if test ${ac_cv_lib_selinux_getfscreatecon_raw+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lselinux $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 getfscreatecon_raw (void); int main (void) { return getfscreatecon_raw (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_selinux_getfscreatecon_raw=yes else $as_nop ac_cv_lib_selinux_getfscreatecon_raw=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_selinux_getfscreatecon_raw" >&5 printf "%s\n" "$ac_cv_lib_selinux_getfscreatecon_raw" >&6; } if test "x$ac_cv_lib_selinux_getfscreatecon_raw" = xyes then : printf "%s\n" "#define HAVE_LIBSELINUX 1" >>confdefs.h LIBS="-lselinux $LIBS" fi ;; esac if test "$ac_cv_lib_selinux_getfscreatecon_raw" = yes then : echo "1" > ./test/test.SELINUX; WITH_SELINUX="yes"; else $as_nop echo "0" > ./test/test.SELINUX; fi WITH_ACL="no" # Check whether --with-acl was given. if test ${with_acl+y} then : withval=$with_acl; else $as_nop with_acl=check fi case "$with_acl" in #( yes) : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for acl_get_file in -lacl" >&5 printf %s "checking for acl_get_file in -lacl... " >&6; } if test ${ac_cv_lib_acl_acl_get_file+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lacl $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 acl_get_file (void); int main (void) { return acl_get_file (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_acl_acl_get_file=yes else $as_nop ac_cv_lib_acl_acl_get_file=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_acl_acl_get_file" >&5 printf "%s\n" "$ac_cv_lib_acl_acl_get_file" >&6; } if test "x$ac_cv_lib_acl_acl_get_file" = xyes then : printf "%s\n" "#define HAVE_LIBACL 1" >>confdefs.h LIBS="-lacl $LIBS" fi ;; #( no) : ;; #( *) : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for acl_get_file in -lacl" >&5 printf %s "checking for acl_get_file in -lacl... " >&6; } if test ${ac_cv_lib_acl_acl_get_file+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lacl $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 acl_get_file (void); int main (void) { return acl_get_file (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_acl_acl_get_file=yes else $as_nop ac_cv_lib_acl_acl_get_file=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_acl_acl_get_file" >&5 printf "%s\n" "$ac_cv_lib_acl_acl_get_file" >&6; } if test "x$ac_cv_lib_acl_acl_get_file" = xyes then : printf "%s\n" "#define HAVE_LIBACL 1" >>confdefs.h LIBS="-lacl $LIBS" fi ;; esac if test "$ac_cv_lib_acl_acl_get_file" = yes then : echo "1" > ./test/test.ACL; WITH_ACL="yes"; else $as_nop echo "0" > ./test/test.ACL; fi DEFAULT_MAIL_COMMAND="/bin/mail" COMPRESS_COMMAND="/bin/gzip" UNCOMPRESS_COMMAND="/bin/gunzip" COMPRESS_EXT=".gz" STATE_FILE_PATH="/var/lib/logrotate.status" case "$host" in *-hpux*) DEFAULT_MAIL_COMMAND="/usr/bin/mailx" COMPRESS_COMMAND="/usr/contrib/bin/gzip" UNCOMPRESS_COMMAND="/usr/contrib/bin/gunzip" ;; *-solaris*|*-sunos*) DEFAULT_MAIL_COMMAND="/usr/bin/mailx" ;; *-netbsd*) DEFAULT_MAIL_COMMAND="/usr/bin/mail" COMPRESS_COMMAND="/usr/bin/gzip" UNCOMPRESS_COMMAND="/usr/bin/gunzip" ;; *-darwin*) COMPRESS_COMMAND="/usr/bin/gzip" UNCOMPRESS_COMMAND="/usr/bin/gunzip" ;; esac # Check whether --with-state-file-path was given. if test ${with_state_file_path+y} then : withval=$with_state_file_path; case "$withval" in yes|no) as_fn_error $? "--with-state-file-path=PATH requires a path to be specified" "$LINENO" 5 ;; *) STATE_FILE_PATH="$withval" ;; esac fi printf "%s\n" "#define STATEFILE \"$STATE_FILE_PATH\"" >>confdefs.h # Check whether --with-default-mail-command was given. if test ${with_default_mail_command+y} then : withval=$with_default_mail_command; case "$withval" in yes|no) as_fn_error $? "--with-default-mail-command=COMMAND requires a command to be specified" "$LINENO" 5 ;; *) DEFAULT_MAIL_COMMAND="$withval" ;; esac fi printf "%s\n" "#define DEFAULT_MAIL_COMMAND \"$DEFAULT_MAIL_COMMAND\"" >>confdefs.h # Check whether --with-compress-command was given. if test ${with_compress_command+y} then : withval=$with_compress_command; case "$withval" in yes|no) as_fn_error $? "--with-compress-command=COMMAND requires a command to be specified" "$LINENO" 5 ;; *) COMPRESS_COMMAND="$withval" ;; esac fi printf "%s\n" "#define COMPRESS_COMMAND \"$COMPRESS_COMMAND\"" >>confdefs.h # Check whether --with-uncompress-command was given. if test ${with_uncompress_command+y} then : withval=$with_uncompress_command; case "$withval" in yes|no) as_fn_error $? "--with-uncompress-command=COMMAND requires a command to be specified" "$LINENO" 5 ;; *) UNCOMPRESS_COMMAND="$withval" ;; esac fi printf "%s\n" "#define UNCOMPRESS_COMMAND \"$UNCOMPRESS_COMMAND\"" >>confdefs.h # Check whether --with-compress-extension was given. if test ${with_compress_extension+y} then : withval=$with_compress_extension; case "$withval" in .*) COMPRESS_EXT="$withval" ;; *) as_fn_error $? "--with-compress-extension=EXTENSION must start with ." "$LINENO" 5 ;; esac fi printf "%s\n" "#define COMPRESS_EXT \"$COMPRESS_EXT\"" >>confdefs.h printf "%s\n" "#define ROOT_UID 0" >>confdefs.h ac_fn_c_check_func "$LINENO" "asprintf" "ac_cv_func_asprintf" if test "x$ac_cv_func_asprintf" = xyes then : printf "%s\n" "#define HAVE_ASPRINTF 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "futimens" "ac_cv_func_futimens" if test "x$ac_cv_func_futimens" = xyes then : printf "%s\n" "#define HAVE_FUTIMENS 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "madvise" "ac_cv_func_madvise" if test "x$ac_cv_func_madvise" = xyes then : printf "%s\n" "#define HAVE_MADVISE 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "secure_getenv" "ac_cv_func_secure_getenv" if test "x$ac_cv_func_secure_getenv" = xyes then : printf "%s\n" "#define HAVE_SECURE_GETENV 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "strndup" "ac_cv_func_strndup" if test "x$ac_cv_func_strndup" = xyes then : printf "%s\n" "#define HAVE_STRNDUP 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "utimensat" "ac_cv_func_utimensat" if test "x$ac_cv_func_utimensat" = xyes then : printf "%s\n" "#define HAVE_UTIMENSAT 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "vsyslog" "ac_cv_func_vsyslog" if test "x$ac_cv_func_vsyslog" = xyes then : printf "%s\n" "#define HAVE_VSYSLOG 1" >>confdefs.h fi ac_fn_c_check_member "$LINENO" "struct stat" "st_atim" "ac_cv_member_struct_stat_st_atim" "$ac_includes_default" if test "x$ac_cv_member_struct_stat_st_atim" = xyes then : printf "%s\n" "#define HAVE_STRUCT_STAT_ST_ATIM 1" >>confdefs.h fi ac_fn_c_check_member "$LINENO" "struct stat" "st_mtim" "ac_cv_member_struct_stat_st_mtim" "$ac_includes_default" if test "x$ac_cv_member_struct_stat_st_mtim" = xyes then : printf "%s\n" "#define HAVE_STRUCT_STAT_ST_MTIM 1" >>confdefs.h fi ac_config_headers="$ac_config_headers config.h" AM_CFLAGS="\ -Wall\ -Wconversion\ -Wdeclaration-after-statement\ -Wextra\ -Wmissing-format-attribute\ -Wmissing-noreturn\ -Wmissing-prototypes\ -Wpointer-arith\ -Wshadow\ -Wstrict-prototypes\ -Wundef\ -Wunused\ -Wwrite-strings" # Check whether --enable-werror was given. if test ${enable_werror+y} then : enableval=$enable_werror; enable_werror="$enableval" else $as_nop enable_werror=no fi if test "x$enable_werror" = "xyes" then : AM_CFLAGS="$AM_CFLAGS -Werror" fi ac_config_files="$ac_config_files Makefile test/Makefile logrotate.8 logrotate.spec" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # 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 # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_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) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (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 # 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. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear 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 { 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 case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { 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 test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= 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=`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" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 printf %s "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: done" >&5 printf "%s\n" "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { 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 # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh as_nop=: 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 $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; 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 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 ${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 || PATH_SEPARATOR=';' } fi # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) 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 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' # 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 printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. 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 printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. 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 : eval 'as_fn_append () { eval $1+=\$2 }' else $as_nop as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # 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 : eval 'as_fn_arith () { as_val=$(( $* )) }' else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' 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*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) 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 else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi 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'. 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 as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p 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'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by logrotate $as_me 3.21.0, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$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. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to the package provider. logrotate home page: ." _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='$ac_cs_config_escaped' ac_cs_version="\\ logrotate config.status 3.21.0 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" Copyright (C) 2021 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) printf "%s\n" "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) 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=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) 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.";; --help | --hel | -h ) 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_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF 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 \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX printf "%s\n" "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "test/Makefile") CONFIG_FILES="$CONFIG_FILES test/Makefile" ;; "logrotate.8") CONFIG_FILES="$CONFIG_FILES logrotate.8" ;; "logrotate.spec") CONFIG_FILES="$CONFIG_FILES logrotate.spec" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # 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+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 # simply because there is no reason against having it here, and in addition, # 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'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 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'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 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'. 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 # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) 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 `:'. 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;; 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 # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { 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=`printf "%s\n" "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. 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/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { 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=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # 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 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 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"; } && { 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 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" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { 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 { 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 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 # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :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 case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. # TODO: see whether this extra hack can be removed once we start # requiring Autoconf 2.70 or later. case $CONFIG_FILES in #( *\'*) : eval set x "$CONFIG_FILES" ;; #( *) : set x $CONFIG_FILES ;; #( *) : ;; esac shift # Used to flag and report bootstrapping failures. am_rc=0 for am_mf do # Strip MF so we end up with the name of the file. am_mf=`printf "%s\n" "$am_mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ || continue am_dirpart=`$as_dirname -- "$am_mf" || $as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$am_mf" : 'X\(//\)[^/]' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$am_mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` am_filepart=`$as_basename -- "$am_mf" || $as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X/"$am_mf" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` { echo "$as_me:$LINENO: cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles" >&5 (cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } || am_rc=$? done if test $am_rc -ne 0; 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 $? "Something went wrong bootstrapping makefile fragments for automatic dependency tracking. If GNU make was not used, consider re-running the configure script with MAKE=\"gmake\" (or whatever is necessary). You can also try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking). See \`config.log' for more details" "$LINENO" 5; } fi { am_dirpart=; unset am_dirpart;} { am_filepart=; unset am_filepart;} { am_mf=; unset am_mf;} { am_rc=; unset am_rc;} rm -f conftest-deps.mk } ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${PACKAGE_NAME} ${VERSION} SELinux support: ${WITH_SELINUX} ACL support: ${WITH_ACL} default mail command: ${DEFAULT_MAIL_COMMAND} compress command: ${COMPRESS_COMMAND} uncompress command: ${UNCOMPRESS_COMMAND} compress extension: ${COMPRESS_EXT} statefile path: ${STATE_FILE_PATH} " >&5 printf "%s\n" " ${PACKAGE_NAME} ${VERSION} SELinux support: ${WITH_SELINUX} ACL support: ${WITH_ACL} default mail command: ${DEFAULT_MAIL_COMMAND} compress command: ${COMPRESS_COMMAND} uncompress command: ${UNCOMPRESS_COMMAND} compress extension: ${COMPRESS_EXT} statefile path: ${STATE_FILE_PATH} " >&6; } logrotate-3.21.0/configure.ac0000644000175000017500000001377014346133207013017 00000000000000AC_INIT([logrotate],m4_esyscmd([build-aux/git-version-gen --prefix '' .tarball-version]), [],[],[https://github.com/logrotate/logrotate]) dnl foreign: Do not require AUTHORS, ChangeLog, NEWS, and README to exist dnl dist-xz: Produce tar.xz version of the release archive AM_INIT_AUTOMAKE([-Wall foreign dist-xz std-options]) # --enable-silent-rules m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])], [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])]) AC_USE_SYSTEM_EXTENSIONS AC_PROG_CC AC_CHECK_MEMBERS([struct stat.st_blksize]) AC_STRUCT_ST_BLOCKS AC_CANONICAL_HOST AC_TYPE_UINT32_T dnl Use 64-bit file offsets on 32-bit systems (defines C macros if necessary) AC_SYS_LARGEFILE dnl needed for basename() on OS X AC_CHECK_HEADERS([libgen.h]) AC_CHECK_LIB([popt],[poptParseArgvString],, AC_MSG_ERROR([libpopt required but not found])) dnl Needed for out-of-source builds mkdir -p test WITH_SELINUX="no" AC_ARG_WITH([selinux], [AS_HELP_STRING([--with-selinux], [support handling SELinux contexts (yes,no,check) @<:@default=check@:>@])], [], [with_selinux=check]) AS_CASE(["$with_selinux"], [yes], [AC_CHECK_LIB([selinux],[getfscreatecon_raw])], [no], [], [AC_CHECK_LIB([selinux],[getfscreatecon_raw])]) AS_IF([test "$ac_cv_lib_selinux_getfscreatecon_raw" = yes], echo "1" > ./test/test.SELINUX; WITH_SELINUX="yes";, echo "0" > ./test/test.SELINUX;) WITH_ACL="no" AC_ARG_WITH([acl], [AS_HELP_STRING([--with-acl], [support handling ACL (yes,no,check) @<:@default=check@:>@])], [], [with_acl=check]) AS_CASE(["$with_acl"], [yes], [AC_CHECK_LIB([acl],[acl_get_file])], [no], [], [AC_CHECK_LIB([acl],[acl_get_file])]) AS_IF([test "$ac_cv_lib_acl_acl_get_file" = yes], echo "1" > ./test/test.ACL; WITH_ACL="yes";, echo "0" > ./test/test.ACL;) DEFAULT_MAIL_COMMAND="/bin/mail" COMPRESS_COMMAND="/bin/gzip" UNCOMPRESS_COMMAND="/bin/gunzip" COMPRESS_EXT=".gz" STATE_FILE_PATH="/var/lib/logrotate.status" case "$host" in *-hpux*) DEFAULT_MAIL_COMMAND="/usr/bin/mailx" COMPRESS_COMMAND="/usr/contrib/bin/gzip" UNCOMPRESS_COMMAND="/usr/contrib/bin/gunzip" ;; *-solaris*|*-sunos*) DEFAULT_MAIL_COMMAND="/usr/bin/mailx" ;; *-netbsd*) DEFAULT_MAIL_COMMAND="/usr/bin/mail" COMPRESS_COMMAND="/usr/bin/gzip" UNCOMPRESS_COMMAND="/usr/bin/gunzip" ;; *-darwin*) COMPRESS_COMMAND="/usr/bin/gzip" UNCOMPRESS_COMMAND="/usr/bin/gunzip" ;; esac AC_ARG_WITH([state-file-path], AS_HELP_STRING([--with-state-file-path=PATH], [path to state file (/var/lib/logrotate.status by default)]), [ case "$withval" in yes|no) AC_MSG_ERROR([--with-state-file-path=PATH requires a path to be specified]) ;; *) STATE_FILE_PATH="$withval" ;; esac ]) AC_DEFINE_UNQUOTED([STATEFILE], ["$STATE_FILE_PATH"], [State file path.]) AC_SUBST(STATE_FILE_PATH) AC_ARG_WITH([default-mail-command], AS_HELP_STRING([--with-default-mail-command=COMMAND], [default mail command (e.g. /bin/mail)]), [ case "$withval" in yes|no) AC_MSG_ERROR([--with-default-mail-command=COMMAND requires a command to be specified]) ;; *) DEFAULT_MAIL_COMMAND="$withval" ;; esac ]) AC_DEFINE_UNQUOTED([DEFAULT_MAIL_COMMAND], ["$DEFAULT_MAIL_COMMAND"], [default mail command]) AC_SUBST(DEFAULT_MAIL_COMMAND) AC_ARG_WITH([compress-command], AS_HELP_STRING([--with-compress-command=COMMAND], [compress command (default: /bin/gzip)]), [ case "$withval" in yes|no) AC_MSG_ERROR([--with-compress-command=COMMAND requires a command to be specified]) ;; *) COMPRESS_COMMAND="$withval" ;; esac ]) AC_DEFINE_UNQUOTED([COMPRESS_COMMAND], "$COMPRESS_COMMAND", [default compress command]) AC_SUBST(COMPRESS_COMMAND) AC_ARG_WITH([uncompress-command], AS_HELP_STRING([--with-uncompress-command=COMMAND], [uncompress command (default: /bin/gunzip)]), [ case "$withval" in yes|no) AC_MSG_ERROR([--with-uncompress-command=COMMAND requires a command to be specified]) ;; *) UNCOMPRESS_COMMAND="$withval" ;; esac ]) AC_DEFINE_UNQUOTED([UNCOMPRESS_COMMAND], "$UNCOMPRESS_COMMAND", [default uncompress command]) AC_SUBST(UNCOMPRESS_COMMAND) AC_ARG_WITH([compress-extension], AS_HELP_STRING([--with-compress-extension=EXTENSION], [compress extension (default: .gz)]), [ case "$withval" in .*) COMPRESS_EXT="$withval" ;; *) AC_MSG_ERROR([--with-compress-extension=EXTENSION must start with .]) ;; esac ]) AC_DEFINE_UNQUOTED([COMPRESS_EXT], ["$COMPRESS_EXT"], [default compress extension]) AC_SUBST(COMPRESS_EXT) AC_DEFINE_UNQUOTED([ROOT_UID], [0], [Root user-id.]) AC_SUBST(ROOT_UID) AC_CHECK_FUNCS([asprintf futimens madvise secure_getenv strndup utimensat vsyslog]) AC_CHECK_MEMBERS([struct stat.st_atim, struct stat.st_mtim]) AC_CONFIG_HEADERS([config.h]) AM_CFLAGS="\ -Wall\ -Wconversion\ -Wdeclaration-after-statement\ -Wextra\ -Wmissing-format-attribute\ -Wmissing-noreturn\ -Wmissing-prototypes\ -Wpointer-arith\ -Wshadow\ -Wstrict-prototypes\ -Wundef\ -Wunused\ -Wwrite-strings" AC_ARG_ENABLE([werror], [AS_HELP_STRING([--enable-werror], [Treat warnings as errors (default: warnings are not errors)])], [enable_werror="$enableval"], [enable_werror=no]) AS_IF([test "x$enable_werror" = "xyes"], [AM_CFLAGS="$AM_CFLAGS -Werror"]) AC_SUBST([AM_CFLAGS]) AC_CONFIG_FILES([Makefile test/Makefile logrotate.8 logrotate.spec]) AC_OUTPUT AC_MSG_RESULT([ ${PACKAGE_NAME} ${VERSION} SELinux support: ${WITH_SELINUX} ACL support: ${WITH_ACL} default mail command: ${DEFAULT_MAIL_COMMAND} compress command: ${COMPRESS_COMMAND} uncompress command: ${UNCOMPRESS_COMMAND} compress extension: ${COMPRESS_EXT} statefile path: ${STATE_FILE_PATH} ]) logrotate-3.21.0/aclocal.m40000644000175000017500000012251214346133573012372 00000000000000# generated automatically by aclocal 1.16.5 -*- Autoconf -*- # Copyright (C) 1996-2021 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],, [m4_warning([this file was generated for autoconf 2.71. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # Copyright (C) 2002-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.16' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.16.5], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.16.5])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to # '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], [$1], [UPC], [depcc="$UPC" am_compiler_list=], [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. # TODO: see whether this extra hack can be removed once we start # requiring Autoconf 2.70 or later. AS_CASE([$CONFIG_FILES], [*\'*], [eval set x "$CONFIG_FILES"], [*], [set x $CONFIG_FILES]) shift # Used to flag and report bootstrapping failures. am_rc=0 for am_mf do # Strip MF so we end up with the name of the file. am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ || continue am_dirpart=`AS_DIRNAME(["$am_mf"])` am_filepart=`AS_BASENAME(["$am_mf"])` AM_RUN_LOG([cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles]) || am_rc=$? done if test $am_rc -ne 0; then AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments for automatic dependency tracking. If GNU make was not used, consider re-running the configure script with MAKE="gmake" (or whatever is necessary). You can also try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking).]) fi AS_UNSET([am_dirpart]) AS_UNSET([am_filepart]) AS_UNSET([am_mf]) AS_UNSET([am_rc]) rm -f conftest-deps.mk } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking is enabled. # This creates each '.Po' and '.Plo' makefile fragment that we'll need in # order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC]) [_AM_PROG_CC_C_O ]) # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl m4_ifdef([_$0_ALREADY_INIT], [m4_fatal([$0 expanded multiple times ]m4_defn([_$0_ALREADY_INIT]))], [m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) # Variables for tags utilities; see am/tags.am if test -z "$CTAGS"; then CTAGS=ctags fi AC_SUBST([CTAGS]) if test -z "$ETAGS"; then ETAGS=etags fi AC_SUBST([ETAGS]) if test -z "$CSCOPE"; then CSCOPE=cscope fi AC_SUBST([CSCOPE]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi dnl The trailing newline in this macro's definition is deliberate, for dnl backward compatibility and to allow trailing 'dnl'-style comments dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) # Copyright (C) 2003-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAKE_INCLUDE() # ----------------- # Check whether make has an 'include' directive that can support all # the idioms we need for our automatic dependency tracking code. AC_DEFUN([AM_MAKE_INCLUDE], [AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out .PHONY: am__doit END am__include="#" am__quote= # BSD make does it like this. echo '.include "confinc.mk" # ignored' > confmf.BSD # Other make implementations (GNU, Solaris 10, AIX) do it like this. echo 'include confinc.mk # ignored' > confmf.GNU _am_result=no for s in GNU BSD; do AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) AS_CASE([$?:`cat confinc.out 2>/dev/null`], ['0:this is the am__doit target'], [AS_CASE([$s], [BSD], [am__include='.include' am__quote='"'], [am__include='include' am__quote=''])]) if test "$am__include" != "#"; then _am_result="yes ($s style)" break fi done rm -f confinc.* confmf.* AC_MSG_RESULT([${_am_result}]) AC_SUBST([am__include])]) AC_SUBST([am__quote])]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it is modern enough. # If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then MISSING="\${SHELL} '$am_aux_dir/missing'" fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_CC_C_O # --------------- # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC # to automatically call this. AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl AC_LANG_PUSH([C])dnl AC_CACHE_CHECK( [whether $CC understands -c and -o together], [am_cv_prog_cc_c_o], [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i]) if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT([yes]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar # AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR logrotate-3.21.0/logrotate.spec0000644000175000017500000000413714346133602013401 00000000000000Summary: Rotates, compresses, removes and mails system log files Name: logrotate Version: 3.21.0 Release: 1%{?dist} License: GPLv2+ Group: System Environment/Base Source: https://github.com/logrotate/logrotate/releases/download/%{version}/logrotate-%{version}.tar.gz Requires: coreutils >= 5.92 libsepol libselinux popt BuildRequires: libselinux-devel popt-devel BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) %{!?_licensedir:%global license %%doc} %description The logrotate utility is designed to simplify the administration of log files on a system which generates a lot of log files. Logrotate allows for the automatic rotation compression, removal and mailing of log files. Logrotate can be set to handle a log file daily, weekly, monthly or when the log file gets to a certain size. Normally, logrotate runs as a daily cron job. Install the logrotate package if you need a utility to deal with the log files on your system. %prep %setup -q %build %configure \ --with-selinux make %{?_smp_mflags} RPM_OPT_FLAGS="$RPM_OPT_FLAGS" %install rm -rf $RPM_BUILD_ROOT make install DESTDIR=$RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/cron.daily mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/lib install -p -m 644 examples/logrotate.conf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.conf install -p -m 644 examples/btmp $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/btmp install -p -m 644 examples/wtmp $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/wtmp install -p -m 755 examples/logrotate.cron $RPM_BUILD_ROOT%{_sysconfdir}/cron.daily/logrotate %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) %license COPYING %attr(0755, root, root) %{_sbindir}/logrotate %attr(0644, root, root) %{_mandir}/man8/logrotate.8* %attr(0644, root, root) %{_mandir}/man5/logrotate.conf.5* %attr(0755, root, root) %{_sysconfdir}/cron.daily/logrotate %attr(0644, root, root) %config(noreplace) %{_sysconfdir}/logrotate.conf %attr(0755, root, root) %{_sysconfdir}/logrotate.d %ghost %attr(0640, root, root) %verify(not size md5 mtime) %{_localstatedir}/lib/logrotate.status logrotate-3.21.0/logrotate.80000644000175000017500000007002714346133602012617 00000000000000.TH LOGROTATE 8 "3.21.0" "Linux" "System Administrator's Manual" .\" Per groff_man(7), the TQ macro should be copied from an-ext.tmac when .\" not running under groff. That's not quite right; not all groff .\" installations include this macro. So bring it in with another name .\" unconditionally. .\" Continuation line for .TP header. .de tq . br . ns . TP \\$1\" no doublequotes around argument! .. .\} .SH NAME logrotate \(hy rotates, compresses, and mails system logs .SH SYNOPSIS \fBlogrotate\fR \fR[\fB\-\-force\fR] \fR[\fB\-\-debug\fR] \fR[\fB\-\-state\fR \fIfile\fR] \fR[\fB\-\-skip-state-lock\fR] \fR[\fB\-\-wait-for-state-lock\fR] \fR[\fB\-\-verbose\fR] \fR[\fB\-\-log\fR \fIfile\fR] \fR[\fB\-\-mail\fR \fIcommand\fR] \fIconfig_file\fR \fR[\fIconfig_file2 ...\fR] .SH DESCRIPTION \fBlogrotate\fR is designed to ease administration of systems that generate large numbers of log files. It allows automatic rotation, compression, removal, and mailing of log files. Each log file may be handled daily, weekly, monthly, or when it grows too large. .P Normally, \fBlogrotate\fR is run as a daily cron job. It will not modify a log more than once in one day unless the criterion for that log is based on the log's size and \fBlogrotate\fR is being run more than once each day, or unless the \fB\-f\fR or \fB\-\-force\fR option is used. .P Any number of config files may be given on the command line. Later config files may override the options given in earlier files, so the order in which the \fBlogrotate\fR config files are listed is important. Normally, a single config file which includes any other config files which are needed should be used. See below for more information on how to use the \fBinclude\fR directive to accomplish this. If a directory is given on the command line, every file in that directory is used as a config file. .P If no command line arguments are given, \fBlogrotate\fR will print version and copyright information, along with a short usage summary. If any errors occur while rotating logs, \fBlogrotate\fR will exit with non-zero status, although the state file will be updated. .SH OPTIONS .TP \fB\-f\fR, \fB\-\-force\fR Tells \fBlogrotate\fR to force the rotation, even if it doesn't think this is necessary. Sometimes this is useful after adding new entries to a \fBlogrotate\fR config file, or if old log files have been removed by hand, as the new files will be created, and logging will continue correctly. .TP \fB\-d\fR, \fB\-\-debug\fR Turn on debug mode, which means that no changes are made to the logs and the \fBlogrotate\fR state file is not updated. Only debug messages are printed. .TP \fB\-s\fR, \fB\-\-state\fR \fIstatefile\fR Tells \fBlogrotate\fR to use an alternate state file. This is useful if \fBlogrotate\fR is being run as a different user for various sets of log files. To prevent parallel execution \fBlogrotate\fR by default acquires a lock on the state file, if it cannot be acquired \fBlogrotate\fR will exit with value 3. The default state file is \fI/var/lib/logrotate.status\fR. If \fI/dev/null\fR is given as the state file, then \fBlogrotate\fR will not try to lock or write the state file. .TP \fB\-\-skip-state-lock\fR Do not lock the state file, for example if locking is unsupported or prohibited. .TP \fB\-\-wait-for-state-lock\fR Wait until lock on the state file is released by another logrotate process. This option may cause logrotate to wait indefinitely. Use with caution. .TP \fB\-v\fR, \fB\-\-verbose\fR Turns on verbose mode, for example to display messages during rotation. .TP \fB\-l\fR, \fB\-\-log\fR \fIfile\fR Tells \fBlogrotate\fR to log verbose output into the log_file. The verbose output logged to that file is the same as when running \fBlogrotate\fR with \fB-v\fR switch. The log file is overwritten on every \fBlogrotate\fR execution. .TP \fB\-m\fR, \fB\-\-mail\fR \fIcommand\fR Tells \fBlogrotate\fR which command to use when mailing logs. This command should accept the following arguments: .IP 1) the subject of the message given with '-s subject' .br 2) the recipient. .IP The command must then read a message on standard input and mail it to the recipient. The default mail command is \fI/bin/mail\fR. .TP \fB\-\-usage\fR Prints a short usage message. .TP \fB\-?\fR, \fB\-\-help\fR Prints help message. .TP \fB\-\-version\fR Display version information. .SH CONFIGURATION FILE \fBlogrotate\fR reads everything about the log files it should be handling from the series of configuration files specified on the command line. Each configuration file can set global options (local definitions override global ones, and later definitions override earlier ones) and specify logfiles to rotate. Global options do not affect preceding include directives. A simple configuration file looks like this: .nf .ta +8n # sample logrotate configuration file compress /var/log/messages { rotate 5 weekly postrotate /usr/bin/killall \-HUP syslogd endscript } "/var/log/httpd/access.log" /var/log/httpd/error.log { rotate 5 mail recipient@example.org size 100k sharedscripts postrotate /usr/bin/killall \-HUP httpd endscript } /var/log/news/* { monthly rotate 2 olddir /var/log/news/old missingok sharedscripts postrotate kill \-HUP $(cat /var/run/inn.pid) endscript nocompress } ~/log/*.log {} .fi .PP The first few lines set global options; in the example, logs are compressed after they are rotated. Note that comments may appear anywhere in the config file as long as the first non-whitespace character on the line is a \fB#\fR. Values are separated from directives by whitespace and/or an optional =. Numbers must be specified in a format understood by \fBstrtoul\fR(3). The next section of the config file defines how to handle the log file \fI/var/log/messages\fR. The log will go through five weekly rotations before being removed. After the log file has been rotated (but before the old version of the log has been compressed), the command \fI/usr/bin/killall \-HUP syslogd\fR will be executed. The next section defines the parameters for both \fI/var/log/httpd/access.log\fR and \fI/var/log/httpd/error.log\fR. Each is rotated whenever it grows over 100\ kilobytes in size, and the old logs files are mailed (uncompressed) to recipient@\:example.org after going through 5 rotations, rather than being removed. The \fBsharedscripts\fR means that the \fBpostrotate\fR script will only be run once (after the old logs have been compressed), not once for each log which is rotated. Note that log file names may be enclosed in quotes (and that quotes are required if the name contains spaces). Normal shell quoting rules apply, with \fB'\fR, \fB"\fR, and \fB\e\fR characters supported. The next section defines the parameters for all of the files in \fI/var/log/news\fR. Each file is rotated on a monthly basis. The last section uses tilde expansion to rotate log files in the home directory of the current user. This is only available, if your glob library supports tilde expansion. GNU glob does support this. Please use wildcards with caution. If you specify *, \fBlogrotate\fR will rotate all files, including previously rotated ones. A way around this is to use the \fBolddir\fR directive or a more exact wildcard (such as *.log). Please note, by default when using \fBsystemd\fR(1), the option \fIProtectSystem=full\fR is set in the \fIlogrotate.service\fR file. This prevents \fBlogrotate\fR from modifying logs in \fI/etc\fR and \fI/usr\fR. Here is more information on the directives which may be included in a \fBlogrotate\fR configuration file: .SH CONFIGURATION FILE DIRECTIVES These directives may be included in a \fBlogrotate\fR configuration file: .SS Rotation .TP \fBrotate \fIcount\fR Log files are rotated \fIcount\fR times before being removed or mailed to the address specified in a \fBmail\fR directive. If \fIcount\fR is 0, old versions are removed rather than rotated. If \fIcount\fR is \-1, old logs are not removed at all, except they are affected by \fBmaxage\fR (use with caution, may waste performance and disk space). Default is 0. .TP \fBolddir \fIdirectory\fR Logs are moved into \fIdirectory\fR for rotation. The \fIdirectory\fR must be on the same physical device as the log file being rotated, unless \fBcopy\fR, \fBcopytruncate\fR or \fBrenamecopy\fR option is used. The \fIdirectory\fR is assumed to be relative to the directory holding the log file unless an absolute path name is specified. When this option is used all old versions of the log end up in \fIdirectory\fR. This option may be overridden by the \fBnoolddir\fR option. .TP \fBnoolddir\fR Logs are rotated in the directory they normally reside in (this overrides the \fBolddir\fR option). .TP \fBsu \fIuser\fR \fIgroup\fR Rotate log files set under this user and group instead of using default user/group (usually root). \fIuser\fR specifies the user used for rotation and \fIgroup\fR specifies the group used for rotation (see the section \fBUSER AND GROUP\fR for details). If the user/group you specify here does not have sufficient privilege to make files with the ownership you've specified in a \fBcreate\fR directive, it will cause an error. If \fBlogrotate\fR runs with root privileges, it is recommended to use the \fBsu\fR directive to rotate files in directories that are directly or indirectly in control of non-privileged users. .SS Frequency .TP \fBhourly\fR Log files are rotated every hour. Note that usually \fBlogrotate\fR is configured to be run by cron daily (or by \fIlogrotate.timer\fR when using \fBsystemd\fR(1)). You have to change this configuration and run \fBlogrotate\fR hourly to be able to really rotate logs hourly. .TP \fBdaily\fR Log files are rotated every day. .TP \fBweekly\fR [\fIweekday\fR] Log files are rotated once each \fIweekday\fR, or if the date is advanced by at least 7 days since the last rotation (while ignoring the exact time). The \fIweekday\fR interpretation is following: 0 means Sunday, 1 means Monday, \&.\|.\|.\|\&, 6 means Saturday; the special value 7 means each 7 days, irrespectively of weekday. Defaults to 0 if the \fIweekday\fR argument is omitted. .TP \fBmonthly\fR Log files are rotated the first time \fBlogrotate\fR is run in a month (this is normally on the first day of the month). .TP \fByearly\fR Log files are rotated if the current year is not the same as the last rotation. .TP \fBsize \fIsize\fR Log files are rotated only if they grow bigger than \fIsize\fR bytes. If \fIsize\fR is followed by \fIk\fR, the size is assumed to be in kilobytes. If \fIM\fR is used, the size is in megabytes, and if \fIG\fR is used, the size is in gigabytes. So \fIsize 100\fR, \fIsize 100k\fR, \fIsize 100M\fR and \fIsize 100G\fR are all valid. This option is mutually exclusive with the time interval options, and it causes log files to be rotated without regard for the last rotation time, if specified after the time criteria (the last specified option takes the precedence). .SS File selection .TP \fBmissingok\fR If the log file is missing, go on to the next one without issuing an error message. See also \fBnomissingok\fR. .TP \fBnomissingok\fR If a log file does not exist, issue an error. This is the default. .TP \fBignoreduplicates\fR Ignore any following matches of a log file. .TP \fBifempty\fR Rotate the log file even if it is empty, overriding the \fBnotifempty\fR option (\fBifempty\fR is the default). .TP \fBnotifempty\fR Do not rotate the log if it is empty (this overrides the \fBifempty\fR option). .TP \fBminage\fR \fIcount\fR Do not rotate logs which are less than days old. .TP \fBmaxage\fR \fIcount\fR Remove rotated logs older than days. The age is only checked if the logfile is to be rotated. \fBrotate \-1\fR does not hinder removal. The files are mailed to the configured address if \fBmaillast\fR and \fBmail\fR are configured. .TP \fBminsize\fR \fIsize\fR Log files are rotated when they grow bigger than \fIsize\fR bytes, but not before the additionally specified time interval (\fBdaily\fR, \fBweekly\fR, \fBmonthly\fR, or \fByearly\fR). The related \fBsize\fR option is similar except that it is mutually exclusive with the time interval options, and it causes log files to be rotated without regard for the last rotation time, if specified after the time criteria (the last specified option takes the precedence). When \fBminsize\fR is used, both the size and timestamp of a log file are considered. .TP \fBmaxsize\fR \fIsize\fR Log files are rotated when they grow bigger than \fIsize\fR bytes even before the additionally specified time interval (\fBdaily\fR, \fBweekly\fR, \fBmonthly\fR, or \fByearly\fR). The related \fBsize\fR option is similar except that it is mutually exclusive with the time interval options, and it causes log files to be rotated without regard for the last rotation time, if specified after the time criteria (the last specified option takes the precedence). When \fBmaxsize\fR is used, both the size and timestamp of a log file are considered. .TP \fBtabooext\fR [+] \fIlist\fR The current taboo extension list is changed (see the \fBinclude\fR directive for information on the taboo extensions). If a + precedes the list of extensions, the current taboo extension list is augmented, otherwise it is replaced. At startup, the taboo extension list .IR ,v , .IR .cfsaved , .IR .disabled , .IR .dpkg\-bak , .IR .dpkg\-del , .IR .dpkg\-dist , .IR .dpkg\-new , .IR .dpkg\-old , .IR .rhn\-cfg\-tmp\-* , .IR .rpmnew , .IR .rpmorig , .IR .rpmsave , .IR .swp , .IR .ucf\-dist , .IR .ucf\-new , .IR .ucf\-old , .I ~ .TP \fBtaboopat\fR [+] \fIlist\fR The current taboo glob pattern list is changed (see the \fBinclude\fR directive for information on the taboo extensions and patterns). If a + precedes the list of patterns, the current taboo pattern list is augmented, otherwise it is replaced. At startup, the taboo pattern list is empty. .SS Files and Folders .TP \fBcreate \fImode\fR \fIowner\fR \fIgroup\fR, \fBcreate \fIowner\fR \fIgroup\fR Immediately after rotation (before the \fBpostrotate\fR script is run) the log file is created (with the same name as the log file just rotated). \fImode\fR specifies the mode for the log file in octal (the same as \fBchmod\fR(2)), \fIowner\fR specifies the user who will own the log file, and \fIgroup\fR specifies the group the log file will belong to (see the section \fBUSER AND GROUP\fR for details). Any of the log file attributes may be omitted, in which case those attributes for the new file will use the same values as the original log file for the omitted attributes. This option can be disabled using the \fBnocreate\fR option. .TP \fBnocreate\fR New log files are not created (this overrides the \fBcreate\fR option). .TP \fBcreateolddir \fImode\fR \fIowner\fR \fIgroup\fR If the directory specified by \fBolddir\fR directive does not exist, it is created. \fImode\fR specifies the mode for the \fBolddir\fR directory in octal (the same as \fBchmod\fR(2)), \fIowner\fR specifies the user who will own the \fBolddir\fR directory, and \fIgroup\fR specifies the group the \fBolddir\fR directory will belong to (see the section \fBUSER AND GROUP \fR for details). This option can be disabled using the \fBnocreateolddir\fR option. .TP \fBnocreateolddir\fR \fBolddir\fR directory is not created by \fBlogrotate\fR when it does not exist. .TP \fBcopy\fR Make a copy of the log file, but don't change the original at all. This option can be used, for instance, to make a snapshot of the current log file, or when some other utility needs to truncate or parse the file. When this option is used, the \fBcreate\fR option will have no effect, as the old log file stays in place. The \fBcopy\fR option allows storing rotated log files on the different devices using \fBolddir\fR directive. .TP \fBnocopy\fR Do not copy the original log file and leave it in place. (this overrides the \fBcopy\fR option). .TP \fBcopytruncate\fR Truncate the original log file to zero size in place after creating a copy, instead of moving the old log file and optionally creating a new one. It can be used when some program cannot be told to close its logfile and thus might continue writing (appending) to the previous log file forever. Note that there is a very small time slice between copying the file and truncating it, so some logging data might be lost. When this option is used, the \fBcreate\fR option will have no effect, as the old log file stays in place. The \fBcopytruncate\fR option allows storing rotated log files on the different devices using \fBolddir\fR directive. The \fBcopytruncate\fR option implies \fBnorenamecopy\fR. .TP \fBnocopytruncate\fR Do not truncate the original log file in place after creating a copy (this overrides the \fBcopytruncate\fR option). .TP \fBrenamecopy\fR Log file is renamed to temporary filename in the same directory by adding ".tmp" extension to it. After that, \fBpostrotate\fR script is run and log file is copied from temporary filename to final filename. In the end, temporary filename is removed. The \fBrenamecopy\fR option allows storing rotated log files on the different devices using \fBolddir\fR directive. The \fBrenamecopy\fR option implies \fBnocopytruncate\fR. .TP \fBnorenamecopy\fR Do not rename and copy the original log file (this overrides the \fBrenamecopy\fR option). .TP \fBshred\fR Delete log files using \fBshred\fR \-u instead of unlink(). This should ensure that logs are not readable after their scheduled deletion; this is off by default. See also \fBnoshred\fR. .TP \fBnoshred\fR Do not use \fBshred\fR when deleting old log files. See also \fBshred\fR. .TP \fBshredcycles\fR \fIcount\fR Asks GNU \fBshred\fR(1) to overwrite log files \fBcount\fR times before deletion. Without this option, \fBshred\fR's default will be used. .TP \fBallowhardlink\fR Rotate files with multiple hard links; this is off by default. The target file might get emptied, e.g. with \fBshred\fR or \fBcopytruncate\fR. Use with caution, especially when the log files are rotated as root. .TP \fBnoallowhardlink\fR Do not rotate files with multiple hard links. See also \fBallowhardlink\fR. .SS Compression .TP \fBcompress\fR Old versions of log files are compressed with \fBgzip\fR(1) by default. See also \fBnocompress\fR. .TP \fBnocompress\fR Old versions of log files are not compressed. See also \fBcompress\fR. .TP \fBcompresscmd\fR Specifies which command to use to compress log files. The default is \fBgzip\fR(1). See also \fBcompress\fR. .TP \fBuncompresscmd\fR Specifies which command to use to uncompress log files. The default is \fBgunzip\fR(1). .TP \fBcompressext\fR Specifies which extension to use on compressed logfiles, if compression is enabled. The default follows that of the configured compression command. .TP \fBcompressoptions\fR Command line options may be passed to the compression program, if one is in use. The default, for \fBgzip\fR(1), is "\-6" (biased towards high compression at the expense of speed). If you use a different compression command, you may need to change the \fBcompressoptions\fR to match. .TP \fBdelaycompress\fR Postpone compression of the previous log file to the next rotation cycle. This only has effect when used in combination with \fBcompress\fR. It can be used when some program cannot be told to close its logfile and thus might continue writing to the previous log file for some time. .TP \fBnodelaycompress\fR Do not postpone compression of the previous log file to the next rotation cycle (this overrides the \fBdelaycompress\fR option). .SS Filenames .TP \fBextension \fIext\fR Log files with \fIext\fR extension can keep it after the rotation. If compression is used, the compression extension (normally \fI.gz\fR) appears after \fIext\fR. For example you have a logfile named mylog.foo and want to rotate it to mylog.1.foo.gz instead of mylog.foo.1.gz. .TP \fBaddextension \fIext\fR Log files are given the final extension \fIext\fR after rotation. If the original file already ends with \fIext\fR, the extension is not duplicated, but merely moved to the end, that is both \fBfilename\fR and \fBfilename\fIext\fR would get rotated to filename.1\fIext\fR. If compression is used, the compression extension (normally \fB.gz\fR) appears after \fIext\fR. .TP \fBstart \fIcount\fR This is the number to use as the base for rotation. For example, if you specify 0, the logs will be created with a .0 extension as they are rotated from the original log files. If you specify 9, log files will be created with a .9, skipping 0\(en8. Files will still be rotated the number of times specified with the \fBrotate\fR directive. .TP \fBdateext\fR Archive old versions of log files adding a date extension like YYYYMMDD instead of simply adding a number. The extension may be configured using the \fBdateformat\fR and \fBdateyesterday\fR options. .TP \fBnodateext\fR Do not archive old versions of log files with date extension (this overrides the \fBdateext\fR option). .TP \fBdateformat\fR \fIformat_string\fR Specify the extension for \fBdateext\fR using the notation similar to \fBstrftime\fR(3) function. Only %Y %m %d %H %M %S %V and %s specifiers are allowed. The default value is \-%Y%m%d except hourly, which uses \-%Y%m%d%H as default value. Note that also the character separating log name from the extension is part of the dateformat string. The system clock must be set past Sep 9th 2001 for %s to work correctly. Note that the datestamps generated by this format must be lexically sortable (that is first the year, then the month then the day. For example 2001/12/01 is ok, but 01/12/2001 is not, since 01/11/2002 would sort lower while it is later). This is because when using the \fBrotate\fR option, \fBlogrotate\fR sorts all rotated filenames to find out which logfiles are older and should be removed. .TP \fBdateyesterday\fR Use yesterday's instead of today's date to create the \fBdateext\fR extension, so that the rotated log file has a date in its name that is the same as the timestamps within it. .TP \fBdatehourago\fR Use hour ago instead of current date to create the \fBdateext\fR extension, so that the rotated log file has a hour in its name that is the same as the timestamps within it. Useful with rotate \fBhourly\fR. .SS Mail .TP \fBmail \fIaddress\fR When a log is rotated out of existence, it is mailed to \fIaddress\fR. If no mail should be generated by a particular log, the \fBnomail\fR directive may be used. .TP \fBnomail\fR Do not mail old log files to any address. .TP \fBmailfirst\fR When using the \fBmail\fR command, mail the just-rotated file, instead of the about-to-expire file. .TP \fBmaillast\fR When using the \fBmail\fR command, mail the about-to-expire file, instead of the just-rotated file (this is the default). .SS Additional config files .TP \fBinclude \fIfile_or_directory\fR Reads the file given as an argument as if it was included inline where the \fBinclude\fR directive appears. If a directory is given, most of the files in that directory are read in alphabetic order before processing of the including file continues. The only files which are ignored are files which are not regular files (such as directories and named pipes) and files whose names end with one of the taboo extensions or patterns, as specified by the \fBtabooext\fR or \fBtaboopat\fR directives, respectively. The given path may start with \fB~/\fR to make it relative to the home directory of the executing user. For security reasons configuration files must not be group-writable nor world-writable. .SS Scripts .TP \fBsharedscripts\fR Normally, \fBprerotate\fR and \fBpostrotate\fR scripts are run for each log which is rotated and the absolute path to the log file is passed as first argument to the script. That means a single script may be run multiple times for log file entries which match multiple files (such as the \fI/var/log/news/*\fR example). If \fBsharedscripts\fR is specified, the scripts are only run once, no matter how many logs match the wildcarded pattern, and whole pattern is passed to them. However, if none of the logs in the pattern require rotating, the scripts will not be run at all. If the scripts exit with error (or any log fails to rotate), the remaining actions will not be executed for any logs. This option overrides the \fBnosharedscripts\fR option. .TP \fBnosharedscripts\fR Run \fBprerotate\fR and \fBpostrotate\fR scripts for every log file which is rotated (this is the default, and overrides the \fBsharedscripts\fR option). The absolute path to the log file is passed as first argument to the script. The absolute path to the final rotated log file is passed as the second argument to the \fBpostrotate\fR script. If the scripts exit with error, the remaining actions will not be executed for the affected log only. .tq \fBfirstaction\fR .tq \ \ \ \ \fIscript\fR .tq \fBendscript\fR The \fIscript\fR is executed once before all log files that match the wildcarded pattern are rotated, before the prerotate script is run and only if at least one log will actually be rotated. These directives may only appear inside a log file definition. The whole pattern is passed to the script as its first argument. If the script exits with an error, no further processing is done. See also \fBlastaction\fR and the \fBSCRIPTS\fR section. .tq \fBlastaction\fR .tq \ \ \ \ \fIscript\fR .tq \fBendscript\fR The \fIscript\fR is executed once after all log files that match the wildcarded pattern are rotated, after the postrotate script is run and only if at least one log is rotated. These directives may only appear inside a log file definition. The whole pattern is passed to the script as its first argument. If the script exits with an error, just an error message is shown (as this is the last action). See also \fBfirstaction\fR and the \fBSCRIPTS\fR section. .tq \fBprerotate\fR .tq \ \ \ \ \fIscript\fR .tq \fBendscript\fR The \fIscript\fR is executed before the log file is rotated and only if the log will actually be rotated. These directives may only appear inside a log file definition. Normally, the absolute path to the log file is passed as the first argument to the script. If \fBsharedscripts\fR is specified, the whole pattern is passed to the script. See also \fBpostrotate\fR and the \fBSCRIPTS\fR section. See \fBsharedscripts\fR and \fBnosharedscripts\fR for error handling. .tq \fBpostrotate\fR .tq \ \ \ \ \fIscript\fR .tq \fBendscript\fR The \fIscript\fR is executed after the log file is rotated. These directives may only appear inside a log file definition. Normally, the absolute path to the log file is passed as the first argument to the script and the absolute path to the final rotated log file is passed as the second argument to the script. If \fBsharedscripts\fR is specified, the whole pattern is passed as the first argument to the script, and the second argument is omitted. See also \fBprerotate\fR and the \fBSCRIPTS\fR section. See \fBsharedscripts\fR and \fBnosharedscripts\fR for error handling. .tq \fBpreremove\fR .tq \ \ \ \ \fIscript\fR .tq \fBendscript\fR The \fIscript\fR is executed once just before removal of a log file. \fBlogrotate\fR will pass the name of file which is soon to be removed as the first argument to the script. See also \fBfirstaction\fR and the \fBSCRIPTS\fR section. .SH SCRIPTS The lines between the starting keyword (e.g. \fBprerotate\fR) and \fBendscript\fR (both of which must appear on lines by themselves) are executed (using \fB/bin/sh\fR). The script inherits some traits from the \fBlogrotate\fR process, including stderr, stdout, the current directory, the environment, and the umask. Scripts are run as the invoking user and group, irrespective of any \fBsu\fR directive. If the \fB\-\-log\fR flag was specified, file descriptor 3 is the log file. The current working directory is unspecified. .SH USER AND GROUP User and group identifiers are resolved first by trying the textual representation and, in case it fails, afterwards by the numeric value. .SH FILES .TS tab(:); l l l. \fI/var/lib/logrotate.status\fR:Default state file. \fI/etc/logrotate.conf\fR:Configuration options. .TE .SH "SEE ALSO" .BR chmod (2), .BR gunzip (1), .BR gzip (1), .BR mail (1), .BR shred (1), .BR strftime (3), .BR strtoul (3), .SH AUTHORS .nf Erik Troan, Preston Brown, Jan Kaluza. .fi logrotate-3.21.0/logrotate.conf.50000644000175000017500000000002513212000407013512 00000000000000.so man8/logrotate.8 logrotate-3.21.0/Makefile.in0000644000175000017500000011063414346133574012602 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ sbin_PROGRAMS = logrotate$(EXEEXT) subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ $(am__configure_deps) $(dist_noinst_DATA) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = logrotate.8 logrotate.spec CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man5dir)" \ "$(DESTDIR)$(man8dir)" PROGRAMS = $(sbin_PROGRAMS) am_logrotate_OBJECTS = config.$(OBJEXT) log.$(OBJEXT) \ logrotate.$(OBJEXT) logrotate_OBJECTS = $(am_logrotate_OBJECTS) logrotate_LDADD = $(LDADD) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/config.Po ./$(DEPDIR)/log.Po \ ./$(DEPDIR)/logrotate.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(logrotate_SOURCES) DIST_SOURCES = $(logrotate_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man5dir = $(mandir)/man5 man8dir = $(mandir)/man8 NROFF = nroff MANS = $(dist_man_MANS) DATA = $(dist_noinst_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir distdir-am dist dist-all distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \ config.h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(dist_man_MANS) $(srcdir)/Makefile.in \ $(srcdir)/config.h.in $(srcdir)/logrotate.8.in \ $(srcdir)/logrotate.spec.in COPYING ChangeLog.md INSTALL \ README.md compile config.guess config.sub depcomp install-sh \ missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.xz GZIP_ENV = --best DIST_TARGETS = dist-xz dist-gzip # Exists only to be overridden by the user if desired. AM_DISTCHECK_DVI_TARGET = dvi distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_CFLAGS = @AM_CFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPRESS_COMMAND = @COMPRESS_COMMAND@ COMPRESS_EXT = @COMPRESS_EXT@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_MAIL_COMMAND = @DEFAULT_MAIL_COMMAND@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ ROOT_UID = @ROOT_UID@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STATE_FILE_PATH = @STATE_FILE_PATH@ STRIP = @STRIP@ UNCOMPRESS_COMMAND = @UNCOMPRESS_COMMAND@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # # 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, version 2 of the License. # # 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. # AM_CPPFLAGS = -include config.h logrotate_SOURCES = config.c log.c logrotate.c \ log.h logrotate.h queue.h dist_man_MANS = logrotate.8 logrotate.conf.5 dist_noinst_DATA = logrotate.spec # taken from build-aux/git-version-gen EXTRA_DIST = ChangeLog.md README.md autogen.sh build-aux examples \ $(top_srcdir)/.version # the dot ensures that logrotate is built before it is tested SUBDIRS = . test BUILT_SOURCES = $(top_srcdir)/.version all: $(BUILT_SOURCES) config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: .SUFFIXES: .c .o .obj am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @test -f $@ || rm -f stamp-h1 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 logrotate.8: $(top_builddir)/config.status $(srcdir)/logrotate.8.in cd $(top_builddir) && $(SHELL) ./config.status $@ logrotate.spec: $(top_builddir)/config.status $(srcdir)/logrotate.spec.in cd $(top_builddir) && $(SHELL) ./config.status $@ install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(sbindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(sbindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \ } \ ; done uninstall-sbinPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(sbindir)" && rm -f $$files clean-sbinPROGRAMS: -test -z "$(sbin_PROGRAMS)" || rm -f $(sbin_PROGRAMS) installcheck-sbinPROGRAMS: $(sbin_PROGRAMS) bad=0; pid=$$$$; list="$(sbin_PROGRAMS)"; for p in $$list; do \ case ' $(AM_INSTALLCHECK_STD_OPTIONS_EXEMPT) ' in \ *" $$p "* | *" $(srcdir)/$$p "*) continue;; \ esac; \ f=`echo "$$p" | \ sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ for opt in --help --version; do \ if "$(DESTDIR)$(sbindir)/$$f" $$opt >c$${pid}_.out \ 2>c$${pid}_.err &2; bad=1; fi; \ done; \ done; rm -f c$${pid}_.???; exit $$bad logrotate$(EXEEXT): $(logrotate_OBJECTS) $(logrotate_DEPENDENCIES) $(EXTRA_logrotate_DEPENDENCIES) @rm -f logrotate$(EXEEXT) $(AM_V_CCLD)$(LINK) $(logrotate_OBJECTS) $(logrotate_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/config.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/log.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/logrotate.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` install-man5: $(dist_man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(dist_man_MANS)'; \ test -n "$(man5dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man5dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man5dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.5[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man5dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man5dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man5dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man5dir)" || exit $$?; }; \ done; } uninstall-man5: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man5dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.5[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man5dir)'; $(am__uninstall_files_from_dir) install-man8: $(dist_man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(dist_man_MANS)'; \ test -n "$(man8dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man8dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man8dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.8[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \ done; } uninstall-man8: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man8dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.8[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man8dir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-zstd: distdir tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ *.tar.zst*) \ zstd -dc $(distdir).tar.zst | $(am__untar) ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build/sub \ && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-recursive all-am: Makefile $(PROGRAMS) $(MANS) $(DATA) config.h installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man8dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-recursive install-exec: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-recursive clean-am: clean-generic clean-sbinPROGRAMS mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f ./$(DEPDIR)/config.Po -rm -f ./$(DEPDIR)/log.Po -rm -f ./$(DEPDIR)/logrotate.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-man install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-sbinPROGRAMS install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-man5 install-man8 install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: installcheck-sbinPROGRAMS maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f ./$(DEPDIR)/config.Po -rm -f ./$(DEPDIR)/log.Po -rm -f ./$(DEPDIR)/logrotate.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-man uninstall-sbinPROGRAMS uninstall-man: uninstall-man5 uninstall-man8 .MAKE: $(am__recursive_targets) all check install install-am \ install-exec install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--depfiles am--refresh check check-am clean clean-cscope \ clean-generic clean-sbinPROGRAMS cscope cscopelist-am ctags \ ctags-am dist dist-all dist-bzip2 dist-gzip dist-hook \ dist-lzip dist-shar dist-tarZ dist-xz dist-zip dist-zstd \ distcheck distclean distclean-compile distclean-generic \ distclean-hdr distclean-tags distcleancheck distdir \ distuninstallcheck dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-man5 install-man8 install-pdf install-pdf-am \ install-ps install-ps-am install-sbinPROGRAMS install-strip \ installcheck installcheck-am installcheck-sbinPROGRAMS \ installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-man uninstall-man5 uninstall-man8 \ uninstall-sbinPROGRAMS .PRECIOUS: Makefile # for compatibility with older releases of logrotate test: check .PHONY: srpm rpm rpm: srpm rpmbuild $(RPM_FLAGS) -ta $(distdir).tar.gz srpm: dist rpmbuild $(RPM_FLAGS) -ts $(distdir).tar.gz $(top_srcdir)/.version: echo $(VERSION) > $@-t && mv $@-t $@ dist-hook: echo $(VERSION) > $(distdir)/.tarball-version # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: logrotate-3.21.0/config.h.in0000644000175000017500000001511314346133574012554 00000000000000/* config.h.in. Generated from configure.ac by autoheader. */ /* default compress command */ #undef COMPRESS_COMMAND /* default compress extension */ #undef COMPRESS_EXT /* default mail command */ #undef DEFAULT_MAIL_COMMAND /* Define to 1 if you have the `asprintf' function. */ #undef HAVE_ASPRINTF /* Define to 1 if you have the `futimens' function. */ #undef HAVE_FUTIMENS /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `acl' library (-lacl). */ #undef HAVE_LIBACL /* Define to 1 if you have the header file. */ #undef HAVE_LIBGEN_H /* Define to 1 if you have the `popt' library (-lpopt). */ #undef HAVE_LIBPOPT /* Define to 1 if you have the `selinux' library (-lselinux). */ #undef HAVE_LIBSELINUX /* Define to 1 if you have the `madvise' function. */ #undef HAVE_MADVISE /* Define to 1 if you have the header file. */ #undef HAVE_MINIX_CONFIG_H /* Define to 1 if you have the `secure_getenv' function. */ #undef HAVE_SECURE_GETENV /* 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 /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strndup' function. */ #undef HAVE_STRNDUP /* Define to 1 if `st_atim' is a member of `struct stat'. */ #undef HAVE_STRUCT_STAT_ST_ATIM /* Define to 1 if `st_blksize' is a member of `struct stat'. */ #undef HAVE_STRUCT_STAT_ST_BLKSIZE /* Define to 1 if `st_blocks' is a member of `struct stat'. */ #undef HAVE_STRUCT_STAT_ST_BLOCKS /* Define to 1 if `st_mtim' is a member of `struct stat'. */ #undef HAVE_STRUCT_STAT_ST_MTIM /* Define to 1 if your `struct stat' has `st_blocks'. Deprecated, use `HAVE_STRUCT_STAT_ST_BLOCKS' instead. */ #undef HAVE_ST_BLOCKS /* 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_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the `utimensat' function. */ #undef HAVE_UTIMENSAT /* Define to 1 if you have the `vsyslog' function. */ #undef HAVE_VSYSLOG /* Define to 1 if you have the header file. */ #undef HAVE_WCHAR_H /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Root user-id. */ #undef ROOT_UID /* State file path. */ #undef STATEFILE /* Define to 1 if all of the C90 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 /* default uncompress command */ #undef UNCOMPRESS_COMMAND /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif /* Enable general extensions on macOS. */ #ifndef _DARWIN_C_SOURCE # undef _DARWIN_C_SOURCE #endif /* Enable general extensions on Solaris. */ #ifndef __EXTENSIONS__ # undef __EXTENSIONS__ #endif /* Enable GNU extensions on systems that have them. */ #ifndef _GNU_SOURCE # undef _GNU_SOURCE #endif /* Enable X/Open compliant socket functions that do not require linking with -lxnet on HP-UX 11.11. */ #ifndef _HPUX_ALT_XOPEN_SOCKET_API # undef _HPUX_ALT_XOPEN_SOCKET_API #endif /* Identify the host operating system as Minix. This macro does not affect the system headers' behavior. A future release of Autoconf may stop defining this macro. */ #ifndef _MINIX # undef _MINIX #endif /* Enable general extensions on NetBSD. Enable NetBSD compatibility extensions on Minix. */ #ifndef _NETBSD_SOURCE # undef _NETBSD_SOURCE #endif /* Enable OpenBSD compatibility extensions on NetBSD. Oddly enough, this does nothing on OpenBSD. */ #ifndef _OPENBSD_SOURCE # undef _OPENBSD_SOURCE #endif /* Define to 1 if needed for POSIX-compatible behavior. */ #ifndef _POSIX_SOURCE # undef _POSIX_SOURCE #endif /* Define to 2 if needed for POSIX-compatible behavior. */ #ifndef _POSIX_1_SOURCE # undef _POSIX_1_SOURCE #endif /* Enable POSIX-compatible threading on Solaris. */ #ifndef _POSIX_PTHREAD_SEMANTICS # undef _POSIX_PTHREAD_SEMANTICS #endif /* Enable extensions specified by ISO/IEC TS 18661-5:2014. */ #ifndef __STDC_WANT_IEC_60559_ATTRIBS_EXT__ # undef __STDC_WANT_IEC_60559_ATTRIBS_EXT__ #endif /* Enable extensions specified by ISO/IEC TS 18661-1:2014. */ #ifndef __STDC_WANT_IEC_60559_BFP_EXT__ # undef __STDC_WANT_IEC_60559_BFP_EXT__ #endif /* Enable extensions specified by ISO/IEC TS 18661-2:2015. */ #ifndef __STDC_WANT_IEC_60559_DFP_EXT__ # undef __STDC_WANT_IEC_60559_DFP_EXT__ #endif /* Enable extensions specified by ISO/IEC TS 18661-4:2015. */ #ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__ # undef __STDC_WANT_IEC_60559_FUNCS_EXT__ #endif /* Enable extensions specified by ISO/IEC TS 18661-3:2015. */ #ifndef __STDC_WANT_IEC_60559_TYPES_EXT__ # undef __STDC_WANT_IEC_60559_TYPES_EXT__ #endif /* Enable extensions specified by ISO/IEC TR 24731-2:2010. */ #ifndef __STDC_WANT_LIB_EXT2__ # undef __STDC_WANT_LIB_EXT2__ #endif /* Enable extensions specified by ISO/IEC 24747:2009. */ #ifndef __STDC_WANT_MATH_SPEC_FUNCS__ # undef __STDC_WANT_MATH_SPEC_FUNCS__ #endif /* Enable extensions on HP NonStop. */ #ifndef _TANDEM_SOURCE # undef _TANDEM_SOURCE #endif /* Enable X/Open extensions. Define to 500 only if necessary to make mbstate_t available. */ #ifndef _XOPEN_SOURCE # undef _XOPEN_SOURCE #endif /* Version number of package */ #undef VERSION /* Number of bits in a file offset, on hosts where this is settable. */ #undef _FILE_OFFSET_BITS /* Define for large files, on AIX-style hosts. */ #undef _LARGE_FILES /* Define for Solaris 2.5.1 so the uint32_t typedef from , , or is not used. If the typedef were allowed, the #define below would cause a syntax error. */ #undef _UINT32_T /* Define to the type of an unsigned integer type of width exactly 32 bits if such a type exists and the standard includes do not define it. */ #undef uint32_t logrotate-3.21.0/logrotate.8.in0000644000175000017500000007002714346133207013225 00000000000000.TH LOGROTATE 8 "@VERSION@" "Linux" "System Administrator's Manual" .\" Per groff_man(7), the TQ macro should be copied from an-ext.tmac when .\" not running under groff. That's not quite right; not all groff .\" installations include this macro. So bring it in with another name .\" unconditionally. .\" Continuation line for .TP header. .de tq . br . ns . TP \\$1\" no doublequotes around argument! .. .\} .SH NAME logrotate \(hy rotates, compresses, and mails system logs .SH SYNOPSIS \fBlogrotate\fR \fR[\fB\-\-force\fR] \fR[\fB\-\-debug\fR] \fR[\fB\-\-state\fR \fIfile\fR] \fR[\fB\-\-skip-state-lock\fR] \fR[\fB\-\-wait-for-state-lock\fR] \fR[\fB\-\-verbose\fR] \fR[\fB\-\-log\fR \fIfile\fR] \fR[\fB\-\-mail\fR \fIcommand\fR] \fIconfig_file\fR \fR[\fIconfig_file2 ...\fR] .SH DESCRIPTION \fBlogrotate\fR is designed to ease administration of systems that generate large numbers of log files. It allows automatic rotation, compression, removal, and mailing of log files. Each log file may be handled daily, weekly, monthly, or when it grows too large. .P Normally, \fBlogrotate\fR is run as a daily cron job. It will not modify a log more than once in one day unless the criterion for that log is based on the log's size and \fBlogrotate\fR is being run more than once each day, or unless the \fB\-f\fR or \fB\-\-force\fR option is used. .P Any number of config files may be given on the command line. Later config files may override the options given in earlier files, so the order in which the \fBlogrotate\fR config files are listed is important. Normally, a single config file which includes any other config files which are needed should be used. See below for more information on how to use the \fBinclude\fR directive to accomplish this. If a directory is given on the command line, every file in that directory is used as a config file. .P If no command line arguments are given, \fBlogrotate\fR will print version and copyright information, along with a short usage summary. If any errors occur while rotating logs, \fBlogrotate\fR will exit with non-zero status, although the state file will be updated. .SH OPTIONS .TP \fB\-f\fR, \fB\-\-force\fR Tells \fBlogrotate\fR to force the rotation, even if it doesn't think this is necessary. Sometimes this is useful after adding new entries to a \fBlogrotate\fR config file, or if old log files have been removed by hand, as the new files will be created, and logging will continue correctly. .TP \fB\-d\fR, \fB\-\-debug\fR Turn on debug mode, which means that no changes are made to the logs and the \fBlogrotate\fR state file is not updated. Only debug messages are printed. .TP \fB\-s\fR, \fB\-\-state\fR \fIstatefile\fR Tells \fBlogrotate\fR to use an alternate state file. This is useful if \fBlogrotate\fR is being run as a different user for various sets of log files. To prevent parallel execution \fBlogrotate\fR by default acquires a lock on the state file, if it cannot be acquired \fBlogrotate\fR will exit with value 3. The default state file is \fI@STATE_FILE_PATH@\fR. If \fI/dev/null\fR is given as the state file, then \fBlogrotate\fR will not try to lock or write the state file. .TP \fB\-\-skip-state-lock\fR Do not lock the state file, for example if locking is unsupported or prohibited. .TP \fB\-\-wait-for-state-lock\fR Wait until lock on the state file is released by another logrotate process. This option may cause logrotate to wait indefinitely. Use with caution. .TP \fB\-v\fR, \fB\-\-verbose\fR Turns on verbose mode, for example to display messages during rotation. .TP \fB\-l\fR, \fB\-\-log\fR \fIfile\fR Tells \fBlogrotate\fR to log verbose output into the log_file. The verbose output logged to that file is the same as when running \fBlogrotate\fR with \fB-v\fR switch. The log file is overwritten on every \fBlogrotate\fR execution. .TP \fB\-m\fR, \fB\-\-mail\fR \fIcommand\fR Tells \fBlogrotate\fR which command to use when mailing logs. This command should accept the following arguments: .IP 1) the subject of the message given with '-s subject' .br 2) the recipient. .IP The command must then read a message on standard input and mail it to the recipient. The default mail command is \fI@DEFAULT_MAIL_COMMAND@\fR. .TP \fB\-\-usage\fR Prints a short usage message. .TP \fB\-?\fR, \fB\-\-help\fR Prints help message. .TP \fB\-\-version\fR Display version information. .SH CONFIGURATION FILE \fBlogrotate\fR reads everything about the log files it should be handling from the series of configuration files specified on the command line. Each configuration file can set global options (local definitions override global ones, and later definitions override earlier ones) and specify logfiles to rotate. Global options do not affect preceding include directives. A simple configuration file looks like this: .nf .ta +8n # sample logrotate configuration file compress /var/log/messages { rotate 5 weekly postrotate /usr/bin/killall \-HUP syslogd endscript } "/var/log/httpd/access.log" /var/log/httpd/error.log { rotate 5 mail recipient@example.org size 100k sharedscripts postrotate /usr/bin/killall \-HUP httpd endscript } /var/log/news/* { monthly rotate 2 olddir /var/log/news/old missingok sharedscripts postrotate kill \-HUP $(cat /var/run/inn.pid) endscript nocompress } ~/log/*.log {} .fi .PP The first few lines set global options; in the example, logs are compressed after they are rotated. Note that comments may appear anywhere in the config file as long as the first non-whitespace character on the line is a \fB#\fR. Values are separated from directives by whitespace and/or an optional =. Numbers must be specified in a format understood by \fBstrtoul\fR(3). The next section of the config file defines how to handle the log file \fI/var/log/messages\fR. The log will go through five weekly rotations before being removed. After the log file has been rotated (but before the old version of the log has been compressed), the command \fI/usr/bin/killall \-HUP syslogd\fR will be executed. The next section defines the parameters for both \fI/var/log/httpd/access.log\fR and \fI/var/log/httpd/error.log\fR. Each is rotated whenever it grows over 100\ kilobytes in size, and the old logs files are mailed (uncompressed) to recipient@\:example.org after going through 5 rotations, rather than being removed. The \fBsharedscripts\fR means that the \fBpostrotate\fR script will only be run once (after the old logs have been compressed), not once for each log which is rotated. Note that log file names may be enclosed in quotes (and that quotes are required if the name contains spaces). Normal shell quoting rules apply, with \fB'\fR, \fB"\fR, and \fB\e\fR characters supported. The next section defines the parameters for all of the files in \fI/var/log/news\fR. Each file is rotated on a monthly basis. The last section uses tilde expansion to rotate log files in the home directory of the current user. This is only available, if your glob library supports tilde expansion. GNU glob does support this. Please use wildcards with caution. If you specify *, \fBlogrotate\fR will rotate all files, including previously rotated ones. A way around this is to use the \fBolddir\fR directive or a more exact wildcard (such as *.log). Please note, by default when using \fBsystemd\fR(1), the option \fIProtectSystem=full\fR is set in the \fIlogrotate.service\fR file. This prevents \fBlogrotate\fR from modifying logs in \fI/etc\fR and \fI/usr\fR. Here is more information on the directives which may be included in a \fBlogrotate\fR configuration file: .SH CONFIGURATION FILE DIRECTIVES These directives may be included in a \fBlogrotate\fR configuration file: .SS Rotation .TP \fBrotate \fIcount\fR Log files are rotated \fIcount\fR times before being removed or mailed to the address specified in a \fBmail\fR directive. If \fIcount\fR is 0, old versions are removed rather than rotated. If \fIcount\fR is \-1, old logs are not removed at all, except they are affected by \fBmaxage\fR (use with caution, may waste performance and disk space). Default is 0. .TP \fBolddir \fIdirectory\fR Logs are moved into \fIdirectory\fR for rotation. The \fIdirectory\fR must be on the same physical device as the log file being rotated, unless \fBcopy\fR, \fBcopytruncate\fR or \fBrenamecopy\fR option is used. The \fIdirectory\fR is assumed to be relative to the directory holding the log file unless an absolute path name is specified. When this option is used all old versions of the log end up in \fIdirectory\fR. This option may be overridden by the \fBnoolddir\fR option. .TP \fBnoolddir\fR Logs are rotated in the directory they normally reside in (this overrides the \fBolddir\fR option). .TP \fBsu \fIuser\fR \fIgroup\fR Rotate log files set under this user and group instead of using default user/group (usually root). \fIuser\fR specifies the user used for rotation and \fIgroup\fR specifies the group used for rotation (see the section \fBUSER AND GROUP\fR for details). If the user/group you specify here does not have sufficient privilege to make files with the ownership you've specified in a \fBcreate\fR directive, it will cause an error. If \fBlogrotate\fR runs with root privileges, it is recommended to use the \fBsu\fR directive to rotate files in directories that are directly or indirectly in control of non-privileged users. .SS Frequency .TP \fBhourly\fR Log files are rotated every hour. Note that usually \fBlogrotate\fR is configured to be run by cron daily (or by \fIlogrotate.timer\fR when using \fBsystemd\fR(1)). You have to change this configuration and run \fBlogrotate\fR hourly to be able to really rotate logs hourly. .TP \fBdaily\fR Log files are rotated every day. .TP \fBweekly\fR [\fIweekday\fR] Log files are rotated once each \fIweekday\fR, or if the date is advanced by at least 7 days since the last rotation (while ignoring the exact time). The \fIweekday\fR interpretation is following: 0 means Sunday, 1 means Monday, \&.\|.\|.\|\&, 6 means Saturday; the special value 7 means each 7 days, irrespectively of weekday. Defaults to 0 if the \fIweekday\fR argument is omitted. .TP \fBmonthly\fR Log files are rotated the first time \fBlogrotate\fR is run in a month (this is normally on the first day of the month). .TP \fByearly\fR Log files are rotated if the current year is not the same as the last rotation. .TP \fBsize \fIsize\fR Log files are rotated only if they grow bigger than \fIsize\fR bytes. If \fIsize\fR is followed by \fIk\fR, the size is assumed to be in kilobytes. If \fIM\fR is used, the size is in megabytes, and if \fIG\fR is used, the size is in gigabytes. So \fIsize 100\fR, \fIsize 100k\fR, \fIsize 100M\fR and \fIsize 100G\fR are all valid. This option is mutually exclusive with the time interval options, and it causes log files to be rotated without regard for the last rotation time, if specified after the time criteria (the last specified option takes the precedence). .SS File selection .TP \fBmissingok\fR If the log file is missing, go on to the next one without issuing an error message. See also \fBnomissingok\fR. .TP \fBnomissingok\fR If a log file does not exist, issue an error. This is the default. .TP \fBignoreduplicates\fR Ignore any following matches of a log file. .TP \fBifempty\fR Rotate the log file even if it is empty, overriding the \fBnotifempty\fR option (\fBifempty\fR is the default). .TP \fBnotifempty\fR Do not rotate the log if it is empty (this overrides the \fBifempty\fR option). .TP \fBminage\fR \fIcount\fR Do not rotate logs which are less than days old. .TP \fBmaxage\fR \fIcount\fR Remove rotated logs older than days. The age is only checked if the logfile is to be rotated. \fBrotate \-1\fR does not hinder removal. The files are mailed to the configured address if \fBmaillast\fR and \fBmail\fR are configured. .TP \fBminsize\fR \fIsize\fR Log files are rotated when they grow bigger than \fIsize\fR bytes, but not before the additionally specified time interval (\fBdaily\fR, \fBweekly\fR, \fBmonthly\fR, or \fByearly\fR). The related \fBsize\fR option is similar except that it is mutually exclusive with the time interval options, and it causes log files to be rotated without regard for the last rotation time, if specified after the time criteria (the last specified option takes the precedence). When \fBminsize\fR is used, both the size and timestamp of a log file are considered. .TP \fBmaxsize\fR \fIsize\fR Log files are rotated when they grow bigger than \fIsize\fR bytes even before the additionally specified time interval (\fBdaily\fR, \fBweekly\fR, \fBmonthly\fR, or \fByearly\fR). The related \fBsize\fR option is similar except that it is mutually exclusive with the time interval options, and it causes log files to be rotated without regard for the last rotation time, if specified after the time criteria (the last specified option takes the precedence). When \fBmaxsize\fR is used, both the size and timestamp of a log file are considered. .TP \fBtabooext\fR [+] \fIlist\fR The current taboo extension list is changed (see the \fBinclude\fR directive for information on the taboo extensions). If a + precedes the list of extensions, the current taboo extension list is augmented, otherwise it is replaced. At startup, the taboo extension list .IR ,v , .IR .cfsaved , .IR .disabled , .IR .dpkg\-bak , .IR .dpkg\-del , .IR .dpkg\-dist , .IR .dpkg\-new , .IR .dpkg\-old , .IR .rhn\-cfg\-tmp\-* , .IR .rpmnew , .IR .rpmorig , .IR .rpmsave , .IR .swp , .IR .ucf\-dist , .IR .ucf\-new , .IR .ucf\-old , .I ~ .TP \fBtaboopat\fR [+] \fIlist\fR The current taboo glob pattern list is changed (see the \fBinclude\fR directive for information on the taboo extensions and patterns). If a + precedes the list of patterns, the current taboo pattern list is augmented, otherwise it is replaced. At startup, the taboo pattern list is empty. .SS Files and Folders .TP \fBcreate \fImode\fR \fIowner\fR \fIgroup\fR, \fBcreate \fIowner\fR \fIgroup\fR Immediately after rotation (before the \fBpostrotate\fR script is run) the log file is created (with the same name as the log file just rotated). \fImode\fR specifies the mode for the log file in octal (the same as \fBchmod\fR(2)), \fIowner\fR specifies the user who will own the log file, and \fIgroup\fR specifies the group the log file will belong to (see the section \fBUSER AND GROUP\fR for details). Any of the log file attributes may be omitted, in which case those attributes for the new file will use the same values as the original log file for the omitted attributes. This option can be disabled using the \fBnocreate\fR option. .TP \fBnocreate\fR New log files are not created (this overrides the \fBcreate\fR option). .TP \fBcreateolddir \fImode\fR \fIowner\fR \fIgroup\fR If the directory specified by \fBolddir\fR directive does not exist, it is created. \fImode\fR specifies the mode for the \fBolddir\fR directory in octal (the same as \fBchmod\fR(2)), \fIowner\fR specifies the user who will own the \fBolddir\fR directory, and \fIgroup\fR specifies the group the \fBolddir\fR directory will belong to (see the section \fBUSER AND GROUP \fR for details). This option can be disabled using the \fBnocreateolddir\fR option. .TP \fBnocreateolddir\fR \fBolddir\fR directory is not created by \fBlogrotate\fR when it does not exist. .TP \fBcopy\fR Make a copy of the log file, but don't change the original at all. This option can be used, for instance, to make a snapshot of the current log file, or when some other utility needs to truncate or parse the file. When this option is used, the \fBcreate\fR option will have no effect, as the old log file stays in place. The \fBcopy\fR option allows storing rotated log files on the different devices using \fBolddir\fR directive. .TP \fBnocopy\fR Do not copy the original log file and leave it in place. (this overrides the \fBcopy\fR option). .TP \fBcopytruncate\fR Truncate the original log file to zero size in place after creating a copy, instead of moving the old log file and optionally creating a new one. It can be used when some program cannot be told to close its logfile and thus might continue writing (appending) to the previous log file forever. Note that there is a very small time slice between copying the file and truncating it, so some logging data might be lost. When this option is used, the \fBcreate\fR option will have no effect, as the old log file stays in place. The \fBcopytruncate\fR option allows storing rotated log files on the different devices using \fBolddir\fR directive. The \fBcopytruncate\fR option implies \fBnorenamecopy\fR. .TP \fBnocopytruncate\fR Do not truncate the original log file in place after creating a copy (this overrides the \fBcopytruncate\fR option). .TP \fBrenamecopy\fR Log file is renamed to temporary filename in the same directory by adding ".tmp" extension to it. After that, \fBpostrotate\fR script is run and log file is copied from temporary filename to final filename. In the end, temporary filename is removed. The \fBrenamecopy\fR option allows storing rotated log files on the different devices using \fBolddir\fR directive. The \fBrenamecopy\fR option implies \fBnocopytruncate\fR. .TP \fBnorenamecopy\fR Do not rename and copy the original log file (this overrides the \fBrenamecopy\fR option). .TP \fBshred\fR Delete log files using \fBshred\fR \-u instead of unlink(). This should ensure that logs are not readable after their scheduled deletion; this is off by default. See also \fBnoshred\fR. .TP \fBnoshred\fR Do not use \fBshred\fR when deleting old log files. See also \fBshred\fR. .TP \fBshredcycles\fR \fIcount\fR Asks GNU \fBshred\fR(1) to overwrite log files \fBcount\fR times before deletion. Without this option, \fBshred\fR's default will be used. .TP \fBallowhardlink\fR Rotate files with multiple hard links; this is off by default. The target file might get emptied, e.g. with \fBshred\fR or \fBcopytruncate\fR. Use with caution, especially when the log files are rotated as root. .TP \fBnoallowhardlink\fR Do not rotate files with multiple hard links. See also \fBallowhardlink\fR. .SS Compression .TP \fBcompress\fR Old versions of log files are compressed with \fBgzip\fR(1) by default. See also \fBnocompress\fR. .TP \fBnocompress\fR Old versions of log files are not compressed. See also \fBcompress\fR. .TP \fBcompresscmd\fR Specifies which command to use to compress log files. The default is \fBgzip\fR(1). See also \fBcompress\fR. .TP \fBuncompresscmd\fR Specifies which command to use to uncompress log files. The default is \fBgunzip\fR(1). .TP \fBcompressext\fR Specifies which extension to use on compressed logfiles, if compression is enabled. The default follows that of the configured compression command. .TP \fBcompressoptions\fR Command line options may be passed to the compression program, if one is in use. The default, for \fBgzip\fR(1), is "\-6" (biased towards high compression at the expense of speed). If you use a different compression command, you may need to change the \fBcompressoptions\fR to match. .TP \fBdelaycompress\fR Postpone compression of the previous log file to the next rotation cycle. This only has effect when used in combination with \fBcompress\fR. It can be used when some program cannot be told to close its logfile and thus might continue writing to the previous log file for some time. .TP \fBnodelaycompress\fR Do not postpone compression of the previous log file to the next rotation cycle (this overrides the \fBdelaycompress\fR option). .SS Filenames .TP \fBextension \fIext\fR Log files with \fIext\fR extension can keep it after the rotation. If compression is used, the compression extension (normally \fI.gz\fR) appears after \fIext\fR. For example you have a logfile named mylog.foo and want to rotate it to mylog.1.foo.gz instead of mylog.foo.1.gz. .TP \fBaddextension \fIext\fR Log files are given the final extension \fIext\fR after rotation. If the original file already ends with \fIext\fR, the extension is not duplicated, but merely moved to the end, that is both \fBfilename\fR and \fBfilename\fIext\fR would get rotated to filename.1\fIext\fR. If compression is used, the compression extension (normally \fB.gz\fR) appears after \fIext\fR. .TP \fBstart \fIcount\fR This is the number to use as the base for rotation. For example, if you specify 0, the logs will be created with a .0 extension as they are rotated from the original log files. If you specify 9, log files will be created with a .9, skipping 0\(en8. Files will still be rotated the number of times specified with the \fBrotate\fR directive. .TP \fBdateext\fR Archive old versions of log files adding a date extension like YYYYMMDD instead of simply adding a number. The extension may be configured using the \fBdateformat\fR and \fBdateyesterday\fR options. .TP \fBnodateext\fR Do not archive old versions of log files with date extension (this overrides the \fBdateext\fR option). .TP \fBdateformat\fR \fIformat_string\fR Specify the extension for \fBdateext\fR using the notation similar to \fBstrftime\fR(3) function. Only %Y %m %d %H %M %S %V and %s specifiers are allowed. The default value is \-%Y%m%d except hourly, which uses \-%Y%m%d%H as default value. Note that also the character separating log name from the extension is part of the dateformat string. The system clock must be set past Sep 9th 2001 for %s to work correctly. Note that the datestamps generated by this format must be lexically sortable (that is first the year, then the month then the day. For example 2001/12/01 is ok, but 01/12/2001 is not, since 01/11/2002 would sort lower while it is later). This is because when using the \fBrotate\fR option, \fBlogrotate\fR sorts all rotated filenames to find out which logfiles are older and should be removed. .TP \fBdateyesterday\fR Use yesterday's instead of today's date to create the \fBdateext\fR extension, so that the rotated log file has a date in its name that is the same as the timestamps within it. .TP \fBdatehourago\fR Use hour ago instead of current date to create the \fBdateext\fR extension, so that the rotated log file has a hour in its name that is the same as the timestamps within it. Useful with rotate \fBhourly\fR. .SS Mail .TP \fBmail \fIaddress\fR When a log is rotated out of existence, it is mailed to \fIaddress\fR. If no mail should be generated by a particular log, the \fBnomail\fR directive may be used. .TP \fBnomail\fR Do not mail old log files to any address. .TP \fBmailfirst\fR When using the \fBmail\fR command, mail the just-rotated file, instead of the about-to-expire file. .TP \fBmaillast\fR When using the \fBmail\fR command, mail the about-to-expire file, instead of the just-rotated file (this is the default). .SS Additional config files .TP \fBinclude \fIfile_or_directory\fR Reads the file given as an argument as if it was included inline where the \fBinclude\fR directive appears. If a directory is given, most of the files in that directory are read in alphabetic order before processing of the including file continues. The only files which are ignored are files which are not regular files (such as directories and named pipes) and files whose names end with one of the taboo extensions or patterns, as specified by the \fBtabooext\fR or \fBtaboopat\fR directives, respectively. The given path may start with \fB~/\fR to make it relative to the home directory of the executing user. For security reasons configuration files must not be group-writable nor world-writable. .SS Scripts .TP \fBsharedscripts\fR Normally, \fBprerotate\fR and \fBpostrotate\fR scripts are run for each log which is rotated and the absolute path to the log file is passed as first argument to the script. That means a single script may be run multiple times for log file entries which match multiple files (such as the \fI/var/log/news/*\fR example). If \fBsharedscripts\fR is specified, the scripts are only run once, no matter how many logs match the wildcarded pattern, and whole pattern is passed to them. However, if none of the logs in the pattern require rotating, the scripts will not be run at all. If the scripts exit with error (or any log fails to rotate), the remaining actions will not be executed for any logs. This option overrides the \fBnosharedscripts\fR option. .TP \fBnosharedscripts\fR Run \fBprerotate\fR and \fBpostrotate\fR scripts for every log file which is rotated (this is the default, and overrides the \fBsharedscripts\fR option). The absolute path to the log file is passed as first argument to the script. The absolute path to the final rotated log file is passed as the second argument to the \fBpostrotate\fR script. If the scripts exit with error, the remaining actions will not be executed for the affected log only. .tq \fBfirstaction\fR .tq \ \ \ \ \fIscript\fR .tq \fBendscript\fR The \fIscript\fR is executed once before all log files that match the wildcarded pattern are rotated, before the prerotate script is run and only if at least one log will actually be rotated. These directives may only appear inside a log file definition. The whole pattern is passed to the script as its first argument. If the script exits with an error, no further processing is done. See also \fBlastaction\fR and the \fBSCRIPTS\fR section. .tq \fBlastaction\fR .tq \ \ \ \ \fIscript\fR .tq \fBendscript\fR The \fIscript\fR is executed once after all log files that match the wildcarded pattern are rotated, after the postrotate script is run and only if at least one log is rotated. These directives may only appear inside a log file definition. The whole pattern is passed to the script as its first argument. If the script exits with an error, just an error message is shown (as this is the last action). See also \fBfirstaction\fR and the \fBSCRIPTS\fR section. .tq \fBprerotate\fR .tq \ \ \ \ \fIscript\fR .tq \fBendscript\fR The \fIscript\fR is executed before the log file is rotated and only if the log will actually be rotated. These directives may only appear inside a log file definition. Normally, the absolute path to the log file is passed as the first argument to the script. If \fBsharedscripts\fR is specified, the whole pattern is passed to the script. See also \fBpostrotate\fR and the \fBSCRIPTS\fR section. See \fBsharedscripts\fR and \fBnosharedscripts\fR for error handling. .tq \fBpostrotate\fR .tq \ \ \ \ \fIscript\fR .tq \fBendscript\fR The \fIscript\fR is executed after the log file is rotated. These directives may only appear inside a log file definition. Normally, the absolute path to the log file is passed as the first argument to the script and the absolute path to the final rotated log file is passed as the second argument to the script. If \fBsharedscripts\fR is specified, the whole pattern is passed as the first argument to the script, and the second argument is omitted. See also \fBprerotate\fR and the \fBSCRIPTS\fR section. See \fBsharedscripts\fR and \fBnosharedscripts\fR for error handling. .tq \fBpreremove\fR .tq \ \ \ \ \fIscript\fR .tq \fBendscript\fR The \fIscript\fR is executed once just before removal of a log file. \fBlogrotate\fR will pass the name of file which is soon to be removed as the first argument to the script. See also \fBfirstaction\fR and the \fBSCRIPTS\fR section. .SH SCRIPTS The lines between the starting keyword (e.g. \fBprerotate\fR) and \fBendscript\fR (both of which must appear on lines by themselves) are executed (using \fB/bin/sh\fR). The script inherits some traits from the \fBlogrotate\fR process, including stderr, stdout, the current directory, the environment, and the umask. Scripts are run as the invoking user and group, irrespective of any \fBsu\fR directive. If the \fB\-\-log\fR flag was specified, file descriptor 3 is the log file. The current working directory is unspecified. .SH USER AND GROUP User and group identifiers are resolved first by trying the textual representation and, in case it fails, afterwards by the numeric value. .SH FILES .TS tab(:); l l l. \fI@STATE_FILE_PATH@\fR:Default state file. \fI/etc/logrotate.conf\fR:Configuration options. .TE .SH "SEE ALSO" .BR chmod (2), .BR gunzip (1), .BR gzip (1), .BR mail (1), .BR shred (1), .BR strftime (3), .BR strtoul (3), .SH AUTHORS .nf Erik Troan, Preston Brown, Jan Kaluza. .fi logrotate-3.21.0/logrotate.spec.in0000644000175000017500000000414214243352606014005 00000000000000Summary: Rotates, compresses, removes and mails system log files Name: logrotate Version: @VERSION@ Release: 1%{?dist} License: GPLv2+ Group: System Environment/Base Source: https://github.com/logrotate/logrotate/releases/download/%{version}/logrotate-%{version}.tar.gz Requires: coreutils >= 5.92 libsepol libselinux popt BuildRequires: libselinux-devel popt-devel BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) %{!?_licensedir:%global license %%doc} %description The logrotate utility is designed to simplify the administration of log files on a system which generates a lot of log files. Logrotate allows for the automatic rotation compression, removal and mailing of log files. Logrotate can be set to handle a log file daily, weekly, monthly or when the log file gets to a certain size. Normally, logrotate runs as a daily cron job. Install the logrotate package if you need a utility to deal with the log files on your system. %prep %setup -q %build %configure \ --with-selinux make %{?_smp_mflags} RPM_OPT_FLAGS="$RPM_OPT_FLAGS" %install rm -rf $RPM_BUILD_ROOT make install DESTDIR=$RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/cron.daily mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/lib install -p -m 644 examples/logrotate.conf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.conf install -p -m 644 examples/btmp $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/btmp install -p -m 644 examples/wtmp $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/wtmp install -p -m 755 examples/logrotate.cron $RPM_BUILD_ROOT%{_sysconfdir}/cron.daily/logrotate %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) %license COPYING %attr(0755, root, root) %{_sbindir}/logrotate %attr(0644, root, root) %{_mandir}/man8/logrotate.8* %attr(0644, root, root) %{_mandir}/man5/logrotate.conf.5* %attr(0755, root, root) %{_sysconfdir}/cron.daily/logrotate %attr(0644, root, root) %config(noreplace) %{_sysconfdir}/logrotate.conf %attr(0755, root, root) %{_sysconfdir}/logrotate.d %ghost %attr(0640, root, root) %verify(not size md5 mtime) %{_localstatedir}/lib/logrotate.status logrotate-3.21.0/COPYING0000644000175000017500000004325413551062667011574 00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 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 of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. logrotate-3.21.0/ChangeLog.md0000644000175000017500000006714114346133207012703 00000000000000# logrotate change log All notable changes to this project will be documented in this file. ## [UNRELEASED] [UNRELEASED]: https://github.com/logrotate/logrotate/compare/3.21.0...master ## [3.21.0] - 2022-12-13 - add `ignoreduplicates` directive to allow duplicate file matches (#473) - add `--wait-for-state-lock` option to wait for lock on the state file (#457) - avoid failure when an anonymous non-privileged user runs logrotate (#463) - support home dir expansion in `olddir` (#454) - reduce unnecessary rename operations with `start N` where `N > 1` (#450) - unify handling of log levels (#239 #449) - do not print `error:` when exit code is unaffected (#448) [3.21.0]: https://github.com/logrotate/logrotate/compare/3.20.1...3.21.0 ## [3.20.1] - 2022-05-25 - drop world-readable permission on state file even when ACLs are enabled (#446) [3.20.1]: https://github.com/logrotate/logrotate/compare/3.20.0...3.20.1 ## [3.20.0] - 2022-05-25 - fix potential DoS from unprivileged users via the state file ([CVE-2022-1348]) - fix a misleading debug message with `copytruncate` and `rotate 0` (#443) - add support for unsigned `time_t` (#438) - do not lock state file `/dev/null` (#433) [CVE-2022-1348]: https://bugzilla.redhat.com/CVE-2022-1348 [3.20.0]: https://github.com/logrotate/logrotate/compare/3.19.0...3.20.0 ## [3.19.0] - 2022-01-07 - continue on `EINTR` in `compressLogFile()` (#430) - enforce stricter parsing of configuration files (#427, #431) - avoid confusing error message in debug mode (#426) - fix `full_write()` on incomplete write (#415) - do not use `alloca()` any more (#412) - do not rotate hard links unless `allowhardlink` is used (#407) - change directory after dropping privileges (#397) - add defence in depth when dropping privileges (#400) - remove invalid configuration on error (#408) - do not open symbolic link log files by accident (#399) - do not write state if state file is `/dev/null` (#395) [3.19.0]: https://github.com/logrotate/logrotate/compare/3.18.1...3.19.0 ## [3.18.1] - 2021-05-21 - fix memory leaks on error-handling paths (#383, #387) - make `renamecopy` and `copytruncate` override each other (#386) - improve error handling in the parser of configuration files (#383) - improve user experience for non-privileged users of logrotate (#372) [3.18.1]: https://github.com/logrotate/logrotate/compare/3.18.0...3.18.1 ## [3.18.0] - 2021-01-08 - allow UIDs and GIDs to be specified numerically (#217) - add support for Zstandard compressed files (#355) - make `delaycompress` not to fail with `rotate 0` (#341) [3.18.0]: https://github.com/logrotate/logrotate/compare/3.17.0...3.18.0 ## [3.17.0] - 2020-07-10 - lock state file to prevent parallel execution of logrotate (#295, #297) - add `.bak` extension to default taboo list (#332) - allow to pass a home-relative path to `include` (#322, #326) - `switch_user_permanently`: skip switchback check if switched to root (#319) - logrotate.service: enable `ProtectClock` to restrict setting of clock (#306) - delete old logs hit by `maxage` regardless of `dateext` (#301) [3.17.0]: https://github.com/logrotate/logrotate/compare/3.16.0...3.17.0 ## [3.16.0] - 2020-02-28 - fix compilation with gcc-10, which defaults to `-fno-common` (#288) - reduce number of `open()` operations on state file (#282) - validate user/group given to the `su` directive early (#276) - add hardening options to systemd unit file in examples (#274, #291) - fix crash of logrotate on invalid configuration with include (#271) - fix heap buffer overflow on too long logfile extension (#270) [3.16.0]: https://github.com/logrotate/logrotate/compare/3.15.1...3.16.0 ## [3.15.1] - 2019-08-30 - use correct `create` mode in examples/btmp (#257) - fix several bugs found by fuzzing (#254) - do not abort globbing on a broken symlink (#251) - rearrange `logrotate.8` man page to improve readability (#248) - encourage admins to use the `su` directive in `logrotate.8` man page (#236) [3.15.1]: https://github.com/logrotate/logrotate/compare/3.15.0...3.15.1 ## [3.15.0] - 2018-12-04 - timer unit: change trigger fuzz from 12h to 1h (#230) - service unit: only run if `/var/log` is mounted (#230) - preserve fractional part of timestamps when compressing (#226) - re-indent source code using spaces only (#188) - minage: avoid rounding issue while comparing the amount of seconds (#36) - never remove old log files if `rotate -1` is specified (#202) - return non-zero exit status if a config file contains an error (#199) - make `copytruncate` work with `rotate 0` (#191) - warn user if both size and the time interval options are used (#192) - pass rotated log file name as the 2nd argument of the `postrotate` script when sharedscript is not enabled (#193) - rename `logrotate-default` to `logrotate.conf` (#187) [3.15.0]: https://github.com/logrotate/logrotate/compare/3.14.0...3.15.0 ## [3.14.0] - 2018-03-09 - make `configure` show support status for SELinux and ACL at the end (#179) - make logrotate build again on FreeBSD (#178) - move `wtmp` and `btmp` definitions from `logrotate.conf` to separate configuration files in `logrotate.d` (#168) - print a warning about logrotate doing nothing when `-d` is used (#165) - do not reject executable config files (#166) - add hardening options to `logrotate.service` in examples (#143) - fix spurious compressor failure when using `su` and `compress` (#169) - keep logrotate version in .tarball-version in release tarballs (#156) - introduce the `hourago` configuration directive (#159) - ignore empty patterns in `tabooext` to avoid exclusion of everything (#160) - properly report skipped test cases instead of pretending success [3.14.0]: https://github.com/logrotate/logrotate/compare/3.13.0...3.14.0 ## [3.13.0] - 2017-10-13 - make distribution tarballs report logrotate version properly [RHBZ#1500264](https://bugzilla.redhat.com/1500264) - make `(un)compress work` even if stdin and/or stdout are closed (#154) - remove `-s` from `DEFAULT_MAIL_COMMAND` and improve its documentation (#152) - uncompress logs before mailing them even if `delaycompress` is enabled (#151) - handle unlink of a non-existing log file as a warning only (#144) - include compile-time options in the output of `logrotate --version` (#145) - make `logrotate --version` print to stdout instead of stderr (#145) - flush write buffers before syncing state file (#148) - specify (un)compress utility explicitly in tests (#137) - enable running tests in parallel (#132) - explicitly map root UID/GID to 0 on Cygwin (#133) - add `.dpkg-bak` and `.dpkg-del` to default tabooext list (#134) [3.13.0]: https://github.com/logrotate/logrotate/compare/3.12.3...3.13.0 ## [3.12.3] - 2017-06-30 - `copy` and `copytruncate` directives now work together again - `unlink()` is no longer preceded by `open()` unless shred is enabled (#124) - `compress` and `uncompress` now take commands from `$PATH`, too (#122) [3.12.3]: https://github.com/logrotate/logrotate/compare/3.12.2...3.12.3 ## [3.12.2] - 2017-05-02 - build fixes related to `-Werror` (#119) and `-Werror=format=` (#108) - `configure --enable-werror` now controls use of the -Werror flag (#123) [3.12.2]: https://github.com/logrotate/logrotate/compare/3.12.1...3.12.2 ## [3.12.1] - 2017-04-21 - Included forgotten `build-aux` directory in release tarballs. [3.12.1]: https://github.com/logrotate/logrotate/compare/3.12.0...3.12.1 ## [3.12.0] - 2017-04-21 - Fixed accident removal of rotated files with dateext. (#118) - Line comments inside globs in config files are now skipped. (#109) - logrotate now recovers from a corrupted state file. (#45) - `Makefile.legacy` has been removed. (#103) - `config.h` is now generated by autotools. (#102 and #103) - `createolddir` now creates old directory as unprivileged user. (#114) - `weekly` rotations are now predictable and configurable. (#93) - Errors in config files are no longer treated as fatal errors. (#81) - `configure --with-default-mail-command` specifies default mail command. (#100) - Fixed heap buffer overflow when parsing crafted config file. (#33) [3.12.0]: https://github.com/logrotate/logrotate/compare/3.11.0...3.12.0 ## [3.11.0] - 2016-12-02 - Add 'taboopat' configuration directive to exclude configuration files based on globing patterns. - Allow to change default state path at build time (via the --with-state-file-path option of the configure script). - Automatically determine resulting file suffix based on the compression program in use. - Preserve SELinux context with 'compress' and 'sharedscripts' properly. - Rename already existing output files to avoid collisions. - Import systemd service and timer for logrotate from openSUSE. - Introduce the 'addextension' configuration directive. - Create 'CONTRIBUTING.md' with instructions for logrotate contributors. - Maintain ChangeLog.md instead of the legacy CHANGES file. - Make 'createolddir' configuration directive preserve sticky bit. - Add 'minage' configuration directive to specify minimum file age to rotate. - Avoid using local implementation of strndup() and asprintf() if these functions are available at build time. - Fix parsing of 'su' directive to accept usernames starting with numeric symbols. - Make sure that 64-bit file offsets are used on 32-bit systems. [3.11.0]: https://github.com/logrotate/logrotate/compare/3.10.0...3.11.0 ## [3.10.0] - 2016-08-03 - Legacy Makefile renamed to Makefile.legacy, will be removed eventually. - Fix 'make dist' and 'make distcheck' to produce a usable release tarball. - Fix 'olddir' usage with wildcard in the middle of path in the pattern definition when the pattern did not match any log file. - Remove half-rotated files when rotation of particular log file is skipped because of an error during copy or compression. [3.10.0]: https://github.com/logrotate/logrotate/compare/3.9.2...3.10.0 ## [3.9.2] - 2016-01-20 - Upstream moved to GitHub: . - Add support for %M, %S and %V in "dateext" directive. - Fix bad filename in subject of email when "compress" and "maillast" is used. - Allow rotating files created before 1996. - Fix compilation errors on NetBSD caused by "array subscript has type 'char' in config.c" - Fix matching subdirectories on BSD systems for patterns like "*/log" in situation where logrotate tried to match "foo/log" even when "foo" has not been a directory. - Fix logging dates in debug messages. - Remove state file entries for logs which do not exist and have not been rotated for more than a year. - Fix poor performance with big state file. - Support logging to syslog by using '-l syslog'. - Allow running test-suite using dash. [3.9.2]: https://github.com/logrotate/logrotate/compare/r3-9-1...3.9.2 ## [3.9.1] - 2015-04-03 - Fix off-by-one error which can lead to crash when copytruncate is used. [3.9.1]: https://github.com/logrotate/logrotate/compare/r3-9-0...r3-9-1 ## [3.9.0] - 2015-04-03 - Fix crash when using long dateformat. [nmerdan] - Add support for %H dateformat. [czchen] - Fix regression introduced in 3.8.9 when when rotating multiple logs when one of them is missing. - In the debug mode, do not skip the code-path which handles the case when the last rotation does not exist. [Sergey Vidishev] - Show more precise description when "log does not need rotating". - Add new -l option to log verbose output to file. The file is overwritten on every logrotate execution. - Allow rotation of sparse files with copytruncate. [3.9.0]: https://github.com/logrotate/logrotate/compare/r3-8-9...r3-9-0 ## [3.8.9] - 2015-02-13 - Add new directive "createolddir" and "nocreateolddir". These directives can be used to create the directory specified by olddir with particular "mode", "owner" and "group". - Continue with rotation even when first log from logset is removed during the rotation. - Fix crash on BSD systems introduced in 3.8.8 caused by different qsort_r function. Function qsort is now used instead. - Fix potential buffer overflow in usage of strncat function. - Fix compilation with musl-libc. - Add experimental 'renamecopy' directive to allow 'olddir' on different physical device. See the "man logrotate" for more information. [3.8.9]: https://github.com/logrotate/logrotate/compare/r3-8-8...r3-8-9 ## [3.8.8] - 2014-10-16 - Add support for building using autotools/automake. Using "./autogen.sh", "./configure" and "make" is now preferred way how to build logrotate. Old Makefile remains available, but it is deprecated and will be removed in the future. Please report any problem related to new build system. - Add support for systems which do not support fork (use vfork instead) and madvise. - Fix bug when wrong log file has been removed in case of dateext and dateformat %d-%m-%Y. - Do not expect that the name of root account is 'root'. - Do not stop rotation with an error when olddir and log file are on different devices and copy or copytruncate is used. - Return an error code when parent directory of log does not exist, "su" directive is not used, logrotate is running as root and missingok is not specified. [vcizek] - Prepend error printed by compression program with the log name even when the compression program exits with zero exit code. [3.8.8]: https://github.com/logrotate/logrotate/compare/r3-8-7...r3-8-8 ## [3.8.7] - 2013-10-10 - Fixed --force/-f option handling together with "size" directive (3.8.5 regression). - Use "logrotate_tmp_t" context for SELinux tests and if this context does not exist, skip SELinux related tests. [3.8.7]: https://github.com/logrotate/logrotate/compare/r3-8-6...r3-8-7 ## [3.8.6] - 2013-07-31 - Fixed memory corruption caused by rotation directory which does not exist with "sharedscripts" together with "prerotate" script. [3.8.6]: https://github.com/logrotate/logrotate/compare/r3-8-5...r3-8-6 ## [3.8.5] - 2013-06-10 - Improved rotation during daylight saving time and between timezone changes. - Fixed ACL setting problem caused by ext3 erroneously reporting ENOSYS instead of ENOSUP. - Do not continue with rotation if state file is corrupted. - Make logrotate.status creation atomic. - Allow "hourly" rotation. See manpage for more information. - Use "/bin/echo" in tests. Fixes tests execution in Dash. - Do no try to parse config files bigger than 16MB. - Improved manpage consistency and formatting. - Fix race condition between acl_set_fd() and fchmod(). [3.8.5]: https://github.com/logrotate/logrotate/compare/r3-8-4...r3-8-5 ## [3.8.4] - 2013-04-30 - Added --version command line option - Disable ACL tests if logrotate is not compiled WITH_ACL support or if ACLs are not supported by the system running tests - Disable SELinux tests if logrotate is not compiled WITH_SELINUX support or if SELinux is not supported by the system running tests - Fixed bug which prevented skipping particular log file config if the config contained errors. - Fixed skipping of configs containing firstaction/lastaction scripts with '}' character in case of error before these scripts. - Support also 'K' unit for *size directives. - Added preremove option to let admin to do something with the old logs before they are removed by logrotate. - Fixed possible loop in tabooext parsing. - Move code to set SELinux context before compressLogFile calls to create compressed log files with the proper context. - Call prerotate/postrotate script only for really rotated files in nosharedscripts mode (as stated in man page). [3.8.4]: https://github.com/logrotate/logrotate/compare/r3-8-3...r3-8-4 ## [3.8.3] - 2012-10-04 - Fixed setting "size" bigger than 4GB on 32bit architectures - Do not overwrite mode set by "create" option when using ACL. "create" directive is now not mixed up with ACLs. If you use "create" in config file and log file has some ACLs set, ACLs are not kept and are overwritten by the mode set in "create" directive. - Mode argument in "create" directive can be omitted. Only owner and group is set in this case. Check man page for more info. [3.8.3]: https://github.com/logrotate/logrotate/compare/r3.8.2...r3-8-3 ## [3.8.2] - 2012-08-01 - show error and ignore config if '{' is not present after log files declaration - support whitespaces in compressoptions directive - support for tilde expansion in config files - 'su' directive does not affect script execution - scripts are executed as a root if 'su' directive is present - fixed mail sending for 'mailfirst', 'dateext' and 'delaycompress' combination - do not use gzip/gunzip from /usr/local on Solaris - add O_NOFOLLOW when opening files as safeguard against symlink tricks. Symlinks rotation is now officially unsupported. It didn't work as expected in the past anyway. - do not run external programs with uid != euid - fixed potential bad-free when ACL is used - Do not include alloca.h on NetBSD, since alloca() is declared in stdlib.h there - 13 new tests added [3.8.2]: https://github.com/logrotate/logrotate/compare/r3-8-1...r3.8.2 ## [3.8.1] - 2011-08-31 - fixed 1 memory leak in prerotateSingleLog - another fixes for Solaris - fixed HP-UX compilation and default config - do not redirect logrotate errors to /dev/null in cron script - fixed "size" directive parsing - handle situation when acl_get_fd is supported, but acl_set_fd is not - added "maxsize" directive (see man page) [3.8.1]: https://github.com/logrotate/logrotate/compare/r3-8-0...r3-8-1 ## [3.8.0] - 2011-06-21 - added "dateyesterday" option (see man page) - fixed crash when config file had exactly 4096*N bytes - added WITH_ACL make option to link against -lacl and preserve ACLs during rotation - added "su" option to define user/group for rotation. Logrotate now skips directories which are world writable or writable by group which is not "root" unless "su" directive is used. - fixed CVE-2011-1098: race condition by creation of new files - fixed possible shell injection when using "shred" directive (CVE-2011-1154) - fixed escaping of file names within 'write state' action (CVE-2011-1155) - better 'size' directive description - fixed possible buffer-overflow when reading config files - NetBSD/FreeBSD compilation fixes - Solaris compilation fixes [3.8.0]: https://github.com/logrotate/logrotate/compare/r3-7-9...r3-8-0 ## [3.7.9] - 2010-06-28 - fix building on Solaris (patch by András Szilárd) - don't copy config files on the stack -- mmap them instead (fixes segfaults with too large/invalid config files) - symlinked conf file man page as requested by Fedora guidelines (thanks to Ivana Hutarova Varekova) - cron script logrotate.cron redirects output to /dev/null - added rotating (copying) non-writable, readable files (patch by Henrique Martins) - fixed missingok problem with globs (taken from the Debian patches by Ted Percival ) - fixed bug when log files could be removed even there was some error in rotation process. - allow setting size greater than 4.2GB in configuration file - pass currently rotated file to postrotate/prerotate script in nosharedscripts mode - added new TabooExts: ".disabled", ".dpkg-old", ".dpkg-dist", ".dpkg-new", ".cfsaved", ".ucf-old", ".ucf-dist", ".ucf-new" (taken from the Debian patches by Paul Martin ) - Don't change utime atime/mtime when compressing files (taken from the Debian patches by Paul Martin ) - Better *rotate scripts parser. (taken from the Debian patches) - Allow 'include' directive in log file definitions [3.7.9]: https://github.com/logrotate/logrotate/compare/r3-7-8...r3-7-9 ## [3.7.8] - 2009-01-28 - do not exit on status file errors - limit config file inclusion nesting - use hashes for status file handling (patch by Petr Tesarik and Leonardo Chiquitto) - dateformat to allow unixtime (patch by Sami Kerola ) - manual page corrections (taken from the Debian patches by Paul Martin ) [3.7.8]: https://github.com/logrotate/logrotate/compare/r3-7-7...r3-7-8 ## [3.7.7] - 2008-05-19 - dateformat - fix possible buffer overflows in strings handling - various minor bugfixes - change logInfo handling (patches by Leonardo Chiquitto) [3.7.7]: https://github.com/logrotate/logrotate/compare/r3-7-6...r3-7-7 ## [3.7.6] - 2008-05-14 - patches from Leonardo Chiquitto that fix compile warnings - examples/logrotate-default: add btmp rotation, dateext - update man page - tabooext honor wildcards - fix selinux support with dateext [3.7.6]: https://github.com/logrotate/logrotate/compare/r3-7-5...r3-7-6 ## [3.7.5] - 2007-03-01 - import Fedora patches - add option to use shred for deleting files, patch by Peter Eckersley - ignore .cfsaved files - bugfixes [3.7.5]: https://github.com/logrotate/logrotate/compare/r3-7-1...r3-7-5 ## [3.7.1] - 2004-10-20 - Fix sending mails and running scripts after the system() -> execve() changes - Preserve file attributes when compressing files (original patch by Daniel Himler) [3.7.1]: https://github.com/logrotate/logrotate/compare/r3-7...r3-7-1 ## [3.7] - 2004-01-26 - always use compressext for the extension for compressed files; before compresscmd and compressext had to agree - moved all compression to one code block - compression, scripts don't use system() anymore - compress and maillast didn't work together properly - delaycompress and mailfirst didn't work properly - don't use system() for mailing (or uncompressing) logs anymore - use "-s" for specifying the subjected of mailed logs [3.7]: https://github.com/logrotate/logrotate/compare/r3-6...r3-7 ## [3.6] - 2001-11-28 - See .spec file for changes [3.6]: https://github.com/logrotate/logrotate/compare/r3-5-4...r3-6 ## [3.5.4] - 2001-01-05 - `%defattr(-,root,root)` in specfile [3.5.4]: https://github.com/logrotate/logrotate/compare/r3-5-3...r3-5-4 ## [3.5.3] - 2001-01-03 - patch /tmp file race condition problem, use mkstemp; Thanks go to Solar Designer [3.5.3]: https://github.com/logrotate/logrotate/compare/r3-5-2...r3-5-3 ## [3.5.2] - 2000-09-29 - added .swp and .rpmnew to default taboo list [3.5.2]: https://github.com/logrotate/logrotate/compare/r3-5-1...r3-5-2 ## [3.5.1] - 2000-08-11 - handle state dates in the future a bit more sanely [3.5.1]: https://github.com/logrotate/logrotate/compare/r3-5...r3-5-1 ## [3.5] - 2000-07-23 - multiple file names/patterns may be given for a single entry - fixed mistake in when logs were uncompressed before mailing [3.5]: https://github.com/logrotate/logrotate/compare/r3-4...r3-5 ## [3.4] - 2000-07-13 - added sharedscripts/nosharedscripts - added simple testbed - quote filenames in state file to allow proper rotation of files with spaces in the name -- this changes the version number of the state file! - ignore white space at end of line [3.4]: https://github.com/logrotate/logrotate/compare/r3-3-2...r3-4 ## [3.3.2] - 2000-06-19 - don't rotate lastlog [3.3.2]: https://github.com/logrotate/logrotate/compare/r3-3-1...r3-3-2 ## [3.3.1] - 2000-02-03 - support gzipped man pages [3.3.1]: https://github.com/logrotate/logrotate/compare/r3-3...r3-3-1 ## [3.3] - 1999-06-16 - added "mailfirst" and "maillast" flags (based on Tim Wall's patch) - documented "extension" flag - "rotate 0" gives proper script and mail behavior [3.3]: https://github.com/logrotate/logrotate/compare/r3-2...r3-3 ## [3.2] - 1999-04-07 - create wtmp with correct perms [3.2]: https://github.com/logrotate/logrotate/compare/r3-1...r3-2 ## [3.1] - 1999-04-01 - fixed small alloca() - added missingok flag - use popt to display usage message - handle /some/file { } in config file [3.1]: https://github.com/logrotate/logrotate/compare/r3-0...r3-1 ## [3.0] - 1999-03-18 - updates for glibc 2.1 [3.0]: https://github.com/logrotate/logrotate/compare/r2-9...r3-0 ## [2.9] - 1999-03-05 - fixed a bug parsing lines where { immediately follows the filename - allow log file patterns to be placed in double quotes, which allows spaces in names - complain about missing log files (John Van Essen) [2.9]: https://github.com/logrotate/logrotate/compare/r2-8...r2-9 ## [2.8] - 1999-01-13 - changes for glibc 2.1 (Cristian Gafton) [2.8]: https://github.com/logrotate/logrotate/compare/r2-7...r2-8 ## [2.7] - 1998-12-29 - updated man page to include --force (Simon Mudd) - invoke scripts via /bin/sh rather then relying on /tmp execute semantics (Philip Guenther) - added "extension" option for forcing a file extension after rotation (Rob Hagopian) [2.7]: https://github.com/logrotate/logrotate/compare/r2-6...r2-7 ## [2.6] - 1998-05-05 - added nodelaycompress flag (from Jos Vos) - added copytruncate, nocopytruncate flag (from Jos Vos) - removed umask handling; explicitly use fchmod() insteadmoved umask - added --force option (Simon Mudd) - moved /bin/mail to MAIL_COMMAND define (Simon Mudd) - fixed segv caused by overly long filenames - switched from getopt_long to popt [2.6]: https://github.com/logrotate/logrotate/compare/r2-5...r2-6 ## [2.5] - 1997-09-01 - set the umask of the process to 0, letting open() create processes with the proper permissions - added delaycompress flag (from Jos Vos) - fixed how old logs are finally removed when an olddir is specified (Jos Vos) - added nomail option - added mail, nomail documentation to man page - added the tabooext directive - fixed problem in globbing [2.5]: https://github.com/logrotate/logrotate/compare/r2-4...r2-5 ## [2.4] - 1997-08-11 - glob log names in config file - added ,v to taboo list - fixed bug w/ create parsing - use an int rather then a mode_t when parsing create entries as sscanf requires it [2.4]: https://github.com/logrotate/logrotate/compare/2-3...r2-4 ## [2.3] - 1997-03-18 - fill in all of last rotated structure (this probable isn't really necessary but it's a bit cleaner and will avoid future problems); - fixed .spec file [2.3]: https://github.com/logrotate/logrotate/compare/2-2...2-3 ## [2.2] - 1997-02-27 - If a file is rotated and we have no state information for it, right out the current time. - Weekly rotation happens when the current weekday is less then the weekday of the last rotation or more then a week has elapsed between the last rotation and now - Monthly rotation happens when the current month is different from the last month or the current year is different from the last year - (these were contributed and suggested by Ronald Wahl) - added olddir/noolddir options - added ifempty/notifempty options - ignore nonnormal files when reading config files from a directory - (these were suggested and originally implemented by Henning Schmiedehausen) - updated the man page to reflect these changes - made "make install" accept PREFIX argument - added .spec file to tarball [2.2]: https://github.com/logrotate/logrotate/compare/2-1...2-2 ## [2.1] - 1997-01-13 - Don't output state information for logs that have never been rotated (better then 1900-1-0) - Accept 1900-1-0 as time 0 [2.1]: https://github.com/logrotate/logrotate/compare/2-0-2...2-1 ## [2.0.2] - 1996-12-10 - I have no idea :-( [2.0.2]: https://github.com/logrotate/logrotate/compare/2-0-1...2-0-2 ## [2.0.1] - 1996-12-09 - ignore files in included directories which end with ~, .rpmorig, or .rpmsave [2.0.1]: https://github.com/logrotate/logrotate/commits/2-0-1 logrotate-3.21.0/INSTALL0000644000175000017500000000137313212000407011540 00000000000000The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code 2. Configure logrotate using `./configure'. 3. Type `make' to compile the package. 4. Optionally, type `make check' to run any self-tests that come with the package. 5. Type `make install' to install the programs and any data files and documentation. 6. You can remove the program binaries and object files from the source code directory by typing `make clean'. If you want to add the Access Control List (ACL) support to the program use `./configure --with-acl=yes' at the point 2. If you want to add the NSA Security-Enhanced Linux (SELinux) support to the program use `./configure --with-selinux=yes' at the point 2. logrotate-3.21.0/README.md0000644000175000017500000001640214346133207012003 00000000000000# logrotate The logrotate utility is designed to simplify the administration of log files on a system which generates a lot of log files. Logrotate allows for the automatic rotation compression, removal and mailing of log files. Logrotate can be set to handle a log file hourly, daily, weekly, monthly or when the log file gets to a certain size. ## Download The latest release is: * [logrotate-3.21.0](https://github.com/logrotate/logrotate/releases/download/3.21.0/logrotate-3.21.0.tar.xz) ([sig](https://github.com/logrotate/logrotate/releases/download/3.21.0/logrotate-3.21.0.tar.xz.asc)) ([Changelog](https://github.com/logrotate/logrotate/releases/tag/3.21.0)) Previous releases: * [logrotate-3.20.1](https://github.com/logrotate/logrotate/releases/download/3.20.1/logrotate-3.20.1.tar.xz) ([sig](https://github.com/logrotate/logrotate/releases/download/3.20.1/logrotate-3.20.1.tar.xz.asc)) ([Changelog](https://github.com/logrotate/logrotate/releases/tag/3.20.1)) * [logrotate-3.20.0](https://github.com/logrotate/logrotate/releases/download/3.20.0/logrotate-3.20.0.tar.xz) ([sig](https://github.com/logrotate/logrotate/releases/download/3.20.0/logrotate-3.20.0.tar.xz.asc)) ([Changelog](https://github.com/logrotate/logrotate/releases/tag/3.20.0)) * [logrotate-3.19.0](https://github.com/logrotate/logrotate/releases/download/3.19.0/logrotate-3.19.0.tar.xz) ([sig](https://github.com/logrotate/logrotate/releases/download/3.19.0/logrotate-3.19.0.tar.xz.asc)) ([Changelog](https://github.com/logrotate/logrotate/releases/tag/3.19.0)) * [logrotate-3.18.1](https://github.com/logrotate/logrotate/releases/download/3.18.1/logrotate-3.18.1.tar.xz) ([sig](https://github.com/logrotate/logrotate/releases/download/3.18.1/logrotate-3.18.1.tar.xz.asc)) ([Changelog](https://github.com/logrotate/logrotate/releases/tag/3.18.1)) * [logrotate-3.18.0](https://github.com/logrotate/logrotate/releases/download/3.18.0/logrotate-3.18.0.tar.xz) ([sig](https://github.com/logrotate/logrotate/releases/download/3.18.0/logrotate-3.18.0.tar.xz.asc)) ([Changelog](https://github.com/logrotate/logrotate/releases/tag/3.18.0)) * [logrotate-3.17.0](https://github.com/logrotate/logrotate/releases/download/3.17.0/logrotate-3.17.0.tar.xz) ([sig](https://github.com/logrotate/logrotate/releases/download/3.17.0/logrotate-3.17.0.tar.xz.asc)) ([Changelog](https://github.com/logrotate/logrotate/releases/tag/3.17.0)) * [logrotate-3.16.0](https://github.com/logrotate/logrotate/releases/download/3.16.0/logrotate-3.16.0.tar.xz) ([sig](https://github.com/logrotate/logrotate/releases/download/3.16.0/logrotate-3.16.0.tar.xz.asc)) ([Changelog](https://github.com/logrotate/logrotate/releases/tag/3.16.0)) * [logrotate-3.15.1](https://github.com/logrotate/logrotate/releases/download/3.15.1/logrotate-3.15.1.tar.xz) ([sig](https://github.com/logrotate/logrotate/releases/download/3.15.1/logrotate-3.15.1.tar.xz.asc)) ([Changelog](https://github.com/logrotate/logrotate/releases/tag/3.15.1)) * [logrotate-3.15.0](https://github.com/logrotate/logrotate/releases/download/3.15.0/logrotate-3.15.0.tar.xz) ([sig](https://github.com/logrotate/logrotate/releases/download/3.15.0/logrotate-3.15.0.tar.xz.asc)) ([Changelog](https://github.com/logrotate/logrotate/releases/tag/3.15.0)) * [logrotate-3.14.0](https://github.com/logrotate/logrotate/releases/download/3.14.0/logrotate-3.14.0.tar.xz) ([sig](https://github.com/logrotate/logrotate/releases/download/3.14.0/logrotate-3.14.0.tar.xz.asc)) ([Changelog](https://github.com/logrotate/logrotate/releases/tag/3.14.0)) * [logrotate-3.13.0](https://github.com/logrotate/logrotate/releases/download/3.13.0/logrotate-3.13.0.tar.xz) ([sig](https://github.com/logrotate/logrotate/releases/download/3.13.0/logrotate-3.13.0.tar.xz.asc)) ([Changelog](https://github.com/logrotate/logrotate/releases/tag/3.13.0)) * [logrotate-3.12.3](https://github.com/logrotate/logrotate/releases/download/3.12.3/logrotate-3.12.3.tar.xz) ([sig](https://github.com/logrotate/logrotate/releases/download/3.12.3/logrotate-3.12.3.tar.xz.asc)) ([Changelog](https://github.com/logrotate/logrotate/releases/tag/3.12.3)) * [logrotate-3.12.2](https://github.com/logrotate/logrotate/releases/download/3.12.2/logrotate-3.12.2.tar.xz) ([sig](https://github.com/logrotate/logrotate/releases/download/3.12.2/logrotate-3.12.2.tar.xz.asc)) ([Changelog](https://github.com/logrotate/logrotate/releases/tag/3.12.2)) * [logrotate-3.12.1](https://github.com/logrotate/logrotate/releases/download/3.12.1/logrotate-3.12.1.tar.xz) ([sig](https://github.com/logrotate/logrotate/releases/download/3.12.1/logrotate-3.12.1.tar.xz.asc)) ([Changelog](https://github.com/logrotate/logrotate/releases/tag/3.12.1)) * [logrotate-3.12.0](https://github.com/logrotate/logrotate/releases/download/3.12.0/logrotate-3.12.0.tar.xz) ([sig](https://github.com/logrotate/logrotate/releases/download/3.12.0/logrotate-3.12.0.tar.xz.asc)) ([Changelog](https://github.com/logrotate/logrotate/releases/tag/3.12.0)) * [logrotate-3.11.0](https://github.com/logrotate/logrotate/releases/download/3.11.0/logrotate-3.11.0.tar.xz) ([sig](https://github.com/logrotate/logrotate/releases/download/3.11.0/logrotate-3.11.0.tar.xz.asc)) ([Changelog](https://github.com/logrotate/logrotate/releases/tag/3.11.0)) * [logrotate-3.10.0](https://github.com/logrotate/logrotate/releases/download/3.10.0/logrotate-3.10.0.tar.gz) ([Changelog](https://github.com/logrotate/logrotate/releases/tag/3.10.0)) * [logrotate-3.9.2](https://github.com/logrotate/logrotate/releases/download/3.9.2/logrotate-3.9.2.tar.gz) ([Changelog](https://github.com/logrotate/logrotate/releases/tag/3.9.2)) ## Git checkout You can also obtain code by using git checkout: ``` git clone https://github.com/logrotate/logrotate.git -b master ``` Replace `master` with branch or tag you intend to checkout ## Verify and unpack After downloading the tarball and .asc signature file, check the signature: Get Kamil's PGP key rsa4096/72A37B36 (almost any keyserver will do if pgp.mit.edu is temporarily unavailable): $ gpg --keyserver pgp.mit.edu --recv-key 992A96E075056E79CD8214F9873DB37572A37B36 and verify the PGP signature on the distribution tarball: $ gpg --verify logrotate-3.11.0.tar.xz.asc logrotate-3.11.0.tar.xz If successful your GPG output should look like this: gpg: Signature made Fri 02 Dec 2016 08:30:39 AM EST gpg: using RSA key 873DB37572A37B36 gpg: Good signature from "Kamil Dudka " [unknown] gpg: WARNING: This key is not certified with a trusted signature! gpg: There is no indication that the signature belongs to the owner. Primary key fingerprint: 992A 96E0 7505 6E79 CD82 14F9 873D B375 72A3 7B36 You may then unpack the tarball: $ tar -xJf logrotate-3.11.0.tar.xz Notice that git tags are signed with same key: $ git tag --verify 3.11.0 ## Compiling Obtain source either by [Downloading](#download) it or doing [Git checkout](#git-checkout). Install dependencies for Debian systems: ``` apt-get update apt-get install autoconf automake libpopt-dev libtool make xz-utils ``` Install dependencies for Fedora/CentOS systems: ``` yum install autoconf automake libtool make popt-devel xz ``` Compilation (`autoreconf` is optional if you obtained source from tarball): ``` cd logrotate-X.Y.Z autoreconf -fiv ./configure make ``` # Patches and Questions Open issues or pull requests on GitHub. logrotate-3.21.0/compile0000755000175000017500000001635014346133574012113 00000000000000#! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1999-2021 Free Software Foundation, Inc. # Written by Tom Tromey . # # 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, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN* | MSYS*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/* | msys/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: logrotate-3.21.0/config.guess0000755000175000017500000014142214346133574013054 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2022 Free Software Foundation, Inc. # shellcheck disable=SC2006,SC2268 # see below for rationale timestamp='2022-09-17' # This file 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 3 of the License, 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, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: # https://git.savannah.gnu.org/cgit/config.git/plain/config.guess # # Please send patches to . # The "shellcheck disable" line above the timestamp inhibits complaints # about features and limitations of the classic Bourne shell that were # superseded or lifted in POSIX. However, this script identifies a wide # variety of pre-POSIX systems that do not have POSIX shells at all, and # even some reasonably current systems (Solaris 10 as case-in-point) still # have a pre-POSIX /bin/sh. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright 1992-2022 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi # Just in case it came from the environment. GUESS= # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. tmp= # shellcheck disable=SC2172 trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15 set_cc_for_build() { # prevent multiple calls if $tmp is already set test "$tmp" && return 0 : "${TMPDIR=/tmp}" # shellcheck disable=SC2039,SC3028 { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } dummy=$tmp/dummy case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in ,,) echo "int x;" > "$dummy.c" for driver in cc gcc c89 c99 ; do if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then CC_FOR_BUILD=$driver break fi done if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac } # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if test -f /.attbin/uname ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case $UNAME_SYSTEM in Linux|GNU|GNU/*) LIBC=unknown set_cc_for_build cat <<-EOF > "$dummy.c" #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #elif defined(__GLIBC__) LIBC=gnu #else #include /* First heuristic to detect musl libc. */ #ifdef __DEFINED_va_list LIBC=musl #endif #endif EOF cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` eval "$cc_set_libc" # Second heuristic to detect musl libc. if [ "$LIBC" = unknown ] && command -v ldd >/dev/null && ldd --version 2>&1 | grep -q ^musl; then LIBC=musl fi # If the system lacks a compiler, then just pick glibc. # We could probably try harder. if [ "$LIBC" = unknown ]; then LIBC=gnu fi ;; esac # Note: order is significant - the case branches are not exclusive. case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ /sbin/sysctl -n hw.machine_arch 2>/dev/null || \ /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \ echo unknown)` case $UNAME_MACHINE_ARCH in aarch64eb) machine=aarch64_be-unknown ;; armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; earmv*) arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` machine=${arch}${endian}-unknown ;; *) machine=$UNAME_MACHINE_ARCH-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently (or will in the future) and ABI. case $UNAME_MACHINE_ARCH in earm*) os=netbsdelf ;; arm*|i386|m68k|ns32k|sh3*|sparc|vax) set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # Determine ABI tags. case $UNAME_MACHINE_ARCH in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case $UNAME_VERSION in Debian*) release='-gnu' ;; *) release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. GUESS=$machine-${os}${release}${abi-} ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-openbsd$UNAME_RELEASE ;; *:SecBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-secbsd$UNAME_RELEASE ;; *:LibertyBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE ;; *:MidnightBSD:*:*) GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE ;; *:ekkoBSD:*:*) GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE ;; *:SolidBSD:*:*) GUESS=$UNAME_MACHINE-unknown-solidbsd$UNAME_RELEASE ;; *:OS108:*:*) GUESS=$UNAME_MACHINE-unknown-os108_$UNAME_RELEASE ;; macppc:MirBSD:*:*) GUESS=powerpc-unknown-mirbsd$UNAME_RELEASE ;; *:MirBSD:*:*) GUESS=$UNAME_MACHINE-unknown-mirbsd$UNAME_RELEASE ;; *:Sortix:*:*) GUESS=$UNAME_MACHINE-unknown-sortix ;; *:Twizzler:*:*) GUESS=$UNAME_MACHINE-unknown-twizzler ;; *:Redox:*:*) GUESS=$UNAME_MACHINE-unknown-redox ;; mips:OSF1:*.*) GUESS=mips-dec-osf1 ;; alpha:OSF1:*:*) # Reset EXIT trap before exiting to avoid spurious non-zero exit code. trap '' 0 case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case $ALPHA_CPU_TYPE in "EV4 (21064)") UNAME_MACHINE=alpha ;; "EV4.5 (21064)") UNAME_MACHINE=alpha ;; "LCA4 (21066/21068)") UNAME_MACHINE=alpha ;; "EV5 (21164)") UNAME_MACHINE=alphaev5 ;; "EV5.6 (21164A)") UNAME_MACHINE=alphaev56 ;; "EV5.6 (21164PC)") UNAME_MACHINE=alphapca56 ;; "EV5.7 (21164PC)") UNAME_MACHINE=alphapca57 ;; "EV6 (21264)") UNAME_MACHINE=alphaev6 ;; "EV6.7 (21264A)") UNAME_MACHINE=alphaev67 ;; "EV6.8CB (21264C)") UNAME_MACHINE=alphaev68 ;; "EV6.8AL (21264B)") UNAME_MACHINE=alphaev68 ;; "EV6.8CX (21264D)") UNAME_MACHINE=alphaev68 ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE=alphaev69 ;; "EV7 (21364)") UNAME_MACHINE=alphaev7 ;; "EV7.9 (21364A)") UNAME_MACHINE=alphaev79 ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. OSF_REL=`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` GUESS=$UNAME_MACHINE-dec-osf$OSF_REL ;; Amiga*:UNIX_System_V:4.0:*) GUESS=m68k-unknown-sysv4 ;; *:[Aa]miga[Oo][Ss]:*:*) GUESS=$UNAME_MACHINE-unknown-amigaos ;; *:[Mm]orph[Oo][Ss]:*:*) GUESS=$UNAME_MACHINE-unknown-morphos ;; *:OS/390:*:*) GUESS=i370-ibm-openedition ;; *:z/VM:*:*) GUESS=s390-ibm-zvmoe ;; *:OS400:*:*) GUESS=powerpc-ibm-os400 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) GUESS=arm-acorn-riscix$UNAME_RELEASE ;; arm*:riscos:*:*|arm*:RISCOS:*:*) GUESS=arm-unknown-riscos ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) GUESS=hppa1.1-hitachi-hiuxmpp ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. case `(/bin/universe) 2>/dev/null` in att) GUESS=pyramid-pyramid-sysv3 ;; *) GUESS=pyramid-pyramid-bsd ;; esac ;; NILE*:*:*:dcosx) GUESS=pyramid-pyramid-svr4 ;; DRS?6000:unix:4.0:6*) GUESS=sparc-icl-nx6 ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) GUESS=sparc-icl-nx7 ;; esac ;; s390x:SunOS:*:*) SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL ;; sun4H:SunOS:5.*:*) SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=sparc-hal-solaris2$SUN_REL ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=sparc-sun-solaris2$SUN_REL ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) GUESS=i386-pc-auroraux$UNAME_RELEASE ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) set_cc_for_build SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if test "$CC_FOR_BUILD" != no_compiler_found; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -m64 -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH=x86_64 fi fi SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=$SUN_ARCH-pc-solaris2$SUN_REL ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=sparc-sun-solaris3$SUN_REL ;; sun4*:SunOS:*:*) case `/usr/bin/arch -k` in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'` GUESS=sparc-sun-sunos$SUN_REL ;; sun3*:SunOS:*:*) GUESS=m68k-sun-sunos$UNAME_RELEASE ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 case `/bin/arch` in sun3) GUESS=m68k-sun-sunos$UNAME_RELEASE ;; sun4) GUESS=sparc-sun-sunos$UNAME_RELEASE ;; esac ;; aushp:SunOS:*:*) GUESS=sparc-auspex-sunos$UNAME_RELEASE ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) GUESS=m68k-atari-mint$UNAME_RELEASE ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) GUESS=m68k-atari-mint$UNAME_RELEASE ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) GUESS=m68k-atari-mint$UNAME_RELEASE ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) GUESS=m68k-milan-mint$UNAME_RELEASE ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) GUESS=m68k-hades-mint$UNAME_RELEASE ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) GUESS=m68k-unknown-mint$UNAME_RELEASE ;; m68k:machten:*:*) GUESS=m68k-apple-machten$UNAME_RELEASE ;; powerpc:machten:*:*) GUESS=powerpc-apple-machten$UNAME_RELEASE ;; RISC*:Mach:*:*) GUESS=mips-dec-mach_bsd4.3 ;; RISC*:ULTRIX:*:*) GUESS=mips-dec-ultrix$UNAME_RELEASE ;; VAX*:ULTRIX*:*:*) GUESS=vax-dec-ultrix$UNAME_RELEASE ;; 2020:CLIX:*:* | 2430:CLIX:*:*) GUESS=clipper-intergraph-clix$UNAME_RELEASE ;; mips:*:*:UMIPS | mips:*:*:RISCos) set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" && dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`"$dummy" "$dummyarg"` && { echo "$SYSTEM_NAME"; exit; } GUESS=mips-mips-riscos$UNAME_RELEASE ;; Motorola:PowerMAX_OS:*:*) GUESS=powerpc-motorola-powermax ;; Motorola:*:4.3:PL8-*) GUESS=powerpc-harris-powermax ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) GUESS=powerpc-harris-powermax ;; Night_Hawk:Power_UNIX:*:*) GUESS=powerpc-harris-powerunix ;; m88k:CX/UX:7*:*) GUESS=m88k-harris-cxux7 ;; m88k:*:4*:R4*) GUESS=m88k-motorola-sysv4 ;; m88k:*:3*:R3*) GUESS=m88k-motorola-sysv3 ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110 then if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \ test "$TARGET_BINARY_INTERFACE"x = x then GUESS=m88k-dg-dgux$UNAME_RELEASE else GUESS=m88k-dg-dguxbcs$UNAME_RELEASE fi else GUESS=i586-dg-dgux$UNAME_RELEASE fi ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) GUESS=m88k-dolphin-sysv3 ;; M88*:*:R3*:*) # Delta 88k system running SVR3 GUESS=m88k-motorola-sysv3 ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) GUESS=m88k-tektronix-sysv3 ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) GUESS=m68k-tektronix-bsd ;; *:IRIX*:*:*) IRIX_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/g'` GUESS=mips-sgi-irix$IRIX_REL ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. GUESS=romp-ibm-aix # uname -m gives an 8 hex-code CPU id ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) GUESS=i386-ibm-aix ;; ia64:AIX:*:*) if test -x /usr/bin/oslevel ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=$UNAME_VERSION.$UNAME_RELEASE fi GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` then GUESS=$SYSTEM_NAME else GUESS=rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then GUESS=rs6000-ibm-aix3.2.4 else GUESS=rs6000-ibm-aix3.2 fi ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if test -x /usr/bin/lslpp ; then IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | \ awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else IBM_REV=$UNAME_VERSION.$UNAME_RELEASE fi GUESS=$IBM_ARCH-ibm-aix$IBM_REV ;; *:AIX:*:*) GUESS=rs6000-ibm-aix ;; ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) GUESS=romp-ibm-bsd4.4 ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and GUESS=romp-ibm-bsd$UNAME_RELEASE # 4.3 with uname added to ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) GUESS=rs6000-bull-bosx ;; DPX/2?00:B.O.S.:*:*) GUESS=m68k-bull-sysv3 ;; 9000/[34]??:4.3bsd:1.*:*) GUESS=m68k-hp-bsd ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) GUESS=m68k-hp-bsd4.4 ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` case $UNAME_MACHINE in 9000/31?) HP_ARCH=m68000 ;; 9000/[34]??) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if test -x /usr/bin/getconf; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case $sc_cpu_version in 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case $sc_kernel_bits in 32) HP_ARCH=hppa2.0n ;; 64) HP_ARCH=hppa2.0w ;; '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi if test "$HP_ARCH" = ""; then set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if test "$HP_ARCH" = hppa2.0w then set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH=hppa2.0w else HP_ARCH=hppa64 fi fi GUESS=$HP_ARCH-hp-hpux$HPUX_REV ;; ia64:HP-UX:*:*) HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` GUESS=ia64-hp-hpux$HPUX_REV ;; 3050*:HI-UX:*:*) set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } GUESS=unknown-hitachi-hiuxwe2 ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) GUESS=hppa1.1-hp-bsd ;; 9000/8??:4.3bsd:*:*) GUESS=hppa1.0-hp-bsd ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) GUESS=hppa1.0-hp-mpeix ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) GUESS=hppa1.1-hp-osf ;; hp8??:OSF1:*:*) GUESS=hppa1.0-hp-osf ;; i*86:OSF1:*:*) if test -x /usr/sbin/sysversion ; then GUESS=$UNAME_MACHINE-unknown-osf1mk else GUESS=$UNAME_MACHINE-unknown-osf1 fi ;; parisc*:Lites*:*:*) GUESS=hppa1.1-hp-lites ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) GUESS=c1-convex-bsd ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) GUESS=c34-convex-bsd ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) GUESS=c38-convex-bsd ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) GUESS=c4-convex-bsd ;; CRAY*Y-MP:*:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=ymp-cray-unicos$CRAY_REL ;; CRAY*[A-Z]90:*:*:*) echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=t90-cray-unicos$CRAY_REL ;; CRAY*T3E:*:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=alphaev5-cray-unicosmk$CRAY_REL ;; CRAY*SV1:*:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=sv1-cray-unicos$CRAY_REL ;; *:UNICOS/mp:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=craynv-cray-unicosmp$CRAY_REL ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE ;; sparc*:BSD/OS:*:*) GUESS=sparc-unknown-bsdi$UNAME_RELEASE ;; *:BSD/OS:*:*) GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE ;; arm:FreeBSD:*:*) UNAME_PROCESSOR=`uname -p` set_cc_for_build if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabi else FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabihf fi ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case $UNAME_PROCESSOR in amd64) UNAME_PROCESSOR=x86_64 ;; i386) UNAME_PROCESSOR=i586 ;; esac FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL ;; i*:CYGWIN*:*) GUESS=$UNAME_MACHINE-pc-cygwin ;; *:MINGW64*:*) GUESS=$UNAME_MACHINE-pc-mingw64 ;; *:MINGW*:*) GUESS=$UNAME_MACHINE-pc-mingw32 ;; *:MSYS*:*) GUESS=$UNAME_MACHINE-pc-msys ;; i*:PW*:*) GUESS=$UNAME_MACHINE-pc-pw32 ;; *:SerenityOS:*:*) GUESS=$UNAME_MACHINE-pc-serenity ;; *:Interix*:*) case $UNAME_MACHINE in x86) GUESS=i586-pc-interix$UNAME_RELEASE ;; authenticamd | genuineintel | EM64T) GUESS=x86_64-unknown-interix$UNAME_RELEASE ;; IA64) GUESS=ia64-unknown-interix$UNAME_RELEASE ;; esac ;; i*:UWIN*:*) GUESS=$UNAME_MACHINE-pc-uwin ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) GUESS=x86_64-pc-cygwin ;; prep*:SunOS:5.*:*) SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=powerpcle-unknown-solaris2$SUN_REL ;; *:GNU:*:*) # the GNU system GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,'` GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'` GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL ;; *:GNU/*:*:*) # other systems with GNU libc and userland GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"` GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC ;; x86_64:[Mm]anagarm:*:*|i?86:[Mm]anagarm:*:*) GUESS="$UNAME_MACHINE-pc-managarm-mlibc" ;; *:[Mm]anagarm:*:*) GUESS="$UNAME_MACHINE-unknown-managarm-mlibc" ;; *:Minix:*:*) GUESS=$UNAME_MACHINE-unknown-minix ;; aarch64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC=gnulibc1 ; fi GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; arc:Linux:*:* | arceb:Linux:*:* | arc32:Linux:*:* | arc64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; arm*:Linux:*:*) set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then GUESS=$UNAME_MACHINE-unknown-linux-$LIBC else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi else GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf fi fi ;; avr32*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; cris:Linux:*:*) GUESS=$UNAME_MACHINE-axis-linux-$LIBC ;; crisv32:Linux:*:*) GUESS=$UNAME_MACHINE-axis-linux-$LIBC ;; e2k:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; frv:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; hexagon:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; i*86:Linux:*:*) GUESS=$UNAME_MACHINE-pc-linux-$LIBC ;; ia64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; k1om:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; loongarch32:Linux:*:* | loongarch64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; m32r*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; m68*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; mips:Linux:*:* | mips64:Linux:*:*) set_cc_for_build IS_GLIBC=0 test x"${LIBC}" = xgnu && IS_GLIBC=1 sed 's/^ //' << EOF > "$dummy.c" #undef CPU #undef mips #undef mipsel #undef mips64 #undef mips64el #if ${IS_GLIBC} && defined(_ABI64) LIBCABI=gnuabi64 #else #if ${IS_GLIBC} && defined(_ABIN32) LIBCABI=gnuabin32 #else LIBCABI=${LIBC} #endif #endif #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 CPU=mipsisa64r6 #else #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 CPU=mipsisa32r6 #else #if defined(__mips64) CPU=mips64 #else CPU=mips #endif #endif #endif #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) MIPS_ENDIAN=el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) MIPS_ENDIAN= #else MIPS_ENDIAN= #endif #endif EOF cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'` eval "$cc_set_vars" test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; } ;; mips64el:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; openrisc*:Linux:*:*) GUESS=or1k-unknown-linux-$LIBC ;; or32:Linux:*:* | or1k*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; padre:Linux:*:*) GUESS=sparc-unknown-linux-$LIBC ;; parisc64:Linux:*:* | hppa64:Linux:*:*) GUESS=hppa64-unknown-linux-$LIBC ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;; PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;; *) GUESS=hppa-unknown-linux-$LIBC ;; esac ;; ppc64:Linux:*:*) GUESS=powerpc64-unknown-linux-$LIBC ;; ppc:Linux:*:*) GUESS=powerpc-unknown-linux-$LIBC ;; ppc64le:Linux:*:*) GUESS=powerpc64le-unknown-linux-$LIBC ;; ppcle:Linux:*:*) GUESS=powerpcle-unknown-linux-$LIBC ;; riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; s390:Linux:*:* | s390x:Linux:*:*) GUESS=$UNAME_MACHINE-ibm-linux-$LIBC ;; sh64*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; sh*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; sparc:Linux:*:* | sparc64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; tile*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; vax:Linux:*:*) GUESS=$UNAME_MACHINE-dec-linux-$LIBC ;; x86_64:Linux:*:*) set_cc_for_build CPU=$UNAME_MACHINE LIBCABI=$LIBC if test "$CC_FOR_BUILD" != no_compiler_found; then ABI=64 sed 's/^ //' << EOF > "$dummy.c" #ifdef __i386__ ABI=x86 #else #ifdef __ILP32__ ABI=x32 #endif #endif EOF cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'` eval "$cc_set_abi" case $ABI in x86) CPU=i686 ;; x32) LIBCABI=${LIBC}x32 ;; esac fi GUESS=$CPU-pc-linux-$LIBCABI ;; xtensa*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. GUESS=i386-sequent-sysv4 ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. GUESS=$UNAME_MACHINE-pc-os2-emx ;; i*86:XTS-300:*:STOP) GUESS=$UNAME_MACHINE-unknown-stop ;; i*86:atheos:*:*) GUESS=$UNAME_MACHINE-unknown-atheos ;; i*86:syllable:*:*) GUESS=$UNAME_MACHINE-pc-syllable ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) GUESS=i386-unknown-lynxos$UNAME_RELEASE ;; i*86:*DOS:*:*) GUESS=$UNAME_MACHINE-pc-msdosdjgpp ;; i*86:*:4.*:*) UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL else GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL fi ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac GUESS=$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL else GUESS=$UNAME_MACHINE-pc-sysv32 fi ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. GUESS=i586-pc-msdosdjgpp ;; Intel:Mach:3*:*) GUESS=i386-pc-mach3 ;; paragon:*:*:*) GUESS=i860-intel-osf1 ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then GUESS=i860-stardent-sysv$UNAME_RELEASE # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. GUESS=i860-unknown-sysv$UNAME_RELEASE # Unknown i860-SVR4 fi ;; mini*:CTIX:SYS*5:*) # "miniframe" GUESS=m68010-convergent-sysv ;; mc68k:UNIX:SYSTEM5:3.51m) GUESS=m68k-convergent-sysv ;; M680?0:D-NIX:5.3:*) GUESS=m68k-diab-dnix ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) GUESS=m68k-unknown-lynxos$UNAME_RELEASE ;; mc68030:UNIX_System_V:4.*:*) GUESS=m68k-atari-sysv4 ;; TSUNAMI:LynxOS:2.*:*) GUESS=sparc-unknown-lynxos$UNAME_RELEASE ;; rs6000:LynxOS:2.*:*) GUESS=rs6000-unknown-lynxos$UNAME_RELEASE ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) GUESS=powerpc-unknown-lynxos$UNAME_RELEASE ;; SM[BE]S:UNIX_SV:*:*) GUESS=mips-dde-sysv$UNAME_RELEASE ;; RM*:ReliantUNIX-*:*:*) GUESS=mips-sni-sysv4 ;; RM*:SINIX-*:*:*) GUESS=mips-sni-sysv4 ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` GUESS=$UNAME_MACHINE-sni-sysv4 else GUESS=ns32k-sni-sysv fi ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says GUESS=i586-unisys-sysv4 ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm GUESS=hppa1.1-stratus-sysv4 ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. GUESS=i860-stratus-sysv4 ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. GUESS=$UNAME_MACHINE-stratus-vos ;; *:VOS:*:*) # From Paul.Green@stratus.com. GUESS=hppa1.1-stratus-vos ;; mc68*:A/UX:*:*) GUESS=m68k-apple-aux$UNAME_RELEASE ;; news*:NEWS-OS:6*:*) GUESS=mips-sony-newsos6 ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if test -d /usr/nec; then GUESS=mips-nec-sysv$UNAME_RELEASE else GUESS=mips-unknown-sysv$UNAME_RELEASE fi ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. GUESS=powerpc-be-beos ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. GUESS=powerpc-apple-beos ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. GUESS=i586-pc-beos ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. GUESS=i586-pc-haiku ;; ppc:Haiku:*:*) # Haiku running on Apple PowerPC GUESS=powerpc-apple-haiku ;; *:Haiku:*:*) # Haiku modern gcc (not bound by BeOS compat) GUESS=$UNAME_MACHINE-unknown-haiku ;; SX-4:SUPER-UX:*:*) GUESS=sx4-nec-superux$UNAME_RELEASE ;; SX-5:SUPER-UX:*:*) GUESS=sx5-nec-superux$UNAME_RELEASE ;; SX-6:SUPER-UX:*:*) GUESS=sx6-nec-superux$UNAME_RELEASE ;; SX-7:SUPER-UX:*:*) GUESS=sx7-nec-superux$UNAME_RELEASE ;; SX-8:SUPER-UX:*:*) GUESS=sx8-nec-superux$UNAME_RELEASE ;; SX-8R:SUPER-UX:*:*) GUESS=sx8r-nec-superux$UNAME_RELEASE ;; SX-ACE:SUPER-UX:*:*) GUESS=sxace-nec-superux$UNAME_RELEASE ;; Power*:Rhapsody:*:*) GUESS=powerpc-apple-rhapsody$UNAME_RELEASE ;; *:Rhapsody:*:*) GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE ;; arm64:Darwin:*:*) GUESS=aarch64-apple-darwin$UNAME_RELEASE ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` case $UNAME_PROCESSOR in unknown) UNAME_PROCESSOR=powerpc ;; esac if command -v xcode-select > /dev/null 2> /dev/null && \ ! xcode-select --print-path > /dev/null 2> /dev/null ; then # Avoid executing cc if there is no toolchain installed as # cc will be a stub that puts up a graphical alert # prompting the user to install developer tools. CC_FOR_BUILD=no_compiler_found else set_cc_for_build fi if test "$CC_FOR_BUILD" != no_compiler_found; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_PPC >/dev/null then UNAME_PROCESSOR=powerpc fi elif test "$UNAME_PROCESSOR" = i386 ; then # uname -m returns i386 or x86_64 UNAME_PROCESSOR=$UNAME_MACHINE fi GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE ;; *:QNX:*:4*) GUESS=i386-pc-qnx ;; NEO-*:NONSTOP_KERNEL:*:*) GUESS=neo-tandem-nsk$UNAME_RELEASE ;; NSE-*:NONSTOP_KERNEL:*:*) GUESS=nse-tandem-nsk$UNAME_RELEASE ;; NSR-*:NONSTOP_KERNEL:*:*) GUESS=nsr-tandem-nsk$UNAME_RELEASE ;; NSV-*:NONSTOP_KERNEL:*:*) GUESS=nsv-tandem-nsk$UNAME_RELEASE ;; NSX-*:NONSTOP_KERNEL:*:*) GUESS=nsx-tandem-nsk$UNAME_RELEASE ;; *:NonStop-UX:*:*) GUESS=mips-compaq-nonstopux ;; BS2000:POSIX*:*:*) GUESS=bs2000-siemens-sysv ;; DS/*:UNIX_System_V:*:*) GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "${cputype-}" = 386; then UNAME_MACHINE=i386 elif test "x${cputype-}" != x; then UNAME_MACHINE=$cputype fi GUESS=$UNAME_MACHINE-unknown-plan9 ;; *:TOPS-10:*:*) GUESS=pdp10-unknown-tops10 ;; *:TENEX:*:*) GUESS=pdp10-unknown-tenex ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) GUESS=pdp10-dec-tops20 ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) GUESS=pdp10-xkl-tops20 ;; *:TOPS-20:*:*) GUESS=pdp10-unknown-tops20 ;; *:ITS:*:*) GUESS=pdp10-unknown-its ;; SEI:*:*:SEIUX) GUESS=mips-sei-seiux$UNAME_RELEASE ;; *:DragonFly:*:*) DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case $UNAME_MACHINE in A*) GUESS=alpha-dec-vms ;; I*) GUESS=ia64-dec-vms ;; V*) GUESS=vax-dec-vms ;; esac ;; *:XENIX:*:SysV) GUESS=i386-pc-xenix ;; i*86:skyos:*:*) SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'` GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL ;; i*86:rdos:*:*) GUESS=$UNAME_MACHINE-pc-rdos ;; i*86:Fiwix:*:*) GUESS=$UNAME_MACHINE-pc-fiwix ;; *:AROS:*:*) GUESS=$UNAME_MACHINE-unknown-aros ;; x86_64:VMkernel:*:*) GUESS=$UNAME_MACHINE-unknown-esx ;; amd64:Isilon\ OneFS:*:*) GUESS=x86_64-unknown-onefs ;; *:Unleashed:*:*) GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE ;; esac # Do we have a guess based on uname results? if test "x$GUESS" != x; then echo "$GUESS" exit fi # No uname command or uname output not recognized. set_cc_for_build cat > "$dummy.c" < #include #endif #if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) #if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) #include #if defined(_SIZE_T_) || defined(SIGLOST) #include #endif #endif #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) #if !defined (ultrix) #include #if defined (BSD) #if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); #else #if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); #else printf ("vax-dec-bsd\n"); exit (0); #endif #endif #else printf ("vax-dec-bsd\n"); exit (0); #endif #else #if defined(_SIZE_T_) || defined(SIGLOST) struct utsname un; uname (&un); printf ("vax-dec-ultrix%s\n", un.release); exit (0); #else printf ("vax-dec-ultrix\n"); exit (0); #endif #endif #endif #if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) #if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) #if defined(_SIZE_T_) || defined(SIGLOST) struct utsname *un; uname (&un); printf ("mips-dec-ultrix%s\n", un.release); exit (0); #else printf ("mips-dec-ultrix\n"); exit (0); #endif #endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; } echo "$0: unable to guess system type" >&2 case $UNAME_MACHINE:$UNAME_SYSTEM in mips:Linux | mips64:Linux) # If we got here on MIPS GNU/Linux, output extra information. cat >&2 <&2 <&2 </dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = "$UNAME_MACHINE" UNAME_RELEASE = "$UNAME_RELEASE" UNAME_SYSTEM = "$UNAME_SYSTEM" UNAME_VERSION = "$UNAME_VERSION" EOF fi exit 1 # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: logrotate-3.21.0/config.sub0000755000175000017500000010575314346133574012526 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2022 Free Software Foundation, Inc. # shellcheck disable=SC2006,SC2268 # see below for rationale timestamp='2022-09-17' # This file 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 3 of the License, 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, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches to . # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # https://git.savannah.gnu.org/cgit/config.git/plain/config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. # The "shellcheck disable" line above the timestamp inhibits complaints # about features and limitations of the classic Bourne shell that were # superseded or lifted in POSIX. However, this script identifies a wide # variety of pre-POSIX systems that do not have POSIX shells at all, and # even some reasonably current systems (Solaris 10 as case-in-point) still # have a pre-POSIX /bin/sh. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright 1992-2022 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; *local*) # First pass through any local machine types. echo "$1" exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Split fields of configuration type # shellcheck disable=SC2162 saved_IFS=$IFS IFS="-" read field1 field2 field3 field4 <&2 exit 1 ;; *-*-*-*) basic_machine=$field1-$field2 basic_os=$field3-$field4 ;; *-*-*) # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two # parts maybe_os=$field2-$field3 case $maybe_os in nto-qnx* | linux-* | uclinux-uclibc* \ | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ | storm-chaos* | os2-emx* | rtmk-nova* | managarm-*) basic_machine=$field1 basic_os=$maybe_os ;; android-linux) basic_machine=$field1-unknown basic_os=linux-android ;; *) basic_machine=$field1-$field2 basic_os=$field3 ;; esac ;; *-*) # A lone config we happen to match not fitting any pattern case $field1-$field2 in decstation-3100) basic_machine=mips-dec basic_os= ;; *-*) # Second component is usually, but not always the OS case $field2 in # Prevent following clause from handling this valid os sun*os*) basic_machine=$field1 basic_os=$field2 ;; zephyr*) basic_machine=$field1-unknown basic_os=$field2 ;; # Manufacturers dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \ | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \ | unicom* | ibm* | next | hp | isi* | apollo | altos* \ | convergent* | ncr* | news | 32* | 3600* | 3100* \ | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \ | ultra | tti* | harris | dolphin | highlevel | gould \ | cbm | ns | masscomp | apple | axis | knuth | cray \ | microblaze* | sim | cisco \ | oki | wec | wrs | winbond) basic_machine=$field1-$field2 basic_os= ;; *) basic_machine=$field1 basic_os=$field2 ;; esac ;; esac ;; *) # Convert single-component short-hands not valid as part of # multi-component configurations. case $field1 in 386bsd) basic_machine=i386-pc basic_os=bsd ;; a29khif) basic_machine=a29k-amd basic_os=udi ;; adobe68k) basic_machine=m68010-adobe basic_os=scout ;; alliant) basic_machine=fx80-alliant basic_os= ;; altos | altos3068) basic_machine=m68k-altos basic_os= ;; am29k) basic_machine=a29k-none basic_os=bsd ;; amdahl) basic_machine=580-amdahl basic_os=sysv ;; amiga) basic_machine=m68k-unknown basic_os= ;; amigaos | amigados) basic_machine=m68k-unknown basic_os=amigaos ;; amigaunix | amix) basic_machine=m68k-unknown basic_os=sysv4 ;; apollo68) basic_machine=m68k-apollo basic_os=sysv ;; apollo68bsd) basic_machine=m68k-apollo basic_os=bsd ;; aros) basic_machine=i386-pc basic_os=aros ;; aux) basic_machine=m68k-apple basic_os=aux ;; balance) basic_machine=ns32k-sequent basic_os=dynix ;; blackfin) basic_machine=bfin-unknown basic_os=linux ;; cegcc) basic_machine=arm-unknown basic_os=cegcc ;; convex-c1) basic_machine=c1-convex basic_os=bsd ;; convex-c2) basic_machine=c2-convex basic_os=bsd ;; convex-c32) basic_machine=c32-convex basic_os=bsd ;; convex-c34) basic_machine=c34-convex basic_os=bsd ;; convex-c38) basic_machine=c38-convex basic_os=bsd ;; cray) basic_machine=j90-cray basic_os=unicos ;; crds | unos) basic_machine=m68k-crds basic_os= ;; da30) basic_machine=m68k-da30 basic_os= ;; decstation | pmax | pmin | dec3100 | decstatn) basic_machine=mips-dec basic_os= ;; delta88) basic_machine=m88k-motorola basic_os=sysv3 ;; dicos) basic_machine=i686-pc basic_os=dicos ;; djgpp) basic_machine=i586-pc basic_os=msdosdjgpp ;; ebmon29k) basic_machine=a29k-amd basic_os=ebmon ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson basic_os=ose ;; gmicro) basic_machine=tron-gmicro basic_os=sysv ;; go32) basic_machine=i386-pc basic_os=go32 ;; h8300hms) basic_machine=h8300-hitachi basic_os=hms ;; h8300xray) basic_machine=h8300-hitachi basic_os=xray ;; h8500hms) basic_machine=h8500-hitachi basic_os=hms ;; harris) basic_machine=m88k-harris basic_os=sysv3 ;; hp300 | hp300hpux) basic_machine=m68k-hp basic_os=hpux ;; hp300bsd) basic_machine=m68k-hp basic_os=bsd ;; hppaosf) basic_machine=hppa1.1-hp basic_os=osf ;; hppro) basic_machine=hppa1.1-hp basic_os=proelf ;; i386mach) basic_machine=i386-mach basic_os=mach ;; isi68 | isi) basic_machine=m68k-isi basic_os=sysv ;; m68knommu) basic_machine=m68k-unknown basic_os=linux ;; magnum | m3230) basic_machine=mips-mips basic_os=sysv ;; merlin) basic_machine=ns32k-utek basic_os=sysv ;; mingw64) basic_machine=x86_64-pc basic_os=mingw64 ;; mingw32) basic_machine=i686-pc basic_os=mingw32 ;; mingw32ce) basic_machine=arm-unknown basic_os=mingw32ce ;; monitor) basic_machine=m68k-rom68k basic_os=coff ;; morphos) basic_machine=powerpc-unknown basic_os=morphos ;; moxiebox) basic_machine=moxie-unknown basic_os=moxiebox ;; msdos) basic_machine=i386-pc basic_os=msdos ;; msys) basic_machine=i686-pc basic_os=msys ;; mvs) basic_machine=i370-ibm basic_os=mvs ;; nacl) basic_machine=le32-unknown basic_os=nacl ;; ncr3000) basic_machine=i486-ncr basic_os=sysv4 ;; netbsd386) basic_machine=i386-pc basic_os=netbsd ;; netwinder) basic_machine=armv4l-rebel basic_os=linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony basic_os=newsos ;; news1000) basic_machine=m68030-sony basic_os=newsos ;; necv70) basic_machine=v70-nec basic_os=sysv ;; nh3000) basic_machine=m68k-harris basic_os=cxux ;; nh[45]000) basic_machine=m88k-harris basic_os=cxux ;; nindy960) basic_machine=i960-intel basic_os=nindy ;; mon960) basic_machine=i960-intel basic_os=mon960 ;; nonstopux) basic_machine=mips-compaq basic_os=nonstopux ;; os400) basic_machine=powerpc-ibm basic_os=os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson basic_os=ose ;; os68k) basic_machine=m68k-none basic_os=os68k ;; paragon) basic_machine=i860-intel basic_os=osf ;; parisc) basic_machine=hppa-unknown basic_os=linux ;; psp) basic_machine=mipsallegrexel-sony basic_os=psp ;; pw32) basic_machine=i586-unknown basic_os=pw32 ;; rdos | rdos64) basic_machine=x86_64-pc basic_os=rdos ;; rdos32) basic_machine=i386-pc basic_os=rdos ;; rom68k) basic_machine=m68k-rom68k basic_os=coff ;; sa29200) basic_machine=a29k-amd basic_os=udi ;; sei) basic_machine=mips-sei basic_os=seiux ;; sequent) basic_machine=i386-sequent basic_os= ;; sps7) basic_machine=m68k-bull basic_os=sysv2 ;; st2000) basic_machine=m68k-tandem basic_os= ;; stratus) basic_machine=i860-stratus basic_os=sysv4 ;; sun2) basic_machine=m68000-sun basic_os= ;; sun2os3) basic_machine=m68000-sun basic_os=sunos3 ;; sun2os4) basic_machine=m68000-sun basic_os=sunos4 ;; sun3) basic_machine=m68k-sun basic_os= ;; sun3os3) basic_machine=m68k-sun basic_os=sunos3 ;; sun3os4) basic_machine=m68k-sun basic_os=sunos4 ;; sun4) basic_machine=sparc-sun basic_os= ;; sun4os3) basic_machine=sparc-sun basic_os=sunos3 ;; sun4os4) basic_machine=sparc-sun basic_os=sunos4 ;; sun4sol2) basic_machine=sparc-sun basic_os=solaris2 ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun basic_os= ;; sv1) basic_machine=sv1-cray basic_os=unicos ;; symmetry) basic_machine=i386-sequent basic_os=dynix ;; t3e) basic_machine=alphaev5-cray basic_os=unicos ;; t90) basic_machine=t90-cray basic_os=unicos ;; toad1) basic_machine=pdp10-xkl basic_os=tops20 ;; tpf) basic_machine=s390x-ibm basic_os=tpf ;; udi29k) basic_machine=a29k-amd basic_os=udi ;; ultra3) basic_machine=a29k-nyu basic_os=sym1 ;; v810 | necv810) basic_machine=v810-nec basic_os=none ;; vaxv) basic_machine=vax-dec basic_os=sysv ;; vms) basic_machine=vax-dec basic_os=vms ;; vsta) basic_machine=i386-pc basic_os=vsta ;; vxworks960) basic_machine=i960-wrs basic_os=vxworks ;; vxworks68) basic_machine=m68k-wrs basic_os=vxworks ;; vxworks29k) basic_machine=a29k-wrs basic_os=vxworks ;; xbox) basic_machine=i686-pc basic_os=mingw32 ;; ymp) basic_machine=ymp-cray basic_os=unicos ;; *) basic_machine=$1 basic_os= ;; esac ;; esac # Decode 1-component or ad-hoc basic machines case $basic_machine in # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) cpu=hppa1.1 vendor=winbond ;; op50n) cpu=hppa1.1 vendor=oki ;; op60c) cpu=hppa1.1 vendor=oki ;; ibm*) cpu=i370 vendor=ibm ;; orion105) cpu=clipper vendor=highlevel ;; mac | mpw | mac-mpw) cpu=m68k vendor=apple ;; pmac | pmac-mpw) cpu=powerpc vendor=apple ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) cpu=m68000 vendor=att ;; 3b*) cpu=we32k vendor=att ;; bluegene*) cpu=powerpc vendor=ibm basic_os=cnk ;; decsystem10* | dec10*) cpu=pdp10 vendor=dec basic_os=tops10 ;; decsystem20* | dec20*) cpu=pdp10 vendor=dec basic_os=tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) cpu=m68k vendor=motorola ;; dpx2*) cpu=m68k vendor=bull basic_os=sysv3 ;; encore | umax | mmax) cpu=ns32k vendor=encore ;; elxsi) cpu=elxsi vendor=elxsi basic_os=${basic_os:-bsd} ;; fx2800) cpu=i860 vendor=alliant ;; genix) cpu=ns32k vendor=ns ;; h3050r* | hiux*) cpu=hppa1.1 vendor=hitachi basic_os=hiuxwe2 ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) cpu=hppa1.0 vendor=hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) cpu=m68000 vendor=hp ;; hp9k3[2-9][0-9]) cpu=m68k vendor=hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) cpu=hppa1.0 vendor=hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) cpu=hppa1.1 vendor=hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp cpu=hppa1.1 vendor=hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp cpu=hppa1.1 vendor=hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) cpu=hppa1.1 vendor=hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) cpu=hppa1.0 vendor=hp ;; i*86v32) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=sysv32 ;; i*86v4*) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=sysv4 ;; i*86v) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=sysv ;; i*86sol2) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=solaris2 ;; j90 | j90-cray) cpu=j90 vendor=cray basic_os=${basic_os:-unicos} ;; iris | iris4d) cpu=mips vendor=sgi case $basic_os in irix*) ;; *) basic_os=irix4 ;; esac ;; miniframe) cpu=m68000 vendor=convergent ;; *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*) cpu=m68k vendor=atari basic_os=mint ;; news-3600 | risc-news) cpu=mips vendor=sony basic_os=newsos ;; next | m*-next) cpu=m68k vendor=next case $basic_os in openstep*) ;; nextstep*) ;; ns2*) basic_os=nextstep2 ;; *) basic_os=nextstep3 ;; esac ;; np1) cpu=np1 vendor=gould ;; op50n-* | op60c-*) cpu=hppa1.1 vendor=oki basic_os=proelf ;; pa-hitachi) cpu=hppa1.1 vendor=hitachi basic_os=hiuxwe2 ;; pbd) cpu=sparc vendor=tti ;; pbb) cpu=m68k vendor=tti ;; pc532) cpu=ns32k vendor=pc532 ;; pn) cpu=pn vendor=gould ;; power) cpu=power vendor=ibm ;; ps2) cpu=i386 vendor=ibm ;; rm[46]00) cpu=mips vendor=siemens ;; rtpc | rtpc-*) cpu=romp vendor=ibm ;; sde) cpu=mipsisa32 vendor=sde basic_os=${basic_os:-elf} ;; simso-wrs) cpu=sparclite vendor=wrs basic_os=vxworks ;; tower | tower-32) cpu=m68k vendor=ncr ;; vpp*|vx|vx-*) cpu=f301 vendor=fujitsu ;; w65) cpu=w65 vendor=wdc ;; w89k-*) cpu=hppa1.1 vendor=winbond basic_os=proelf ;; none) cpu=none vendor=none ;; leon|leon[3-9]) cpu=sparc vendor=$basic_machine ;; leon-*|leon[3-9]-*) cpu=sparc vendor=`echo "$basic_machine" | sed 's/-.*//'` ;; *-*) # shellcheck disable=SC2162 saved_IFS=$IFS IFS="-" read cpu vendor <&2 exit 1 ;; esac ;; esac # Here we canonicalize certain aliases for manufacturers. case $vendor in digital*) vendor=dec ;; commodore*) vendor=cbm ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if test x$basic_os != x then # First recognize some ad-hoc cases, or perhaps split kernel-os, or else just # set os. case $basic_os in gnu/linux*) kernel=linux os=`echo "$basic_os" | sed -e 's|gnu/linux|gnu|'` ;; os2-emx) kernel=os2 os=`echo "$basic_os" | sed -e 's|os2-emx|emx|'` ;; nto-qnx*) kernel=nto os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'` ;; *-*) # shellcheck disable=SC2162 saved_IFS=$IFS IFS="-" read kernel os <&2 exit 1 ;; esac # As a final step for OS-related things, validate the OS-kernel combination # (given a valid OS), if there is a kernel. case $kernel-$os in linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \ | linux-musl* | linux-relibc* | linux-uclibc* | linux-mlibc* ) ;; uclinux-uclibc* ) ;; managarm-mlibc* | managarm-kernel* ) ;; -dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* | -mlibc* ) # These are just libc implementations, not actual OSes, and thus # require a kernel. echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2 exit 1 ;; -kernel* ) echo "Invalid configuration \`$1': \`$os' needs explicit kernel." 1>&2 exit 1 ;; *-kernel* ) echo "Invalid configuration \`$1': \`$kernel' does not support \`$os'." 1>&2 exit 1 ;; kfreebsd*-gnu* | kopensolaris*-gnu*) ;; vxworks-simlinux | vxworks-simwindows | vxworks-spe) ;; nto-qnx*) ;; os2-emx) ;; *-eabi* | *-gnueabi*) ;; -*) # Blank kernel with real OS is always fine. ;; *-*) echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2 exit 1 ;; esac # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. case $vendor in unknown) case $cpu-$os in *-riscix*) vendor=acorn ;; *-sunos*) vendor=sun ;; *-cnk* | *-aix*) vendor=ibm ;; *-beos*) vendor=be ;; *-hpux*) vendor=hp ;; *-mpeix*) vendor=hp ;; *-hiux*) vendor=hitachi ;; *-unos*) vendor=crds ;; *-dgux*) vendor=dg ;; *-luna*) vendor=omron ;; *-genix*) vendor=ns ;; *-clix*) vendor=intergraph ;; *-mvs* | *-opened*) vendor=ibm ;; *-os400*) vendor=ibm ;; s390-* | s390x-*) vendor=ibm ;; *-ptx*) vendor=sequent ;; *-tpf*) vendor=ibm ;; *-vxsim* | *-vxworks* | *-windiss*) vendor=wrs ;; *-aux*) vendor=apple ;; *-hms*) vendor=hitachi ;; *-mpw* | *-macos*) vendor=apple ;; *-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*) vendor=atari ;; *-vos*) vendor=stratus ;; esac ;; esac echo "$cpu-$vendor-${kernel:+$kernel-}$os" exit # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: logrotate-3.21.0/depcomp0000755000175000017500000005602014346133574012110 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2018-03-07.03; # UTC # Copyright (C) 1999-2021 Free Software Foundation, Inc. # 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, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # Get the directory component of the given path, and save it in the # global variables '$dir'. Note that this directory component will # be either empty or ending with a '/' character. This is deliberate. set_dir_from () { case $1 in */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; *) dir=;; esac } # Get the suffix-stripped basename of the given path, and save it the # global variable '$base'. set_base_from () { base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` } # If no dependency file was actually created by the compiler invocation, # we still have to create a dummy depfile, to avoid errors with the # Makefile "include basename.Plo" scheme. make_dummy_depfile () { echo "#dummy" > "$depfile" } # Factor out some common post-processing of the generated depfile. # Requires the auxiliary global variable '$tmpdepfile' to be set. aix_post_process_depfile () { # If the compiler actually managed to produce a dependency file, # post-process it. if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependency.h'. # Do two passes, one to just change these to # $object: dependency.h # and one to simply output # dependency.h: # which is needed to avoid the deleted-header problem. { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" } > "$depfile" rm -f "$tmpdepfile" else make_dummy_depfile fi } # A tabulation character. tab=' ' # A newline character. nl=' ' # Character ranges might be problematic outside the C locale. # These definitions help. upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ lower=abcdefghijklmnopqrstuvwxyz digits=0123456789 alpha=${upper}${lower} if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Avoid interferences from the environment. gccflag= dashmflag= # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. ## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. ## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). Also, it might not be ## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The second -e expression handles DOS-style file names with drive # letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ | tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done aix_post_process_depfile ;; tcc) # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 # FIXME: That version still under development at the moment of writing. # Make that this statement remains true also for stable, released # versions. # It will wrap lines (doesn't matter whether long or short) with a # trailing '\', as in: # # foo.o : \ # foo.c \ # foo.h \ # # It will put a trailing '\' even on the last line, and will use leading # spaces rather than leading tabs (at least since its commit 0394caf7 # "Emit spaces for -MD"). "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. # We have to change lines of the first kind to '$object: \'. sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" # And for each line of the second kind, we have to emit a 'dep.h:' # dummy dependency, to avoid the deleted-header problem. sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; ## The order of this option in the case statement is important, since the ## shell code in configure will try each of these formats in the order ## listed in this file. A plain '-MD' option would be understood by many ## compilers, so we must ensure this comes after the gcc and icc options. pgcc) # Portland's C compiler understands '-MD'. # Will always output deps to 'file.d' where file is the root name of the # source file under compilation, even if file resides in a subdirectory. # The object file name does not affect the name of the '.d' file. # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... set_dir_from "$object" # Use the source, not the object, to determine the base name, since # that's sadly what pgcc will do too. set_base_from "$source" tmpdepfile=$base.d # For projects that build the same source file twice into different object # files, the pgcc approach of using the *source* file root name can cause # problems in parallel builds. Use a locking strategy to avoid stomping on # the same $tmpdepfile. lockdir=$base.d-lock trap " echo '$0: caught signal, cleaning up...' >&2 rmdir '$lockdir' exit 1 " 1 2 13 15 numtries=100 i=$numtries while test $i -gt 0; do # mkdir is a portable test-and-set. if mkdir "$lockdir" 2>/dev/null; then # This process acquired the lock. "$@" -MD stat=$? # Release the lock. rmdir "$lockdir" break else # If the lock is being held by a different process, wait # until the winning process is done or we timeout. while test -d "$lockdir" && test $i -gt 0; do sleep 1 i=`expr $i - 1` done fi i=`expr $i - 1` done trap - 1 2 13 15 if test $i -le 0; then echo "$0: failed to acquire lock after $numtries attempts" >&2 echo "$0: check lockdir '$lockdir'" >&2 exit 1 fi if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then # Libtool generates 2 separate objects for the 2 libraries. These # two compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir$base.o.d # libtool 1.5 tmpdepfile2=$dir.libs/$base.o.d # Likewise. tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d "$@" -MD fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done # Same post-processing that is required for AIX mode. aix_post_process_depfile ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this sed invocation # correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process the last invocation # correctly. Breaking it into two sed invocations is a workaround. sed '1,2d' "$tmpdepfile" \ | tr ' ' "$nl" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E \ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: logrotate-3.21.0/install-sh0000755000175000017500000003577614346133574012556 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2020-11-14.01; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. tab=' ' nl=' ' IFS=" $tab$nl" # Set DOITPROG to "echo" to test this script. doit=${DOITPROG-} doit_exec=${doit:-exec} # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_mkdir= # Desired mode of installed file. mode=0755 # Create dirs (including intermediate dirs) using mode 755. # This is like GNU 'install' as of coreutils 8.32 (2020). mkdir_umask=22 backupsuffix= chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false is_target_a_directory=possibly usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -p pass -p to $cpprog. -s $stripprog installed files. -S SUFFIX attempt to back up existing files, with suffix SUFFIX. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG By default, rm is invoked with -f; when overridden with RMPROG, it's up to you to specify -f if you want it. If -S is not specified, no backups are attempted. Email bug reports to bug-automake@gnu.org. Automake home page: https://www.gnu.org/software/automake/ " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -p) cpprog="$cpprog -p";; -s) stripcmd=$stripprog;; -S) backupsuffix="$2" shift;; -t) is_target_a_directory=always dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done # We allow the use of options -d and -T together, by making -d # take the precedence; this is for compatibility with GNU install. if test -n "$dir_arg"; then if test -n "$dst_arg"; then echo "$0: target directory not allowed when installing a directory." >&2 exit 1 fi fi if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then if test $# -gt 1 || test "$is_target_a_directory" = always; then if test ! -d "$dst_arg"; then echo "$0: $dst_arg: Is not a directory." >&2 exit 1 fi fi fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? # Don't chown directories that already exist. if test $dstdir_status = 0; then chowncmd="" fi else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename. if test -d "$dst"; then if test "$is_target_a_directory" = never; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dstbase=`basename "$src"` case $dst in */) dst=$dst$dstbase;; *) dst=$dst/$dstbase;; esac dstdir_status=0 else dstdir=`dirname "$dst"` test -d "$dstdir" dstdir_status=$? fi fi case $dstdir in */) dstdirslash=$dstdir;; *) dstdirslash=$dstdir/;; esac obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false # The $RANDOM variable is not portable (e.g., dash). Use it # here however when possible just to lower collision chance. tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap ' ret=$? rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null exit $ret ' 0 # Because "mkdir -p" follows existing symlinks and we likely work # directly in world-writeable /tmp, make sure that the '$tmpdir' # directory is successfully created first before we actually test # 'mkdir -p'. if (umask $mkdir_umask && $mkdirprog $mkdir_mode "$tmpdir" && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. test_tmpdir="$tmpdir/a" ls_ld_tmpdir=`ls -ld "$test_tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null fi trap '' 0;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac oIFS=$IFS IFS=/ set -f set fnord $dstdir shift set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=${dstdirslash}_inst.$$_ rmtmp=${dstdirslash}_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && { test -z "$stripcmd" || { # Create $dsttmp read-write so that cp doesn't create it read-only, # which would cause strip to fail. if test -z "$doit"; then : >"$dsttmp" # No need to fork-exec 'touch'. else $doit touch "$dsttmp" fi } } && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # If $backupsuffix is set, and the file being installed # already exists, attempt a backup. Don't worry if it fails, # e.g., if mv doesn't support -f. if test -n "$backupsuffix" && test -f "$dst"; then $doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null fi # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: logrotate-3.21.0/missing0000755000175000017500000001533614346133574012137 00000000000000#! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1996-2021 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # 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, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=https://www.perl.org/ flex_URL=https://github.com/westes/flex gnu_software_URL=https://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: logrotate-3.21.0/config.c0000644000175000017500000023517314346133207012145 00000000000000#include "queue.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #if !defined(PATH_MAX) && defined(__FreeBSD__) #include #endif #include "log.h" #include "logrotate.h" struct logInfoHead logs; #if !defined(GLOB_ABORTED) && defined(GLOB_ABEND) #define GLOB_ABORTED GLOB_ABEND #endif #define REALLOC_STEP 10 #define GLOB_STR_REALLOC_STEP 0x100 #if defined(SunOS) && !defined(isblank) #define isblank(c) ( ( (c) == ' ' || (c) == '\t' ) ? 1 : 0 ) #endif #ifdef __hpux #include "asprintf.c" #endif #if !defined(HAVE_SECURE_GETENV) #define secure_getenv getenv #endif #if !defined(HAVE_ASPRINTF) && !defined(_FORTIFY_SOURCE) #include int asprintf(char **string_ptr, const char *format, ...) { va_list arg; char *str; int size; int rv; va_start(arg, format); size = vsnprintf(NULL, 0, format, arg); va_end(arg); if (size < 0) { return -1; } str = malloc((size_t)size + 1); if (str == NULL) { return -1; } va_start(arg, format); rv = vsnprintf(str, (size_t)size + 1, format, arg); va_end(arg); *string_ptr = str; return rv; } #endif #if !defined(HAVE_STRNDUP) char *strndup(const char *s, size_t n) { size_t nAvail; char *p; /* min() */ nAvail = strlen(s) + 1; if ( (n + 1) < nAvail) nAvail = n + 1; p = malloc(nAvail); if (!p) return NULL; memcpy(p, s, nAvail); p[nAvail - 1] = 0; return p; } #endif /* list of compression commands and the corresponding file extensions */ struct compress_cmd_item { const char *cmd; const char *ext; }; static const struct compress_cmd_item compress_cmd_list[] = { {"gzip", ".gz"}, {"bzip2", ".bz2"}, {"xz", ".xz"}, {"zstd", ".zst"}, {"compress", ".Z"}, {"zip", "zip"}, }; static const unsigned compress_cmd_list_size = sizeof(compress_cmd_list) / sizeof(compress_cmd_list[0]); enum { STATE_DEFAULT = 2, STATE_SKIP_LINE = 4, STATE_DEFINITION_END = 8, STATE_SKIP_CONFIG = 16, STATE_LOAD_SCRIPT = 32, STATE_ERROR = 64, }; static const char *const defTabooExts[] = { ",v", ".bak", ".cfsaved", ".disabled", ".dpkg-bak", ".dpkg-del", ".dpkg-dist", ".dpkg-new", ".dpkg-old", ".dpkg-tmp", ".rhn-cfg-tmp-*", ".rpmnew", ".rpmorig", ".rpmsave", ".swp", ".ucf-dist", ".ucf-new", ".ucf-old", "~" }; static const unsigned defTabooCount = sizeof(defTabooExts) / sizeof(char *); /* I shouldn't use globals here :-( */ static char **tabooPatterns = NULL; static unsigned tabooCount = 0; static int glob_errno = 0; static int readConfigFile(const char *configFile, struct logInfo *defConfig); static int globerr(const char *pathname, int theerr); static char *isolateLine(char **strt, char **buf, size_t length) { char *endtag, *start, *tmp; const char *max = *buf + length; char *key; start = *strt; endtag = start; while (endtag < max && *endtag != '\n') { endtag++;} if (max < endtag) return NULL; tmp = endtag - 1; while (isspace((unsigned char)*endtag)) endtag--; key = strndup(start, (size_t)(endtag - start + 1)); if (key == NULL) { message_OOM(); return NULL; } *strt = tmp; return key; } static char *isolateValue(const char *fileName, int lineNum, const char *key, char **startPtr, char **buf, size_t length) { char *chptr = *startPtr; const char *max = *startPtr + length; while (chptr < max && isblank((unsigned char)*chptr)) chptr++; if (chptr < max && *chptr == '=') { chptr++; while ( chptr < max && isblank((unsigned char)*chptr)) chptr++; } if (chptr < max && *chptr == '\n') { message(MESS_ERROR, "%s:%d argument expected after %s\n", fileName, lineNum, key); return NULL; } *startPtr = chptr; return isolateLine(startPtr, buf, length); } static char *isolateWord(char **strt, char **buf, size_t length) { char *endtag, *start; const char *max = *buf + length; char *key; start = *strt; while (start < max && isblank((unsigned char)*start)) start++; endtag = start; while (endtag < max && isalpha((unsigned char)*endtag)) { endtag++;} if (max < endtag) return NULL; key = strndup(start, (size_t)(endtag - start)); if (key == NULL) { message_OOM(); return NULL; } *strt = endtag; return key; } static char *readPath(const char *configFile, int lineNum, const char *key, char **startPtr, char **buf, size_t length) { char *path = isolateValue(configFile, lineNum, key, startPtr, buf, length); if (path != NULL) { wchar_t pwc; size_t len; const char *chptr = path; while (*chptr && (len = mbrtowc(&pwc, chptr, strlen(chptr), NULL)) != 0) { if (len == (size_t)(-1) || len == (size_t)(-2) || !iswprint((wint_t)pwc) || iswblank((wint_t)pwc)) { message(MESS_ERROR, "%s:%d bad %s path %s\n", configFile, lineNum, key, path); free(path); return NULL; } chptr += len; } } return path; } /* set *pUid to UID of the given user, return non-zero on failure */ static int resolveUid(const char *userName, uid_t *pUid) { const struct passwd *pw; char *endptr; unsigned long int parsed_uid; #ifdef __CYGWIN__ if (strcmp(userName, "root") == 0) { *pUid = 0; return 0; } #endif pw = getpwnam(userName); if (pw) { *pUid = pw->pw_uid; return 0; } parsed_uid = strtoul(userName, &endptr, 10); if (userName[0] != '\0' && *endptr == '\0' && parsed_uid < INT_MAX && /* parsed_uid != ULONG_MAX && */ getpwuid((uid_t)parsed_uid) != NULL) { *pUid = (uid_t)parsed_uid; return 0; } return -1; } /* set *pGid to GID of the given group, return non-zero on failure */ static int resolveGid(const char *groupName, gid_t *pGid) { const struct group *gr; char *endptr; unsigned long int parsed_gid; #ifdef __CYGWIN__ if (strcmp(groupName, "root") == 0) { *pGid = 0; return 0; } #endif gr = getgrnam(groupName); if (gr) { *pGid = gr->gr_gid; return 0; } parsed_gid = strtoul(groupName, &endptr, 10); if (groupName[0] != '\0' && *endptr == '\0' && parsed_gid < INT_MAX && /* parsed_gid != ULONG_MAX && */ getgrgid((gid_t)parsed_gid) != NULL) { *pGid = (gid_t)parsed_gid; return 0; } return -1; } static int readModeUidGid(const char *configFile, int lineNum, const char *key, const char *directive, mode_t *mode, uid_t *pUid, gid_t *pGid) { char u[200], g[200]; mode_t m = 0; char tmp; int rc; if (!strcmp("su", directive)) /* do not read for the 'su' directive */ rc = 0; else { unsigned short int parsed_mode; rc = sscanf(key, "%ho %199s %199s%c", &parsed_mode, u, g, &tmp); m = parsed_mode; } /* We support 'key notation now */ if (rc == 0) { rc = sscanf(key, "%199s %199s%c", u, g, &tmp); /* Simulate that we have read mode and keep the default value. */ if (rc > 0) { m = *mode; rc += 1; } } if (rc == 4) { message(MESS_ERROR, "%s:%d extra arguments for " "%s\n", configFile, lineNum, directive); return -1; } if (rc > 0) { *mode = m; } if (rc > 1) { if (resolveUid(u, pUid) != 0) { message(MESS_ERROR, "%s:%d unknown user '%s'\n", configFile, lineNum, u); return -1; } } if (rc > 2) { if (resolveGid(g, pGid) != 0) { message(MESS_ERROR, "%s:%d unknown group '%s'\n", configFile, lineNum, g); return -1; } } return 0; } static char *readAddress(const char *configFile, int lineNum, const char *key, char **startPtr, char **buf, size_t length) { char *start = *startPtr; char *address = isolateValue(configFile, lineNum, key, startPtr, buf, length); if (address != NULL) { /* validate the address */ const char *chptr = address; while (isprint((unsigned char) *chptr) && *chptr != ' ') { chptr++; } if (*chptr) { message(MESS_ERROR, "%s:%d bad %s address %s\n", configFile, lineNum, key, start); free(address); return NULL; } } return address; } static int do_mkdir(const char *path, mode_t mode, uid_t uid, gid_t gid) { if (mkdir(path, mode) == 0) { int fd; /* newly created directory, set the owner and permissions */ fd = open(path, O_RDONLY | O_DIRECTORY | O_NOFOLLOW); if (fd < 0) { message(MESS_ERROR, "error opening %s after creation: %s\n", path, strerror(errno)); return -1; } if (fchown(fd, uid, gid) != 0) { message(MESS_ERROR, "error setting owner of %s to uid %u and gid %u: %s\n", path, (unsigned) uid, (unsigned) gid, strerror(errno)); close(fd); return -1; } if (fchmod(fd, mode) != 0) { message(MESS_ERROR, "error setting permissions of %s to 0%o: %s\n", path, mode, strerror(errno)); close(fd); return -1; } close(fd); return 0; } if (errno == EEXIST) { /* path already exists, check whether it is a directory or not */ struct stat sb; if ((stat(path, &sb) == 0) && S_ISDIR(sb.st_mode)) return 0; message(MESS_ERROR, "path %s already exists, but it is not a directory\n", path); errno = ENOTDIR; return -1; } message(MESS_ERROR, "error creating %s: %s\n", path, strerror(errno)); return -1; } static int mkpath(const char *path, mode_t mode, uid_t uid, gid_t gid) { char *pp; char *sp; int rv; char *copypath = strdup(path); if (!copypath) { message_OOM(); return 1; } rv = 0; pp = copypath; while (rv == 0 && (sp = strchr(pp, '/')) != NULL) { if (sp != pp) { *sp = '\0'; rv = do_mkdir(copypath, mode, uid, gid); *sp = '/'; } pp = sp + 1; } if (rv == 0) { rv = do_mkdir(path, mode, uid, gid); } free(copypath); return rv; } static int checkFile(const char *fname) { unsigned i; /* Check if fname is '.' or '..'; if so, return false */ if (fname[0] == '.' && (!fname[1] || (fname[1] == '.' && !fname[2]))) return 0; /* Check if fname is ending in a taboo-extension; if so, return false */ for (i = 0; i < tabooCount; i++) { const char *pattern = tabooPatterns[i]; if (!fnmatch(pattern, fname, FNM_PERIOD)) { message(MESS_DEBUG, "Ignoring %s, because of %s pattern match\n", fname, pattern); return 0; } } /* All checks have been passed; return true */ return 1; } /* Used by qsort to sort filelist */ static int compar(const void *p, const void *q) { return strcoll(*((char * const*) p), *((char * const*) q)); } /* Free memory blocks pointed to by pointers in a 2d array and the array itself */ static void free_2d_array(char **array, unsigned lines_count) { unsigned i; for (i = 0; i < lines_count; ++i) free(array[i]); free(array); } #define MEMBER_COPY(dest, src) \ do { \ if ((src) && rv == 0) { \ (dest) = strdup(src); \ if ((dest) == NULL) { \ message_OOM(); \ rv = 1; \ } \ } else { \ (dest) = NULL; \ } \ } while (0) static int copyLogInfo(struct logInfo *to, const struct logInfo *from) { int rv = 0; memset(to, 0, sizeof(*to)); MEMBER_COPY(to->oldDir, from->oldDir); to->criterium = from->criterium; to->weekday = from->weekday; to->threshold = from->threshold; to->minsize = from->minsize; to->maxsize = from->maxsize; to->rotateCount = from->rotateCount; to->rotateMinAge = from->rotateMinAge; to->rotateAge = from->rotateAge; to->logStart = from->logStart; MEMBER_COPY(to->pre, from->pre); MEMBER_COPY(to->post, from->post); MEMBER_COPY(to->first, from->first); MEMBER_COPY(to->last, from->last); MEMBER_COPY(to->preremove, from->preremove); MEMBER_COPY(to->logAddress , from->logAddress); MEMBER_COPY(to->extension, from->extension); MEMBER_COPY(to->compress_prog, from->compress_prog); MEMBER_COPY(to->uncompress_prog, from->uncompress_prog); MEMBER_COPY(to->compress_ext, from->compress_ext); to->flags = from->flags; to->shred_cycles = from->shred_cycles; to->createMode = from->createMode; to->createUid = from->createUid; to->createGid = from->createGid; to->suUid = from->suUid; to->suGid = from->suGid; to->olddirMode = from->olddirMode; to->olddirUid = from->olddirUid; to->olddirGid = from->olddirGid; if (from->compress_options_count) { poptDupArgv(from->compress_options_count, from->compress_options_list, &to->compress_options_count, &to->compress_options_list); if (to->compress_options_list == NULL) { message_OOM(); rv = 1; } } MEMBER_COPY(to->dateformat, from->dateformat); to->list = from->list; return rv; } #undef MEMBER_COPY static void freeLogInfo(struct logInfo *log) { free(log->pattern); free_2d_array(log->files, log->numFiles); free(log->oldDir); free(log->pre); free(log->post); free(log->first); free(log->last); free(log->preremove); free(log->logAddress); free(log->extension); free(log->compress_prog); free(log->uncompress_prog); free(log->compress_ext); free(log->compress_options_list); free(log->dateformat); } static struct logInfo *newLogInfo(const struct logInfo *template) { struct logInfo *new; new = malloc(sizeof(*new)); if (new == NULL) { message_OOM(); return NULL; } if (copyLogInfo(new, template)) { freeLogInfo(new); free(new); return NULL; } TAILQ_INSERT_TAIL(&logs, new, list); numLogs++; return new; } static void removeLogInfo(struct logInfo *log) { if (log == NULL) return; freeLogInfo(log); TAILQ_REMOVE(&logs, log, list); free(log); numLogs--; } static void freeTailLogs(int num) { message(MESS_DEBUG, "removing last %d log configs\n", num); while (num--) removeLogInfo(TAILQ_LAST(&logs, logInfoHead)); } static const char *crit_to_string(enum criterium crit) { switch (crit) { case ROT_HOURLY: return "hourly"; case ROT_DAYS: return "daily"; case ROT_WEEKLY: return "weekly"; case ROT_MONTHLY: return "monthly"; case ROT_YEARLY: return "yearly"; case ROT_SIZE: return "size"; default: return "XXX"; } } static void set_criterium(enum criterium *pDst, enum criterium src, int *pSet) { if (*pSet && (*pDst != src)) { /* we are overriding a previously set criterium */ message(MESS_DEBUG, "note: '%s' overrides previously specified '%s'\n", crit_to_string(src), crit_to_string(*pDst)); } *pDst = src; *pSet = 1; } static int readConfigPath(const char *path, struct logInfo *defConfig) { struct stat sb; int result = 0; struct logInfo defConfigBackup; if (stat(path, &sb)) { message(MESS_ERROR, "cannot stat %s: %s\n", path, strerror(errno)); return 1; } if (S_ISDIR(sb.st_mode)) { char **namelist = NULL; struct dirent *dp; int here; unsigned files_count = 0, i; DIR *dirp; if ((here = open(".", O_RDONLY)) == -1) { message(MESS_ERROR, "cannot open current directory: %s\n", strerror(errno)); return 1; } if ((dirp = opendir(path)) == NULL) { message(MESS_ERROR, "cannot open directory %s: %s\n", path, strerror(errno)); close(here); return 1; } while ((dp = readdir(dirp)) != NULL) { if (checkFile(dp->d_name)) { /* Realloc memory for namelist array if necessary */ if (files_count % REALLOC_STEP == 0) { char **p = (char **) realloc(namelist, (files_count + REALLOC_STEP) * sizeof(char *)); if (p) { namelist = p; memset(namelist + files_count, '\0', REALLOC_STEP * sizeof(char *)); } else { free_2d_array(namelist, files_count); closedir(dirp); close(here); message_OOM(); return 1; } } /* Alloc memory for file name */ namelist[files_count] = strdup(dp->d_name); if (namelist[files_count] != NULL) { files_count++; } else { free_2d_array(namelist, files_count); closedir(dirp); close(here); message_OOM(); return 1; } } } closedir(dirp); if (files_count > 0) { qsort(namelist, files_count, sizeof(char *), compar); } else { close(here); return 0; } if (chdir(path)) { message(MESS_ERROR, "error in chdir(\"%s\"): %s\n", path, strerror(errno)); close(here); free_2d_array(namelist, files_count); return 1; } for (i = 0; i < files_count; ++i) { assert(namelist[i] != NULL); if (copyLogInfo(&defConfigBackup, defConfig)) { freeLogInfo(&defConfigBackup); close(here); free_2d_array(namelist, files_count); return 1; } if (readConfigFile(namelist[i], defConfig)) { message(MESS_ERROR, "found error in file %s, skipping\n", namelist[i]); freeLogInfo(defConfig); if (copyLogInfo(defConfig, &defConfigBackup)){} /* do not check, we are already in a error path */ freeLogInfo(&defConfigBackup); result = 1; continue; } freeLogInfo(&defConfigBackup); } if (fchdir(here) < 0) { message(MESS_ERROR, "could not change directory to '.': %s\n", strerror(errno)); } close(here); free_2d_array(namelist, files_count); } else { if (copyLogInfo(&defConfigBackup, defConfig)) { freeLogInfo(&defConfigBackup); return 1; } if (readConfigFile(path, defConfig)) { freeLogInfo(defConfig); if (copyLogInfo(defConfig, &defConfigBackup)){} /* do not check, we are already in a error path */ result = 1; } freeLogInfo(&defConfigBackup); } return result; } int readAllConfigPaths(const char **paths) { int result = 0; unsigned i; const char **file; struct logInfo defConfig = { .pattern = NULL, .files = NULL, .numFiles = 0, .oldDir = NULL, .criterium = ROT_SIZE, .threshold = 1024 * 1024, .minsize = 0, .maxsize = 0, .rotateCount = 0, .rotateMinAge = 0, .rotateAge = 0, .logStart = 1, .pre = NULL, .post = NULL, .first = NULL, .last = NULL, .preremove = NULL, .logAddress = NULL, .extension = NULL, .addextension = NULL, .compress_prog = NULL, .uncompress_prog = NULL, .compress_ext = NULL, .dateformat = NULL, .flags = LOG_FLAG_IFEMPTY, .shred_cycles = 0, .createMode = NO_MODE, .createUid = NO_UID, .createGid = NO_GID, .olddirMode = NO_MODE, .olddirUid = NO_UID, .olddirGid = NO_GID, .suUid = NO_UID, .suGid = NO_GID, .compress_options_list = NULL, .compress_options_count = 0 }; tabooPatterns = malloc(sizeof(*tabooPatterns) * defTabooCount); if (tabooPatterns == NULL) { message_OOM(); return 1; } for (i = 0; i < defTabooCount; i++) { char *pattern = NULL; /* generate a pattern by concatenating star (wildcard) to the * suffix literal */ if (asprintf(&pattern, "*%s", defTabooExts[i]) < 0) { free_2d_array(tabooPatterns, tabooCount); message_OOM(); return 1; } tabooPatterns[i] = pattern; tabooCount++; } for (file = paths; *file; file++) { if (readConfigPath(*file, &defConfig)) result = 1; } free_2d_array(tabooPatterns, tabooCount); freeLogInfo(&defConfig); return result; } static char* parseGlobString(const char *configFile, int lineNum, const char *buf, size_t length, char **ppos) { /* output buffer */ char *globString = NULL; size_t globStringPos = 0; size_t globStringAlloc = 0; enum { PGS_INIT, /* picking blanks, looking for '#' */ PGS_DATA, /* picking data, looking for end of line */ PGS_COMMENT /* skipping comment, looking for end of line */ } state = PGS_INIT; /* move the cursor at caller's side while going through the input */ for (; ((size_t)(*ppos - buf) < length) && **ppos; (*ppos)++) { /* state transition (see above) */ switch (state) { case PGS_INIT: if ('#' == **ppos) state = PGS_COMMENT; else if (!isspace((unsigned char) **ppos)) state = PGS_DATA; break; default: if ('\n' == **ppos) state = PGS_INIT; } if (PGS_COMMENT == state) /* skip comment */ continue; switch (**ppos) { case '}': message(MESS_ERROR, "%s:%d unexpected } (missing previous '{')\n", configFile, lineNum); free(globString); return NULL; case '{': /* NUL-terminate globString */ assert(globStringPos < globStringAlloc); globString[globStringPos] = '\0'; return globString; default: break; } /* grow the output buffer if needed */ if (globStringPos + 2 > globStringAlloc) { char *ptr; globStringAlloc += GLOB_STR_REALLOC_STEP; ptr = realloc(globString, globStringAlloc); if (!ptr) { message_OOM(); free(globString); return NULL; } globString = ptr; } /* copy a single character */ globString[globStringPos++] = **ppos; } /* premature end of input */ message(MESS_ERROR, "%s:%d missing '{' after log files definition\n", configFile, lineNum); free(globString); return NULL; } static int globerr(const char *pathname, int theerr) { (void) pathname; /* prevent glob() from being aborted in certain cases */ switch (theerr) { case ENOTDIR: /* non-directory where directory was expected by the glob */ return 0; case ENOENT: /* most likely symlink with non-existent target */ return 0; default: break; } glob_errno = theerr; /* We want the glob operation to abort on error, so return 1 */ return 1; } static int expand_home_relative_path(char **path) { const char *env_home; char *new_path = NULL; if (!*path || (*path)[0] != '~' || (*path)[1] != '/') return 0; env_home = secure_getenv("HOME"); if (!env_home) { const struct passwd *pwd; message(MESS_DEBUG, "cannot get HOME directory from environment " "to replace ~/, trying password database...\n"); pwd = getpwuid(getuid()); if (!pwd) { message(MESS_ERROR, "cannot get passwd entry for " "running user %u: %s\n", getuid(), strerror(errno)); return 1; } env_home = pwd->pw_dir; } if (asprintf(&new_path, "%s/%s", env_home, *path + 2) < 0) { message_OOM(); return 1; } message(MESS_DEBUG, "replaced '%s' with '%s'\n", *path, new_path); free(*path); *path = new_path; return 0; } #define freeLogItem(what) \ do { \ free(newlog->what); \ newlog->what = NULL; \ } while (0) #define RAISE_ERROR() \ do { \ if (newlog != defConfig) { \ state = STATE_ERROR; \ goto next_state; \ } else { \ goto error; \ } \ } while (0) #define MAX_NESTING 16U static int readConfigFile(const char *configFile, struct logInfo *defConfig) { int fd; char *buf, *key = NULL; size_t length; int lineNum = 1; char *scriptStart = NULL; char **scriptDest = NULL; struct logInfo *newlog = defConfig; char *start, *chptr; struct stat sb_config; int state = STATE_DEFAULT; int logerror = 0; /* to check if incompatible criteria are specified */ int criterium_set = 0; static unsigned recursion_depth = 0U; char *globerr_msg = NULL; int in_config = 0; #ifdef HAVE_MADVISE int r; #endif struct flock fd_lock = { .l_start = 0, .l_len = 0, .l_whence = SEEK_SET, .l_type = F_RDLCK }; fd = open(configFile, O_RDONLY); if (fd < 0) { message(MESS_ERROR, "failed to open config file %s: %s\n", configFile, strerror(errno)); return 1; } /* We don't want anybody to change the file while we parse it, * let's try to lock it for reading. */ if (fcntl(fd, F_SETLK, &fd_lock) == -1) { message(MESS_ERROR, "Could not lock file %s for reading\n", configFile); } if (fstat(fd, &sb_config)) { message(MESS_ERROR, "fstat of %s failed: %s\n", configFile, strerror(errno)); close(fd); return 1; } if (!S_ISREG(sb_config.st_mode)) { message(MESS_DEBUG, "Ignoring %s because it's not a regular file.\n", configFile); close(fd); return 0; } if (getuid() == ROOT_UID) { if ((sb_config.st_mode & 07533) != 0400) { message(MESS_WARN, "Potentially dangerous mode on %s: 0%o\n", configFile, (unsigned) (sb_config.st_mode & 07777)); } if (sb_config.st_mode & 0022) { message(MESS_ERROR, "Ignoring %s because it is writable by group or others.\n", configFile); close(fd); return 0; } if (sb_config.st_uid != ROOT_UID) { message(MESS_ERROR, "Ignoring %s because the file owner is wrong (should be root or user with uid 0).\n", configFile); close(fd); return 0; } } length = (size_t)sb_config.st_size; if (length > 0xffffff) { message(MESS_ERROR, "file %s too large, probably not a config file.\n", configFile); close(fd); return 1; } /* We can't mmap empty file... */ if (length == 0) { message(MESS_DEBUG, "Ignoring %s because it's empty.\n", configFile); close(fd); return 0; } #ifdef MAP_POPULATE buf = mmap(NULL, length, PROT_READ, MAP_PRIVATE | MAP_POPULATE, fd, (off_t) 0); #else /* MAP_POPULATE */ buf = mmap(NULL, length, PROT_READ, MAP_PRIVATE, fd, (off_t) 0); #endif /* MAP_POPULATE */ if (buf == MAP_FAILED) { message(MESS_ERROR, "Error mapping config file %s: %s\n", configFile, strerror(errno)); close(fd); return 1; } #ifdef HAVE_MADVISE #ifdef MADV_DONTFORK r = madvise(buf, length, MADV_SEQUENTIAL | MADV_WILLNEED | MADV_DONTFORK); #else /* MADV_DONTFORK */ r = madvise(buf, length, MADV_SEQUENTIAL | MADV_WILLNEED); #endif /* MADV_DONTFORK */ if (r < 0) { message(MESS_DEBUG, "Failed to advise use of memory: %s\n", strerror(errno)); } #endif /* HAVE_MADVISE */ message(MESS_DEBUG, "reading config file %s\n", configFile); for (start = buf; (size_t)(start - buf) < length; start++) { switch (state) { case STATE_DEFAULT: if (isblank((unsigned char)*start)) continue; /* Skip comment */ if (*start == '#') { state = STATE_SKIP_LINE; continue; } if (isalpha((unsigned char)*start)) { free(key); key = isolateWord(&start, &buf, length); if (key == NULL) { message(MESS_ERROR, "%s:%d failed to parse keyword\n", configFile, lineNum); RAISE_ERROR(); } if (!isspace((unsigned char)*start) && *start != '=') { message(MESS_ERROR, "%s:%d keyword '%s' not properly" " separated, found %#x\n", configFile, lineNum, key, *start); RAISE_ERROR(); } if (!strcmp(key, "compress")) { newlog->flags |= LOG_FLAG_COMPRESS; } else if (!strcmp(key, "nocompress")) { newlog->flags &= ~LOG_FLAG_COMPRESS; } else if (!strcmp(key, "delaycompress")) { newlog->flags |= LOG_FLAG_DELAYCOMPRESS; } else if (!strcmp(key, "nodelaycompress")) { newlog->flags &= ~LOG_FLAG_DELAYCOMPRESS; } else if (!strcmp(key, "shred")) { newlog->flags |= LOG_FLAG_SHRED; } else if (!strcmp(key, "noshred")) { newlog->flags &= ~LOG_FLAG_SHRED; } else if (!strcmp(key, "allowhardlink")) { newlog->flags |= LOG_FLAG_ALLOWHARDLINK; } else if (!strcmp(key, "noallowhardlink")) { newlog->flags &= ~LOG_FLAG_ALLOWHARDLINK; } else if (!strcmp(key, "sharedscripts")) { newlog->flags |= LOG_FLAG_SHAREDSCRIPTS; } else if (!strcmp(key, "nosharedscripts")) { newlog->flags &= ~LOG_FLAG_SHAREDSCRIPTS; } else if (!strcmp(key, "copytruncate")) { newlog->flags |= LOG_FLAG_COPYTRUNCATE; newlog->flags &= ~LOG_FLAG_TMPFILENAME; } else if (!strcmp(key, "nocopytruncate")) { newlog->flags &= ~LOG_FLAG_COPYTRUNCATE; } else if (!strcmp(key, "renamecopy")) { newlog->flags |= LOG_FLAG_TMPFILENAME; newlog->flags &= ~LOG_FLAG_COPYTRUNCATE; } else if (!strcmp(key, "norenamecopy")) { newlog->flags &= ~LOG_FLAG_TMPFILENAME; } else if (!strcmp(key, "copy")) { newlog->flags |= LOG_FLAG_COPY; } else if (!strcmp(key, "nocopy")) { newlog->flags &= ~LOG_FLAG_COPY; } else if (!strcmp(key, "ifempty")) { newlog->flags |= LOG_FLAG_IFEMPTY; } else if (!strcmp(key, "notifempty")) { newlog->flags &= ~LOG_FLAG_IFEMPTY; } else if (!strcmp(key, "dateext")) { newlog->flags |= LOG_FLAG_DATEEXT; } else if (!strcmp(key, "nodateext")) { newlog->flags &= ~LOG_FLAG_DATEEXT; } else if (!strcmp(key, "dateyesterday")) { newlog->flags |= LOG_FLAG_DATEYESTERDAY; } else if (!strcmp(key, "datehourago")) { newlog->flags |= LOG_FLAG_DATEHOURAGO; } else if (!strcmp(key, "dateformat")) { freeLogItem(dateformat); newlog->dateformat = isolateValue(configFile, lineNum, key, &start, &buf, length); } else if (!strcmp(key, "noolddir")) { freeLogItem(oldDir); } else if (!strcmp(key, "mailfirst")) { newlog->flags |= LOG_FLAG_MAILFIRST; } else if (!strcmp(key, "maillast")) { newlog->flags &= ~LOG_FLAG_MAILFIRST; } else if (!strcmp(key, "su")) { int rv; mode_t tmp_mode = NO_MODE; free(key); key = isolateLine(&start, &buf, length); if (key == NULL) { message(MESS_ERROR, "%s:%d failed to parse su option value\n", configFile, lineNum); RAISE_ERROR(); } rv = readModeUidGid(configFile, lineNum, key, "su", &tmp_mode, &newlog->suUid, &newlog->suGid); if (rv == -1) { RAISE_ERROR(); } else if (tmp_mode != NO_MODE) { message(MESS_ERROR, "%s:%d extra arguments for " "su\n", configFile, lineNum); RAISE_ERROR(); } else if (newlog->suUid == NO_UID) { message(MESS_ERROR, "%s:%d no user for " "su\n", configFile, lineNum); RAISE_ERROR(); } else if (newlog->suGid == NO_GID) { message(MESS_ERROR, "%s:%d no group for " "su\n", configFile, lineNum); RAISE_ERROR(); } newlog->flags |= LOG_FLAG_SU; } else if (!strcmp(key, "create")) { int rv; free(key); key = isolateLine(&start, &buf, length); if (key == NULL) continue; rv = readModeUidGid(configFile, lineNum, key, "create", &newlog->createMode, &newlog->createUid, &newlog->createGid); if (rv == -1) { RAISE_ERROR(); } newlog->flags |= LOG_FLAG_CREATE; } else if (!strcmp(key, "createolddir")) { int rv; free(key); key = isolateLine(&start, &buf, length); if (key == NULL) continue; rv = readModeUidGid(configFile, lineNum, key, "createolddir", &newlog->olddirMode, &newlog->olddirUid, &newlog->olddirGid); if (rv == -1) { RAISE_ERROR(); } newlog->flags |= LOG_FLAG_OLDDIRCREATE; } else if (!strcmp(key, "nocreateolddir")) { newlog->flags &= ~LOG_FLAG_OLDDIRCREATE; } else if (!strcmp(key, "nocreate")) { newlog->flags &= ~LOG_FLAG_CREATE; } else if (!strcmp(key, "size") || !strcmp(key, "minsize") || !strcmp(key, "maxsize")) { char *opt = key; key = isolateValue(configFile, lineNum, opt, &start, &buf, length); if (key && key[0]) { off_t size; unsigned long multiplier; const size_t l = strlen(key) - 1; if (key[l] == 'k' || key[l] == 'K') { key[l] = '\0'; multiplier = 1024; } else if (key[l] == 'M') { key[l] = '\0'; multiplier = 1024 * 1024; } else if (key[l] == 'G') { key[l] = '\0'; multiplier = 1024 * 1024 * 1024; } else if (!isdigit((unsigned char)key[l])) { free(opt); message(MESS_ERROR, "%s:%d unknown unit '%c'\n", configFile, lineNum, key[l]); RAISE_ERROR(); } else { multiplier = 1; } size = (off_t) (multiplier * strtoull(key, &chptr, 0)); if (*chptr || size < 0) { message(MESS_ERROR, "%s:%d bad size '%s'\n", configFile, lineNum, key); free(opt); RAISE_ERROR(); } if (!strncmp(opt, "size", 4)) { set_criterium(&newlog->criterium, ROT_SIZE, &criterium_set); newlog->threshold = size; } else if (!strncmp(opt, "maxsize", 7)) { newlog->maxsize = size; } else { newlog->minsize = size; } free(opt); } else { free(opt); continue; } } else if (!strcmp(key, "shredcycles")) { free(key); key = isolateValue(configFile, lineNum, "shred cycles", &start, &buf, length); if (key == NULL) { RAISE_ERROR(); } newlog->shred_cycles = (int)strtoul(key, &chptr, 0); if (*chptr || newlog->shred_cycles < 0) { message(MESS_ERROR, "%s:%d bad shred cycles '%s'\n", configFile, lineNum, key); RAISE_ERROR(); } } else if (!strcmp(key, "hourly")) { set_criterium(&newlog->criterium, ROT_HOURLY, &criterium_set); } else if (!strcmp(key, "daily")) { set_criterium(&newlog->criterium, ROT_DAYS, &criterium_set); newlog->threshold = 1; } else if (!strcmp(key, "monthly")) { set_criterium(&newlog->criterium, ROT_MONTHLY, &criterium_set); } else if (!strcmp(key, "weekly")) { unsigned weekday; char tmp; set_criterium(&newlog->criterium, ROT_WEEKLY, &criterium_set); free(key); key = isolateLine(&start, &buf, length); if (key == NULL || key[0] == '\0') { /* default to Sunday if no argument was given */ newlog->weekday = 0; continue; } if (1 == sscanf(key, "%u%c", &weekday, &tmp) && weekday <= 7) { /* use the selected weekday, 7 means "once per week" */ newlog->weekday = weekday; continue; } message(MESS_ERROR, "%s:%d bad weekly directive '%s'\n", configFile, lineNum, key); goto error; } else if (!strcmp(key, "yearly")) { set_criterium(&newlog->criterium, ROT_YEARLY, &criterium_set); } else if (!strcmp(key, "rotate")) { free(key); key = isolateValue(configFile, lineNum, "rotate count", &start, &buf, length); if (key == NULL) { RAISE_ERROR(); } newlog->rotateCount = (int)strtol(key, &chptr, 0); if (*chptr || newlog->rotateCount < -1) { message(MESS_ERROR, "%s:%d bad rotation count '%s'\n", configFile, lineNum, key); RAISE_ERROR(); } } else if (!strcmp(key, "start")) { free(key); key = isolateValue(configFile, lineNum, "start count", &start, &buf, length); if (key == NULL) { RAISE_ERROR(); } newlog->logStart = (int)strtoul(key, &chptr, 0); if (*chptr || newlog->logStart < 0) { message(MESS_ERROR, "%s:%d bad start count '%s'\n", configFile, lineNum, key); RAISE_ERROR(); } } else if (!strcmp(key, "minage")) { free(key); key = isolateValue(configFile, lineNum, "minage count", &start, &buf, length); if (key == NULL) { RAISE_ERROR(); } newlog->rotateMinAge = (int)strtoul(key, &chptr, 0); if (*chptr || newlog->rotateMinAge < 0) { message(MESS_ERROR, "%s:%d bad minimum age '%s'\n", configFile, lineNum, start); RAISE_ERROR(); } } else if (!strcmp(key, "maxage")) { free(key); key = isolateValue(configFile, lineNum, "maxage count", &start, &buf, length); if (key == NULL) { RAISE_ERROR(); } newlog->rotateAge = (int)strtoul(key, &chptr, 0); if (*chptr || newlog->rotateAge < 0) { message(MESS_ERROR, "%s:%d bad maximum age '%s'\n", configFile, lineNum, start); RAISE_ERROR(); } } else if (!strcmp(key, "errors")) { message(MESS_WARN, "%s: %d: the errors directive is deprecated and no longer used.\n", configFile, lineNum); } else if (!strcmp(key, "mail")) { freeLogItem(logAddress); if (!(newlog->logAddress = readAddress(configFile, lineNum, "mail", &start, &buf, length))) { RAISE_ERROR(); } } else if (!strcmp(key, "nomail")) { freeLogItem(logAddress); } else if (!strcmp(key, "missingok")) { newlog->flags |= LOG_FLAG_MISSINGOK; } else if (!strcmp(key, "nomissingok")) { newlog->flags &= ~LOG_FLAG_MISSINGOK; } else if (!strcmp(key, "ignoreduplicates")) { newlog->flags |= LOG_FLAG_IGNOREDUPLICATES; } else if (!strcmp(key, "prerotate")) { freeLogItem (pre); scriptStart = start; scriptDest = &newlog->pre; state = STATE_LOAD_SCRIPT; } else if (!strcmp(key, "firstaction")) { freeLogItem (first); scriptStart = start; scriptDest = &newlog->first; state = STATE_LOAD_SCRIPT; } else if (!strcmp(key, "postrotate")) { freeLogItem (post); scriptStart = start; scriptDest = &newlog->post; state = STATE_LOAD_SCRIPT; } else if (!strcmp(key, "lastaction")) { freeLogItem (last); scriptStart = start; scriptDest = &newlog->last; state = STATE_LOAD_SCRIPT; } else if (!strcmp(key, "preremove")) { freeLogItem (preremove); scriptStart = start; scriptDest = &newlog->preremove; state = STATE_LOAD_SCRIPT; } else if (!strcmp(key, "tabooext")) { char *endtag; if (newlog != defConfig) { message(MESS_ERROR, "%s:%d tabooext may not appear inside " "of log file definition\n", configFile, lineNum); state = STATE_ERROR; continue; } free(key); key = isolateValue(configFile, lineNum, "tabooext", &start, &buf, length); if (key == NULL) continue; endtag = key; if (*endtag == '+') { endtag++; while (isspace((unsigned char)*endtag) && *endtag) endtag++; } else { free_2d_array(tabooPatterns, tabooCount); tabooCount = 0; /* realloc of NULL is safe by definition */ tabooPatterns = NULL; } while (*endtag) { char *pattern = NULL; chptr = endtag; while (!isspace((unsigned char)*chptr) && *chptr != ',' && *chptr) chptr++; /* accept only non-empty patterns to avoid exclusion of everything */ if (endtag < chptr) { char **tmp = realloc(tabooPatterns, sizeof(*tabooPatterns) * (tabooCount + 1)); if (tmp == NULL) { message_OOM(); RAISE_ERROR(); } tabooPatterns = tmp; if (asprintf(&pattern, "*%.*s", (int)(chptr - endtag), endtag) < 0) { message_OOM(); RAISE_ERROR(); } tabooPatterns[tabooCount] = pattern; tabooCount++; } endtag = chptr; if (*endtag == ',') endtag++; while (*endtag && isspace((unsigned char)*endtag)) endtag++; } } else if (!strcmp(key, "taboopat")) { char *endtag; if (newlog != defConfig) { message(MESS_ERROR, "%s:%d taboopat may not appear inside " "of log file definition\n", configFile, lineNum); state = STATE_ERROR; continue; } free(key); key = isolateValue(configFile, lineNum, "taboopat", &start, &buf, length); if (key == NULL) continue; endtag = key; if (*endtag == '+') { endtag++; while (isspace((unsigned char)*endtag) && *endtag) endtag++; } else { free_2d_array(tabooPatterns, tabooCount); tabooCount = 0; /* realloc of NULL is safe by definition */ tabooPatterns = NULL; } while (*endtag) { char *pattern = NULL; char **tmp; chptr = endtag; while (!isspace((unsigned char)*chptr) && *chptr != ',' && *chptr) chptr++; tmp = realloc(tabooPatterns, sizeof(*tabooPatterns) * (tabooCount + 1)); if (tmp == NULL) { message_OOM(); RAISE_ERROR(); } tabooPatterns = tmp; if (asprintf(&pattern, "%.*s", (int)(chptr - endtag), endtag) < 0) { message_OOM(); RAISE_ERROR(); } tabooPatterns[tabooCount] = pattern; tabooCount++; endtag = chptr; if (*endtag == ',') endtag++; while (*endtag && isspace((unsigned char)*endtag)) endtag++; } } else if (!strcmp(key, "include")) { int rv; free(key); key = isolateValue(configFile, lineNum, "include", &start, &buf, length); if (key == NULL) { RAISE_ERROR(); } /* replace '~' with content of $HOME cause low-level functions * like stat() do not support the glob ~ */ if (expand_home_relative_path(&key)) { RAISE_ERROR(); } message(MESS_DEBUG, "including %s\n", key); if (recursion_depth >= MAX_NESTING) { message(MESS_ERROR, "%s:%d include nesting too deep\n", configFile, lineNum); logerror = 1; continue; } ++recursion_depth; rv = readConfigPath(key, newlog); --recursion_depth; if (rv) { logerror = 1; continue; } } else if (!strcmp(key, "olddir")) { freeLogItem (oldDir); if (!(newlog->oldDir = readPath(configFile, lineNum, "olddir", &start, &buf, length))) { RAISE_ERROR(); } /* replace '~' with content of $HOME cause low-level functions * like stat() do not support the glob ~ */ if (expand_home_relative_path(&newlog->oldDir)) { RAISE_ERROR(); } message(MESS_DEBUG, "olddir is now %s\n", newlog->oldDir); } else if (!strcmp(key, "extension")) { free(key); key = isolateValue(configFile, lineNum, "extension name", &start, &buf, length); if (key == NULL) { RAISE_ERROR(); } freeLogItem (extension); newlog->extension = key; key = NULL; message(MESS_DEBUG, "extension is now %s\n", newlog->extension); } else if (!strcmp(key, "addextension")) { free(key); key = isolateValue(configFile, lineNum, "addextension name", &start, &buf, length); if (key == NULL) { RAISE_ERROR(); } freeLogItem (addextension); newlog->addextension = key; key = NULL; message(MESS_DEBUG, "addextension is now %s\n", newlog->addextension); } else if (!strcmp(key, "compresscmd")) { char *compresscmd_full; const char *compresscmd_base; unsigned i; freeLogItem (compress_prog); if (! (newlog->compress_prog = readPath(configFile, lineNum, "compress", &start, &buf, length))) { RAISE_ERROR(); } message(MESS_DEBUG, "compress_prog is now %s\n", newlog->compress_prog); compresscmd_full = strdup(newlog->compress_prog); if (compresscmd_full == NULL) { message_OOM(); RAISE_ERROR(); } compresscmd_base = basename(compresscmd_full); /* we check whether we changed the compress_cmd. In case we use the appropriate extension as listed in compress_cmd_list */ for (i = 0; i < compress_cmd_list_size; i++) { if (!strcmp(compress_cmd_list[i].cmd, compresscmd_base)) { freeLogItem (compress_ext); newlog->compress_ext = strdup(compress_cmd_list[i].ext); if (newlog->compress_ext == NULL) { message_OOM(); free(compresscmd_full); RAISE_ERROR(); } message(MESS_DEBUG, "compress_ext was changed to %s\n", newlog->compress_ext); break; } } free(compresscmd_full); } else if (!strcmp(key, "uncompresscmd")) { freeLogItem (uncompress_prog); if (! (newlog->uncompress_prog = readPath(configFile, lineNum, "uncompress", &start, &buf, length))) { RAISE_ERROR(); } message(MESS_DEBUG, "uncompress_prog is now %s\n", newlog->uncompress_prog); } else if (!strcmp(key, "compressoptions")) { char *options; if (newlog->compress_options_list) { free(newlog->compress_options_list); newlog->compress_options_list = NULL; newlog->compress_options_count = 0; } if (!(options = isolateLine(&start, &buf, length))) { RAISE_ERROR(); } if (poptParseArgvString(options, &newlog->compress_options_count, &newlog->compress_options_list)) { message(MESS_ERROR, "%s:%d invalid compression options\n", configFile, lineNum); free(options); RAISE_ERROR(); } message(MESS_DEBUG, "compress_options is now %s\n", options); free(options); } else if (!strcmp(key, "compressext")) { freeLogItem (compress_ext); if (! (newlog->compress_ext = readPath(configFile, lineNum, "compress-ext", &start, &buf, length))) { RAISE_ERROR(); } message(MESS_DEBUG, "compress_ext is now %s\n", newlog->compress_ext); } else { message(MESS_ERROR, "%s:%d unknown option '%s' " "-- ignoring line\n", configFile, lineNum, key); if (*start != '\n') state = STATE_SKIP_LINE; } } else if (*start == '/' || *start == '"' || *start == '\'' #ifdef GLOB_TILDE || *start == '~' #endif ) { char *glob_string; size_t glob_count; int argc, argNum; const char **argv; in_config = 0; if (newlog != defConfig) { message(MESS_ERROR, "%s:%d unexpected log filename\n", configFile, lineNum); state = STATE_ERROR; continue; } /* If no compression options were found in config file, set default values */ if (!newlog->compress_prog) newlog->compress_prog = strdup(COMPRESS_COMMAND); if (!newlog->uncompress_prog) newlog->uncompress_prog = strdup(UNCOMPRESS_COMMAND); if (!newlog->compress_ext) newlog->compress_ext = strdup(COMPRESS_EXT); if (!newlog->compress_prog || !newlog->uncompress_prog || !newlog->compress_ext) { message_OOM(); goto error; } /* Allocate a new logInfo structure and insert it into the logs queue, copying the actual values from defConfig */ if ((newlog = newLogInfo(defConfig)) == NULL) goto error; glob_string = parseGlobString(configFile, lineNum, buf, length, &start); if (glob_string) in_config = 1; else /* error already printed */ goto error; if (poptParseArgvString(glob_string, &argc, &argv)) { message(MESS_ERROR, "%s:%d error parsing filename\n", configFile, lineNum); free(glob_string); goto error; } else if (argc < 1) { message(MESS_ERROR, "%s:%d { expected after log file name(s)\n", configFile, lineNum); free(glob_string); goto error; } newlog->files = NULL; newlog->numFiles = 0; for (argNum = 0; argNum < argc; argNum++) { char **tmp; int rc; glob_t globResult; if (globerr_msg) { free(globerr_msg); globerr_msg = NULL; } rc = glob(argv[argNum], GLOB_NOCHECK #ifdef GLOB_TILDE | GLOB_TILDE #endif , globerr, &globResult); if (rc == GLOB_ABORTED) { if (newlog->flags & LOG_FLAG_MISSINGOK) { continue; } /* We don't yet know whether this stanza has "missingok" * set, so store the error message for later. */ rc = asprintf(&globerr_msg, "%s:%d glob failed for %s: %s\n", configFile, lineNum, argv[argNum], strerror(glob_errno)); if (rc == -1) globerr_msg = NULL; globResult.gl_pathc = 0; } tmp = realloc(newlog->files, sizeof(*newlog->files) * (newlog->numFiles + globResult. gl_pathc)); if (tmp == NULL) { message_OOM(); logerror = 1; goto duperror; } newlog->files = tmp; for (glob_count = 0; glob_count < globResult.gl_pathc; glob_count++) { const struct logInfo *log; struct stat sb_glob; int add_file = 1; /* if we glob directories we can get false matches */ if (!lstat(globResult.gl_pathv[glob_count], &sb_glob) && S_ISDIR(sb_glob.st_mode)) { continue; } for (log = logs.tqh_first; log != NULL; log = log->list.tqe_next) { unsigned k; for (k = 0; k < log->numFiles; k++) { if (!strcmp(log->files[k], globResult.gl_pathv[glob_count])) { if (log->flags & LOG_FLAG_IGNOREDUPLICATES) { add_file = 0; message(MESS_DEBUG, "%s:%d ignore duplicate log entry for %s\n", configFile, lineNum, globResult.gl_pathv[glob_count]); } else { message(MESS_ERROR, "%s:%d duplicate log entry for %s\n", configFile, lineNum, globResult.gl_pathv[glob_count]); logerror = 1; goto duperror; } } } } if (add_file) { newlog->files[newlog->numFiles] = strdup(globResult.gl_pathv[glob_count]); if (newlog->files[newlog->numFiles] == NULL) { message_OOM(); logerror = 1; goto duperror; } newlog->numFiles++; } } duperror: globfree(&globResult); } newlog->pattern = glob_string; free(argv); } else if (*start == '}') { if (newlog == defConfig) { message(MESS_ERROR, "%s:%d unexpected }\n", configFile, lineNum); goto error; } if (!in_config) { message(MESS_ERROR, "%s:%d unexpected } (missing previous '{')\n", configFile, lineNum); goto error; } in_config = 0; if (globerr_msg) { if (!(newlog->flags & LOG_FLAG_MISSINGOK)) message(MESS_ERROR, "%s", globerr_msg); free(globerr_msg); globerr_msg = NULL; if (!(newlog->flags & LOG_FLAG_MISSINGOK)) goto error; } if (newlog->oldDir) { unsigned j; for (j = 0; j < newlog->numFiles; j++) { char *ld = NULL; char *dirpath; const char *dirName; struct stat sb_logdir; struct stat sb_olddir; dirpath = strdup(newlog->files[j]); if (dirpath == NULL) { message_OOM(); goto error; } dirName = dirname(dirpath); if (stat(dirName, &sb_logdir)) { if (!(newlog->flags & LOG_FLAG_MISSINGOK)) { message(MESS_ERROR, "%s:%d error verifying log file " "path %s: %s\n", configFile, lineNum, dirName, strerror(errno)); free(dirpath); goto error; } else { message(MESS_DEBUG, "%s:%d verifying log file " "path failed %s: %s, log is probably missing, " "but missingok is set, so this is not an error.\n", configFile, lineNum, dirName, strerror(errno)); free(dirpath); continue; } } if (newlog->oldDir[0] != '/') { if (asprintf(&ld, "%s/%s", dirName, newlog->oldDir) < 0) { message_OOM(); free(dirpath); goto error; } dirName = ld; } else { dirName = newlog->oldDir; } free(dirpath); if (stat(dirName, &sb_olddir)) { if (errno == ENOENT && (newlog->flags & LOG_FLAG_OLDDIRCREATE)) { int ret; if (newlog->flags & LOG_FLAG_SU) { if (switch_user(newlog->suUid, newlog->suGid) != 0) { free(ld); goto error; } } ret = mkpath(dirName, newlog->olddirMode, newlog->olddirUid, newlog->olddirGid); if (newlog->flags & LOG_FLAG_SU) { if (switch_user_back() != 0) { free(ld); goto error; } } if (ret) { free(ld); goto error; } if (stat(dirName, &sb_olddir) != 0) { message(MESS_ERROR, "%s:%d error verifying created olddir " "path %s: %s\n", configFile, lineNum, dirName, strerror(errno)); free(ld); goto error; } } else { message(MESS_ERROR, "%s:%d error verifying olddir " "path %s: %s\n", configFile, lineNum, dirName, strerror(errno)); free(ld); goto error; } } free(ld); if (sb_logdir.st_dev != sb_olddir.st_dev && !(newlog->flags & (LOG_FLAG_COPYTRUNCATE | LOG_FLAG_COPY | LOG_FLAG_TMPFILENAME))) { message(MESS_ERROR, "%s:%d olddir %s and log file %s " "are on different devices\n", configFile, lineNum, newlog->oldDir, newlog->files[j]); goto error; } } } criterium_set = 0; newlog = defConfig; state = STATE_DEFINITION_END; } else if (*start != '\n') { message(MESS_ERROR, "%s:%d lines must begin with a keyword " "or a filename (possibly in double quotes)\n", configFile, lineNum); RAISE_ERROR(); } break; case STATE_SKIP_LINE: case STATE_SKIP_LINE | STATE_SKIP_CONFIG: if (*start == '\n') state = (state & STATE_SKIP_CONFIG) ? STATE_SKIP_CONFIG : STATE_DEFAULT; break; case STATE_SKIP_LINE | STATE_LOAD_SCRIPT: if (*start == '\n') state = STATE_LOAD_SCRIPT; break; case STATE_SKIP_LINE | STATE_LOAD_SCRIPT | STATE_SKIP_CONFIG: if (*start == '\n') state = STATE_LOAD_SCRIPT | STATE_SKIP_CONFIG; break; case STATE_DEFINITION_END: case STATE_DEFINITION_END | STATE_SKIP_CONFIG: if (isblank((unsigned char)*start)) continue; if (*start != '\n') { message(MESS_ERROR, "%s:%d, unexpected text after }\n", configFile, lineNum); state = STATE_SKIP_LINE | ((state & STATE_SKIP_CONFIG) ? STATE_SKIP_CONFIG : 0); } else state = (state & STATE_SKIP_CONFIG) ? STATE_SKIP_CONFIG : STATE_DEFAULT; break; case STATE_ERROR: assert(newlog != defConfig); message(MESS_ERROR, "found error in %s, skipping\n", newlog->pattern ? newlog->pattern : "log config"); logerror = 1; state = STATE_SKIP_CONFIG; break; case STATE_LOAD_SCRIPT: case STATE_LOAD_SCRIPT | STATE_SKIP_CONFIG: free(key); key = isolateWord(&start, &buf, length); if (key == NULL) continue; if (strcmp(key, "endscript") == 0) { if (state & STATE_SKIP_CONFIG) { state = STATE_SKIP_CONFIG; } else { const char *endtag = start - 9; while (*endtag != '\n') endtag--; endtag++; *scriptDest = strndup(scriptStart, (size_t)(endtag - scriptStart)); if (*scriptDest == NULL) { message_OOM(); goto error; } scriptDest = NULL; scriptStart = NULL; } state = (state & STATE_SKIP_CONFIG) ? STATE_SKIP_CONFIG : STATE_DEFAULT; } else { state = (*start == '\n' ? 0 : STATE_SKIP_LINE) | STATE_LOAD_SCRIPT | ((state & STATE_SKIP_CONFIG) ? STATE_SKIP_CONFIG : 0); } break; case STATE_SKIP_CONFIG: if (*start == '}') { state = STATE_DEFAULT; freeTailLogs(1); newlog = defConfig; } else { free(key); key = isolateWord(&start, &buf, length); if (key == NULL) continue; if ( (strcmp(key, "postrotate") == 0) || (strcmp(key, "prerotate") == 0) || (strcmp(key, "firstaction") == 0) || (strcmp(key, "lastaction") == 0) || (strcmp(key, "preremove") == 0) ) { state = STATE_LOAD_SCRIPT | STATE_SKIP_CONFIG; } else { /* isolateWord moves the "start" pointer. * If we have a line like * rotate 5 * after isolateWord "start" points to "5" and it * is OK to skip the line, but if we have a line * like the following * nocompress * after isolateWord "start" points to "\n". In * this case if we skip a line, we skip the next * line, not the current "nocompress" one, * because in the for cycle the "start" * pointer is increased by one and, after this, * "start" points to the beginning of the next line. */ if (*start != '\n') { state = STATE_SKIP_LINE | STATE_SKIP_CONFIG; } } } break; default: message(MESS_FATAL, "%s: %d: readConfigFile() unknown state: %#x\n", configFile, lineNum, state); } if (*start == '\n') { lineNum++; } next_state: ; } if (scriptStart) { message(MESS_ERROR, "%s:prerotate, postrotate or preremove without endscript\n", configFile); goto error; } free(key); munmap(buf, length); close(fd); free(globerr_msg); return logerror; error: if (newlog != defConfig) freeTailLogs(1); /* free is a NULL-safe operation */ free(key); munmap(buf, length); close(fd); free(globerr_msg); return 1; } /* vim: set et sw=4 ts=4: */ logrotate-3.21.0/log.c0000644000175000017500000000422114246060643011447 00000000000000#include #include #include #include #ifdef HAVE_VSYSLOG #include #endif #include "log.h" static int logLevel = MESS_DEBUG; static FILE *messageFile = NULL; static int _logToSyslog = 0; void logSetLevel(int level) { logLevel = level; } void logSetMessageFile(FILE * f) { messageFile = f; } void logToSyslog(int enable) { _logToSyslog = enable; #ifdef HAVE_VSYSLOG if (_logToSyslog) { openlog("logrotate", 0, LOG_USER); } else { closelog(); } #endif } __attribute__((format (printf, 3, 0))) static void log_once(FILE *where, int level, const char *format, va_list args) { switch (level) { case MESS_DEBUG: break; case MESS_WARN: fprintf(where, "warning: "); break; default: fprintf(where, "error: "); break; } vfprintf(where, format, args); fflush(where); } __attribute__((format (printf, 2, 3))) void message(int level, const char *format, ...) { va_list args; if (level >= logLevel) { va_start(args, format); log_once(stderr, level, format, args); va_end(args); } if (messageFile != NULL) { va_start(args, format); log_once(messageFile, level, format, args); va_end(args); } #ifdef HAVE_VSYSLOG if (_logToSyslog) { int priority = LOG_USER; switch(level) { case MESS_REALDEBUG: priority |= LOG_DEBUG; break; case MESS_DEBUG: priority |= LOG_INFO; break; case MESS_WARN: priority |= LOG_WARNING; break; case MESS_ERROR: priority |= LOG_ERR; break; case MESS_FATAL: priority |= LOG_CRIT; break; default: priority |= LOG_INFO; break; } va_start(args, format); vsyslog(priority, format, args); va_end(args); } #endif if (level == MESS_FATAL) exit(1); } /* vim: set et sw=4 ts=4: */ logrotate-3.21.0/logrotate.c0000644000175000017500000031242214346133207012671 00000000000000#include "queue.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #if !defined(PATH_MAX) && defined(__FreeBSD__) #include #endif #include "log.h" #include "logrotate.h" static char *prev_context; #ifdef WITH_SELINUX #include static int selinux_enabled = 0; static int selinux_enforce = 0; #endif #ifdef WITH_ACL #include "sys/acl.h" #define acl_type acl_t #else #define acl_type void * #endif static acl_type prev_acl = NULL; #if !defined(GLOB_ABORTED) && defined(GLOB_ABEND) #define GLOB_ABORTED GLOB_ABEND #endif #ifdef PATH_MAX #define STATEFILE_BUFFER_SIZE ( 2 * PATH_MAX + 16 ) #else #define STATEFILE_BUFFER_SIZE 4096 #endif #ifdef __hpux extern int asprintf(char **str, const char *fmt, ...); #endif /* Number of seconds in a day */ #define DAY_SECONDS 86400 struct logState { char *fn; struct tm lastRotated; /* only tm_hour, tm_mday, tm_mon, tm_year are good! */ struct stat sb; int doRotate; int isUsed; /* True if there is real log file in system for this state. */ LIST_ENTRY(logState) list; }; struct logNames { char *firstRotated; char *disposeName; char *finalName; char *dirName; char *baseName; }; struct compData { size_t prefix_len; const char *dformat; }; static struct logStateList { LIST_HEAD(stateSet, logState) head; } **states; int numLogs = 0; int debug = 0; static unsigned int hashSize; static const char *mailCommand = DEFAULT_MAIL_COMMAND; static time_t nowSecs = 0; static uid_t save_euid; static gid_t save_egid; static int globerr(const char *pathname, int theerr) { message(MESS_ERROR, "error accessing %s: %s\n", pathname, strerror(theerr)); /* We want the glob operation to abort on error, so return 1 */ return 1; } /* We could switch to qsort_r to get rid of this global variable, * but qsort_r is not portable enough (Linux vs. *BSD vs ...)... */ static struct compData _compData; static int compGlobResult(const void *result1, const void *result2) { struct tm time_tmp; time_t t1, t2; const char *r1 = *(char * const*)(result1); const char *r2 = *(char * const*)(result2); memset(&time_tmp, 0, sizeof(struct tm)); strptime(r1 + _compData.prefix_len, _compData.dformat, &time_tmp); t1 = mktime(&time_tmp); memset(&time_tmp, 0, sizeof(struct tm)); strptime(r2 + _compData.prefix_len, _compData.dformat, &time_tmp); t2 = mktime(&time_tmp); if (t1 < t2) return -1; if (t1 > t2) return 1; return 0; } static void sortGlobResult(glob_t *result, size_t prefix_len, const char *dformat) { if (!dformat || *dformat == '\0') { return; } _compData.prefix_len = prefix_len; _compData.dformat = dformat; qsort(result->gl_pathv, result->gl_pathc, sizeof(char *), compGlobResult); } int switch_user(uid_t user, gid_t group) { save_egid = getegid(); save_euid = geteuid(); if (save_euid == user && save_egid == group) return 0; message(MESS_DEBUG, "switching euid from %u to %u and egid from %u to %u (pid %d)\n", (unsigned) save_euid, (unsigned) user, (unsigned) save_egid, (unsigned) group, getpid()); if (setegid(group) || seteuid(user)) { message(MESS_ERROR, "error switching euid from %u to %u and egid from %u to %u (pid %d): %s\n", (unsigned) save_euid, (unsigned) user, (unsigned) save_egid, (unsigned) group, getpid(), strerror(errno)); return 1; } return 0; } static int switch_user_permanently(const struct logInfo *log) { const gid_t group = getegid(); const uid_t user = geteuid(); if (!(log->flags & LOG_FLAG_SU)) { return 0; } if (user != log->suUid) { message(MESS_ERROR, "current euid (%u) does not match uid of log configuration (%u) (pid %d)\n", (unsigned) user, (unsigned) log->suUid, getpid()); return 1; } if (group != log->suGid) { message(MESS_ERROR, "current egid (%u) does not match gid of log configuration (%u) (pid %d)\n", (unsigned) group, (unsigned) log->suGid, getpid()); return 1; } /* we are already the final configuration specified user/group */ if (getuid() == user && getgid() == group) { return 0; } /* switch to full root first */ if (setgid(getgid()) || setuid(getuid())) { message(MESS_ERROR, "error getting rid of euid != uid (pid %d): %s\n", getpid(), strerror(errno)); return 1; } message(MESS_DEBUG, "switching uid to %u and gid to %u permanently (pid %d)\n", (unsigned) user, (unsigned) group, getpid()); if (setgid(group) || setuid(user)) { message(MESS_ERROR, "error switching uid to %u and gid to %u (pid %d): %s\n", (unsigned) user, (unsigned) group, getpid(), strerror(errno)); return 1; } if (user != ROOT_UID && (setuid(ROOT_UID) != -1 || seteuid(ROOT_UID) != -1)) { message(MESS_ERROR, "failed to switch user permanently, able to switch back (pid %d)\n", getpid()); return 1; } if (chdir("/") != 0) { message(MESS_ERROR, "failed to change current directory to root path: %s\n", strerror(errno)); return -1; } return 0; } int switch_user_back(void) { return switch_user(save_euid, save_egid); } static int switch_user_back_permanently(void) { gid_t tmp_egid = save_egid; uid_t tmp_euid = save_euid; int ret = switch_user(save_euid, save_egid); save_euid = tmp_euid; save_egid = tmp_egid; return ret; } static int open_logfile(const char *path, const struct logInfo *log, int write_access) { int fd; struct stat sb; fd = open(path, O_NOFOLLOW | (write_access ? O_RDWR : O_RDONLY)); if (fd < 0) return fd; if (fstat(fd, &sb) != 0) { close(fd); return -1; } if (! S_ISREG(sb.st_mode)) { close(fd); errno = ENOTSUP; return -1; } if (sb.st_nlink != 1 && !(log->flags & LOG_FLAG_ALLOWHARDLINK)) { close(fd); errno = ENOTSUP; return -1; } return fd; } static void unescape(char *arg) { char *p = arg; char *next; char escaped; while ((next = strchr(p, '\\')) != NULL) { p = next; switch (p[1]) { case 'n': escaped = '\n'; break; case '\\': escaped = '\\'; break; default: ++p; continue; } /* Overwrite the backslash with the intended character, * and shift everything down one */ *p++ = escaped; memmove(p, p+1, 1 + strlen(p+1)); } } #define HASH_SIZE_MIN 64 #define HASH_SIZE_MAX 8192 static int allocateHash(unsigned long hs) { unsigned int i; /* Enforce some reasonable minimum hash size */ if (hs < HASH_SIZE_MIN) hs = HASH_SIZE_MIN; /* Enforce some reasonable maximum hash size */ if (hs > HASH_SIZE_MAX) hs = HASH_SIZE_MAX; message(MESS_DEBUG, "Allocating hash table for state file, size %lu entries\n", hs); states = calloc(hs, sizeof(struct logStateList *)); if (states == NULL) { message_OOM(); return 1; } for (i = 0; i < hs; i++) { states[i] = malloc(sizeof *states[0]); if (states[i] == NULL) { message_OOM(); return 1; } LIST_INIT(&(states[i]->head)); } hashSize = (unsigned)hs; return 0; } #define HASH_CONST 13 #if defined(__clang__) && defined(__clang_major__) && (__clang_major__ >= 4) __attribute__((no_sanitize("unsigned-integer-overflow"))) #endif static int hashIndex(const char *fn) { unsigned hash = 0; if (!hashSize) /* hash table not yet allocated */ return -1; while (*fn) { hash *= HASH_CONST; hash += (unsigned char)*fn++; } return (int)(hash % hashSize); } /* safe implementation of dup2(oldfd, nefd) followed by close(oldfd) */ static int movefd(int oldfd, int newfd) { int rc; if (oldfd == newfd) /* avoid accidental close of newfd in case it is equal to oldfd */ return 0; rc = dup2(oldfd, newfd); if (rc == 0) close(oldfd); return rc; } static int setSecCtx(int fdSrc, const char *src, char **pPrevCtx) { #ifdef WITH_SELINUX char *srcCtx; *pPrevCtx = NULL; if (!selinux_enabled) /* pretend success */ return 0; /* read security context of fdSrc */ if (fgetfilecon_raw(fdSrc, &srcCtx) < 0) { if (errno == ENOTSUP) /* pretend success */ return 0; message(MESS_ERROR, "getting file context %s: %s\n", src, strerror(errno)); return selinux_enforce; } /* save default security context for restoreSecCtx() */ if (getfscreatecon_raw(pPrevCtx) < 0) { message(MESS_ERROR, "getting default context: %s\n", strerror(errno)); return selinux_enforce; } /* set default security context to match fdSrc */ if (setfscreatecon_raw(srcCtx) < 0) { message(MESS_ERROR, "setting default context to %s: %s\n", srcCtx, strerror(errno)); freecon(srcCtx); return selinux_enforce; } message(MESS_DEBUG, "set default create context to %s\n", srcCtx); freecon(srcCtx); #else (void) fdSrc; (void) src; (void) pPrevCtx; #endif return 0; } static int setSecCtxByName(const char *src, const struct logInfo *log, char **pPrevCtx) { int hasErrors = 0; #ifdef WITH_SELINUX int fd; if (!selinux_enabled) /* pretend success */ return 0; fd = open_logfile(src, log, 0); if (fd < 0) { message(MESS_ERROR, "error opening %s: %s\n", src, strerror(errno)); return 1; } hasErrors = setSecCtx(fd, src, pPrevCtx); close(fd); #else (void) src; (void) log; (void) pPrevCtx; #endif return hasErrors; } static void restoreSecCtx(char **pPrevCtx) { #ifdef WITH_SELINUX if (!*pPrevCtx) /* no security context saved for restoration */ return; /* set default security context to the previously stored one */ if (selinux_enabled && setfscreatecon_raw(*pPrevCtx) < 0) message(MESS_ERROR, "setting default context to %s: %s\n", *pPrevCtx, strerror(errno)); /* free the memory allocated to save the security context */ freecon(*pPrevCtx); *pPrevCtx = NULL; #else (void) pPrevCtx; #endif } static struct logState *newState(const char *fn) { struct tm now; struct logState *new; time_t lr_time; message(MESS_DEBUG, "Creating new state\n"); localtime_r(&nowSecs, &now); new = malloc(sizeof(*new)); if (new == NULL) { message_OOM(); return NULL; } new->fn = strdup(fn); if (new->fn == NULL) { message_OOM(); free(new); return NULL; } new->doRotate = 0; new->isUsed = 0; memset(&new->lastRotated, 0, sizeof(new->lastRotated)); new->lastRotated.tm_hour = now.tm_hour; new->lastRotated.tm_mday = now.tm_mday; new->lastRotated.tm_mon = now.tm_mon; new->lastRotated.tm_year = now.tm_year; new->lastRotated.tm_isdst = now.tm_isdst; /* fill in the rest of the new->lastRotated fields */ lr_time = mktime(&new->lastRotated); localtime_r(&lr_time, &new->lastRotated); return new; } static struct logState *findState(const char *fn) { const int i = hashIndex(fn); struct logState *p; if (i < 0) /* hash table not yet allocated */ return NULL; for (p = states[i]->head.lh_first; p != NULL; p = p->list.le_next) if (!strcmp(fn, p->fn)) break; /* new state */ if (p == NULL) { if ((p = newState(fn)) == NULL) return NULL; LIST_INSERT_HEAD(&(states[i]->head), p, list); } return p; } static int runScript(const struct logInfo *log, const char *logfn, const char *logrotfn, const char *script) { int rc; pid_t pid; if (debug) { message(MESS_DEBUG, "running script with args %s %s: \"%s\"\n", logfn, logrotfn ? logrotfn : "", script); return 0; } pid = fork(); if (pid == -1) { message(MESS_ERROR, "cannot fork: %s\n", strerror(errno)); return 1; } if (pid == 0) { if (log->flags & LOG_FLAG_SU) { if (switch_user_back_permanently() != 0) { exit(1); } } execl("/bin/sh", "sh", "-c", (char *) script, "logrotate_script", (char *) logfn, (char *) logrotfn, (char *) NULL); message(MESS_ERROR, "cannot execute sub-shell: %s\n", strerror(errno)); exit(1); } wait(&rc); return rc; } #ifdef WITH_ACL static int is_acl_well_supported(int err) { switch (err) { case ENOTSUP: /* no file system support */ case EINVAL: /* acl does not point to a valid ACL */ case ENOSYS: /* compatibility - acl_(g|s)et_fd(3) should never return this */ case EBUSY: /* compatibility - acl_(g|s)et_fd(3) should never return this */ return 0; default: return 1; } } #endif /* WITH_ACL */ static int createOutputFile(const char *fileName, int flags, const struct stat *sb, acl_type acl, int force_mode) { int fd = -1; struct stat sb_create; int acl_set = 0; int i; for (i = 0; i < 2; ++i) { struct tm now; size_t fileName_size, buf_size; char *backupName, *ptr; fd = open(fileName, (flags | O_CREAT | O_EXCL | O_NOFOLLOW), (S_IRUSR | S_IWUSR) & sb->st_mode); if ((fd >= 0) || (errno != EEXIST)) break; /* the destination file already exists, while it should not */ localtime_r(&nowSecs, &now); fileName_size = strlen(fileName); buf_size = fileName_size + sizeof("-YYYYMMDDHH.backup"); backupName = malloc(buf_size); if (!backupName) { message_OOM(); return -1; } ptr = backupName; /* construct backupName starting with fileName */ strcpy(ptr, fileName); ptr += fileName_size; buf_size -= fileName_size; /* append the -YYYYMMDDHH time stamp and the .backup suffix */ ptr += strftime(ptr, buf_size, "-%Y%m%d%H", &now); strcpy(ptr, ".backup"); message(MESS_ERROR, "destination %s already exists, renaming to %s\n", fileName, backupName); if (rename(fileName, backupName) != 0) { message(MESS_ERROR, "error renaming already existing output file" " %s to %s: %s\n", fileName, backupName, strerror(errno)); free(backupName); return -1; } free(backupName); /* existing file renamed, try it once again */ } if (fd < 0) { message(MESS_ERROR, "error creating output file %s: %s\n", fileName, strerror(errno)); return -1; } if (fchmod(fd, (S_IRUSR | S_IWUSR) & sb->st_mode)) { message(MESS_ERROR, "error setting mode of %s: %s\n", fileName, strerror(errno)); close(fd); return -1; } if (fstat(fd, &sb_create)) { message(MESS_ERROR, "fstat of %s failed: %s\n", fileName, strerror(errno)); close(fd); return -1; } /* Only attempt to set user/group if running as root */ if ( ROOT_UID == geteuid() && (sb_create.st_uid != sb->st_uid || sb_create.st_gid != sb->st_gid) && fchown(fd, sb->st_uid, sb->st_gid) ) { message(MESS_ERROR, "error setting owner of %s to uid %u and gid %u: %s\n", fileName, (unsigned) sb->st_uid, (unsigned) sb->st_gid, strerror(errno)); close(fd); return -1; } #ifdef WITH_ACL if (!force_mode && acl) { if (acl_set_fd(fd, acl) == -1) { if (is_acl_well_supported(errno)) { message(MESS_ERROR, "setting ACL for %s: %s\n", fileName, strerror(errno)); close(fd); return -1; } acl_set = 0; } else { acl_set = 1; } } #else (void) acl; #endif if (!acl_set || force_mode) { if (fchmod(fd, sb->st_mode)) { message(MESS_ERROR, "error setting mode of %s: %s\n", fileName, strerror(errno)); close(fd); return -1; } } return fd; } /* unlink, but try to call shred from GNU coreutils if LOG_FLAG_SHRED * is enabled (in that case fd needs to be a valid file descriptor) */ static int shred_file(int fd, const char *filename, const struct logInfo *log) { char count[12]; /* 11 digits - that's a lot of shredding :) */ const char *fullCommand[6]; int id = 0; int status; pid_t pid; if (log->preremove) { message(MESS_DEBUG, "running preremove script\n"); if (runScript(log, filename, NULL, log->preremove)) { message(MESS_ERROR, "error running preremove script " "for %s of '%s'. Not removing this file.\n", filename, log->pattern); /* What ever was supposed to happen did not happen, * therefore do not unlink the file yet. */ return 1; } } if (!(log->flags & LOG_FLAG_SHRED)) { goto unlink_file; } if (!(log->flags & LOG_FLAG_ALLOWHARDLINK)) { struct stat sb; if (fstat(fd, &sb) != 0) { message(MESS_ERROR, "cannot stat %s: %s\n", filename, strerror(errno)); return 1; } if (sb.st_nlink != 1) { message(MESS_ERROR, "failed to shred \"%s\", because shredding files with" " multiple hard links is disabled for %s.\n", filename, log->pattern); return 1; } } message(MESS_DEBUG, "Using shred to remove the file %s\n", filename); fullCommand[id++] = "shred"; fullCommand[id++] = "-u"; if (log->shred_cycles != 0) { fullCommand[id++] = "-n"; snprintf(count, sizeof(count), "%d", log->shred_cycles); fullCommand[id++] = count; } fullCommand[id++] = "-"; fullCommand[id++] = NULL; pid = fork(); if (pid == -1) { message(MESS_ERROR, "cannot fork: %s\n", strerror(errno)); return 1; } if (pid == 0) { movefd(fd, STDOUT_FILENO); if (switch_user_permanently(log) != 0) { exit(1); } execvp(fullCommand[0], (void *) fullCommand); message(MESS_ERROR, "cannot execute shred command: %s\n", strerror(errno)); exit(1); } wait(&status); if (!WIFEXITED(status) || WEXITSTATUS(status)) { message(MESS_ERROR, "Failed to shred %s, trying unlink\n", filename); return unlink(filename); } /* We have to unlink it after shred anyway, * because it doesn't remove the file itself */ unlink_file: if (unlink(filename) == 0) return 0; if (errno != ENOENT) return 1; /* unlink of log file that no longer exists is not a fatal error */ message(MESS_ERROR, "error unlinking log file %s: %s\n", filename, strerror(errno)); return 0; } static int removeLogFile(const char *name, const struct logInfo *log) { int fd = -1; int result = 0; message(MESS_DEBUG, "removing old log %s\n", name); if (log->flags & LOG_FLAG_SHRED) { fd = open_logfile(name, log, 1); if (fd < 0) { message(MESS_ERROR, "error opening %s: %s\n", name, strerror(errno)); return 1; } } if (!debug && shred_file(fd, name, log)) { message(MESS_ERROR, "Failed to remove old log %s: %s\n", name, strerror(errno)); result = 1; } if (fd != -1) close(fd); return result; } static void setAtimeMtime(int fd, const char *filename, const struct stat *sb) { /* If we can't change atime/mtime, it's not a disaster. It might possibly fail under SELinux. But do try to preserve the fractional part if we have utimensat(). */ #if defined HAVE_FUTIMENS && defined HAVE_STRUCT_STAT_ST_ATIM && defined HAVE_STRUCT_STAT_ST_MTIM struct timespec ts[2]; ts[0] = sb->st_atim; ts[1] = sb->st_mtim; futimens(fd, ts); (void)filename; #elif defined HAVE_UTIMENSAT && defined HAVE_STRUCT_STAT_ST_ATIM && defined HAVE_STRUCT_STAT_ST_MTIM struct timespec ts[2]; ts[0] = sb->st_atim; ts[1] = sb->st_mtim; utimensat(AT_FDCWD, filename, ts, AT_SYMLINK_NOFOLLOW); (void)fd; #else struct utimbuf utim; utim.actime = sb->st_atime; utim.modtime = sb->st_mtime; utime(filename, &utim); (void)fd; #endif } static int compressLogFile(const char *name, const struct logInfo *log, const struct stat *sb) { char *compressedName; int inFile; int outFile; int status; int compressPipe[2]; char *prevCtx; pid_t pid; message(MESS_DEBUG, "compressing log with: %s\n", log->compress_prog); if (debug) return 0; if ((inFile = open_logfile(name, log, log->flags & LOG_FLAG_SHRED)) < 0) { message(MESS_ERROR, "unable to open %s (%s) for compression: %s\n", name, (log->flags & LOG_FLAG_SHRED) ? "read-write" : "read-only", strerror(errno)); return 1; } if (setSecCtx(inFile, name, &prevCtx) != 0) { /* error msg already printed */ close(inFile); return 1; } #ifdef WITH_ACL if ((prev_acl = acl_get_fd(inFile)) == NULL) { if (is_acl_well_supported(errno)) { message(MESS_ERROR, "getting file ACL %s: %s\n", name, strerror(errno)); restoreSecCtx(&prevCtx); close(inFile); return 1; } } #endif if (asprintf(&compressedName, "%s%s", name, log->compress_ext) < 0) { message_OOM(); close(inFile); return 1; } outFile = createOutputFile(compressedName, O_RDWR, sb, prev_acl, 0); restoreSecCtx(&prevCtx); #ifdef WITH_ACL if (prev_acl) { acl_free(prev_acl); prev_acl = NULL; } #endif if (outFile < 0) { close(inFile); free(compressedName); return 1; } /* pipe used to capture stderr of the compress process */ if (pipe(compressPipe) < 0) { message(MESS_ERROR, "error opening pipe for compress: %s\n", strerror(errno)); close(inFile); close(outFile); free(compressedName); return 1; } pid = fork(); if (pid == -1) { message(MESS_ERROR, "cannot fork: %s\n", strerror(errno)); close(inFile); close(outFile); close(compressPipe[1]); close(compressPipe[0]); free(compressedName); return 1; } if (pid == 0) { const char **fullCommand; int i; /* close read end of pipe in the child process */ close(compressPipe[0]); free(compressedName); movefd(inFile, STDIN_FILENO); movefd(outFile, STDOUT_FILENO); if (switch_user_permanently(log) != 0) { exit(1); } movefd(compressPipe[1], STDERR_FILENO); /* export name of file to compress for custom compress scripts */ { char *envInFilename; if (asprintf(&envInFilename, "LOGROTATE_COMPRESSED_FILENAME=%s", name) < 0) { message_OOM(); exit(1); } putenv(envInFilename); /* do not free envInFilename, cause putenv(3) might not create a copy */ } fullCommand = malloc(sizeof(*fullCommand) * ((size_t)log->compress_options_count + 2)); if (!fullCommand) { message_OOM(); exit(1); } fullCommand[0] = log->compress_prog; for (i = 0; i < log->compress_options_count; i++) fullCommand[i + 1] = log->compress_options_list[i]; fullCommand[log->compress_options_count + 1] = NULL; execvp(fullCommand[0], (void *) fullCommand); message(MESS_ERROR, "cannot execute compress command '%s': %s\n", fullCommand[0], strerror(errno)); exit(1); } /* close write end of pipe in the parent process */ close(compressPipe[1]); { int error_printed = 0; for (;;) { char buff[4096]; ssize_t n_read = read(compressPipe[0], buff, sizeof(buff) - 1); if (n_read < 0) { if (errno == EINTR) continue; else break; } if (n_read == 0) break; if (!error_printed) { error_printed = 1; message(MESS_ERROR, "Compressing program wrote following message " "to stderr when compressing log %s:\n", name); } buff[n_read] = '\0'; fprintf(stderr, "%s", buff); } } close(compressPipe[0]); wait(&status); fsync(outFile); if (!WIFEXITED(status) || WEXITSTATUS(status)) { message(MESS_ERROR, "failed to compress log %s\n", name); close(inFile); close(outFile); unlink(compressedName); free(compressedName); return 1; } setAtimeMtime(outFile, compressedName, sb); close(outFile); free(compressedName); if (shred_file(inFile, name, log)) { close(inFile); return 1; } close(inFile); return 0; } static int mailLog(const struct logInfo *log, const char *logFile, const char *mailComm, const char *uncompressCommand, const char *address, const char *subject) { int mailInput; pid_t mailChild, uncompressChild = 0; int mailStatus, uncompressStatus; int uncompressPipe[2]; char * const mailArgv[] = { (char *) mailComm, (char *) "-s", (char *) subject, (char *) address, NULL }; int rc = 0; if ((mailInput = open_logfile(logFile, log, 0)) < 0) { message(MESS_ERROR, "failed to open %s for mailing: %s\n", logFile, strerror(errno)); return 1; } if (uncompressCommand) { /* pipe used to capture output of the uncompress process */ if (pipe(uncompressPipe) < 0) { message(MESS_ERROR, "error opening pipe for uncompress: %s\n", strerror(errno)); close(mailInput); return 1; } uncompressChild = fork(); if (uncompressChild == -1) { message(MESS_ERROR, "cannot fork: %s\n", strerror(errno)); close(mailInput); close(uncompressPipe[1]); close(uncompressPipe[0]); return 1; } if (uncompressChild == 0) { /* uncompress child */ /* close read end of pipe in the child process */ close(uncompressPipe[0]); movefd(mailInput, STDIN_FILENO); movefd(uncompressPipe[1], STDOUT_FILENO); if (switch_user_permanently(log) != 0) { exit(1); } execlp(uncompressCommand, uncompressCommand, (char *) NULL); message(MESS_ERROR, "cannot execute uncompress command: %s\n", strerror(errno)); exit(1); } close(mailInput); mailInput = uncompressPipe[0]; close(uncompressPipe[1]); } mailChild = fork(); if (mailChild == -1) { message(MESS_ERROR, "cannot fork: %s\n", strerror(errno)); close(mailInput); return 1; } if (mailChild == 0) { movefd(mailInput, STDIN_FILENO); close(STDOUT_FILENO); /* mail command runs as root */ if (log->flags & LOG_FLAG_SU) { if (switch_user_back_permanently() != 0) { exit(1); } } execvp(mailArgv[0], mailArgv); message(MESS_ERROR, "cannot execute mail command: %s\n", strerror(errno)); exit(1); } close(mailInput); waitpid(mailChild, &mailStatus, 0); if (!WIFEXITED(mailStatus) || WEXITSTATUS(mailStatus)) { message(MESS_ERROR, "mail command failed for %s\n", logFile); rc = 1; } if (uncompressCommand) { waitpid(uncompressChild, &uncompressStatus, 0); if (!WIFEXITED(uncompressStatus) || WEXITSTATUS(uncompressStatus)) { message(MESS_ERROR, "uncompress command failed mailing %s\n", logFile); rc = 1; } } return rc; } static int mailLogWrapper(const char *mailFilename, const char *mailComm, unsigned logNum, const struct logInfo *log) { /* uncompress already compressed log files before mailing them */ const char *uncompress_prog = (log->flags & LOG_FLAG_COMPRESS) ? log->uncompress_prog : NULL; const char *subject = mailFilename; if (log->flags & LOG_FLAG_MAILFIRST) { if (log->flags & LOG_FLAG_DELAYCOMPRESS) /* the log we are mailing has not been compressed yet */ uncompress_prog = NULL; if (uncompress_prog) /* use correct subject when mailfirst is enabled */ subject = log->files[logNum]; } return mailLog(log, mailFilename, mailComm, uncompress_prog, log->logAddress, subject); } /* Use a heuristic to determine whether stat buffer SB comes from a file with sparse blocks. If the file has fewer blocks than would normally be needed for a file of its size, then at least one of the blocks in the file is a hole. In that case, return true. */ static int is_probably_sparse(struct stat const *sb) { #if defined(HAVE_STRUCT_STAT_ST_BLOCKS) && defined(HAVE_STRUCT_STAT_ST_BLKSIZE) return (S_ISREG (sb->st_mode) && sb->st_blksize != 0 && sb->st_blocks < sb->st_size / sb->st_blksize); #else return 0; #endif } #define MIN(a,b) ((a) < (b) ? (a) : (b)) /* Return whether the buffer consists entirely of NULs. Note the word after the buffer must be non NUL. */ static int is_nul (void const *buf, size_t bufsize) { char const *cbuf = buf; char const *cp = buf; /* Find the first nonzero *byte*, or the sentinel. */ while (*cp++ == 0) continue; return cbuf + bufsize < cp; } static size_t full_write(int fd, const void *buf, size_t count) { size_t total = 0; const unsigned char *ptr = (const unsigned char *) buf; while (count > 0) { size_t n_rw; for (;;) { n_rw = (size_t)write (fd, ptr, count); if (n_rw == (size_t) -1 && errno == EINTR) continue; break; } if (n_rw == (size_t) -1) break; if (n_rw == 0) break; total += n_rw; ptr += n_rw; count -= n_rw; } return total; } static int sparse_copy(int src_fd, int dest_fd, const struct stat *sb, const char *saveLog, const char *currLog) { const int make_holes = is_probably_sparse(sb); size_t max_n_read = SIZE_MAX; int last_write_made_hole = 0; off_t total_n_read = 0; char buf[BUFSIZ + 1]; while (max_n_read) { int make_hole = 0; size_t bytes_read; const ssize_t n_read = read (src_fd, buf, MIN (max_n_read, BUFSIZ)); if (n_read < 0) { if (errno == EINTR) { continue; } message(MESS_ERROR, "error reading %s: %s\n", currLog, strerror(errno)); return 0; } if (n_read == 0) break; bytes_read = (size_t)n_read; max_n_read -= bytes_read; total_n_read += n_read; if (make_holes) { /* Sentinel required by is_nul(). */ buf[bytes_read] = '\1'; if ((make_hole = is_nul(buf, bytes_read))) { if (lseek (dest_fd, n_read, SEEK_CUR) < 0) { message(MESS_ERROR, "error seeking %s: %s\n", saveLog, strerror(errno)); return 0; } } } if (!make_hole) { if (full_write (dest_fd, buf, bytes_read) != bytes_read) { message(MESS_ERROR, "error writing to %s: %s\n", saveLog, strerror(errno)); return 0; } } last_write_made_hole = make_hole; } if (last_write_made_hole) { if (ftruncate(dest_fd, total_n_read) < 0) { message(MESS_ERROR, "error ftruncate %s: %s\n", saveLog, strerror(errno)); return 0; } } return 1; } static int copyTruncate(const char *currLog, const char *saveLog, const struct stat *sb, const struct logInfo *log, int skip_copy) { int rc = 1; int fdcurr = -1, fdsave = -1; message(MESS_DEBUG, "%scopying %s to %s\n", skip_copy ? "skip " : "", currLog, saveLog); if (!debug) { /* read access is sufficient for 'copy' but not for 'copytruncate' */ const int read_only = (log->flags & LOG_FLAG_COPY) && !(log->flags & LOG_FLAG_COPYTRUNCATE); if ((fdcurr = open_logfile(currLog, log, !read_only)) < 0) { message(MESS_ERROR, "error opening %s: %s\n", currLog, strerror(errno)); goto fail; } if (!skip_copy) { char *prevCtx; if (setSecCtx(fdcurr, currLog, &prevCtx) != 0) { /* error msg already printed */ goto fail; } #ifdef WITH_ACL if ((prev_acl = acl_get_fd(fdcurr)) == NULL) { if (is_acl_well_supported(errno)) { message(MESS_ERROR, "getting file ACL %s: %s\n", currLog, strerror(errno)); restoreSecCtx(&prevCtx); goto fail; } } #endif /* WITH_ACL */ fdsave = createOutputFile(saveLog, O_WRONLY, sb, prev_acl, 0); restoreSecCtx(&prevCtx); #ifdef WITH_ACL if (prev_acl) { acl_free(prev_acl); prev_acl = NULL; } #endif if (fdsave < 0) goto fail; if (sparse_copy(fdcurr, fdsave, sb, saveLog, currLog) != 1) { message(MESS_ERROR, "error copying %s to %s: %s\n", currLog, saveLog, strerror(errno)); unlink(saveLog); goto fail; } } } if (log->flags & LOG_FLAG_COPYTRUNCATE) { message(MESS_DEBUG, "truncating %s\n", currLog); if (!debug) { if (fdsave >= 0) fsync(fdsave); if (ftruncate(fdcurr, 0)) { message(MESS_ERROR, "error truncating %s: %s\n", currLog, strerror(errno)); goto fail; } } } else message(MESS_DEBUG, "Not truncating %s\n", currLog); rc = 0; fail: if (fdcurr >= 0) { close(fdcurr); } if (fdsave >= 0) { close(fdsave); } return rc; } /* return value similar to mktime() but the exact time is ignored */ static time_t mktimeFromDateOnly(const struct tm *src) { /* explicit struct copy to retain C89 compatibility */ struct tm tmp; memcpy(&tmp, src, sizeof tmp); /* abstract out (nullify) fields expressing the exact time */ tmp.tm_hour = 0; tmp.tm_min = 0; tmp.tm_sec = 0; return mktime(&tmp); } /* return by how many days the date was advanced but ignore exact time */ static long daysElapsed(const struct tm *now, const struct tm *last) { const double diff = difftime(mktimeFromDateOnly(now),mktimeFromDateOnly(last)); return (long) (diff / (24 * 3600)); } static int findNeedRotating(const struct logInfo *log, unsigned logNum, int force) { struct stat sb; struct logState *state; struct tm now; message(MESS_DEBUG, "considering log %s\n", log->files[logNum]); localtime_r(&nowSecs, &now); /* Check if parent directory of this log has safe permissions */ if ((log->flags & LOG_FLAG_SU) == 0 && getuid() == ROOT_UID) { char *ld; char *logpath = strdup(log->files[logNum]); if (logpath == NULL) { message_OOM(); return 1; } ld = dirname(logpath); if (stat(ld, &sb)) { /* If parent directory doesn't exist, it's not real error (unless nomissingok is specified) and rotation is not needed */ if (errno != ENOENT || (log->flags & LOG_FLAG_MISSINGOK) == 0) { message(MESS_ERROR, "stat of %s failed: %s\n", ld, strerror(errno)); free(logpath); return 1; } free(logpath); return 0; } /* Don't rotate in directories writable by others or group which is not "root" */ if ((sb.st_gid != 0 && (sb.st_mode & S_IWGRP)) || (sb.st_mode & S_IWOTH)) { message(MESS_ERROR, "skipping \"%s\" because parent directory has insecure permissions" " (It's world writable or writable by group which is not \"root\")" " Set \"su\" directive in config file to tell logrotate which user/group" " should be used for rotation.\n" ,log->files[logNum]); free(logpath); return 1; } free(logpath); } if (lstat(log->files[logNum], &sb)) { if ((log->flags & LOG_FLAG_MISSINGOK) && (errno == ENOENT)) { message(MESS_DEBUG, " log %s does not exist -- skipping\n", log->files[logNum]); return 0; } message(MESS_ERROR, "stat of %s failed: %s\n", log->files[logNum], strerror(errno)); return 1; } state = findState(log->files[logNum]); if (!state) return 1; state->doRotate = 0; state->sb = sb; state->isUsed = 1; if ((sb.st_mode & S_IFMT) == S_IFLNK) { message(MESS_DEBUG, " log %s is symbolic link. Rotation of symbolic" " links is not allowed to avoid security issues -- skipping.\n", log->files[logNum]); return 0; } if (!(log->flags & LOG_FLAG_ALLOWHARDLINK) && sb.st_nlink != 1) { message(MESS_DEBUG, " log %s has multiple (%lu) hard links. Rotation of files" " with multiple hard links is not allowed for %s -- skipping.\n", log->files[logNum], (unsigned long)sb.st_nlink, log->pattern); return 0; } message(MESS_DEBUG, " Now: %d-%02d-%02d %02d:%02d\n", 1900 + now.tm_year, 1 + now.tm_mon, now.tm_mday, now.tm_hour, now.tm_min); message(MESS_DEBUG, " Last rotated at %d-%02d-%02d %02d:%02d\n", 1900 + state->lastRotated.tm_year, 1 + state->lastRotated.tm_mon, state->lastRotated.tm_mday, state->lastRotated.tm_hour, state->lastRotated.tm_min); if (force) { /* user forced rotation of logs from command line */ state->doRotate = 1; } else if (log->maxsize && sb.st_size > log->maxsize) { state->doRotate = 1; } else if (log->criterium == ROT_SIZE) { state->doRotate = (sb.st_size >= log->threshold); if (!state->doRotate) { message(MESS_DEBUG, " log does not need rotating " "(log size is below the 'size' threshold)\n"); } } else if (difftime(mktime(&state->lastRotated), mktime(&now)) > (25 * 3600)) { /* 25 hours allows for DST changes as well as geographical moves */ message(MESS_ERROR, "log %s last rotated in the future -- rotation forced\n", log->files[logNum]); state->doRotate = 1; } else if (state->lastRotated.tm_year != now.tm_year || state->lastRotated.tm_mon != now.tm_mon || state->lastRotated.tm_mday != now.tm_mday || state->lastRotated.tm_hour != now.tm_hour) { long days; switch (log->criterium) { case ROT_WEEKLY: days = daysElapsed(&now, &state->lastRotated); /* rotate if date is advanced by 7+ days (exact time is ignored) */ state->doRotate = (days >= 7) /* ... or if we have not yet rotated today */ || (days >= 1 /* ... and the selected weekday is today */ && (unsigned)now.tm_wday == log->weekday); if (!state->doRotate) { message(MESS_DEBUG, " log does not need rotating " "(log has been rotated at %d-%02d-%02d %02d:%02d, " "which is less than a week ago)\n", 1900 + state->lastRotated.tm_year, 1 + state->lastRotated.tm_mon, state->lastRotated.tm_mday, state->lastRotated.tm_hour, state->lastRotated.tm_min); } break; case ROT_HOURLY: state->doRotate = ((now.tm_hour != state->lastRotated.tm_hour) || (now.tm_mday != state->lastRotated.tm_mday) || (now.tm_mon != state->lastRotated.tm_mon) || (now.tm_year != state->lastRotated.tm_year)); if (!state->doRotate) { message(MESS_DEBUG, " log does not need rotating " "(log has been rotated at %d-%02d-%02d %02d:%02d, " "which is less than an hour ago)\n", 1900 + state->lastRotated.tm_year, 1 + state->lastRotated.tm_mon, state->lastRotated.tm_mday, state->lastRotated.tm_hour, state->lastRotated.tm_min); } break; case ROT_DAYS: state->doRotate = ((now.tm_mday != state->lastRotated.tm_mday) || (now.tm_mon != state->lastRotated.tm_mon) || (now.tm_year != state->lastRotated.tm_year)); if (!state->doRotate) { message(MESS_DEBUG, " log does not need rotating " "(log has been rotated at %d-%02d-%02d %02d:%02d, " "which is less than a day ago)\n", 1900 + state->lastRotated.tm_year, 1 + state->lastRotated.tm_mon, state->lastRotated.tm_mday, state->lastRotated.tm_hour, state->lastRotated.tm_min); } break; case ROT_MONTHLY: /* rotate if the logs haven't been rotated this month or this year */ state->doRotate = ((now.tm_mon != state->lastRotated.tm_mon) || (now.tm_year != state->lastRotated.tm_year)); if (!state->doRotate) { message(MESS_DEBUG, " log does not need rotating " "(log has been rotated at %d-%02d-%02d %02d:%02d, " "which is less than a month ago)\n", 1900 + state->lastRotated.tm_year, 1 + state->lastRotated.tm_mon, state->lastRotated.tm_mday, state->lastRotated.tm_hour, state->lastRotated.tm_min); } break; case ROT_YEARLY: /* rotate if the logs haven't been rotated this year */ state->doRotate = (now.tm_year != state->lastRotated.tm_year); if (!state->doRotate) { message(MESS_DEBUG, " log does not need rotating " "(log has been rotated at %d-%02d-%02d %02d:%02d, " "which is less than a year ago)\n", 1900 + state->lastRotated.tm_year, 1 + state->lastRotated.tm_mon, state->lastRotated.tm_mday, state->lastRotated.tm_hour, state->lastRotated.tm_min); } break; case ROT_SIZE: default: /* ack! */ state->doRotate = 0; break; } if (log->minsize && sb.st_size < log->minsize) { state->doRotate = 0; message(MESS_DEBUG, " log does not need rotating " "('minsize' directive is used and the log " "size is smaller than the minsize value)\n"); } if (log->rotateMinAge && log->rotateMinAge * DAY_SECONDS >= difftime(nowSecs, sb.st_mtime)) { state->doRotate = 0; message(MESS_DEBUG, " log does not need rotating " "('minage' directive is used and the log " "age is smaller than the minage days)\n"); } } else if (!state->doRotate) { message(MESS_DEBUG, " log does not need rotating " "(log has already been rotated)\n"); } /* The notifempty flag overrides the normal criteria */ if (state->doRotate && !(log->flags & LOG_FLAG_IFEMPTY) && !sb.st_size) { state->doRotate = 0; message(MESS_DEBUG, " log does not need rotating " "(log is empty)\n"); } if (state->doRotate) { message(MESS_DEBUG, " log needs rotating\n"); } return 0; } /* find the rotated file with the highest index */ static int findLastRotated(const struct logNames *rotNames, const char *fileext, const char *compext) { char *pattern; int glob_rc; glob_t globResult; size_t i; int last = 0; size_t prefixLen, suffixLen; if (asprintf(&pattern, "%s/%s.*%s%s", rotNames->dirName, rotNames->baseName, fileext, compext) < 0) /* out of memory */ return -1; glob_rc = glob(pattern, 0, globerr, &globResult); free(pattern); switch (glob_rc) { case 0: /* glob() succeeded */ break; case GLOB_NOMATCH: /* found nothing -> assume first rotation */ return 0; default: /* glob() failed */ return -1; } prefixLen = strlen(rotNames->dirName) + /* '/' */1 + strlen(rotNames->baseName) + /* '.' */ 1; suffixLen = strlen(fileext) + strlen(compext); for (i = 0; i < globResult.gl_pathc; ++i) { char *fileName = globResult.gl_pathv[i]; const size_t fileNameLen = strlen(fileName); int num; char c; if (fileNameLen <= prefixLen + suffixLen) /* not enough room for index in this file name */ continue; /* cut off prefix/suffix */ fileName[fileNameLen - suffixLen] = '\0'; fileName += prefixLen; if (sscanf(fileName, "%d%c", &num, &c) != 1) /* index not matched in this file name */ continue; /* update last index */ if (last < num) last = num; } globfree(&globResult); return last; } static int prerotateSingleLog(const struct logInfo *log, unsigned logNum, struct logState *state, struct logNames *rotNames) { struct tm now; const char *compext = ""; const char *fileext = ""; int hasErrors = 0; char *glob_pattern; glob_t globResult; int rc; int rotateCount = log->rotateCount ? log->rotateCount : 1; #define DATEEXT_LEN 64 #define PATTERN_LEN (DATEEXT_LEN * 2) char dext_str[DATEEXT_LEN]; char dformat[PATTERN_LEN] = ""; char dext_pattern[PATTERN_LEN]; if (!state->doRotate) return 0; /* Logs with rotateCounts of 0 are rotated once, then removed. This lets scripts run properly, and everything gets mailed properly. */ message(MESS_DEBUG, "rotating log %s, log->rotateCount is %d\n", log->files[logNum], log->rotateCount); if (log->flags & LOG_FLAG_COMPRESS) { if (!log->compress_ext) { message(MESS_ERROR, "log %s: compression enabled, but compression " "extension is not set\n", log->files[logNum]); return 1; } compext = log->compress_ext; } localtime_r(&nowSecs, &now); state->lastRotated = now; { const char *ld; char *logpath = strdup(log->files[logNum]); if (logpath == NULL) { message_OOM(); return 1; } ld = dirname(logpath); if (log->oldDir) { if (log->oldDir[0] != '/') { if (asprintf(&rotNames->dirName, "%s/%s", ld, log->oldDir) < 0) { rotNames->dirName = NULL; } } else rotNames->dirName = strdup(log->oldDir); } else rotNames->dirName = strdup(ld); free(logpath); if (rotNames->dirName == NULL) { message_OOM(); return 1; } } { char *filename = strdup(log->files[logNum]); if (filename == NULL) { message_OOM(); return 1; } rotNames->baseName = strdup(basename(filename)); if (rotNames->baseName == NULL) { message_OOM(); free(filename); return 1; } free(filename); } if (log->addextension) { const size_t baseLen = strlen(rotNames->baseName); const size_t extLen = strlen(log->addextension); if (baseLen >= extLen && strncmp(&(rotNames->baseName[baseLen - extLen]), log->addextension, extLen) == 0) { char *tempstr = strndup(rotNames->baseName, baseLen - extLen); if (tempstr == NULL) { message_OOM(); return 1; } free(rotNames->baseName); rotNames->baseName = tempstr; } fileext = log->addextension; } if (log->extension) { const size_t baseLen = strlen(rotNames->baseName); const size_t extLen = strlen(log->extension); if (baseLen >= extLen && strncmp(&(rotNames->baseName[baseLen - extLen]), log->extension, extLen) == 0) { char *tempstr; fileext = log->extension; tempstr = strndup(rotNames->baseName, baseLen - extLen); if (tempstr == NULL) { message_OOM(); return 1; } free(rotNames->baseName); rotNames->baseName = tempstr; } } /* Adjust "now" if we want yesterday's date */ if (log->flags & LOG_FLAG_DATEYESTERDAY) { now.tm_hour = 12; /* set hour to noon to work around DST issues */ now.tm_mday = now.tm_mday - 1; mktime(&now); } if (log->flags & LOG_FLAG_DATEHOURAGO) { now.tm_hour -= 1; mktime(&now); } /* Construct the glob pattern corresponding to the date format */ dext_str[0] = '\0'; if (log->dateformat) { char *dext; size_t i = 0, j = 0; memset(dext_pattern, 0, sizeof(dext_pattern)); dext = log->dateformat; while (*dext == ' ') dext++; while ((*dext != '\0') && (!hasErrors)) { /* Will there be a space for a char and '\0'? */ if (j >= (sizeof(dext_pattern) - 1)) { message(MESS_ERROR, "Date format %s is too long\n", log->dateformat); hasErrors = 1; break; } if (*dext == '%') { switch (*(dext + 1)) { case 'Y': strncat(dext_pattern, "[0-9][0-9]", sizeof(dext_pattern) - strlen(dext_pattern) - 1); j += 10; /* strlen("[0-9][0-9]") */ /* FALLTHRU */ case 'm': case 'd': case 'H': case 'M': case 'S': case 'V': strncat(dext_pattern, "[0-9][0-9]", sizeof(dext_pattern) - strlen(dext_pattern) - 1); j += 10; if (j >= (sizeof(dext_pattern) - 1)) { message(MESS_ERROR, "Date format %s is too long\n", log->dateformat); hasErrors = 1; break; } dformat[i++] = *(dext++); dformat[i] = *dext; break; case 's': /* End of year 2293 this pattern does not work. */ strncat(dext_pattern, "[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]", sizeof(dext_pattern) - strlen(dext_pattern) - 1); j += 50; if (j >= (sizeof(dext_pattern) - 1)) { message(MESS_ERROR, "Date format %s is too long\n", log->dateformat); hasErrors = 1; break; } dformat[i++] = *(dext++); dformat[i] = *dext; break; default: dformat[i++] = *dext; dformat[i] = '%'; dext_pattern[j++] = *dext; break; } } else { dformat[i] = *dext; dext_pattern[j++] = *dext; } ++i; ++dext; } dformat[i] = '\0'; message(MESS_DEBUG, "Converted '%s' -> '%s'\n", log->dateformat, dformat); strftime(dext_str, sizeof(dext_str), dformat, &now); } else { if (log->criterium == ROT_HOURLY) { /* hourly adds another two digits */ strftime(dext_str, sizeof(dext_str), "-%Y%m%d%H", &now); strncpy(dext_pattern, "-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]", sizeof(dext_pattern)); } else { /* The default dateformat and glob pattern */ strftime(dext_str, sizeof(dext_str), "-%Y%m%d", &now); strncpy(dext_pattern, "-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]", sizeof(dext_pattern)); } dext_pattern[PATTERN_LEN - 1] = '\0'; } message(MESS_DEBUG, "dateext suffix '%s'\n", dext_str); message(MESS_DEBUG, "glob pattern '%s'\n", dext_pattern); if (setSecCtxByName(log->files[logNum], log, &prev_context) != 0) { /* error msg already printed */ return 1; } /* First compress the previous log when necessary */ if ((log->flags & LOG_FLAG_COMPRESS) && (log->flags & LOG_FLAG_DELAYCOMPRESS)) { if (log->flags & LOG_FLAG_DATEEXT) { /* glob for uncompressed files with our pattern */ if (asprintf(&glob_pattern, "%s/%s%s%s", rotNames->dirName, rotNames->baseName, dext_pattern, fileext) < 0) { message_OOM(); return 1; } rc = glob(glob_pattern, 0, globerr, &globResult); if (!rc && globResult.gl_pathc > 0) { size_t glob_count; sortGlobResult(&globResult, strlen(rotNames->dirName) + 1 + strlen(rotNames->baseName), dformat); for (glob_count = 0; glob_count < globResult.gl_pathc && !hasErrors; glob_count++) { struct stat sbprev; const char *oldName = globResult.gl_pathv[glob_count]; if (stat(oldName, &sbprev)) { if (errno == ENOENT) message(MESS_DEBUG, "previous log %s does not exist\n", oldName); else message(MESS_ERROR, "cannot stat %s: %s\n", oldName, strerror(errno)); } else { hasErrors = compressLogFile(oldName, log, &sbprev); } } } else { message(MESS_DEBUG, "glob finding logs to compress failed\n"); } globfree(&globResult); free(glob_pattern); } else { struct stat sbprev; char *oldName; if (asprintf(&oldName, "%s/%s.%d%s", rotNames->dirName, rotNames->baseName, log->logStart, fileext) < 0) { message_OOM(); return 1; } if (stat(oldName, &sbprev)) { if (errno == ENOENT) message(MESS_DEBUG, "previous log %s does not exist\n", oldName); else message(MESS_ERROR, "cannot stat %s: %s\n", oldName, strerror(errno)); } else { hasErrors = compressLogFile(oldName, log, &sbprev); } free(oldName); } } if (log->flags & LOG_FLAG_DATEEXT) { /* glob for compressed files with our pattern * and compress ext */ if (asprintf(&glob_pattern, "%s/%s%s%s%s", rotNames->dirName, rotNames->baseName, dext_pattern, fileext, compext) < 0) { message_OOM(); return 1; } rc = glob(glob_pattern, 0, globerr, &globResult); if (!rc) { /* search for files to drop, if we find one remember it, * if we find another one mail and remove the first and * remember the second and so on */ struct stat fst_buf; size_t glob_count, mail_out = (size_t)-1; /* Remove the first (n - rotateCount) matches no real rotation * needed, since the files have the date in their name. Note that * (size_t)-1 == SIZE_T_MAX in rotateCount */ sortGlobResult(&globResult, strlen(rotNames->dirName) + 1 + strlen(rotNames->baseName), dformat); for (glob_count = 0; glob_count < globResult.gl_pathc; glob_count++) { if (!stat((globResult.gl_pathv)[glob_count], &fst_buf)) { if (((globResult.gl_pathc >= (size_t)rotateCount) && (glob_count <= (globResult.gl_pathc - (size_t)rotateCount))) || ((log->rotateAge > 0) && ((difftime(nowSecs, fst_buf.st_mtime) / DAY_SECONDS) > log->rotateAge))) { if (mail_out != (size_t)-1) { char *mailFilename = (globResult.gl_pathv)[mail_out]; if (!hasErrors && log->logAddress) hasErrors = mailLogWrapper(mailFilename, mailCommand, logNum, log); if (!hasErrors) { message(MESS_DEBUG, "removing %s\n", mailFilename); hasErrors = removeLogFile(mailFilename, log); } } mail_out = glob_count; } } } if (mail_out != (size_t)-1) { /* oldName is oldest Backup found (for unlink later) */ const char *oldName = globResult.gl_pathv[mail_out]; rotNames->disposeName = strdup(oldName); if (rotNames->disposeName == NULL) { message_OOM(); globfree(&globResult); free(glob_pattern); return 1; } } else { free(rotNames->disposeName); rotNames->disposeName = NULL; } } else { message(MESS_DEBUG, "glob finding old rotated logs failed\n"); free(rotNames->disposeName); rotNames->disposeName = NULL; } /* firstRotated is most recently created/compressed rotated log */ if (asprintf(&rotNames->firstRotated, "%s/%s%s%s%s", rotNames->dirName, rotNames->baseName, dext_str, fileext, (log->flags & LOG_FLAG_DELAYCOMPRESS) ? "" : compext) < 0) { message_OOM(); rotNames->firstRotated = NULL; globfree(&globResult); free(glob_pattern); return 1; } globfree(&globResult); free(glob_pattern); } else { int i; char *newName = NULL; char *oldName; if (rotateCount == -1) { rotateCount = findLastRotated(rotNames, fileext, compext); if (rotateCount < 0) { message(MESS_ERROR, "could not find last rotated file: %s/%s.*%s%s\n", rotNames->dirName, rotNames->baseName, fileext, compext); return 1; } } if (asprintf(&oldName, "%s/%s.%d%s%s", rotNames->dirName, rotNames->baseName, log->logStart + rotateCount, fileext, compext) < 0) { message_OOM(); return 1; } if (log->rotateCount != -1) { rotNames->disposeName = strdup(oldName); if (rotNames->disposeName == NULL) { message_OOM(); free(oldName); return 1; } } if (asprintf(&rotNames->firstRotated, "%s/%s.%d%s%s", rotNames->dirName, rotNames->baseName, log->logStart, fileext, (log->flags & LOG_FLAG_DELAYCOMPRESS) ? "" : compext) < 0) { message_OOM(); free(oldName); rotNames->firstRotated = NULL; return 1; } for (i = rotateCount + log->logStart - 1; (i >= log->logStart) && !hasErrors; i--) { free(newName); newName = oldName; if (asprintf(&oldName, "%s/%s.%d%s%s", rotNames->dirName, rotNames->baseName, i, fileext, compext) < 0) { message_OOM(); oldName = NULL; break; } /* remove files hit by maxage */ if (log->rotateAge) { struct stat fst_buf; if (stat(oldName, &fst_buf)) { if (errno == ENOENT) { message(MESS_DEBUG, "old log %s does not exist\n", oldName); } else { message(MESS_ERROR, "cannot stat %s: %s\n", oldName, strerror(errno)); hasErrors = 1; } continue; } if ((difftime(nowSecs, fst_buf.st_mtime) / DAY_SECONDS) > log->rotateAge) { if (!hasErrors && log->logAddress) hasErrors = mailLogWrapper(oldName, mailCommand, logNum, log); if (!hasErrors) hasErrors = removeLogFile(oldName, log); continue; } } message(MESS_DEBUG, "renaming %s to %s (rotatecount %d, logstart %d, i %d), \n", oldName, newName, rotateCount, log->logStart, i); if (!debug && rename(oldName, newName)) { if (errno == ENOENT) { message(MESS_DEBUG, "old log %s does not exist\n", oldName); } else { message(MESS_ERROR, "error renaming %s to %s: %s\n", oldName, newName, strerror(errno)); hasErrors = 1; } } } free(newName); free(oldName); } /* !LOG_FLAG_DATEEXT */ if (log->flags & LOG_FLAG_DATEEXT) { char *destFile; struct stat fst_buf; if (asprintf(&(rotNames->finalName), "%s/%s%s%s", rotNames->dirName, rotNames->baseName, dext_str, fileext) < 0) { message_OOM(); rotNames->finalName = NULL; return 1; } if (asprintf(&destFile, "%s%s", rotNames->finalName, compext) < 0) { message_OOM(); return 1; } if (!stat(destFile, &fst_buf)) { message(MESS_ERROR, "destination %s already exists, skipping rotation\n", rotNames->firstRotated); hasErrors = 1; } free(destFile); } else { /* note: the gzip extension is *not* used here! */ if (asprintf(&(rotNames->finalName), "%s/%s.%d%s", rotNames->dirName, rotNames->baseName, log->logStart, fileext) < 0) { message_OOM(); rotNames->finalName = NULL; } } /* if the last rotation doesn't exist, that's okay */ if (rotNames->disposeName && access(rotNames->disposeName, F_OK)) { message(MESS_DEBUG, "log %s doesn't exist -- won't try to dispose of it\n", rotNames->disposeName); free(rotNames->disposeName); rotNames->disposeName = NULL; } return hasErrors; } static int rotateSingleLog(const struct logInfo *log, unsigned logNum, struct logState *state, struct logNames *rotNames) { int hasErrors = 0; struct stat sb; char *savedContext = NULL; if (!state->doRotate) return 0; if (!hasErrors) { if (!(log->flags & (LOG_FLAG_COPYTRUNCATE | LOG_FLAG_COPY))) { if (setSecCtxByName(log->files[logNum], log, &savedContext) != 0) { /* error msg already printed */ return 1; } #ifdef WITH_ACL if ((prev_acl = acl_get_file(log->files[logNum], ACL_TYPE_ACCESS)) == NULL) { if (is_acl_well_supported(errno)) { message(MESS_ERROR, "getting file ACL %s: %s\n", log->files[logNum], strerror(errno)); hasErrors = 1; } } #endif /* WITH_ACL */ if (log->flags & LOG_FLAG_TMPFILENAME) { char *tmpFilename; if (asprintf(&tmpFilename, "%s%s", log->files[logNum], ".tmp") < 0) { message_OOM(); restoreSecCtx(&savedContext); return 1; } message(MESS_DEBUG, "renaming %s to %s\n", log->files[logNum], tmpFilename); if (!debug && !hasErrors && rename(log->files[logNum], tmpFilename)) { message(MESS_ERROR, "failed to rename %s to %s: %s\n", log->files[logNum], tmpFilename, strerror(errno)); hasErrors = 1; } free(tmpFilename); } else { message(MESS_DEBUG, "renaming %s to %s\n", log->files[logNum], rotNames->finalName); if (!debug && !hasErrors && rename(log->files[logNum], rotNames->finalName)) { message(MESS_ERROR, "failed to rename %s to %s: %s\n", log->files[logNum], rotNames->finalName, strerror(errno)); hasErrors = 1; } } if (!log->rotateCount) { const char *ext = ""; if (log->compress_ext && (log->flags & LOG_FLAG_COMPRESS) && !(log->flags & LOG_FLAG_DELAYCOMPRESS)) ext = log->compress_ext; free(rotNames->disposeName); if (asprintf(&rotNames->disposeName, "%s%s", rotNames->finalName, ext) < 0) { message_OOM(); rotNames->disposeName = NULL; return 1; } message(MESS_DEBUG, "disposeName will be %s\n", rotNames->disposeName); } } if (!hasErrors && (log->flags & LOG_FLAG_CREATE) && !(log->flags & (LOG_FLAG_COPYTRUNCATE | LOG_FLAG_COPY))) { int have_create_mode = 0; if (log->createUid == NO_UID) sb.st_uid = state->sb.st_uid; else sb.st_uid = log->createUid; if (log->createGid == NO_GID) sb.st_gid = state->sb.st_gid; else sb.st_gid = log->createGid; if (log->createMode == NO_MODE) sb.st_mode = state->sb.st_mode & 0777; else { sb.st_mode = log->createMode; have_create_mode = 1; } message(MESS_DEBUG, "creating new %s mode = 0%o uid = %d " "gid = %d\n", log->files[logNum], (unsigned int) sb.st_mode, (int) sb.st_uid, (int) sb.st_gid); if (!debug) { if (!hasErrors) { int fd = createOutputFile(log->files[logNum], O_RDWR, &sb, prev_acl, have_create_mode); #ifdef WITH_ACL if (prev_acl) { acl_free(prev_acl); prev_acl = NULL; } #endif if (fd < 0) hasErrors = 1; else { close(fd); } } } } restoreSecCtx(&savedContext); if (!hasErrors && (log->flags & (LOG_FLAG_COPYTRUNCATE | LOG_FLAG_COPY)) && !(log->flags & LOG_FLAG_TMPFILENAME)) { hasErrors = copyTruncate(log->files[logNum], rotNames->finalName, &state->sb, log, !log->rotateCount); } #ifdef WITH_ACL if (prev_acl) { acl_free(prev_acl); prev_acl = NULL; } #endif /* WITH_ACL */ } return hasErrors; } static int postrotateSingleLog(const struct logInfo *log, unsigned logNum, struct logState *state, struct logNames *rotNames) { int hasErrors = 0; if (!state->doRotate) { return 0; } if (!hasErrors && (log->flags & LOG_FLAG_TMPFILENAME)) { char *tmpFilename; if (asprintf(&tmpFilename, "%s%s", log->files[logNum], ".tmp") < 0) { message_OOM(); return 1; } hasErrors = copyTruncate(tmpFilename, rotNames->finalName, &state->sb, log, /* skip_copy */ 0); message(MESS_DEBUG, "removing tmp log %s\n", tmpFilename); if (!debug && !hasErrors) { unlink(tmpFilename); } free(tmpFilename); } if (!hasErrors && (log->flags & LOG_FLAG_COMPRESS) && !(log->flags & LOG_FLAG_DELAYCOMPRESS)) { hasErrors = compressLogFile(rotNames->finalName, log, &state->sb); } if (!hasErrors && log->logAddress) { char *mailFilename; if (log->flags & LOG_FLAG_MAILFIRST) mailFilename = rotNames->firstRotated; else mailFilename = rotNames->disposeName; if (mailFilename) hasErrors = mailLogWrapper(mailFilename, mailCommand, logNum, log); } if (!hasErrors && rotNames->disposeName) hasErrors = removeLogFile(rotNames->disposeName, log); restoreSecCtx(&prev_context); return hasErrors; } static int rotateLogSet(const struct logInfo *log, int force) { unsigned i, j; int hasErrors = 0; int *logHasErrors; int numRotated = 0; struct logState **state; struct logNames **rotNames; message(MESS_DEBUG, "\nrotating pattern: %s ", log->pattern); if (force) { message(MESS_DEBUG, "forced from command line "); } else { switch (log->criterium) { case ROT_HOURLY: message(MESS_DEBUG, "hourly "); break; case ROT_DAYS: message(MESS_DEBUG, "after %jd days ", (intmax_t)log->threshold); break; case ROT_WEEKLY: message(MESS_DEBUG, "weekly "); break; case ROT_MONTHLY: message(MESS_DEBUG, "monthly "); break; case ROT_YEARLY: message(MESS_DEBUG, "yearly "); break; case ROT_SIZE: message(MESS_DEBUG, "%jd bytes ", (intmax_t)log->threshold); break; default: message(MESS_FATAL, "rotateLogSet() does not have case for: %u ", (unsigned) log->criterium); } } if (log->rotateCount > 0) message(MESS_DEBUG, "(%d rotations)\n", log->rotateCount); else if (log->rotateCount == 0) message(MESS_DEBUG, "(no old logs will be kept)\n"); if (log->oldDir) message(MESS_DEBUG, "olddir is %s, ", log->oldDir); if (log->flags & LOG_FLAG_IFEMPTY) message(MESS_DEBUG, "empty log files are rotated, "); else message(MESS_DEBUG, "empty log files are not rotated, "); if (log->minsize) message(MESS_DEBUG, "only log files >= %jd bytes are rotated, ", (intmax_t)log->minsize); if (log->maxsize) message(MESS_DEBUG, "log files >= %jd are rotated earlier, ", (intmax_t)log->maxsize); if (log->rotateMinAge) message(MESS_DEBUG, "only log files older than %d days are rotated, ", log->rotateMinAge); if (log->logAddress) { message(MESS_DEBUG, "old logs mailed to %s\n", log->logAddress); } else { message(MESS_DEBUG, "old logs are removed\n"); } if (log->numFiles == 0) { message(MESS_DEBUG, "No logs found. Rotation not needed.\n"); return 0; } logHasErrors = calloc(log->numFiles, sizeof(int)); if (!logHasErrors) { message_OOM(); return 1; } if (log->flags & LOG_FLAG_SU) { if (switch_user(log->suUid, log->suGid) != 0) { free(logHasErrors); return 1; } } for (i = 0; i < log->numFiles; i++) { struct logState *logState; logHasErrors[i] = findNeedRotating(log, i, force); hasErrors |= logHasErrors[i]; /* sure is a lot of findStating going on .. */ if (((logState = findState(log->files[i]))) && logState->doRotate) numRotated++; } if (log->first) { if (!numRotated) { message(MESS_DEBUG, "not running first action script, " "since no logs will be rotated\n"); } else { message(MESS_DEBUG, "running first action script\n"); if (runScript(log, log->pattern, NULL, log->first)) { message(MESS_ERROR, "error running first action script " "for %s\n", log->pattern); hasErrors = 1; if (log->flags & LOG_FLAG_SU) { if (switch_user_back() != 0) { free(logHasErrors); return 1; } } /* finish early, firstaction failed, affects all logs in set */ free(logHasErrors); return hasErrors; } } } state = malloc(log->numFiles * sizeof(struct logState *)); rotNames = malloc(log->numFiles * sizeof(struct logNames *)); if (state == NULL || rotNames == NULL) { message_OOM(); if (log->flags & LOG_FLAG_SU) { switch_user_back(); } free(rotNames); free(state); free(logHasErrors); return 1; } for (j = 0; (!(log->flags & LOG_FLAG_SHAREDSCRIPTS) && j < log->numFiles) || ((log->flags & LOG_FLAG_SHAREDSCRIPTS) && j < 1); j++) { for (i = j; ((log->flags & LOG_FLAG_SHAREDSCRIPTS) && i < log->numFiles) || (!(log->flags & LOG_FLAG_SHAREDSCRIPTS) && i == j); i++) { state[i] = findState(log->files[i]); if (!state[i]) logHasErrors[i] = 1; rotNames[i] = malloc(sizeof(struct logNames)); if (rotNames[i] == NULL) { message_OOM(); if (log->flags & LOG_FLAG_SU) { switch_user_back(); } free(rotNames); free(state); free(logHasErrors); return 1; } memset(rotNames[i], 0, sizeof(struct logNames)); logHasErrors[i] |= prerotateSingleLog(log, i, state[i], rotNames[i]); hasErrors |= logHasErrors[i]; } if (log->pre && (!( (!(log->flags & LOG_FLAG_SHAREDSCRIPTS) && (logHasErrors[j] || !state[j]->doRotate)) || (hasErrors && (log->flags & LOG_FLAG_SHAREDSCRIPTS)) )) ) { if (!numRotated) { message(MESS_DEBUG, "not running prerotate script, " "since no logs will be rotated\n"); } else { message(MESS_DEBUG, "running prerotate script\n"); if (runScript(log, (log->flags & LOG_FLAG_SHAREDSCRIPTS) ? log->pattern : log->files[j], NULL, log->pre)) { if (log->flags & LOG_FLAG_SHAREDSCRIPTS) message(MESS_ERROR, "error running shared prerotate script " "for '%s'\n", log->pattern); else { message(MESS_ERROR, "error running non-shared prerotate script " "for %s of '%s'\n", log->files[j], log->pattern); } logHasErrors[j] = 1; hasErrors = 1; } } } for (i = j; ((log->flags & LOG_FLAG_SHAREDSCRIPTS) && i < log->numFiles) || (!(log->flags & LOG_FLAG_SHAREDSCRIPTS) && i == j); i++) { if (! ( (logHasErrors[i] && !(log->flags & LOG_FLAG_SHAREDSCRIPTS)) || (hasErrors && (log->flags & LOG_FLAG_SHAREDSCRIPTS)) ) ) { logHasErrors[i] |= rotateSingleLog(log, i, state[i], rotNames[i]); hasErrors |= logHasErrors[i]; } } if (log->post && (!( (!(log->flags & LOG_FLAG_SHAREDSCRIPTS) && (logHasErrors[j] || !state[j]->doRotate)) || (hasErrors && (log->flags & LOG_FLAG_SHAREDSCRIPTS)) )) ) { if (!numRotated) { message(MESS_DEBUG, "not running postrotate script, " "since no logs were rotated\n"); } else { char *logfn = (log->flags & LOG_FLAG_SHAREDSCRIPTS) ? log->pattern : log->files[j]; /* It only makes sense to pass in a final rotated filename if scripts are not shared */ char *logrotfn = (log->flags & LOG_FLAG_SHAREDSCRIPTS) ? NULL : rotNames[j]->finalName; message(MESS_DEBUG, "running postrotate script\n"); if (runScript(log, logfn, logrotfn, log->post)) { if (log->flags & LOG_FLAG_SHAREDSCRIPTS) message(MESS_ERROR, "error running shared postrotate script " "for '%s'\n", log->pattern); else { message(MESS_ERROR, "error running non-shared postrotate script " "for %s of '%s'\n", log->files[j], log->pattern); } logHasErrors[j] = 1; hasErrors = 1; } } } for (i = j; ((log->flags & LOG_FLAG_SHAREDSCRIPTS) && i < log->numFiles) || (!(log->flags & LOG_FLAG_SHAREDSCRIPTS) && i == j); i++) { if (! ( (logHasErrors[i] && !(log->flags & LOG_FLAG_SHAREDSCRIPTS)) || (hasErrors && (log->flags & LOG_FLAG_SHAREDSCRIPTS)) ) ) { logHasErrors[i] |= postrotateSingleLog(log, i, state[i], rotNames[i]); hasErrors |= logHasErrors[i]; } } } for (i = 0; i < log->numFiles; i++) { free(rotNames[i]->firstRotated); free(rotNames[i]->disposeName); free(rotNames[i]->finalName); free(rotNames[i]->dirName); free(rotNames[i]->baseName); free(rotNames[i]); } free(rotNames); free(state); if (log->last) { if (!numRotated) { message(MESS_DEBUG, "not running last action script, " "since no logs will be rotated\n"); } else { message(MESS_DEBUG, "running last action script\n"); if (runScript(log, log->pattern, NULL, log->last)) { message(MESS_ERROR, "error running last action script " "for %s\n", log->pattern); hasErrors = 1; } } } if (log->flags & LOG_FLAG_SU) { if (switch_user_back() != 0) { free(logHasErrors); return 1; } } free(logHasErrors); return hasErrors; } static int writeState(const char *stateFilename) { struct logState *p; FILE *f; char *chptr; unsigned int i = 0; int error = 0; int bytes = 0; int fdcurr; int fdsave; struct stat sb; char *tmpFilename = NULL; struct tm now; time_t now_time, last_time; char *prevCtx; int force_mode = 0; if (!strcmp(stateFilename, "/dev/null")) /* explicitly asked not to write the state file */ return 0; localtime_r(&nowSecs, &now); tmpFilename = malloc(strlen(stateFilename) + 5 ); if (tmpFilename == NULL) { message_OOM(); return 1; } strcpy(tmpFilename, stateFilename); strcat(tmpFilename, ".tmp"); /* Remove possible tmp state file from previous run */ error = unlink(tmpFilename); if (error == -1 && errno != ENOENT) { message(MESS_ERROR, "error removing old temporary state file %s: %s\n", tmpFilename, strerror(errno)); free(tmpFilename); return 1; } error = 0; fdcurr = open(stateFilename, O_RDONLY); if (fdcurr == -1) { /* the statefile should exist, lockState() already created an empty * state file in case it did not exist initially */ message(MESS_ERROR, "error opening state file %s: %s\n", stateFilename, strerror(errno)); free(tmpFilename); return 1; } /* get attributes, to assign them to the new state file */ if (setSecCtx(fdcurr, stateFilename, &prevCtx) != 0) { /* error msg already printed */ free(tmpFilename); close(fdcurr); return 1; } #ifdef WITH_ACL if ((prev_acl = acl_get_fd(fdcurr)) == NULL) { if (is_acl_well_supported(errno)) { message(MESS_ERROR, "getting file ACL %s: %s\n", stateFilename, strerror(errno)); restoreSecCtx(&prevCtx); free(tmpFilename); close(fdcurr); return 1; } } #endif if (fstat(fdcurr, &sb) == -1) { message(MESS_ERROR, "error stating %s: %s\n", stateFilename, strerror(errno)); restoreSecCtx(&prevCtx); free(tmpFilename); #ifdef WITH_ACL if (prev_acl) { acl_free(prev_acl); prev_acl = NULL; } #endif return 1; } close(fdcurr); if (sb.st_mode & (mode_t)S_IROTH) { /* drop world-readable flag to prevent others from locking */ sb.st_mode &= ~(mode_t)S_IROTH; force_mode = 1; } fdsave = createOutputFile(tmpFilename, O_RDWR, &sb, prev_acl, force_mode); #ifdef WITH_ACL if (prev_acl) { acl_free(prev_acl); prev_acl = NULL; } #endif restoreSecCtx(&prevCtx); if (fdsave < 0) { free(tmpFilename); return 1; } f = fdopen(fdsave, "w"); if (!f) { message(MESS_ERROR, "error creating temp state file %s: %s\n", tmpFilename, strerror(errno)); free(tmpFilename); return 1; } bytes = fprintf(f, "logrotate state -- version 2\n"); if (bytes < 0) error = bytes; /* * Time in seconds it takes earth to go around sun. The value is * astronomical measurement (solar year) rather than something derived from * a convention (calendar year). */ #define SECONDS_IN_YEAR 31556926 for (i = 0; i < hashSize && error == 0; i++) { for (p = states[i]->head.lh_first; p != NULL && error == 0; p = p->list.le_next) { /* Skip states which are not used for more than a year. */ now_time = mktime(&now); last_time = mktime(&p->lastRotated); if (!p->isUsed && difftime(now_time, last_time) > SECONDS_IN_YEAR) { message(MESS_DEBUG, "Removing %s from state file, " "because it does not exist and has not been rotated for one year\n", p->fn); continue; } error = fputc('"', f) == EOF; for (chptr = p->fn; *chptr && error == 0; chptr++) { switch (*chptr) { case '"': case '\\': error = fputc('\\', f) == EOF; break; case '\n': error = fputc('\\', f) == EOF; if (error == 0) { error = fputc('n', f) == EOF; } continue; default: break; } if (error == 0 && fputc(*chptr, f) == EOF) { error = 1; } } if (error == 0 && fputc('"', f) == EOF) error = 1; if (error == 0) { bytes = fprintf(f, " %d-%d-%d-%d:%d:%d\n", p->lastRotated.tm_year + 1900, p->lastRotated.tm_mon + 1, p->lastRotated.tm_mday, p->lastRotated.tm_hour, p->lastRotated.tm_min, p->lastRotated.tm_sec); if (bytes < 0) error = bytes; } } } if (error == 0) error = fflush(f); if (error == 0) error = fsync(fdsave); if (error == 0) error = fclose(f); else fclose(f); if (error == 0) { if (rename(tmpFilename, stateFilename)) { message(MESS_ERROR, "error renaming temp state file %s to %s: %s\n", tmpFilename, stateFilename, strerror(errno)); unlink(tmpFilename); error = 1; } } else { if (errno) message(MESS_ERROR, "error creating temp state file %s: %s\n", tmpFilename, strerror(errno)); else message(MESS_ERROR, "error creating temp state file %s%s\n", tmpFilename, error == ENOMEM ? ": Insufficient storage space is available." : "" ); unlink(tmpFilename); } free(tmpFilename); return error; } static int readState(const char *stateFilename) { FILE *f; char buf[STATEFILE_BUFFER_SIZE]; int line = 0; int fd; struct stat f_stat; int rc = 0; message(MESS_DEBUG, "Reading state from file: %s\n", stateFilename); fd = open(stateFilename, O_RDONLY); if (fd == -1) { /* treat non-openable file as an empty file for allocateHash() */ f_stat.st_size = 0; /* Do not return until the hash table is allocated. * In debug mode the state file might not exist, * cause lockState() is not called */ if (!debug) { message(MESS_ERROR, "error opening state file %s: %s\n", stateFilename, strerror(errno)); rc = 1; } else if (errno == ENOENT) { message(MESS_DEBUG, "state file %s does not exist\n", stateFilename); } else { message(MESS_ERROR, "error opening state file %s; assuming empty state: %s\n", stateFilename, strerror(errno)); } } else { if (fstat(fd, &f_stat) == -1) { /* treat non-statable file as an empty file for allocateHash() */ f_stat.st_size = 0; message(MESS_ERROR, "error stat()ing state file %s: %s\n", stateFilename, strerror(errno)); /* do not return until the hash table is allocated */ rc = 1; } } /* Try to estimate how many state entries we have in the state file. * We expect single entry to have around 80 characters (Of course this is * just an estimation). During the testing I've found out that 200 entries * per single hash entry gives good mem/performance ratio. */ if (allocateHash((size_t)f_stat.st_size / 80 / 200)) rc = 1; if (rc || (f_stat.st_size == 0)) { /* error already occurred, or we have no state file to read from */ if (fd != -1) close(fd); return rc; } f = fdopen(fd, "r"); if (!f) { message(MESS_ERROR, "error opening state file %s: %s\n", stateFilename, strerror(errno)); close(fd); return 1; } if (!fgets(buf, sizeof(buf) - 1, f)) { message(MESS_ERROR, "error reading top line of %s\n", stateFilename); fclose(f); return 1; } if (strcmp(buf, "logrotate state -- version 1\n") != 0 && strcmp(buf, "logrotate state -- version 2\n") != 0) { fclose(f); message(MESS_ERROR, "bad top line in state file %s\n", stateFilename); return 1; } line++; while (fgets(buf, sizeof(buf) - 1, f)) { const size_t i = strlen(buf); char *filename; int argc; const char **argv = NULL; int year, month, day, hour, minute, second; struct logState *st; time_t lr_time; line++; if (i == 0) { message(MESS_ERROR, "line %d not parsable in state file %s\n", line, stateFilename); fclose(f); return 1; } if (buf[i - 1] != '\n') { message(MESS_ERROR, "line %d too long in state file %s\n", line, stateFilename); fclose(f); return 1; } buf[i - 1] = '\0'; if (i == 1) continue; year = month = day = hour = minute = second = 0; if (poptParseArgvString(buf, &argc, &argv) || (argc != 2) || (sscanf(argv[1], "%d-%d-%d-%d:%d:%d", &year, &month, &day, &hour, &minute, &second) < 3)) { message(MESS_ERROR, "bad line %d in state file %s\n", line, stateFilename); free(argv); fclose(f); return 1; } /* Hack to hide earlier bug */ if ((year != 1900) && (year < 1970 || year > 2100)) { message(MESS_ERROR, "bad year %d for file %s in state file %s\n", year, argv[0], stateFilename); free(argv); fclose(f); return 1; } if (month < 1 || month > 12) { message(MESS_ERROR, "bad month %d for file %s in state file %s\n", month, argv[0], stateFilename); free(argv); fclose(f); return 1; } /* 0 to hide earlier bug */ if (day < 0 || day > 31) { message(MESS_ERROR, "bad day %d for file %s in state file %s\n", day, argv[0], stateFilename); free(argv); fclose(f); return 1; } if (hour < 0 || hour > 23) { message(MESS_ERROR, "bad hour %d for file %s in state file %s\n", hour, argv[0], stateFilename); free(argv); fclose(f); return 1; } if (minute < 0 || minute > 59) { message(MESS_ERROR, "bad minute %d for file %s in state file %s\n", minute, argv[0], stateFilename); free(argv); fclose(f); return 1; } if (second < 0 || second > 59) { message(MESS_ERROR, "bad second %d for file %s in state file %s\n", second, argv[0], stateFilename); free(argv); fclose(f); return 1; } year -= 1900; month -= 1; filename = strdup(argv[0]); if (filename == NULL) { message_OOM(); free(argv); fclose(f); return 1; } unescape(filename); if ((st = findState(filename)) == NULL) { free(argv); free(filename); fclose(f); return 1; } memset(&st->lastRotated, 0, sizeof(st->lastRotated)); st->lastRotated.tm_year = year; st->lastRotated.tm_mon = month; st->lastRotated.tm_mday = day; st->lastRotated.tm_hour = hour; st->lastRotated.tm_min = minute; st->lastRotated.tm_sec = second; st->lastRotated.tm_isdst = -1; /* fill in the rest of the st->lastRotated fields */ lr_time = mktime(&st->lastRotated); localtime_r(&lr_time, &st->lastRotated); free(argv); free(filename); } fclose(f); return 0; } static int lockState(const char *stateFilename, int skip_state_lock, int wait_for_state_lock) { int lockFd; int lockFlags; struct stat sb; if (!strcmp(stateFilename, "/dev/null")) { return 0; } lockFd = open(stateFilename, O_RDWR | O_CLOEXEC); if (lockFd == -1) { if (errno == ENOENT) { message(MESS_DEBUG, "Creating stub state file: %s\n", stateFilename); /* create a stub state file with mode 0640 */ lockFd = open(stateFilename, O_CREAT | O_EXCL | O_WRONLY, S_IWUSR | S_IRUSR | S_IRGRP); if (lockFd == -1) { message(MESS_ERROR, "error creating stub state file %s: %s\n", stateFilename, strerror(errno)); return 1; } } else { message(MESS_ERROR, "error opening state file %s: %s\n", stateFilename, strerror(errno)); return 1; } } if (skip_state_lock) { message(MESS_DEBUG, "Skip locking state file %s\n", stateFilename); close(lockFd); return 0; } if (fstat(lockFd, &sb) == -1) { message(MESS_ERROR, "error stat()ing state file %s: %s\n", stateFilename, strerror(errno)); close(lockFd); return 1; } if (sb.st_mode & S_IROTH) { message(MESS_WARN, "state file %s is world-readable" " and thus can be locked from other unprivileged users." " Skipping lock acquisition...\n", stateFilename); close(lockFd); return 0; } lockFlags = LOCK_EX; if (wait_for_state_lock) message(MESS_DEBUG, "waiting for lock on state file %s", stateFilename); else lockFlags |= LOCK_NB; if (flock(lockFd, lockFlags) == -1) { if (errno == EWOULDBLOCK) { message(MESS_ERROR, "state file %s is already locked\n" "logrotate does not support parallel execution on the" " same set of logfiles.\n", stateFilename); } else { message(MESS_ERROR, "error acquiring lock on state file %s: %s\n", stateFilename, strerror(errno)); } close(lockFd); return 1; } message(MESS_DEBUG, "acquired lock on state file %s", stateFilename); /* keep lockFd open till we terminate */ return 0; } int main(int argc, const char **argv) { int force = 0; int skip_state_lock = 0; int wait_for_state_lock = 0; const char *stateFile = STATEFILE; const char *logFile = NULL; FILE *logFd = NULL; int rc = 0; int arg; const char **files; poptContext optCon; const struct logInfo *log; const struct poptOption options[] = { {"debug", 'd', 0, NULL, 'd', "Don't do anything, just test and print debug messages", NULL}, {"force", 'f', 0, &force, 0, "Force file rotation", NULL}, {"mail", 'm', POPT_ARG_STRING, &mailCommand, 0, "Command to send mail (instead of `" DEFAULT_MAIL_COMMAND "')", "command"}, {"state", 's', POPT_ARG_STRING, &stateFile, 0, "Path of state file", "statefile"}, {"skip-state-lock", '\0', POPT_ARG_NONE, &skip_state_lock, 0, "Do not lock the state file", NULL}, {"wait-for-state-lock", '\0', POPT_ARG_NONE, &wait_for_state_lock, 0, "Wait for lock on the state file", NULL}, {"verbose", 'v', 0, NULL, 'v', "Display messages during rotation", NULL}, {"log", 'l', POPT_ARG_STRING, &logFile, 'l', "Log file or 'syslog' to log to syslog", "logfile"}, {"version", '\0', POPT_ARG_NONE, NULL, 'V', "Display version information", NULL}, POPT_AUTOHELP { NULL, 0, 0, NULL, 0, NULL, NULL } }; logSetLevel(MESS_WARN); setlocale (LC_ALL, ""); optCon = poptGetContext("logrotate", argc, argv, options, 0); poptReadDefaultConfig(optCon, 1); poptSetOtherOptionHelp(optCon, "[OPTION...] "); while ((arg = poptGetNextOpt(optCon)) >= 0) { switch (arg) { case 'd': debug = 1; message(MESS_WARN, "logrotate in debug mode does nothing" " except printing debug messages! Consider using verbose" " mode (-v) instead if this is not what you want.\n\n"); /* fallthrough */ case 'v': logSetLevel(MESS_DEBUG); break; case 'l': if (strcmp(logFile, "syslog") == 0) { logToSyslog(1); } else { logFd = fopen(logFile, "w"); if (!logFd) { message(MESS_ERROR, "error opening log file %s: %s\n", logFile, strerror(errno)); break; } logSetMessageFile(logFd); } break; case 'V': printf("logrotate %s\n", VERSION); printf("\n"); printf(" Default mail command: %s\n", DEFAULT_MAIL_COMMAND); printf(" Default compress command: %s\n", COMPRESS_COMMAND); printf(" Default uncompress command: %s\n", UNCOMPRESS_COMMAND); printf(" Default compress extension: %s\n", COMPRESS_EXT); printf(" Default state file path: %s\n", STATEFILE); #ifdef WITH_ACL printf(" ACL support: yes\n"); #else printf(" ACL support: no\n"); #endif #ifdef WITH_SELINUX printf(" SELinux support: yes\n"); #else printf(" SELinux support: no\n"); #endif poptFreeContext(optCon); exit(0); default: break; } } if (arg < -1) { fprintf(stderr, "logrotate: bad argument %s: %s\n", poptBadOption(optCon, POPT_BADOPTION_NOALIAS), poptStrerror(rc)); poptFreeContext(optCon); return 2; } files = poptGetArgs(optCon); if (!files) { fprintf(stderr, "logrotate " VERSION " - Copyright (C) 1995-2001 Red Hat, Inc.\n"); fprintf(stderr, "This may be freely redistributed under the terms of " "the GNU General Public License\n\n"); poptPrintUsage(optCon, stderr, 0); poptFreeContext(optCon); exit(1); } if (skip_state_lock && wait_for_state_lock) { fprintf(stderr, "logrotate: options --skip-state-lock and" " --wait-for-state-lock are mutually exclusive\n"); poptFreeContext(optCon); exit(1); } #ifdef WITH_SELINUX selinux_enabled = (is_selinux_enabled() > 0); selinux_enforce = security_getenforce(); #endif TAILQ_INIT(&logs); if (readAllConfigPaths(files)) rc = 1; poptFreeContext(optCon); nowSecs = time(NULL); if (!debug && lockState(stateFile, skip_state_lock, wait_for_state_lock)) { exit(3); } if (readState(stateFile)) rc = 1; message(MESS_DEBUG, "\nHandling %d logs\n", numLogs); for (log = logs.tqh_first; log != NULL; log = log->list.tqe_next) rc |= rotateLogSet(log, force); if (!debug) rc |= writeState(stateFile); return (rc != 0); } /* vim: set et sw=4 ts=4: */ logrotate-3.21.0/log.h0000644000175000017500000000110114246060643011446 00000000000000#ifndef H_LOG #define H_LOG #include #define MESS_REALDEBUG 1 #define MESS_DEBUG 2 #define MESS_WARN 4 #define MESS_ERROR 5 #define MESS_FATAL 6 void message(int level, const char *format, ...) #ifdef __GNUC__ __attribute__ ((format(printf, 2, 3))); #else ; #endif #define message_OOM() \ do { \ message(MESS_ERROR, "cannot allocate memory [%s():%d]\n", __func__, __LINE__); \ } while (0) void logSetMessageFile(FILE * f); void logToSyslog(int enable); void logSetLevel(int level); #endif /* vim: set et sw=4 ts=4: */ logrotate-3.21.0/logrotate.h0000644000175000017500000000566114346133207012702 00000000000000#ifndef H_LOGROTATE #define H_LOGROTATE #include #include #include "queue.h" #include /* needed for basename() on OS X */ #if HAVE_LIBGEN_H # include #endif #define LOG_FLAG_COMPRESS (1U << 0) #define LOG_FLAG_CREATE (1U << 1) #define LOG_FLAG_IFEMPTY (1U << 2) #define LOG_FLAG_DELAYCOMPRESS (1U << 3) #define LOG_FLAG_COPYTRUNCATE (1U << 4) #define LOG_FLAG_MISSINGOK (1U << 5) #define LOG_FLAG_MAILFIRST (1U << 6) #define LOG_FLAG_SHAREDSCRIPTS (1U << 7) #define LOG_FLAG_COPY (1U << 8) #define LOG_FLAG_DATEEXT (1U << 9) #define LOG_FLAG_SHRED (1U << 10) #define LOG_FLAG_SU (1U << 11) #define LOG_FLAG_DATEYESTERDAY (1U << 12) #define LOG_FLAG_OLDDIRCREATE (1U << 13) #define LOG_FLAG_TMPFILENAME (1U << 14) #define LOG_FLAG_DATEHOURAGO (1U << 15) #define LOG_FLAG_ALLOWHARDLINK (1U << 16) #define LOG_FLAG_IGNOREDUPLICATES (1U << 17) #define NO_MODE ((mode_t) -1) #define NO_UID ((uid_t) -1) #define NO_GID ((gid_t) -1) #ifdef HAVE_LIBSELINUX #define WITH_SELINUX 1 #endif #ifdef HAVE_LIBACL #define WITH_ACL 1 #endif enum criterium { ROT_HOURLY, ROT_DAYS, ROT_WEEKLY, ROT_MONTHLY, ROT_YEARLY, ROT_SIZE }; struct logInfo { char *pattern; char **files; unsigned numFiles; char *oldDir; enum criterium criterium; unsigned weekday; /* used by ROT_WEEKLY only */ off_t threshold; off_t maxsize; off_t minsize; int rotateCount; int rotateMinAge; int rotateAge; int logStart; char *pre, *post, *first, *last, *preremove; char *logAddress; char *extension; char *addextension; char *compress_prog; char *uncompress_prog; char *compress_ext; char *dateformat; /* specify format for strftime (for dateext) */ uint32_t flags; int shred_cycles; /* if !=0, pass -n shred_cycles to GNU shred */ mode_t createMode; /* if any/all of these are -1, we use the */ uid_t createUid; /* attributes from the log file just rotated */ gid_t createGid; uid_t suUid; /* switch user to this uid and group to this gid */ gid_t suGid; mode_t olddirMode; uid_t olddirUid; uid_t olddirGid; /* these are at the end so they end up nil */ const char **compress_options_list; int compress_options_count; TAILQ_ENTRY(logInfo) list; }; TAILQ_HEAD(logInfoHead, logInfo); extern struct logInfoHead logs; extern int numLogs; extern int debug; int switch_user(uid_t user, gid_t group); int switch_user_back(void); int readAllConfigPaths(const char **paths); #if !defined(asprintf) && !defined(_FORTIFY_SOURCE) int asprintf(char **string_ptr, const char *format, ...); #endif #if !defined(HAVE_STRNDUP) __attribute__((nonnull)) char *strndup(const char *s, size_t n); #endif #endif /* vim: set et sw=4 ts=4: */ logrotate-3.21.0/queue.h0000644000175000017500000004612514113152524012021 00000000000000/* * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)queue.h 8.5 (Berkeley) 8/20/94 */ #ifndef _SYS_QUEUE_H_ #define _SYS_QUEUE_H_ /* * This file defines five types of data structures: singly-linked lists, * lists, simple queues, tail queues, and circular queues. * * A singly-linked list is headed by a single forward pointer. The * elements are singly linked for minimum space and pointer manipulation * overhead at the expense of O(n) removal for arbitrary elements. New * elements can be added to the list after an existing element or at the * head of the list. Elements being removed from the head of the list * should use the explicit macro for this purpose for optimum * efficiency. A singly-linked list may only be traversed in the forward * direction. Singly-linked lists are ideal for applications with large * datasets and few or no removals or for implementing a LIFO queue. * * A list is headed by a single forward pointer (or an array of forward * pointers for a hash table header). The elements are doubly linked * so that an arbitrary element can be removed without a need to * traverse the list. New elements can be added to the list before * or after an existing element or at the head of the list. A list * may only be traversed in the forward direction. * * A simple queue is headed by a pair of pointers, one the head of the * list and the other to the tail of the list. The elements are singly * linked to save space, so elements can only be removed from the * head of the list. New elements can be added to the list after * an existing element, at the head of the list, or at the end of the * list. A simple queue may only be traversed in the forward direction. * * A tail queue is headed by a pair of pointers, one to the head of the * list and the other to the tail of the list. The elements are doubly * linked so that an arbitrary element can be removed without a need to * traverse the list. New elements can be added to the list before or * after an existing element, at the head of the list, or at the end of * the list. A tail queue may be traversed in either direction. * * A circle queue is headed by a pair of pointers, one to the head of the * list and the other to the tail of the list. The elements are doubly * linked so that an arbitrary element can be removed without a need to * traverse the list. New elements can be added to the list before or after * an existing element, at the head of the list, or at the end of the list. * A circle queue may be traversed in either direction, but has a more * complex end of list detection. * * For details on the use of these macros, see the queue(3) manual page. */ /* * List definitions. */ #define LIST_HEAD(name, type) \ struct name { \ struct type *lh_first; /* first element */ \ } #define LIST_HEAD_INITIALIZER(head) \ { NULL } #define LIST_ENTRY(type) \ struct { \ struct type *le_next; /* next element */ \ struct type **le_prev; /* address of previous next element */ \ } /* * List functions. */ #define LIST_INIT(head) do { \ (head)->lh_first = NULL; \ } while (/*CONSTCOND*/0) #define LIST_INSERT_AFTER(listelm, elm, field) do { \ if (((elm)->field.le_next = (listelm)->field.le_next) != NULL) \ (listelm)->field.le_next->field.le_prev = \ &(elm)->field.le_next; \ (listelm)->field.le_next = (elm); \ (elm)->field.le_prev = &(listelm)->field.le_next; \ } while (/*CONSTCOND*/0) #define LIST_INSERT_BEFORE(listelm, elm, field) do { \ (elm)->field.le_prev = (listelm)->field.le_prev; \ (elm)->field.le_next = (listelm); \ *(listelm)->field.le_prev = (elm); \ (listelm)->field.le_prev = &(elm)->field.le_next; \ } while (/*CONSTCOND*/0) #define LIST_INSERT_HEAD(head, elm, field) do { \ if (((elm)->field.le_next = (head)->lh_first) != NULL) \ (head)->lh_first->field.le_prev = &(elm)->field.le_next;\ (head)->lh_first = (elm); \ (elm)->field.le_prev = &(head)->lh_first; \ } while (/*CONSTCOND*/0) #define LIST_REMOVE(elm, field) do { \ if ((elm)->field.le_next != NULL) \ (elm)->field.le_next->field.le_prev = \ (elm)->field.le_prev; \ *(elm)->field.le_prev = (elm)->field.le_next; \ } while (/*CONSTCOND*/0) #define LIST_FOREACH(var, head, field) \ for ((var) = ((head)->lh_first); \ (var); \ (var) = ((var)->field.le_next)) /* * List access methods. */ #define LIST_EMPTY(head) ((head)->lh_first == NULL) #define LIST_FIRST(head) ((head)->lh_first) #define LIST_NEXT(elm, field) ((elm)->field.le_next) /* * Singly-linked List definitions. */ #define SLIST_HEAD(name, type) \ struct name { \ struct type *slh_first; /* first element */ \ } #define SLIST_HEAD_INITIALIZER(head) \ { NULL } #define SLIST_ENTRY(type) \ struct { \ struct type *sle_next; /* next element */ \ } /* * Singly-linked List functions. */ #define SLIST_INIT(head) do { \ (head)->slh_first = NULL; \ } while (/*CONSTCOND*/0) #define SLIST_INSERT_AFTER(slistelm, elm, field) do { \ (elm)->field.sle_next = (slistelm)->field.sle_next; \ (slistelm)->field.sle_next = (elm); \ } while (/*CONSTCOND*/0) #define SLIST_INSERT_HEAD(head, elm, field) do { \ (elm)->field.sle_next = (head)->slh_first; \ (head)->slh_first = (elm); \ } while (/*CONSTCOND*/0) #define SLIST_REMOVE_HEAD(head, field) do { \ (head)->slh_first = (head)->slh_first->field.sle_next; \ } while (/*CONSTCOND*/0) #define SLIST_REMOVE(head, elm, type, field) do { \ if ((head)->slh_first == (elm)) { \ SLIST_REMOVE_HEAD((head), field); \ } \ else { \ struct type *curelm = (head)->slh_first; \ while (curelm->field.sle_next != (elm)) \ curelm = curelm->field.sle_next; \ curelm->field.sle_next = \ curelm->field.sle_next->field.sle_next; \ } \ } while (/*CONSTCOND*/0) #define SLIST_FOREACH(var, head, field) \ for ((var) = (head)->slh_first; (var); (var) = (var)->field.sle_next) /* * Singly-linked List access methods. */ #define SLIST_EMPTY(head) ((head)->slh_first == NULL) #define SLIST_FIRST(head) ((head)->slh_first) #define SLIST_NEXT(elm, field) ((elm)->field.sle_next) /* * Singly-linked Tail queue declarations. */ #define STAILQ_HEAD(name, type) \ struct name { \ struct type *stqh_first; /* first element */ \ struct type **stqh_last; /* addr of last next element */ \ } #define STAILQ_HEAD_INITIALIZER(head) \ { NULL, &(head).stqh_first } #define STAILQ_ENTRY(type) \ struct { \ struct type *stqe_next; /* next element */ \ } /* * Singly-linked Tail queue functions. */ #define STAILQ_INIT(head) do { \ (head)->stqh_first = NULL; \ (head)->stqh_last = &(head)->stqh_first; \ } while (/*CONSTCOND*/0) #define STAILQ_INSERT_HEAD(head, elm, field) do { \ if (((elm)->field.stqe_next = (head)->stqh_first) == NULL) \ (head)->stqh_last = &(elm)->field.stqe_next; \ (head)->stqh_first = (elm); \ } while (/*CONSTCOND*/0) #define STAILQ_INSERT_TAIL(head, elm, field) do { \ (elm)->field.stqe_next = NULL; \ *(head)->stqh_last = (elm); \ (head)->stqh_last = &(elm)->field.stqe_next; \ } while (/*CONSTCOND*/0) #define STAILQ_INSERT_AFTER(head, listelm, elm, field) do { \ if (((elm)->field.stqe_next = (listelm)->field.stqe_next) == NULL)\ (head)->stqh_last = &(elm)->field.stqe_next; \ (listelm)->field.stqe_next = (elm); \ } while (/*CONSTCOND*/0) #define STAILQ_REMOVE_HEAD(head, field) do { \ if (((head)->stqh_first = (head)->stqh_first->field.stqe_next) == NULL) \ (head)->stqh_last = &(head)->stqh_first; \ } while (/*CONSTCOND*/0) #define STAILQ_REMOVE(head, elm, type, field) do { \ if ((head)->stqh_first == (elm)) { \ STAILQ_REMOVE_HEAD((head), field); \ } else { \ struct type *curelm = (head)->stqh_first; \ while (curelm->field.stqe_next != (elm)) \ curelm = curelm->field.stqe_next; \ if ((curelm->field.stqe_next = \ curelm->field.stqe_next->field.stqe_next) == NULL) \ (head)->stqh_last = &(curelm)->field.stqe_next; \ } \ } while (/*CONSTCOND*/0) #define STAILQ_FOREACH(var, head, field) \ for ((var) = ((head)->stqh_first); \ (var); \ (var) = ((var)->field.stqe_next)) #define STAILQ_CONCAT(head1, head2) do { \ if (!STAILQ_EMPTY((head2))) { \ *(head1)->stqh_last = (head2)->stqh_first; \ (head1)->stqh_last = (head2)->stqh_last; \ STAILQ_INIT((head2)); \ } \ } while (/*CONSTCOND*/0) /* * Singly-linked Tail queue access methods. */ #define STAILQ_EMPTY(head) ((head)->stqh_first == NULL) #define STAILQ_FIRST(head) ((head)->stqh_first) #define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next) /* * Simple queue definitions. */ #define SIMPLEQ_HEAD(name, type) \ struct name { \ struct type *sqh_first; /* first element */ \ struct type **sqh_last; /* addr of last next element */ \ } #define SIMPLEQ_HEAD_INITIALIZER(head) \ { NULL, &(head).sqh_first } #define SIMPLEQ_ENTRY(type) \ struct { \ struct type *sqe_next; /* next element */ \ } /* * Simple queue functions. */ #define SIMPLEQ_INIT(head) do { \ (head)->sqh_first = NULL; \ (head)->sqh_last = &(head)->sqh_first; \ } while (/*CONSTCOND*/0) #define SIMPLEQ_INSERT_HEAD(head, elm, field) do { \ if (((elm)->field.sqe_next = (head)->sqh_first) == NULL) \ (head)->sqh_last = &(elm)->field.sqe_next; \ (head)->sqh_first = (elm); \ } while (/*CONSTCOND*/0) #define SIMPLEQ_INSERT_TAIL(head, elm, field) do { \ (elm)->field.sqe_next = NULL; \ *(head)->sqh_last = (elm); \ (head)->sqh_last = &(elm)->field.sqe_next; \ } while (/*CONSTCOND*/0) #define SIMPLEQ_INSERT_AFTER(head, listelm, elm, field) do { \ if (((elm)->field.sqe_next = (listelm)->field.sqe_next) == NULL)\ (head)->sqh_last = &(elm)->field.sqe_next; \ (listelm)->field.sqe_next = (elm); \ } while (/*CONSTCOND*/0) #define SIMPLEQ_REMOVE_HEAD(head, field) do { \ if (((head)->sqh_first = (head)->sqh_first->field.sqe_next) == NULL) \ (head)->sqh_last = &(head)->sqh_first; \ } while (/*CONSTCOND*/0) #define SIMPLEQ_REMOVE(head, elm, type, field) do { \ if ((head)->sqh_first == (elm)) { \ SIMPLEQ_REMOVE_HEAD((head), field); \ } else { \ struct type *curelm = (head)->sqh_first; \ while (curelm->field.sqe_next != (elm)) \ curelm = curelm->field.sqe_next; \ if ((curelm->field.sqe_next = \ curelm->field.sqe_next->field.sqe_next) == NULL) \ (head)->sqh_last = &(curelm)->field.sqe_next; \ } \ } while (/*CONSTCOND*/0) #define SIMPLEQ_FOREACH(var, head, field) \ for ((var) = ((head)->sqh_first); \ (var); \ (var) = ((var)->field.sqe_next)) /* * Simple queue access methods. */ #define SIMPLEQ_EMPTY(head) ((head)->sqh_first == NULL) #define SIMPLEQ_FIRST(head) ((head)->sqh_first) #define SIMPLEQ_NEXT(elm, field) ((elm)->field.sqe_next) /* * Tail queue definitions. */ #define _TAILQ_HEAD(name, type, qual) \ struct name { \ qual type *tqh_first; /* first element */ \ qual type *qual *tqh_last; /* addr of last next element */ \ } #define TAILQ_HEAD(name, type) _TAILQ_HEAD(name, struct type,) #define TAILQ_HEAD_INITIALIZER(head) \ { NULL, &(head).tqh_first } #define _TAILQ_ENTRY(type, qual) \ struct { \ qual type *tqe_next; /* next element */ \ qual type *qual *tqe_prev; /* address of previous next element */\ } #define TAILQ_ENTRY(type) _TAILQ_ENTRY(struct type,) /* * Tail queue functions. */ #define TAILQ_INIT(head) do { \ (head)->tqh_first = NULL; \ (head)->tqh_last = &(head)->tqh_first; \ } while (/*CONSTCOND*/0) #define TAILQ_INSERT_HEAD(head, elm, field) do { \ if (((elm)->field.tqe_next = (head)->tqh_first) != NULL) \ (head)->tqh_first->field.tqe_prev = \ &(elm)->field.tqe_next; \ else \ (head)->tqh_last = &(elm)->field.tqe_next; \ (head)->tqh_first = (elm); \ (elm)->field.tqe_prev = &(head)->tqh_first; \ } while (/*CONSTCOND*/0) #define TAILQ_INSERT_TAIL(head, elm, field) do { \ (elm)->field.tqe_next = NULL; \ (elm)->field.tqe_prev = (head)->tqh_last; \ *(head)->tqh_last = (elm); \ (head)->tqh_last = &(elm)->field.tqe_next; \ } while (/*CONSTCOND*/0) #define TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \ if (((elm)->field.tqe_next = (listelm)->field.tqe_next) != NULL)\ (elm)->field.tqe_next->field.tqe_prev = \ &(elm)->field.tqe_next; \ else \ (head)->tqh_last = &(elm)->field.tqe_next; \ (listelm)->field.tqe_next = (elm); \ (elm)->field.tqe_prev = &(listelm)->field.tqe_next; \ } while (/*CONSTCOND*/0) #define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \ (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \ (elm)->field.tqe_next = (listelm); \ *(listelm)->field.tqe_prev = (elm); \ (listelm)->field.tqe_prev = &(elm)->field.tqe_next; \ } while (/*CONSTCOND*/0) #define TAILQ_REMOVE(head, elm, field) do { \ if (((elm)->field.tqe_next) != NULL) \ (elm)->field.tqe_next->field.tqe_prev = \ (elm)->field.tqe_prev; \ else \ (head)->tqh_last = (elm)->field.tqe_prev; \ *(elm)->field.tqe_prev = (elm)->field.tqe_next; \ } while (/*CONSTCOND*/0) #define TAILQ_FOREACH(var, head, field) \ for ((var) = ((head)->tqh_first); \ (var); \ (var) = ((var)->field.tqe_next)) #define TAILQ_FOREACH_REVERSE(var, head, headname, field) \ for ((var) = (*(((struct headname *)((head)->tqh_last))->tqh_last)); \ (var); \ (var) = (*(((struct headname *)((var)->field.tqe_prev))->tqh_last))) #define TAILQ_CONCAT(head1, head2, field) do { \ if (!TAILQ_EMPTY(head2)) { \ *(head1)->tqh_last = (head2)->tqh_first; \ (head2)->tqh_first->field.tqe_prev = (head1)->tqh_last; \ (head1)->tqh_last = (head2)->tqh_last; \ TAILQ_INIT((head2)); \ } \ } while (/*CONSTCOND*/0) /* * Tail queue access methods. */ #define TAILQ_EMPTY(head) ((head)->tqh_first == NULL) #define TAILQ_FIRST(head) ((head)->tqh_first) #define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next) #define TAILQ_LAST(head, headname) \ (*(((struct headname *)((head)->tqh_last))->tqh_last)) #define TAILQ_PREV(elm, headname, field) \ (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last)) /* * Circular queue definitions. */ #define CIRCLEQ_HEAD(name, type) \ struct name { \ struct type *cqh_first; /* first element */ \ struct type *cqh_last; /* last element */ \ } #define CIRCLEQ_HEAD_INITIALIZER(head) \ { (void *)&head, (void *)&head } #define CIRCLEQ_ENTRY(type) \ struct { \ struct type *cqe_next; /* next element */ \ struct type *cqe_prev; /* previous element */ \ } /* * Circular queue functions. */ #define CIRCLEQ_INIT(head) do { \ (head)->cqh_first = (void *)(head); \ (head)->cqh_last = (void *)(head); \ } while (/*CONSTCOND*/0) #define CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) do { \ (elm)->field.cqe_next = (listelm)->field.cqe_next; \ (elm)->field.cqe_prev = (listelm); \ if ((listelm)->field.cqe_next == (void *)(head)) \ (head)->cqh_last = (elm); \ else \ (listelm)->field.cqe_next->field.cqe_prev = (elm); \ (listelm)->field.cqe_next = (elm); \ } while (/*CONSTCOND*/0) #define CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) do { \ (elm)->field.cqe_next = (listelm); \ (elm)->field.cqe_prev = (listelm)->field.cqe_prev; \ if ((listelm)->field.cqe_prev == (void *)(head)) \ (head)->cqh_first = (elm); \ else \ (listelm)->field.cqe_prev->field.cqe_next = (elm); \ (listelm)->field.cqe_prev = (elm); \ } while (/*CONSTCOND*/0) #define CIRCLEQ_INSERT_HEAD(head, elm, field) do { \ (elm)->field.cqe_next = (head)->cqh_first; \ (elm)->field.cqe_prev = (void *)(head); \ if ((head)->cqh_last == (void *)(head)) \ (head)->cqh_last = (elm); \ else \ (head)->cqh_first->field.cqe_prev = (elm); \ (head)->cqh_first = (elm); \ } while (/*CONSTCOND*/0) #define CIRCLEQ_INSERT_TAIL(head, elm, field) do { \ (elm)->field.cqe_next = (void *)(head); \ (elm)->field.cqe_prev = (head)->cqh_last; \ if ((head)->cqh_first == (void *)(head)) \ (head)->cqh_first = (elm); \ else \ (head)->cqh_last->field.cqe_next = (elm); \ (head)->cqh_last = (elm); \ } while (/*CONSTCOND*/0) #define CIRCLEQ_REMOVE(head, elm, field) do { \ if ((elm)->field.cqe_next == (void *)(head)) \ (head)->cqh_last = (elm)->field.cqe_prev; \ else \ (elm)->field.cqe_next->field.cqe_prev = \ (elm)->field.cqe_prev; \ if ((elm)->field.cqe_prev == (void *)(head)) \ (head)->cqh_first = (elm)->field.cqe_next; \ else \ (elm)->field.cqe_prev->field.cqe_next = \ (elm)->field.cqe_next; \ } while (/*CONSTCOND*/0) #define CIRCLEQ_FOREACH(var, head, field) \ for ((var) = ((head)->cqh_first); \ (var) != (const void *)(head); \ (var) = ((var)->field.cqe_next)) #define CIRCLEQ_FOREACH_REVERSE(var, head, field) \ for ((var) = ((head)->cqh_last); \ (var) != (const void *)(head); \ (var) = ((var)->field.cqe_prev)) /* * Circular queue access methods. */ #define CIRCLEQ_EMPTY(head) ((head)->cqh_first == (void *)(head)) #define CIRCLEQ_FIRST(head) ((head)->cqh_first) #define CIRCLEQ_LAST(head) ((head)->cqh_last) #define CIRCLEQ_NEXT(elm, field) ((elm)->field.cqe_next) #define CIRCLEQ_PREV(elm, field) ((elm)->field.cqe_prev) #define CIRCLEQ_LOOP_NEXT(head, elm, field) \ (((elm)->field.cqe_next == (void *)(head)) \ ? ((head)->cqh_first) \ : (elm->field.cqe_next)) #define CIRCLEQ_LOOP_PREV(head, elm, field) \ (((elm)->field.cqe_prev == (void *)(head)) \ ? ((head)->cqh_last) \ : (elm->field.cqe_prev)) #endif /* sys/queue.h */ logrotate-3.21.0/autogen.sh0000755000175000017500000000063013571674643012536 00000000000000#!/bin/sh autoreconf --force --install --warnings=all ret=$? if [ $ret -ne 0 ]; then echo "autoreconf: failed with return code: $ret" exit $ret fi echo "The logrotate build system is now prepared. To build here, run:" echo " ./configure && make" exit 0 # Local Variables: # mode: sh # tab-width: 8 # sh-basic-offset: 4 # sh-indentation: 4 # indent-tabs-mode: t # End: # ex: shiftwidth=4 tabstop=8 logrotate-3.21.0/build-aux/0000755000175000017500000000000013551062667012503 500000000000000logrotate-3.21.0/build-aux/git-version-gen0000755000175000017500000002035413551062667015372 00000000000000#!/bin/sh # Print a version string. scriptversion=2017-01-09.19; # UTC # Copyright (C) 2007-2017 Free Software Foundation, Inc. # # 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 3 of the License, 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, see . # This script is derived from GIT-VERSION-GEN from GIT: http://git.or.cz/. # It may be run two ways: # - from a git repository in which the "git describe" command below # produces useful output (thus requiring at least one signed tag) # - from a non-git-repo directory containing a .tarball-version file, which # presumes this script is invoked like "./git-version-gen .tarball-version". # In order to use intra-version strings in your project, you will need two # separate generated version string files: # # .tarball-version - present only in a distribution tarball, and not in # a checked-out repository. Created with contents that were learned at # the last time autoconf was run, and used by git-version-gen. Must not # be present in either $(srcdir) or $(builddir) for git-version-gen to # give accurate answers during normal development with a checked out tree, # but must be present in a tarball when there is no version control system. # Therefore, it cannot be used in any dependencies. GNUmakefile has # hooks to force a reconfigure at distribution time to get the value # correct, without penalizing normal development with extra reconfigures. # # .version - present in a checked-out repository and in a distribution # tarball. Usable in dependencies, particularly for files that don't # want to depend on config.h but do want to track version changes. # Delete this file prior to any autoconf run where you want to rebuild # files to pick up a version string change; and leave it stale to # minimize rebuild time after unrelated changes to configure sources. # # As with any generated file in a VC'd directory, you should add # /.version to .gitignore, so that you don't accidentally commit it. # .tarball-version is never generated in a VC'd directory, so needn't # be listed there. # # Use the following line in your configure.ac, so that $(VERSION) will # automatically be up-to-date each time configure is run (and note that # since configure.ac no longer includes a version string, Makefile rules # should not depend on configure.ac for version updates). # # AC_INIT([GNU project], # m4_esyscmd([build-aux/git-version-gen .tarball-version]), # [bug-project@example]) # # Then use the following lines in your Makefile.am, so that .version # will be present for dependencies, and so that .version and # .tarball-version will exist in distribution tarballs. # # EXTRA_DIST = $(top_srcdir)/.version # BUILT_SOURCES = $(top_srcdir)/.version # $(top_srcdir)/.version: # echo $(VERSION) > $@-t && mv $@-t $@ # dist-hook: # echo $(VERSION) > $(distdir)/.tarball-version me=$0 version="git-version-gen $scriptversion Copyright 2011 Free Software Foundation, Inc. There is NO warranty. You may redistribute this software under the terms of the GNU General Public License. For more information about these matters, see the files named COPYING." usage="\ Usage: $me [OPTION]... \$srcdir/.tarball-version [TAG-NORMALIZATION-SED-SCRIPT] Print a version string. Options: --prefix PREFIX prefix of git tags (default 'v') --fallback VERSION fallback version to use if \"git --version\" fails --help display this help and exit --version output version information and exit Running without arguments will suffice in most cases." prefix=v fallback= while test $# -gt 0; do case $1 in --help) echo "$usage"; exit 0;; --version) echo "$version"; exit 0;; --prefix) shift; prefix=${1?};; --fallback) shift; fallback=${1?};; -*) echo "$0: Unknown option '$1'." >&2 echo "$0: Try '--help' for more information." >&2 exit 1;; *) if test "x$tarball_version_file" = x; then tarball_version_file="$1" elif test "x$tag_sed_script" = x; then tag_sed_script="$1" else echo "$0: extra non-option argument '$1'." >&2 exit 1 fi;; esac shift done if test "x$tarball_version_file" = x; then echo "$usage" exit 1 fi tag_sed_script="${tag_sed_script:-s/x/x/}" nl=' ' # Avoid meddling by environment variable of the same name. v= v_from_git= # First see if there is a tarball-only version file. # then try "git describe", then default. if test -f $tarball_version_file then v=`cat $tarball_version_file` || v= case $v in *$nl*) v= ;; # reject multi-line output [0-9]*) ;; *) v= ;; esac test "x$v" = x \ && echo "$0: WARNING: $tarball_version_file is missing or damaged" 1>&2 fi if test "x$v" != x then : # use $v # Otherwise, if there is at least one git commit involving the working # directory, and "git describe" output looks sensible, use that to # derive a version string. elif test "`git log -1 --pretty=format:x . 2>&1`" = x \ && v=`git describe --abbrev=4 --match="$prefix*" HEAD 2>/dev/null \ || git describe --abbrev=4 HEAD 2>/dev/null` \ && v=`printf '%s\n' "$v" | sed "$tag_sed_script"` \ && case $v in $prefix[0-9]*) ;; *) (exit 1) ;; esac then # Is this a new git that lists number of commits since the last # tag or the previous older version that did not? # Newer: v6.10-77-g0f8faeb # Older: v6.10-g0f8faeb case $v in *-*-*) : git describe is okay three part flavor ;; *-*) : git describe is older two part flavor # Recreate the number of commits and rewrite such that the # result is the same as if we were using the newer version # of git describe. vtag=`echo "$v" | sed 's/-.*//'` commit_list=`git rev-list "$vtag"..HEAD 2>/dev/null` \ || { commit_list=failed; echo "$0: WARNING: git rev-list failed" 1>&2; } numcommits=`echo "$commit_list" | wc -l` v=`echo "$v" | sed "s/\(.*\)-\(.*\)/\1-$numcommits-\2/"`; test "$commit_list" = failed && v=UNKNOWN ;; esac # Change the first '-' to a '.', so version-comparing tools work properly. # Remove the "g" in git describe's output string, to save a byte. v=`echo "$v" | sed 's/-/./;s/\(.*\)-g/\1-/'`; v_from_git=1 elif test "x$fallback" = x || git --version >/dev/null 2>&1; then # fallback in case .tarball-version is missing (use directory suffix) v="`basename "$PWD" | sed 's/^[^-]*-//'`" else v=$fallback fi v=`echo "$v" |sed "s/^$prefix//"` # Test whether to append the "-dirty" suffix only if the version # string we're using came from git. I.e., skip the test if it's "UNKNOWN" # or if it came from .tarball-version. if test "x$v_from_git" != x; then # Don't declare a version "dirty" merely because a timestamp has changed. git update-index --refresh > /dev/null 2>&1 dirty=`exec 2>/dev/null;git diff-index --name-only HEAD` || dirty= case "$dirty" in '') ;; *) # Append the suffix only if there isn't one already. case $v in *-dirty) ;; *) v="$v-dirty" ;; esac ;; esac fi # Logrotate travis tests include rpmbuild that fail if version number has # hyphen(s) in it. To go-around convert hyphens to underscores, that does # nothing when building real release version, but needs to take effect when # a development time build is packaged. v=`echo "$v" |sed "s/-/_/g"` # Omit the trailing newline, so that m4_esyscmd can use the result directly. printf %s "$v" # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: logrotate-3.21.0/examples/0000755000175000017500000000000014127324140012412 500000000000000logrotate-3.21.0/examples/btmp0000644000175000017500000000020213551062667013226 00000000000000# no packages own btmp -- we'll rotate it here /var/log/btmp { missingok monthly create 0660 root utmp rotate 1 } logrotate-3.21.0/examples/logrotate.cron0000644000175000017500000000027513551062667015236 00000000000000#!/bin/sh /usr/sbin/logrotate /etc/logrotate.conf EXITVALUE=$? if [ $EXITVALUE != 0 ]; then /usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]" fi exit $EXITVALUE logrotate-3.21.0/examples/logrotate.timer0000644000175000017500000000027713551062667015417 00000000000000[Unit] Description=Daily rotation of log files Documentation=man:logrotate(8) man:logrotate.conf(5) [Timer] OnCalendar=daily AccuracySec=1h Persistent=true [Install] WantedBy=timers.target logrotate-3.21.0/examples/wtmp0000644000175000017500000000022113551062667013254 00000000000000# no packages own wtmp -- we'll rotate it here /var/log/wtmp { missingok monthly create 0664 root utmp minsize 1M rotate 1 } logrotate-3.21.0/examples/logrotate.service0000644000175000017500000000154613717742756015747 00000000000000[Unit] Description=Rotate log files Documentation=man:logrotate(8) man:logrotate.conf(5) RequiresMountsFor=/var/log ConditionACPower=true [Service] Type=oneshot ExecStart=/usr/sbin/logrotate /etc/logrotate.conf # performance options Nice=19 IOSchedulingClass=best-effort IOSchedulingPriority=7 # hardening options # details: https://www.freedesktop.org/software/systemd/man/systemd.exec.html # no ProtectHome for userdir logs # no PrivateNetwork for mail deliviery # no NoNewPrivileges for third party rotate scripts # no RestrictSUIDSGID for creating setgid directories LockPersonality=true MemoryDenyWriteExecute=true PrivateDevices=true PrivateTmp=true ProtectClock=true ProtectControlGroups=true ProtectHostname=true ProtectKernelLogs=true ProtectKernelModules=true ProtectKernelTunables=true ProtectSystem=full RestrictNamespaces=true RestrictRealtime=true logrotate-3.21.0/examples/logrotate.conf0000644000175000017500000000075514036336047015220 00000000000000# see "man logrotate" for details # global options do not affect preceding include directives # rotate log files weekly weekly # keep 4 weeks worth of backlogs rotate 4 # create new (empty) log files after rotating old ones create # use date as a suffix of the rotated file dateext # uncomment this if you want your log files compressed #compress # packages drop log rotation information into this directory include /etc/logrotate.d # system-specific logs may also be configured here. logrotate-3.21.0/.version0000644000175000017500000000000714346133605012206 000000000000003.21.0 logrotate-3.21.0/test/0000755000175000017500000000000014346133605011562 500000000000000logrotate-3.21.0/test/Makefile.am0000644000175000017500000000415014346133207013534 00000000000000TEST_CASES = \ test-0001.sh \ test-0002.sh \ test-0003.sh \ test-0004.sh \ test-0005.sh \ test-0006.sh \ test-0007.sh \ test-0008.sh \ test-0009.sh \ test-0010.sh \ test-0011.sh \ test-0012.sh \ test-0013.sh \ test-0014.sh \ test-0015.sh \ test-0016.sh \ test-0017.sh \ test-0018.sh \ test-0019.sh \ test-0020.sh \ test-0021.sh \ test-0022.sh \ test-0023.sh \ test-0024.sh \ test-0025.sh \ test-0026.sh \ test-0027.sh \ test-0028.sh \ test-0029.sh \ test-0030.sh \ test-0031.sh \ test-0032.sh \ test-0033.sh \ test-0034.sh \ test-0035.sh \ test-0036.sh \ test-0037.sh \ test-0038.sh \ test-0039.sh \ test-0040.sh \ test-0041.sh \ test-0042.sh \ test-0043.sh \ test-0044.sh \ test-0045.sh \ test-0046.sh \ test-0047.sh \ test-0048.sh \ test-0049.sh \ test-0050.sh \ test-0051.sh \ test-0052.sh \ test-0053.sh \ test-0054.sh \ test-0055.sh \ test-0056.sh \ test-0057.sh \ test-0058.sh \ test-0059.sh \ test-0060.sh \ test-0061.sh \ test-0062.sh \ test-0063.sh \ test-0064.sh \ test-0065.sh \ test-0066.sh \ test-0067.sh \ test-0068.sh \ test-0069.sh \ test-0070.sh \ test-0071.sh \ test-0072.sh \ test-0073.sh \ test-0074.sh \ test-0075.sh \ test-0076.sh \ test-0077.sh \ test-0078.sh \ test-0079.sh \ test-0080.sh \ test-0081.sh \ test-0082.sh \ test-0083.sh \ test-0084.sh \ test-0085.sh \ test-0086.sh \ test-0087.sh \ test-0088.sh \ test-0089.sh \ test-0090.sh \ test-0091.sh \ test-0092.sh \ test-0093.sh \ test-0100.sh \ test-0101.sh \ test-0102.sh \ test-0103.sh \ test-0104.sh \ test-0105.sh \ test-0106.sh \ test-0107.sh \ test-0108.sh EXTRA_DIST = \ compress \ compress-error \ mailer \ test-common.sh \ test-common-acl.sh \ test-common-selinux.sh \ $(TEST_CASES) \ $(top_srcdir)/test/test-config.*.in DISTCLEANFILES = \ test.ACL \ test.SELINUX \ test.example distclean-local: rm -rf test-????/ # this needs to run exactly once even if tests run in parallel all: test $(top_srcdir) = $(top_builddir) || ln -fs $(top_srcdir)/test/* . TESTS_ENVIRONMENT = \ export LOGROTATE=$(top_builddir)/logrotate ; TESTS = $(TEST_CASES) logrotate-3.21.0/test/Makefile.in0000644000175000017500000015725214346133574013570 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = test ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* # A command that, given a newline-separated list of test names on the # standard input, print the name of the tests that are to be re-run # upon "make recheck". am__list_recheck_tests = $(AWK) '{ \ recheck = 1; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ { \ if ((getline line2 < ($$0 ".log")) < 0) \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ { \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ { \ break; \ } \ }; \ if (recheck) \ print $$0; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # A command that, given a newline-separated list of test names on the # standard input, create the global log from their .trs and .log files. am__create_global_log = $(AWK) ' \ function fatal(msg) \ { \ print "fatal: making $@: " msg | "cat >&2"; \ exit 1; \ } \ function rst_section(header) \ { \ print header; \ len = length(header); \ for (i = 1; i <= len; i = i + 1) \ printf "="; \ printf "\n\n"; \ } \ { \ copy_in_global_log = 1; \ global_test_result = "RUN"; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".trs"); \ if (line ~ /$(am__global_test_result_rx)/) \ { \ sub("$(am__global_test_result_rx)", "", line); \ sub("[ ]*$$", "", line); \ global_test_result = line; \ } \ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ copy_in_global_log = 0; \ }; \ if (copy_in_global_log) \ { \ rst_section(global_test_result ": " $$0); \ while ((rc = (getline line < ($$0 ".log"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".log"); \ print line; \ }; \ printf "\n"; \ }; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # Restructured Text title. am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } # Solaris 10 'make', and several other traditional 'make' implementations, # pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it # by disabling -e (using the XSI extension "set +e") if it's set. am__sh_e_setup = case $$- in *e*) set +e;; esac # Default flags passed to test drivers. am__common_driver_flags = \ --color-tests "$$am__color_tests" \ --enable-hard-errors "$$am__enable_hard_errors" \ --expect-failure "$$am__expect_failure" # To be inserted before the command running the test. Creates the # directory for the log if needed. Stores in $dir the directory # containing $f, in $tst the test, in $log the log. Executes the # developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and # passes TESTS_ENVIRONMENT. Set up options for the wrapper that # will run the test scripts (or their associated LOG_COMPILER, if # thy have one). am__check_pre = \ $(am__sh_e_setup); \ $(am__vpath_adj_setup) $(am__vpath_adj) \ $(am__tty_colors); \ srcdir=$(srcdir); export srcdir; \ case "$@" in \ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ *) am__odir=.;; \ esac; \ test "x$$am__odir" = x"." || test -d "$$am__odir" \ || $(MKDIR_P) "$$am__odir" || exit $$?; \ if test -f "./$$f"; then dir=./; \ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; \ if test -n '$(DISABLE_HARD_ERRORS)'; then \ am__enable_hard_errors=no; \ else \ am__enable_hard_errors=yes; \ fi; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ am__expect_failure=yes;; \ *) \ am__expect_failure=no;; \ esac; \ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) # A shell command to get the names of the tests scripts with any registered # extension removed (i.e., equivalently, the names of the test logs, with # the '.log' extension removed). The result is saved in the shell variable # '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, # we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", # since that might cause problem with VPATH rewrites for suffix-less tests. # See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' RECHECK_LOGS = $(TEST_LOGS) AM_RECURSIVE_TARGETS = check recheck TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) am__set_b = \ case '$@' in \ */*) \ case '$*' in \ */*) b='$*';; \ *) b=`echo '$@' | sed 's/\.log$$//'`; \ esac;; \ *) \ b='$*';; \ esac am__test_logs1 = $(TESTS:=.log) am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) TEST_LOGS = $(am__test_logs2:.test.log=.log) TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/test-driver DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_CFLAGS = @AM_CFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPRESS_COMMAND = @COMPRESS_COMMAND@ COMPRESS_EXT = @COMPRESS_EXT@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_MAIL_COMMAND = @DEFAULT_MAIL_COMMAND@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ ROOT_UID = @ROOT_UID@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STATE_FILE_PATH = @STATE_FILE_PATH@ STRIP = @STRIP@ UNCOMPRESS_COMMAND = @UNCOMPRESS_COMMAND@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ TEST_CASES = \ test-0001.sh \ test-0002.sh \ test-0003.sh \ test-0004.sh \ test-0005.sh \ test-0006.sh \ test-0007.sh \ test-0008.sh \ test-0009.sh \ test-0010.sh \ test-0011.sh \ test-0012.sh \ test-0013.sh \ test-0014.sh \ test-0015.sh \ test-0016.sh \ test-0017.sh \ test-0018.sh \ test-0019.sh \ test-0020.sh \ test-0021.sh \ test-0022.sh \ test-0023.sh \ test-0024.sh \ test-0025.sh \ test-0026.sh \ test-0027.sh \ test-0028.sh \ test-0029.sh \ test-0030.sh \ test-0031.sh \ test-0032.sh \ test-0033.sh \ test-0034.sh \ test-0035.sh \ test-0036.sh \ test-0037.sh \ test-0038.sh \ test-0039.sh \ test-0040.sh \ test-0041.sh \ test-0042.sh \ test-0043.sh \ test-0044.sh \ test-0045.sh \ test-0046.sh \ test-0047.sh \ test-0048.sh \ test-0049.sh \ test-0050.sh \ test-0051.sh \ test-0052.sh \ test-0053.sh \ test-0054.sh \ test-0055.sh \ test-0056.sh \ test-0057.sh \ test-0058.sh \ test-0059.sh \ test-0060.sh \ test-0061.sh \ test-0062.sh \ test-0063.sh \ test-0064.sh \ test-0065.sh \ test-0066.sh \ test-0067.sh \ test-0068.sh \ test-0069.sh \ test-0070.sh \ test-0071.sh \ test-0072.sh \ test-0073.sh \ test-0074.sh \ test-0075.sh \ test-0076.sh \ test-0077.sh \ test-0078.sh \ test-0079.sh \ test-0080.sh \ test-0081.sh \ test-0082.sh \ test-0083.sh \ test-0084.sh \ test-0085.sh \ test-0086.sh \ test-0087.sh \ test-0088.sh \ test-0089.sh \ test-0090.sh \ test-0091.sh \ test-0092.sh \ test-0093.sh \ test-0100.sh \ test-0101.sh \ test-0102.sh \ test-0103.sh \ test-0104.sh \ test-0105.sh \ test-0106.sh \ test-0107.sh \ test-0108.sh EXTRA_DIST = \ compress \ compress-error \ mailer \ test-common.sh \ test-common-acl.sh \ test-common-selinux.sh \ $(TEST_CASES) \ $(top_srcdir)/test/test-config.*.in DISTCLEANFILES = \ test.ACL \ test.SELINUX \ test.example TESTS_ENVIRONMENT = \ export LOGROTATE=$(top_builddir)/logrotate ; TESTS = $(TEST_CASES) all: all-am .SUFFIXES: .SUFFIXES: .log .test .test$(EXEEXT) .trs $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign test/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): tags TAGS: ctags CTAGS: cscope cscopelist: # Recover from deleted '.trs' file; this should ensure that # "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create # both 'foo.log' and 'foo.trs'. Break the recipe in two subshells # to avoid problems with "make -n". .log.trs: rm -f $< $@ $(MAKE) $(AM_MAKEFLAGS) $< # Leading 'am--fnord' is there to ensure the list of targets does not # expand to empty, as could happen e.g. with make check TESTS=''. am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) am--force-recheck: @: $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__set_TESTS_bases); \ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ redo_bases=`for i in $$bases; do \ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ done`; \ if test -n "$$redo_bases"; then \ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ if $(am__make_dryrun); then :; else \ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ fi; \ if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ elif test -n "$$redo_logs"; then \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ st=0; \ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ for i in $$redo_bases; do \ test -f $$i.trs && test -r $$i.trs \ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ test -f $$i.log && test -r $$i.log \ || { echo "$$errmsg $$i.log" >&2; st=1; }; \ done; \ test $$st -eq 0 || exit 1; \ fi @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ ws='[ ]'; \ results=`for b in $$bases; do echo $$b.trs; done`; \ test -n "$$results" || results=/dev/null; \ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ if test `expr $$fail + $$xpass + $$error` -eq 0; then \ success=true; \ else \ success=false; \ fi; \ br='==================='; br=$$br$$br$$br$$br; \ result_count () \ { \ if test x"$$1" = x"--maybe-color"; then \ maybe_colorize=yes; \ elif test x"$$1" = x"--no-color"; then \ maybe_colorize=no; \ else \ echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ shift; \ desc=$$1 count=$$2; \ if test $$maybe_colorize = yes && test $$count -gt 0; then \ color_start=$$3 color_end=$$std; \ else \ color_start= color_end=; \ fi; \ echo "$${color_start}# $$desc $$count$${color_end}"; \ }; \ create_testsuite_report () \ { \ result_count $$1 "TOTAL:" $$all "$$brg"; \ result_count $$1 "PASS: " $$pass "$$grn"; \ result_count $$1 "SKIP: " $$skip "$$blu"; \ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ result_count $$1 "FAIL: " $$fail "$$red"; \ result_count $$1 "XPASS:" $$xpass "$$red"; \ result_count $$1 "ERROR:" $$error "$$mgn"; \ }; \ { \ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ $(am__rst_title); \ create_testsuite_report --no-color; \ echo; \ echo ".. contents:: :depth: 2"; \ echo; \ for b in $$bases; do echo $$b; done \ | $(am__create_global_log); \ } >$(TEST_SUITE_LOG).tmp || exit 1; \ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ if $$success; then \ col="$$grn"; \ else \ col="$$red"; \ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ if $$success; then :; else \ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ if test -n "$(PACKAGE_BUGREPORT)"; then \ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ fi; \ echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 check-TESTS: @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ log_list=`for i in $$bases; do echo $$i.log; done`; \ trs_list=`for i in $$bases; do echo $$i.trs; done`; \ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; recheck: all @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ | $(am__list_recheck_tests)` || exit 1; \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? test-0001.sh.log: test-0001.sh @p='test-0001.sh'; \ b='test-0001.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0002.sh.log: test-0002.sh @p='test-0002.sh'; \ b='test-0002.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0003.sh.log: test-0003.sh @p='test-0003.sh'; \ b='test-0003.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0004.sh.log: test-0004.sh @p='test-0004.sh'; \ b='test-0004.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0005.sh.log: test-0005.sh @p='test-0005.sh'; \ b='test-0005.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0006.sh.log: test-0006.sh @p='test-0006.sh'; \ b='test-0006.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0007.sh.log: test-0007.sh @p='test-0007.sh'; \ b='test-0007.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0008.sh.log: test-0008.sh @p='test-0008.sh'; \ b='test-0008.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0009.sh.log: test-0009.sh @p='test-0009.sh'; \ b='test-0009.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0010.sh.log: test-0010.sh @p='test-0010.sh'; \ b='test-0010.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0011.sh.log: test-0011.sh @p='test-0011.sh'; \ b='test-0011.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0012.sh.log: test-0012.sh @p='test-0012.sh'; \ b='test-0012.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0013.sh.log: test-0013.sh @p='test-0013.sh'; \ b='test-0013.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0014.sh.log: test-0014.sh @p='test-0014.sh'; \ b='test-0014.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0015.sh.log: test-0015.sh @p='test-0015.sh'; \ b='test-0015.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0016.sh.log: test-0016.sh @p='test-0016.sh'; \ b='test-0016.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0017.sh.log: test-0017.sh @p='test-0017.sh'; \ b='test-0017.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0018.sh.log: test-0018.sh @p='test-0018.sh'; \ b='test-0018.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0019.sh.log: test-0019.sh @p='test-0019.sh'; \ b='test-0019.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0020.sh.log: test-0020.sh @p='test-0020.sh'; \ b='test-0020.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0021.sh.log: test-0021.sh @p='test-0021.sh'; \ b='test-0021.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0022.sh.log: test-0022.sh @p='test-0022.sh'; \ b='test-0022.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0023.sh.log: test-0023.sh @p='test-0023.sh'; \ b='test-0023.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0024.sh.log: test-0024.sh @p='test-0024.sh'; \ b='test-0024.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0025.sh.log: test-0025.sh @p='test-0025.sh'; \ b='test-0025.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0026.sh.log: test-0026.sh @p='test-0026.sh'; \ b='test-0026.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0027.sh.log: test-0027.sh @p='test-0027.sh'; \ b='test-0027.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0028.sh.log: test-0028.sh @p='test-0028.sh'; \ b='test-0028.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0029.sh.log: test-0029.sh @p='test-0029.sh'; \ b='test-0029.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0030.sh.log: test-0030.sh @p='test-0030.sh'; \ b='test-0030.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0031.sh.log: test-0031.sh @p='test-0031.sh'; \ b='test-0031.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0032.sh.log: test-0032.sh @p='test-0032.sh'; \ b='test-0032.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0033.sh.log: test-0033.sh @p='test-0033.sh'; \ b='test-0033.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0034.sh.log: test-0034.sh @p='test-0034.sh'; \ b='test-0034.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0035.sh.log: test-0035.sh @p='test-0035.sh'; \ b='test-0035.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0036.sh.log: test-0036.sh @p='test-0036.sh'; \ b='test-0036.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0037.sh.log: test-0037.sh @p='test-0037.sh'; \ b='test-0037.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0038.sh.log: test-0038.sh @p='test-0038.sh'; \ b='test-0038.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0039.sh.log: test-0039.sh @p='test-0039.sh'; \ b='test-0039.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0040.sh.log: test-0040.sh @p='test-0040.sh'; \ b='test-0040.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0041.sh.log: test-0041.sh @p='test-0041.sh'; \ b='test-0041.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0042.sh.log: test-0042.sh @p='test-0042.sh'; \ b='test-0042.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0043.sh.log: test-0043.sh @p='test-0043.sh'; \ b='test-0043.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0044.sh.log: test-0044.sh @p='test-0044.sh'; \ b='test-0044.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0045.sh.log: test-0045.sh @p='test-0045.sh'; \ b='test-0045.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0046.sh.log: test-0046.sh @p='test-0046.sh'; \ b='test-0046.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0047.sh.log: test-0047.sh @p='test-0047.sh'; \ b='test-0047.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0048.sh.log: test-0048.sh @p='test-0048.sh'; \ b='test-0048.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0049.sh.log: test-0049.sh @p='test-0049.sh'; \ b='test-0049.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0050.sh.log: test-0050.sh @p='test-0050.sh'; \ b='test-0050.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0051.sh.log: test-0051.sh @p='test-0051.sh'; \ b='test-0051.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0052.sh.log: test-0052.sh @p='test-0052.sh'; \ b='test-0052.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0053.sh.log: test-0053.sh @p='test-0053.sh'; \ b='test-0053.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0054.sh.log: test-0054.sh @p='test-0054.sh'; \ b='test-0054.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0055.sh.log: test-0055.sh @p='test-0055.sh'; \ b='test-0055.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0056.sh.log: test-0056.sh @p='test-0056.sh'; \ b='test-0056.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0057.sh.log: test-0057.sh @p='test-0057.sh'; \ b='test-0057.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0058.sh.log: test-0058.sh @p='test-0058.sh'; \ b='test-0058.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0059.sh.log: test-0059.sh @p='test-0059.sh'; \ b='test-0059.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0060.sh.log: test-0060.sh @p='test-0060.sh'; \ b='test-0060.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0061.sh.log: test-0061.sh @p='test-0061.sh'; \ b='test-0061.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0062.sh.log: test-0062.sh @p='test-0062.sh'; \ b='test-0062.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0063.sh.log: test-0063.sh @p='test-0063.sh'; \ b='test-0063.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0064.sh.log: test-0064.sh @p='test-0064.sh'; \ b='test-0064.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0065.sh.log: test-0065.sh @p='test-0065.sh'; \ b='test-0065.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0066.sh.log: test-0066.sh @p='test-0066.sh'; \ b='test-0066.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0067.sh.log: test-0067.sh @p='test-0067.sh'; \ b='test-0067.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0068.sh.log: test-0068.sh @p='test-0068.sh'; \ b='test-0068.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0069.sh.log: test-0069.sh @p='test-0069.sh'; \ b='test-0069.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0070.sh.log: test-0070.sh @p='test-0070.sh'; \ b='test-0070.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0071.sh.log: test-0071.sh @p='test-0071.sh'; \ b='test-0071.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0072.sh.log: test-0072.sh @p='test-0072.sh'; \ b='test-0072.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0073.sh.log: test-0073.sh @p='test-0073.sh'; \ b='test-0073.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0074.sh.log: test-0074.sh @p='test-0074.sh'; \ b='test-0074.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0075.sh.log: test-0075.sh @p='test-0075.sh'; \ b='test-0075.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0076.sh.log: test-0076.sh @p='test-0076.sh'; \ b='test-0076.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0077.sh.log: test-0077.sh @p='test-0077.sh'; \ b='test-0077.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0078.sh.log: test-0078.sh @p='test-0078.sh'; \ b='test-0078.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0079.sh.log: test-0079.sh @p='test-0079.sh'; \ b='test-0079.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0080.sh.log: test-0080.sh @p='test-0080.sh'; \ b='test-0080.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0081.sh.log: test-0081.sh @p='test-0081.sh'; \ b='test-0081.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0082.sh.log: test-0082.sh @p='test-0082.sh'; \ b='test-0082.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0083.sh.log: test-0083.sh @p='test-0083.sh'; \ b='test-0083.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0084.sh.log: test-0084.sh @p='test-0084.sh'; \ b='test-0084.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0085.sh.log: test-0085.sh @p='test-0085.sh'; \ b='test-0085.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0086.sh.log: test-0086.sh @p='test-0086.sh'; \ b='test-0086.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0087.sh.log: test-0087.sh @p='test-0087.sh'; \ b='test-0087.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0088.sh.log: test-0088.sh @p='test-0088.sh'; \ b='test-0088.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0089.sh.log: test-0089.sh @p='test-0089.sh'; \ b='test-0089.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0090.sh.log: test-0090.sh @p='test-0090.sh'; \ b='test-0090.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0091.sh.log: test-0091.sh @p='test-0091.sh'; \ b='test-0091.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0092.sh.log: test-0092.sh @p='test-0092.sh'; \ b='test-0092.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0093.sh.log: test-0093.sh @p='test-0093.sh'; \ b='test-0093.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0100.sh.log: test-0100.sh @p='test-0100.sh'; \ b='test-0100.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0101.sh.log: test-0101.sh @p='test-0101.sh'; \ b='test-0101.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0102.sh.log: test-0102.sh @p='test-0102.sh'; \ b='test-0102.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0103.sh.log: test-0103.sh @p='test-0103.sh'; \ b='test-0103.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0104.sh.log: test-0104.sh @p='test-0104.sh'; \ b='test-0104.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0105.sh.log: test-0105.sh @p='test-0105.sh'; \ b='test-0105.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0106.sh.log: test-0106.sh @p='test-0106.sh'; \ b='test-0106.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0107.sh.log: test-0107.sh @p='test-0107.sh'; \ b='test-0107.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-0108.sh.log: test-0108.sh @p='test-0108.sh'; \ b='test-0108.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) .test.log: @p='$<'; \ $(am__set_b); \ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) @am__EXEEXT_TRUE@.test$(EXEEXT).log: @am__EXEEXT_TRUE@ @p='$<'; \ @am__EXEEXT_TRUE@ $(am__set_b); \ @am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-local dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: check-am install-am install-strip .PHONY: all all-am check check-TESTS check-am clean clean-generic \ cscopelist-am ctags-am distclean distclean-generic \ distclean-local distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic pdf pdf-am ps ps-am recheck tags-am \ uninstall uninstall-am .PRECIOUS: Makefile distclean-local: rm -rf test-????/ # this needs to run exactly once even if tests run in parallel all: test $(top_srcdir) = $(top_builddir) || ln -fs $(top_srcdir)/test/* . # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: logrotate-3.21.0/test/compress0000755000175000017500000000010413775061434013263 00000000000000#!/bin/sh echo "gzip $*" > compress-args env > compress-env gzip $*logrotate-3.21.0/test/compress-error0000755000175000017500000000006013775061434014413 00000000000000#!/bin/sh echo "compression error" 1>&2 gzip $*logrotate-3.21.0/test/mailer0000755000175000017500000000006013775061434012702 00000000000000#!/bin/sh echo "$*" > mail-out cat >> mail-out logrotate-3.21.0/test/test-common.sh0000644000175000017500000001010414346133207014275 00000000000000# shellcheck shell=sh disable=SC2034 # common variables and functions for legacy tests if readlink -f $LOGROTATE > /dev/null 2>&1; then LOGROTATE="$(readlink -f $LOGROTATE)" elif greadlink -f $LOGROTATE > /dev/null 2>&1; then LOGROTATE="$(greadlink -f $LOGROTATE)" else echo "no readlink with canonicalize option found:" readlink -f $LOGROTATE greadlink -f $LOGROTATE exit 1 fi RLR="$LOGROTATE -v -m ./mailer -s state" if du --apparent-size $LOGROTATE > /dev/null 2>&1; then DU_APPARENT_SIZE='du --apparent-size' elif du -A $LOGROTATE > /dev/null 2>&1; then DU_APPARENT_SIZE='du -A' else echo "no du option for apparent size found, using default mode:" du --apparent-size $LOGROTATE du -A $LOGROTATE DU_APPARENT_SIZE='du' fi if command -v md5sum > /dev/null 2>&1; then MD5SUM=md5sum elif command -v md5 > /dev/null 2>&1; then MD5SUM=md5 else echo "no md5sum/md5 command found" exit 1 fi if stat -c %f $LOGROTATE > /dev/null 2>&1; then STAT_MODE_FORMAT='stat -c %f' STAT_ATIME_FORMAT='stat -c %X' STAT_MTIME_FORMAT='stat -c %Y' elif stat -f %Xp $LOGROTATE > /dev/null 2>&1; then STAT_MODE_FORMAT='stat -f %Xp' STAT_ATIME_FORMAT='stat -f %a' STAT_MTIME_FORMAT='stat -f %m' else echo "no stat format option found:" stat -c %f $LOGROTATE stat -f %Xp $LOGROTATE exit 1 fi TESTDIR="$(basename "$0" .sh)" mkdir -p "$TESTDIR" cd "$TESTDIR" || exit $? TESTNUM="$(printf "%s\n" "$TESTDIR" | sed -e 's/^test-0*//')" import() { [ -e "$1" ] && return [ -e "../$1" ] || return ln -s "../$1" } import "compress" import "compress-error" import "mailer" import "test-common-acl.sh" import "test-common-selinux.sh" import "test-config.$TESTNUM.in" cleanup() { rm -f test*.log* anothertest*.log* state test-config. scriptout mail-out compress-args compress-env different*.log* test-config.*[0-9] [ -n "$1" ] && echo "Running test $1" return 0 } genconfig() { input=test-config.$1.in output=test-config.$1 user=$(id -u -n) group=$(id -g -n) rootgroup=$(id -g -n root) sed "s,&DIR&,$PWD,g" < $input | sed "s,&USER&,$user,g" | sed "s,&GROUP&,$group,g" | sed "s,&ROOTGROUP&,$rootgroup,g" > $output chmod go-w $output config_crc=$(${MD5SUM} $output) } createlog() { num=$1 file=$2 cl_compressed=$3 case $num in 0) what=zero ;; 1) what=first ;; 2) what=second ;; 3) what=third ;; 4) what=fourth ;; 5) what=fifth ;; 6) what=sixth ;; 7) what=seventh ;; 8) what=eight ;; 9) what=ninth ;; *) exit 1 ;; esac echo $what > $file [ -n "$cl_compressed" ] && gzip -9 $file } createlogs() { base=$1 numlogs=$2 cls_compressed=$3 rm -f ${base}* createlog 0 $base num=1 while [ $num -le $numlogs ]; do createlog $num ${base}.$num $cls_compressed num=`expr $num + 1` done } checkmail() { printf "%s\n%s\n" "-s $PWD/$1 user@invalid." "$2" | diff -u - mail-out if [ $? != 0 ]; then exit 5 fi } checkoutput() { while read line; do set $line file=$1 co_compressed=$2 if [ "$#" -le 2 ]; then shift $# else shift 2 fi fileother=`echo $line | awk '{print $1}'` expected=`echo $line | cut -s -d\ -f3-` if [ $file != $fileother ]; then echo "unexpected file $file'" >&2 exit 2 fi if [ ! -f $file ]; then echo "file $file does not exist" fi if [ -n "$co_compressed" ] && [ "$co_compressed" != 0 ]; then contents=`gunzip -c $file` else contents=`cat $file | tr -d '\000'` fi if [ "$contents" != "$expected" ]; then echo "file $file does not contain expected results (compressed $co_compressed, args $*)" >&2 echo contains: \'$contents\' echo expected: \'$expected\' exit 2 fi echo "$config_crc" | ${MD5SUM} -c - >/dev/null if [ $? != 0 ]; then echo "config file $output has been altered: MD5 sum mismatch" exit 3 fi done } preptest() { base=$1 confignum=$2 numlogs=$3 pt_compressed=$4 rm -f $base* rm -f state genconfig $confignum createlogs $base $numlogs $pt_compressed } logrotate-3.21.0/test/test-common-acl.sh0000644000175000017500000000135314306637324015045 00000000000000# shellcheck shell=sh # We test if the ACLs tests should be done or not if [ -z "$ACL_TESTS" ]; then # not yet checked ACL_TESTS=1 echo 1 > test.x setfacl -m u:nobody:rwx test.x 2>/dev/null if [ $? != 0 ]; then ACL_TESTS=0 echo "setfacl failed on this system. ACL tests will not be executed." fi rm -f test.x if [ $ACL_TESTS = 1 ]; then # It seems we can run the ACL tests, but was logrotate compiled WITH_ACL=yes ? # See the Makefile, "pretest" part, for more information import "test.ACL" if [ -f ./test.ACL ]; then ACL_TESTS=`cat ./test.ACL` if [ $ACL_TESTS = 0 ]; then echo "logrotate was NOT compiled with 'WITH_ACL=yes'. ACL tests will not be executed." fi fi fi fi logrotate-3.21.0/test/test-common-selinux.sh0000644000175000017500000000214214306637324015772 00000000000000# shellcheck shell=sh # We test if the SELinux tests should be done or not if [ -z "$SELINUX_TESTS" ]; then # not yet checked SELINUX_TESTS=0 if type "selinuxenabled" >/dev/null 2>&1 && selinuxenabled; then SELINUX_TESTS=1 else echo "SELinux disabled. SELinux tests will not be executed." fi if [ $SELINUX_TESTS = 1 ]; then # It seems we can run the ACL tests, but was logrotate compiled WITH_ACL=yes ? # See the Makefile, "pretest" part, for more information import "test.SELINUX" if [ -f ./test.SELINUX ]; then SELINUX_TESTS=`cat ./test.SELINUX` if [ $SELINUX_TESTS = 0 ]; then echo "logrotate was NOT compiled with 'WITH_SELINUX=yes'. SELINUX tests will not be executed." fi fi fi if [ $SELINUX_TESTS = 1 ]; then # if logrotate_tmp_t, we can't continue with SELinux tests... touch .selinuxtest chcon --type=logrotate_tmp_t .selinuxtest 2>/dev/null if [ $? != 0 ]; then SELINUX_TESTS=0 echo "SELinux context 'logrotate_tmp_t' does not exist. SELinux tests will not be executed." fi rm -f .selinuxtest fi fi logrotate-3.21.0/test/test-0001.sh0000755000175000017500000000132714060660524013377 00000000000000#!/bin/sh . ./test-common.sh # we don't want any stuff left from previous runs cleanup 1 # ------------------------------- Test 1 ------------------------------------- # Without a log file, no rotations should occur preptest test.log 1 2 $RLR test-config.1 || exit 23 checkoutput < state </dev/null if [ $? != 0 ]; then echo "test.log.0 should have selinux context logrotate_tmp_t." exit 3 fi ls -Z anothertest.log.0|grep logrotate_tmp_t >/dev/null if [ $? = 0 ]; then echo "anothertest.log.0 should not have selinux context logrotate_tmp_t." exit 3 fi fi checkoutput < test.log $RLR test-config.10 --force || exit 23 if [ $SELINUX_TESTS = 1 ]; then ls -Z test.log.2.gz|grep logrotate_tmp_t >/dev/null if [ $? != 0 ]; then echo "test.log.2.gz should have selinux context logrotate_tmp_t." ls -Z test.log.2.gz exit 3 fi ls -Z test.log.1|grep logrotate_tmp_t >/dev/null if [ $? != 0 ]; then echo "test.log.1 should have selinux context logrotate_tmp_t." ls -Z test.log.1 exit 3 fi fi checkoutput </dev/null >/dev/null if [ $? != 0 ]; then echo "testdir should have mode 2700, but it has:" ls -l|grep testdir exit 3 fi checkoutput <> test.log $RLR test-config.13 --force || exit 23 ls -l|grep testdir|grep "drwxrwxrwx." 2>/dev/null >/dev/null if [ $? != 0 ]; then echo "testdir should have mode 2777, but it has:" ls -l|grep testdir exit 3 fi checkoutput < test.log $RLR test-config.16 || exit 23 if [ -f test.log.1 ]; then echo "file $file does exist!" exit 2 fi # log with 4 bytes should be rotated echo "zero" > test.log $RLR test-config.16 || exit 23 checkoutput <error.log && exit 23 grep "unexpected } (missing previous '{')" error.log >/dev/null if [ $? != 0 ]; then echo "No error printed, but there should be one." exit 3 fi rm error.log grep "reading config file test-config.17" logrotate.log >/dev/null if [ $? != 0 ]; then echo "There is no log output in logrotate.log" exit 3 fi rm -f logrotate.log checkoutput </dev/null if [ $? = 0 ]; then journalctl -n 50 2>/dev/null | grep syslog_test 2>/dev/null >/dev/null if [ $? = 0 ]; then SYSLOG_TESTS=1 fi fi if [ $SYSLOG_TESTS = 1 ]; then journalctl -n 100 2>/dev/null|grep "$PWD/test.log.1" 2>/dev/null >/dev/null if [ $? != 0 ]; then echo "syslog message not found" exit 1 fi fi logrotate-3.21.0/test/test-0019.sh0000755000175000017500000000054314060660524013407 00000000000000#!/bin/sh . ./test-common.sh cleanup 19 # ------------------------------- Test 19 ------------------------------------ preptest test.log 19 1 $RLR test-config.19 --force 2>error.log && exit 23 grep "error running non-shared postrotate script for" error.log >/dev/null if [ $? != 0 ]; then echo "No error printed, but there should be one." exit 3 fi logrotate-3.21.0/test/test-0020.sh0000755000175000017500000000053714060660524013402 00000000000000#!/bin/sh . ./test-common.sh cleanup 20 # ------------------------------- Test 20 ------------------------------------ preptest test.log 20 1 $RLR test-config.20 --force 2>error.log && exit 23 grep "error running shared postrotate script for" error.log >/dev/null if [ $? != 0 ]; then echo "No error printed, but there should be one." exit 3 fi logrotate-3.21.0/test/test-0021.sh0000755000175000017500000000103214060660524013372 00000000000000#!/bin/sh . ./test-common.sh cleanup 21 # ------------------------------- Test 21 ------------------------------------ # different base name, so it should not find the file preptest differenttest.log 21 1 checkoutput <error.log || exit 23 checkoutput <error.log && exit 23 grep "error: stat of" error.log >/dev/null if [ $? != 0 ]; then echo "No error printed, but there should be one." exit 3 fi logrotate-3.21.0/test/test-0023.sh0000755000175000017500000000062614060660524013404 00000000000000#!/bin/sh . ./test-common.sh cleanup 23 # ------------------------------- Test 23 ------------------------------------ # symlinks - symlinks rotation is not allowed for security reasons. preptest test.log.original 23 1 ln -s test.log.original test.log $RLR test-config.23 --force 2>error.log || exit 23 checkoutput </dev/null || true logrotate-3.21.0/test/test-0024.sh0000755000175000017500000000100014060660524013370 00000000000000#!/bin/sh . ./test-common.sh cleanup 24 # ------------------------------- Test 24 ------------------------------------ # symlinks 2 - now copytruncate is used, but symlinks rotation is not allowed for # security reasons. # since logrotate-3.8.2, we don't support symlinks rotation officially. preptest test.log.original 24 1 ln -s test.log.original test.log $RLR test-config.24 --force 2>error.log || exit 23 checkoutput </dev/null || true logrotate-3.21.0/test/test-0025.sh0000755000175000017500000000105214060660524013400 00000000000000#!/bin/sh . ./test-common.sh cleanup 25 # ------------------------------- Test 25 ------------------------------------ # If there is no '{' character after log files definition, error should be printed # and config file should be skipped preptest test.log 25 1 0 # log with 1 byte should not be rotated $RLR test-config.25 2>error.log && exit 23 grep "missing '{' after log files definition" error.log >/dev/null if [ $? != 0 ]; then echo "No error printed, but there should be one." exit 3 fi rm error.log checkoutput <error.log || exit 23 grep "unknown option" error.log >/dev/null if [ $? != 0 ]; then echo "No error printed, but there should be one." exit 3 fi rm error.log checkoutput < test.log-$DATESTRING $RLR test-config.30 --force && exit 23 checkoutput </dev/null if [ $? != 0 ]; then echo "Bad mode of test.log, should be 0600, is:" $STAT_MODE_FORMAT test.log exit 3 fi checkoutput </dev/null if [ $? != 0 ]; then echo "test.log must have user:nobody:rwx ACL" getfacl test.log exit 3 fi getfacl test.log|grep "group::---" >/dev/null if [ $? != 0 ]; then echo "test.log must have group::--- ACL" getfacl test.log exit 3 fi getfacl test.log.1|grep "user:nobody:rwx" >/dev/null if [ $? != 0 ]; then echo "test.log.1 must have user:nobody:rwx ACL" getfacl test.log.1 exit 3 fi getfacl test.log.1|grep "group::---" >/dev/null if [ $? != 0 ]; then echo "test.log.1 must have group::--- ACL" getfacl test.log.1 exit 3 fi checkoutput </dev/null if [ $? = 0 ]; then echo "test.log must not contain user:nobody:rwx" exit 3 fi getfacl test.log.1|grep "user:nobody:rwx" >/dev/null if [ $? != 0 ]; then echo "test.log.1 must contain user:nobody:rwx" exit 3 fi checkoutput <&1) RET=$? if [ $RET != 0 ]; then echo "logrotate exited with value $RET" exit 23 fi echo "${OUTPUT}" | grep "uid = 0 gid = 0" > /dev/null if [ $? != 0 ]; then echo "${OUTPUT}" echo "logrotate output must contain 'uid = 0 gid = 0'" exit 3 fi checkoutput </dev/null if [ $? != 0 ]; then echo "test.log must contain user:nobody:rwx" getfacl test.log exit 3 fi getfacl test.log.1|grep "user:nobody:rwx" >/dev/null if [ $? != 0 ]; then echo "test.log.1 must contain user:nobody:rwx" getfacl test.log.1 exit 3 fi checkoutput <error.log && exit 23 grep "unknown unit" error.log >/dev/null if [ $? != 0 ]; then echo "No error 'unknown unit' printed, but there should be one." exit 3 fi checkoutput <error.log && exit 23 grep "skipping" error.log >/dev/null if [ $? != 0 ]; then echo "No error 'skipping' printed, but there should be one." exit 3 fi checkoutput </dev/null if [ $? != 0 ]; then grep "test.log.1test2.log.1" scriptout >/dev/null if [ $? != 0 ]; then echo "ERROR: scriptout should contain 'test2.log.1test.log.1' or 'test.log.1test2.log.1'" exit 3 fi fi rm -f scriptout checkoutput <error.log && exit 23 grep "error running preremove script" error.log >/dev/null if [ $? != 0 ]; then echo "No error 'error running preremove script' printed, but there should be one." exit 3 fi # Check both possible orders grep "test2.log.1" scriptout >/dev/null if [ $? != 0 ]; then grep "test.log.1" scriptout >/dev/null if [ $? != 0 ]; then echo "ERROR: scriptout should contain 'test2.log.1' or 'test.log.1'" exit 3 fi fi rm -f scriptout checkoutput < ./testingdir/config.v echo 2 > ./testingdir/config.x echo 3 > ./testingdir/.config.z $RLR test-config.40 --force || exit 23 rm -rf testingdir logrotate-3.21.0/test/test-0041.sh0000755000175000017500000000061414060660524013401 00000000000000#!/bin/sh . ./test-common.sh cleanup 41 # ------------------------------- Test 41 ------------------------------------ # Test that prerotate and postrotate scripts are called only when the log files # are actually rotated preptest test.log 41 1 echo x > test2.log $RLR test-config.41 || exit 23 checkoutput < test2.log $RLR test-config.42 || exit 23 checkoutput < test2.log $RLR test-config.43 || exit 23 # Check both possible orders grep "test2.log;test2.log;test.log;test.log;" scriptout >/dev/null if [ $? != 0 ]; then grep "test.log;test.log;test2.log;test2.log;" scriptout >/dev/null if [ $? != 0 ]; then echo "ERROR: scriptout should contain 'test2.log;test2.log;test.log;test.log;' or 'test.log;test.log;test2.log;test2.log;'" exit 3 fi fi rm -f scriptout checkoutput <error.log && exit 23 grep "error: stat of" error.log >/dev/null if [ $? != 0 ]; then echo "No error printed, but there should be one." exit 3 fi rm -f error.log checkoutput <error.log && exit 23 grep "error: stat of" error.log >/dev/null if [ $? != 0 ]; then echo "No error printed, but there should be one." exit 3 fi rm -f error.log checkoutput < state << EOF logrotate state -- version 1 "$PWD/test.log" 2000-1-1 "$PWD/test2.l EOF DATESTRING=$(/bin/date +%Y%m%d) $RLR test-config.46 2>error.log && exit 23 grep "error: bad line 3 in state file state" error.log >/dev/null if [ $? != 0 ]; then echo "No error printed, but there should be one." exit 3 fi rm -f error.log checkoutput < state << EOF logrotate state -- version 2 EOF chcon --type=logrotate_tmp_t state $RLR test-config.47 || exit 23 ls -Z state|grep logrotate_tmp_t >/dev/null if [ $? != 0 ]; then echo "state file should have selinux context logrotate_tmp_t." exit 3 fi checkoutput < state << EOF logrotate state -- version 2 EOF chmod 0640 state setfacl -m u:nobody:rwx state $RLR test-config.48 || exit 23 getfacl state|grep "user:nobody:rwx" >/dev/null if [ $? != 0 ]; then echo "state file must have acls user:nobody:rwx" exit 3 fi checkoutput < state << EOF logrotate state -- version 2 "test.log" 2012-8-19 EOF $RLR test-config.49 || exit 23 checkoutput </dev/null) HOURAGO=$(/bin/date "+%Y-%-m-%-d-%-H" --date "1 hour ago" 2>/dev/null) GNUDATE=$? # --force to trigger rotation $RLR test-config.50 --force || exit 23 checkoutput < test.log rm -f test.log-$DATESTRING $RLR test-config.50 || exit 23 checkoutput < state << EOF logrotate state -- version 2 "/var/log/httpd/backend_error_log" 2013-6-16 "/var/log/tokyotyrant/*.log" 2011-5-30 "/var/log/mailman/digest" 2011-5-30 "/var/log/piranha/piranha-gui-access" 2011-5-30 "/var/log/boincerr.log" 2011-5-30 "/var/log/btmp" 2013-7-9 "/var/log/httpd/a_log" 2011-11-15 "/var/log/cups/*_log" 2012-7-19 "/var/log/rabbitmq/*.log" 2011-5-30 "/var/log/func/func.log" 2011-11-17 "/var/log/wtmp" 2013-7-9 "/var/log/glusterfs/*glusterd.vol.log" 2011-11-17 "/var/log/imapd.log" 2011-5-30 "/var/log/cobbler/cobbler.log" 2011-11-6 "/var/log/httpd/ssl_access_log" 2013-3-27 "/var/log/mrepo.log" 2011-5-30 EOF $RLR test-config.51 || exit 23 logrotate-3.21.0/test/test-0052.sh0000755000175000017500000000047014060660524013403 00000000000000#!/bin/sh . ./test-common.sh cleanup 52 # ------------------------------- Test 52 ------------------------------------ # sharedscripts are not run if the first log file does not exist preptest test.log 52 1 0 $RLR test-config.52 || exit 23 checkoutput < /dev/null 2>&1; then DATE=$(date -v-${i}d "+%Y-%m-%d") else DATE=$(date "+%Y-%m-%d" --date "$i day ago") fi echo "x" > test.log-$DATE done $RLR test-config.54 --force || exit 23 if [ -e test.log-$DATE ]; then echo "File test.log-$DATE should not exist (it should be deleted)" exit 3 fi rm -f *test.log* logrotate-3.21.0/test/test-0055.sh0000755000175000017500000000114014060660524013401 00000000000000#!/bin/sh . ./test-common.sh cleanup 55 # ------------------------------- Test 55 ------------------------------------ # removing last log file when using %s and hourly rm -f *test.log* preptest test.log 55 1 0 DATE="" for i in $(seq 1 60) do if date -v -1d > /dev/null 2>&1; then DATE=$(date -v-${i}H "+%s") else DATE=$(date "+%s" --date "$i hour ago") fi echo "x" > test.log-$DATE.gz done $RLR test-config.55 --force || exit 23 if [ -e test.log-$DATE.gz ]; then echo "File test.log-$DATE.gz should not exist (it should be deleted)" exit 3 fi rm -f *test.log* logrotate-3.21.0/test/test-0056.sh0000755000175000017500000000113514060660524013406 00000000000000#!/bin/sh . ./test-common.sh cleanup 56 # ------------------------------- Test 56 ------------------------------------ # removing last log file when using %d-%m-%Y rm -f *test.log* preptest test.log 56 1 0 DATE="" for i in $(seq 1 60) do if date -v -1d > /dev/null 2>&1; then DATE=$(date -v-${i}d "+%d-%m-%Y") else DATE=$(date "+%d-%m-%Y" --date "$i day ago") fi echo "x" > test.log-$DATE done $RLR test-config.56 --force || exit 23 if [ -e test.log-$DATE ]; then echo "File test.log-$DATE should not exist (it should be deleted)" exit 3 fi rm -f *test.log* logrotate-3.21.0/test/test-0057.sh0000755000175000017500000000122014060660524013402 00000000000000#!/bin/sh . ./test-common.sh cleanup 57 # ------------------------------- Test 57 ------------------------------------ # When compressing program prints something to stderr, we should prepend it # with the log name. preptest test.log 57 1 $RLR test-config.57 --force 2>error.log || exit 23 grep "error: Compressing" error.log >/dev/null if [ $? != 0 ]; then cat error.log echo "No error printed, but there should be one." exit 3 fi grep "compression error" error.log >/dev/null if [ $? != 0 ]; then cat error.log echo "No error printed, but there should be one." exit 3 fi rm -f error.log checkoutput </dev/null || exit 23 checkoutput </dev/null if [ $? != 0 ]; then echo "There is no log output in logrotate.log" exit 3 fi rm -f logrotate.log checkoutput < test.log truncate -s 10M test.log echo x >> test.log cp test.log test.example SIZE_SPARSE_OLD=$(du test.log|awk '{print $1}') if [ $SIZE_SPARSE_OLD -gt 100 ]; then echo "unable to create (or detect) sparse files" exit 77 fi SIZE_OLD=$($DU_APPARENT_SIZE test.log|awk '{print $1}') $RLR test-config.62 --force || exit 23 SIZE_NEW=$($DU_APPARENT_SIZE test.log.1|awk '{print $1}') SIZE_SPARSE_NEW=$(du test.log.1|awk '{print $1}') if [ $SIZE_OLD != $SIZE_NEW ]; then echo "Bad apparent size of sparse logs" echo "test.log: $SIZE_OLD" echo "test.log.1: $SIZE_NEW" exit 3 fi if [ $SIZE_SPARSE_NEW -gt 100 ]; then echo "Bad size of sparse logs" echo "test.log: $SIZE_SPARSE_OLD" echo "test.log.1: $SIZE_SPARSE_NEW" exit 3 fi checkoutput < test.log truncate -s 10M test.log cp test.log test.example SIZE_SPARSE_OLD=$(du test.log|awk '{print $1}') SIZE_OLD=$($DU_APPARENT_SIZE test.log|awk '{print $1}') $RLR test-config.63 --force || exit 23 SIZE_NEW=$($DU_APPARENT_SIZE test.log.1|awk '{print $1}') SIZE_SPARSE_NEW=$(du test.log.1|awk '{print $1}') if [ $SIZE_OLD != $SIZE_NEW ]; then echo "Bad apparent size of sparse logs" echo "test.log: $SIZE_OLD" echo "test.log.1: $SIZE_NEW" exit 3 fi if [ $SIZE_SPARSE_OLD -gt 100 ] || [ $SIZE_SPARSE_NEW -gt 100 ]; then echo "Bad size of sparse logs" echo "test.log: $SIZE_SPARSE_OLD" echo "test.log.1: $SIZE_SPARSE_NEW" exit 3 fi checkoutput < /dev/null 2>&1; then DAYAGO=$(date -v-1d "+%Y-%m-%d") else DAYAGO=$(date "+%Y-%m-%d" --date "1 day ago") fi echo "DAYAGO=${DAYAGO}" echo removed > "test.log$DAYAGO" $RLR test-config.66 --force || exit 23 checkoutput </dev/null) echo removed > "test.log$TODAY" $RLR test-config.67 --force && exit 23 cat scriptout|grep firstaction >/dev/null if [ $? != 0 ]; then echo "scriptout should contain 'firstaction'" exit 3 fi cat scriptout|grep lastaction >/dev/null if [ $? != 0 ]; then echo "scriptout should contain 'lastaction'" exit 3 fi logrotate-3.21.0/test/test-0068.sh0000755000175000017500000000126414060660524013414 00000000000000#!/bin/sh . ./test-common.sh cleanup 68 # ------------------------------- Test 68 ------------------------------------ # Old state file entries should be removed when not used. Logrotate should # not freeze on big state file. preptest test.log 68 1 0 cat > state << EOF logrotate state -- version 1 "$PWD/test.log" 2000-1-1 EOF for i in $(seq 1 200000) do echo "\"$PWD/removed.log$i\" 2000-1-1" >> state done $RLR test-config.68 --force || exit 23 cat state|grep test.log >/dev/null if [ $? != 0 ]; then echo "state file should contain 'test.log'" exit 3 fi cat state|grep removed.log >/dev/null if [ $? = 0 ]; then echo "state file should not contain 'removed.log'" exit 3 fi logrotate-3.21.0/test/test-0069.sh0000755000175000017500000000064014060660524013412 00000000000000#!/bin/sh . ./test-common.sh cleanup 69 # ------------------------------- Test 69 ------------------------------------ # Test olddir with wildcard in the pattern preptest test.log 69 1 0 rm -rf testdir adir bdir mkdir adir mkdir bdir cp test.log adir cp test.log bdir $RLR test-config.69 --force || exit 23 checkoutput < state < state < test.log.1.gz $RLR test-config.72 --force || exit 23 dt="$(date +%Y%m%d%H)" checkoutput <&- || exit 23 checkoutput < includedir/test-0077.conf << EOF copytruncate rotate 1 EOF chmod go-w includedir/test-0077.conf $RLR test-config.77 --force || exit 23 rm -rf includedir checkoutput <verbose.log || exit 23 grep -e "^Final rotated log filename should be empty in prerotate: $" verbose.log >/dev/null if [ $? != 0 ]; then echo "Expected prerotate message to not include final filename." exit 3 fi grep -e "^Final rotated log filename is: .*test.log.1$" verbose.log >/dev/null if [ $? != 0 ]; then echo "Expected postrotate message not printed." exit 3 fi logrotate-3.21.0/test/test-0080.sh0000755000175000017500000000053114246060643013404 00000000000000#!/bin/sh . ./test-common.sh cleanup 80 # ------------------------------- Test 80 ------------------------------------ # size option and the time interval option are mutually exclusive, so the user # should be warned. preptest test.log 80 1 0 $RLR -d test-config.80 2>&1 | \ grep -q "note: 'daily' overrides previously specified 'size'" logrotate-3.21.0/test/test-0081.sh0000755000175000017500000000061613775061434013416 00000000000000#!/bin/sh . ./test-common.sh cleanup 81 # ------------------------------- Test 81 ------------------------------------ # size option and the time interval option are mutually exclusive, so the user # should be warned, but only if they are used inside the same log config preptest test.log 81 1 0 ! $RLR -d test-config.81 2>&1 | \ grep -q "warning: '.*' overrides previously specified '.*'" logrotate-3.21.0/test/test-0082.sh0000755000175000017500000000040114060660524013400 00000000000000#!/bin/sh . ./test-common.sh cleanup 82 # ------------------------------- Test 82 ------------------------------------ preptest test.log 82 0 for i in $(seq 32); do $RLR test-config.82 --force || exit 23 done test "$(ls test.log.* | wc -l)" -eq 32 logrotate-3.21.0/test/test-0083.sh0000755000175000017500000000032614060660524013407 00000000000000#!/bin/sh . ./test-common.sh cleanup 83 # ------------------------------- Test 83 ------------------------------------ preptest test.log 83 1 if $RLR test-config.83 --force; then exit 23 else exit 0 fi logrotate-3.21.0/test/test-0084.sh0000755000175000017500000000036014060660524013406 00000000000000#!/bin/sh . ./test-common.sh cleanup 84 # ------------------------------- Test 84 ------------------------------------ preptest test.log 84 1 mkdir -p log/dir ln -s XXX log/sym touch log/dir/file $RLR test-config.84 --force || exit 23 logrotate-3.21.0/test/test-0085.sh0000755000175000017500000000103714060660524013411 00000000000000#!/bin/sh . ./test-common.sh cleanup 85 # ------------------------------- Test 85 ------------------------------------ preptest test.log 85 0 $RLR test-config.85 -f || exit 23 checkoutput <> test.log $RLR test-config.85 -f || exit 23 # maxage should remove this file if [ -f test.log.2 ]; then echo "log not removed" >&2 exit 3 fi checkoutput <> test.log $RLR test-config.86 -f || exit 23 # maxage should remove this file if [ -f test.log-20000101 ]; then echo "log not removed" >&2 exit 3 fi checkoutput < stderr || exit 23 if grep 'error:.*No such file or directory' stderr; then exit 7 else exit 0 fi logrotate-3.21.0/test/test-0089.sh0000755000175000017500000000061314060660524013414 00000000000000#!/bin/sh . ./test-common.sh # skip the test if /dev/null is not readable test -r /dev/null || exit 77 # we don't want any stuff left from previous runs cleanup 89 # ------------------------------- Test 89 ------------------------------------ # using /dev/null as state file tells logrotate not to write the state file preptest test.log 89 2 $RLR --state /dev/null test-config.89 || exit 23 logrotate-3.21.0/test/test-0090.sh0000755000175000017500000000077514077741363013426 00000000000000#!/bin/sh . ./test-common.sh # we don't want any stuff left from previous runs cleanup 90 rm -Rf real*.log* # ------------------------------- Test 90 ------------------------------------ # do not rotate file with multiple hard links by default preptest real.log 90 0 ln real.log test.log $RLR -f test-config.90 || exit 23 checkoutput < homedir/includedir/test-0106-included.conf << EOF $(pwd)/test.log { rotate 1 create olddir ~/old createolddir 700 } EOF chmod go-w homedir/includedir/test-0106-included.conf $RLR test-config.106 --force || exit 23 checkoutput <&2 exit 3 fi if [ "$mtime" -ne $expected_time ]; then echo "mtime not set (expected $expected_time, got $mtime)" >&2 exit 3 fi # check last, to not modify atime checkoutput < foo mv foo scriptout endscript } logrotate-3.21.0/test/test-config.12.in0000644000175000017500000000013214060660524014467 00000000000000create &DIR&/test.log { monthly rotate 1 olddir testdir nocreateolddir } logrotate-3.21.0/test/test-config.13.in0000644000175000017500000000016113212000407014454 00000000000000create &DIR&/test.log { monthly rotate 1 olddir &DIR&/testdir createolddir 700 &USER& &GROUP& } logrotate-3.21.0/test/test-config.14.in0000644000175000017500000000012113212000407014451 00000000000000create &DIR&/test.log { daily dateext dateformat .%Y-%m-%d rotate 1 } logrotate-3.21.0/test/test-config.15.in0000644000175000017500000000011713212000407014457 00000000000000create &DIR&/test.log { daily shred shredcycles 20 rotate 1 } logrotate-3.21.0/test/test-config.16.in0000644000175000017500000000010113212000407014451 00000000000000create &DIR&/test.log { weekly maxsize 4 rotate 1 } logrotate-3.21.0/test/test-config.17.in0000644000175000017500000000015513212000407014463 00000000000000create # missing { is OK, we're testing parsing here &DIR&/test.log weekly maxsize 4 rotate 1 } logrotate-3.21.0/test/test-config.18.in0000644000175000017500000000022213212000407014457 00000000000000create # tests more compressoptions &DIR&/test.log { compress compresscmd ./compress compressoptions -f -9 weekly rotate 1 } logrotate-3.21.0/test/test-config.19.in0000644000175000017500000000013013212000407014456 00000000000000create &DIR&/test*.log { daily rotate 1 postrotate exit 1 endscript } logrotate-3.21.0/test/test-config.1.in0000644000175000017500000000020113640372664014412 00000000000000create &DIR&/test.log { daily # note the white space after this line rotate 2 mail user@invalid. maillast } logrotate-3.21.0/test/test-config.20.in0000644000175000017500000000015213212000407014452 00000000000000create &DIR&/test*.log { daily rotate 1 sharedscripts postrotate exit 1 endscript } logrotate-3.21.0/test/test-config.21.in0000644000175000017500000000010113212000407014445 00000000000000create &DIR&/test*.log { daily rotate 1 missingok } logrotate-3.21.0/test/test-config.22.in0000644000175000017500000000006313212000407014455 00000000000000create &DIR&/test*.log { daily rotate 1 } logrotate-3.21.0/test/test-config.23.in0000644000175000017500000000006313212000407014456 00000000000000create &DIR&/test*.log { daily rotate 1 } logrotate-3.21.0/test/test-config.24.in0000644000175000017500000000016514043767746014517 00000000000000create # will be overridden by copytruncate renamecopy &DIR&/test*.log { daily copytruncate rotate 1 } logrotate-3.21.0/test/test-config.25.in0000644000175000017500000000015313212000407014460 00000000000000create # missing { is OK, we're testing parsing here &DIR&/test.log weekly maxsize 4 rotate 1 logrotate-3.21.0/test/test-config.26.in0000644000175000017500000000010113212000407014452 00000000000000create &DIR&/test.log { waeekly maxsize 4 rotate 1 }logrotate-3.21.0/test/test-config.27.in0000644000175000017500000000017113551062667014510 00000000000000create &DIR&/test.log { daily rotate 999 compress dateext ifempty delaycompress mailfirst mail user@invalid. } logrotate-3.21.0/test/test-config.28.in0000644000175000017500000000013013212000407014456 00000000000000create #testing { on new line &DIR&/test.log { weekly maxsize 4 rotate 1 } logrotate-3.21.0/test/test-config.29.in0000644000175000017500000000011013212000407014455 00000000000000create rotate 1 daily #testing { } on the same line &DIR&/test.log { } logrotate-3.21.0/test/test-config.2.in0000644000175000017500000000012213551062667014415 00000000000000"&DIR&/test.log" { monthly rotate 2 mail user@invalid. maillast } logrotate-3.21.0/test/test-config.30.in0000644000175000017500000000006713212000407014460 00000000000000create &DIR&/test.log { daily rotate 999 dateext } logrotate-3.21.0/test/test-config.31.in0000644000175000017500000000010213212000407014447 00000000000000create 0600 &USER& &GROUP& &DIR&/test.log { daily rotate 999 } logrotate-3.21.0/test/test-config.32.in0000644000175000017500000000005613212000407014460 00000000000000create &DIR&/test.log { daily rotate 999 } logrotate-3.21.0/test/test-config.33.in0000644000175000017500000000006313212000407014457 00000000000000create 0600 &DIR&/test.log { daily rotate 999 } logrotate-3.21.0/test/test-config.34.in0000644000175000017500000000007513775061434014510 00000000000000create root &ROOTGROUP& &DIR&/test.log { daily rotate 1 } logrotate-3.21.0/test/test-config.35.in0000644000175000017500000000007313212000407014462 00000000000000create &USER& &GROUP& &DIR&/test.log { daily rotate 1 } logrotate-3.21.0/test/test-config.36.in0000644000175000017500000000007713212000407014467 00000000000000# bad unit 'x' &DIR&/test.log { daily size 300x rotate 1 } logrotate-3.21.0/test/test-config.37.in0000644000175000017500000000054513212000407014470 00000000000000&DIR&/test.log { size 300x daily firstaction touch scriptout # put some } here, so we check if parser won't break on it. } echo $(cat scriptout) foo > foo } mv foo scriptout endscript rotate 1 } &DIR&/test.log { create daily firstaction touch scriptout echo $(cat scriptout) second > foo mv foo scriptout endscript rotate 1 } logrotate-3.21.0/test/test-config.38.in0000644000175000017500000000030413551062667014510 00000000000000create &DIR&/test*.log { monthly rotate 0 mail user@invalid. maillast sharedscripts preremove touch scriptout printf '%s' "$(basename $*)" >> scriptout endscript } logrotate-3.21.0/test/test-config.39.in0000644000175000017500000000034213551062667014513 00000000000000create &DIR&/test*.log { monthly rotate 0 mail user@invalid. maillast sharedscripts preremove touch scriptout printf '%s' "$(basename $*)" >> scriptout this should trigger an error endscript } logrotate-3.21.0/test/test-config.3.in0000644000175000017500000000027313551062667014425 00000000000000create &DIR&/test*.log { monthly rotate 1 mail user@invalid. maillast postrotate touch scriptout echo $(cat scriptout) foo > foo mv foo scriptout endscript } logrotate-3.21.0/test/test-config.40.in0000644000175000017500000000014413223413366014473 00000000000000create tabooext .v,.sample,.unused,~ tabooext + .x, .y, .z taboopat + .* include &DIR&/testingdir logrotate-3.21.0/test/test-config.41.in0000644000175000017500000000046113212000407014460 00000000000000create &DIR&/test*.log { size 5 rotate 1 nosharedscripts prerotate touch scriptout printf '%s' "$(basename $1)" >> scriptout printf ";" >> scriptout endscript postrotate touch scriptout printf '%s' "$(basename $1)" >> scriptout printf ";" >> scriptout endscript } logrotate-3.21.0/test/test-config.42.in0000644000175000017500000000072013212000407014457 00000000000000create &DIR&/test*.log { size 5 rotate 1 sharedscripts prerotate touch scriptout IFS=$(printf "\n\b") printf "\"" >> scriptout for f in "$1" do printf '%s' "$(basename $f)" >> scriptout printf ";" >> scriptout done endscript postrotate touch scriptout IFS=$(printf "\n\b") for f in "$1" do printf '%s' "$(basename $f)" >> scriptout printf ";" >> scriptout done printf "\"" >> scriptout endscript } logrotate-3.21.0/test/test-config.43.in0000644000175000017500000000046213212000407014463 00000000000000create &DIR&/test*.log { size 5 rotate 1 nosharedscripts prerotate touch scriptout printf '%s' "$(basename $1)" >> scriptout printf ";" >> scriptout endscript postrotate touch scriptout printf '%s' "$(basename $1)" >> scriptout printf ";" >> scriptout endscript } logrotate-3.21.0/test/test-config.44.in0000644000175000017500000000074213640372664014513 00000000000000create &DIR&/test.log &DIR&/test2.log { size 5 rotate 1 nosharedscripts prerotate touch scriptout IFS=$(printf "\n\b") printf "\"" >> scriptout for f in "$1" do printf '%s' "$(basename $f)" >> scriptout printf ";" >> scriptout done endscript postrotate touch scriptout IFS=$(printf "\n\b") for f in "$1" do printf '%s' "$(basename $f)" >> scriptout printf ";" >> scriptout done printf "\"" >> scriptout endscript } logrotate-3.21.0/test/test-config.45.in0000644000175000017500000000074013212000407014464 00000000000000create &DIR&/test.log &DIR&/test2.log { size 5 rotate 1 sharedscripts prerotate touch scriptout IFS=$(printf "\n\b") printf "\"" >> scriptout for f in "$1" do printf '%s' "$(basename $f)" >> scriptout printf ";" >> scriptout done endscript postrotate touch scriptout IFS=$(printf "\n\b") for f in "$1" do printf '%s' "$(basename $f)" >> scriptout printf ";" >> scriptout done printf "\"" >> scriptout endscript } logrotate-3.21.0/test/test-config.46.in0000644000175000017500000000006713212000407014467 00000000000000create &DIR&/test.log { daily rotate 999 dateext } logrotate-3.21.0/test/test-config.47.in0000644000175000017500000000006713212000407014470 00000000000000create &DIR&/test.log { daily rotate 999 dateext } logrotate-3.21.0/test/test-config.48.in0000644000175000017500000000006613212000407014470 00000000000000create &DIR&/test.log { daily rotate 999 size 2 } logrotate-3.21.0/test/test-config.49.in0000644000175000017500000000006413212000407014467 00000000000000create &DIR&/test.log { daily rotate 4 size 2 } logrotate-3.21.0/test/test-config.4.in0000644000175000017500000000031513551062667014423 00000000000000create &DIR&/test*.log { monthly rotate 1 mail user@invalid. maillast sharedscripts postrotate touch scriptout echo $(cat scriptout) foo > foo mv foo scriptout endscript } logrotate-3.21.0/test/test-config.50.in0000644000175000017500000000006613212000407014461 00000000000000create &DIR&/test.log { hourly dateext rotate 4 } logrotate-3.21.0/test/test-config.51.in0000644000175000017500000000021313212000407014454 00000000000000/var/log/this_dir_does_not_exist/*log { size 1 missingok sharedscripts prerotate /usr/bin/some-program endscript } logrotate-3.21.0/test/test-config.52.in0000644000175000017500000000030113212000407014453 00000000000000create /var/log/does_not_exist.log &DIR&/test.log { rotate 14 size 2 missingok sharedscripts postrotate touch scriptout echo $(cat scriptout) foo > foo mv foo scriptout endscript }logrotate-3.21.0/test/test-config.53.in0000644000175000017500000000007313212000407014462 00000000000000create &DIR&/test.log { rotate 14 size 4096 missingok }logrotate-3.21.0/test/test-config.54.in0000644000175000017500000000012213212000407014456 00000000000000create &DIR&/test.log { daily dateext dateformat -%Y-%m-%d rotate 60 } logrotate-3.21.0/test/test-config.55.in0000644000175000017500000000057513551062667014521 00000000000000create # continue and throw no error message when log file is not present missingok # truncate the original log file in place after creating a copy copytruncate # compress the file compress compresscmd gzip uncompresscmd gunzip compressext .gz # do only rotate when not empty notifempty &DIR&/test.log { hourly dateext dateformat -%s rotate 60 nosharedscripts } logrotate-3.21.0/test/test-config.56.in0000644000175000017500000000012213212000407014460 00000000000000create &DIR&/test.log { daily dateext dateformat -%d-%m-%Y rotate 60 } logrotate-3.21.0/test/test-config.57.in0000644000175000017500000000025413551062667014515 00000000000000create # tests more compressoptions &DIR&/test.log { compress compresscmd ./compress-error compressoptions -f -9 compressext .gz weekly rotate 1 } logrotate-3.21.0/test/test-config.58.in0000644000175000017500000000016314043767746014524 00000000000000create # will be overridden by renamecopy copytruncate &DIR&/test.log { renamecopy weekly rotate 1 } logrotate-3.21.0/test/test-config.59.in0000644000175000017500000000016314043767746014525 00000000000000create # will be overridden by renamecopy copytruncate &DIR&/test.log { renamecopy weekly rotate 1 } logrotate-3.21.0/test/test-config.5.in0000644000175000017500000000034213551062667014424 00000000000000create &DIR&/test.log &DIR&/anothertest.log { monthly rotate 1 mail user@invalid. maillast sharedscripts postrotate touch scriptout echo $(cat scriptout) foo > foo mv foo scriptout endscript } logrotate-3.21.0/test/test-config.60.in0000644000175000017500000000013213212000407014454 00000000000000create &DIR&/test.log { daily dateext dateformat .%Y-%m-%d-%H rotate 1 } logrotate-3.21.0/test/test-config.61.in0000644000175000017500000000013213212000407014455 00000000000000create &DIR&/test.log { daily dateext dateformat .%Y-%m-%d-%H rotate 1 } logrotate-3.21.0/test/test-config.62.in0000644000175000017500000000016514043767746014521 00000000000000create # will be overridden by copytruncate renamecopy &DIR&/test*.log { daily copytruncate rotate 1 } logrotate-3.21.0/test/test-config.63.in0000644000175000017500000000016514043767746014522 00000000000000create # will be overridden by copytruncate renamecopy &DIR&/test*.log { daily copytruncate rotate 1 } logrotate-3.21.0/test/test-config.64.in0000644000175000017500000000035013551062667014510 00000000000000create &DIR&/test.log { daily dateext dateformat -%Y%m%d rotate 0 compress compresscmd gzip uncompresscmd gunzip compressext .gz nosharedscripts dateext mail user@invalid. maillast } logrotate-3.21.0/test/test-config.65.in0000644000175000017500000000023113551062667014507 00000000000000create &DIR&/test.log { daily dateext dateformat -%Y%m%d rotate 0 nosharedscripts dateext mail user@invalid. maillast } logrotate-3.21.0/test/test-config.66.in0000644000175000017500000000016613212000407014471 00000000000000create &DIR&/test.log { daily dateext dateformat %Y-%m-%d rotate 1 nosharedscripts dateext } logrotate-3.21.0/test/test-config.67.in0000644000175000017500000000031113212000407014462 00000000000000create &DIR&/test.log { daily dateext dateformat %Y-%m-%d rotate 1 firstaction echo "firstaction" > scriptout endscript lastaction echo "lastaction" >> scriptout endscript } logrotate-3.21.0/test/test-config.68.in0000644000175000017500000000006213212000407014466 00000000000000create &DIR&/test.log { daily rotate 1 } logrotate-3.21.0/test/test-config.69.in0000644000175000017500000000022213212000407014465 00000000000000create &DIR&/*/test.log &DIR&/*/test.lo3 { monthly rotate 1 olddir &DIR&/testdir createolddir 700 &USER& &GROUP& missingok } logrotate-3.21.0/test/test-config.6.in0000644000175000017500000000035613551062667014432 00000000000000create &DIR&/test.log &DIR&/anothertest.log { monthly rotate 1 start 0 mail user@invalid. maillast sharedscripts postrotate touch scriptout echo $(cat scriptout) foo > foo mv foo scriptout endscript } logrotate-3.21.0/test/test-config.70.in0000644000175000017500000000011513223413366014474 00000000000000create &DIR&/test.log { daily rotate 3 missingok minage 5 } logrotate-3.21.0/test/test-config.71.in0000644000175000017500000000011513223413366014475 00000000000000create &DIR&/test.log { daily rotate 3 missingok minage 5 } logrotate-3.21.0/test/test-config.72.in0000644000175000017500000000022613551062667014511 00000000000000&DIR&/test.log { daily rotate 3 compress compresscmd gzip uncompresscmd gunzip compressext .gz delaycompress create } logrotate-3.21.0/test/test-config.73.in0000644000175000017500000000017013702022517014474 00000000000000&DIR&/test_copy.log { copy copytruncate rotate 1 } &DIR&/test_rotate.log { copytruncate rotate 0 } logrotate-3.21.0/test/test-config.74.in0000644000175000017500000000016313551062667014513 00000000000000&DIR&/test.log { create rotate 1 size 0 postrotate rm -fv &DIR&/test.log.2 endscript } logrotate-3.21.0/test/test-config.75.in0000644000175000017500000000025613551062667014517 00000000000000&DIR&/test.log { create rotate 2 size 0 compress compresscmd gzip uncompresscmd gunzip compressext .gz delaycompress mail user@invalid. } logrotate-3.21.0/test/test-config.76.in0000644000175000017500000000023413551062667014514 00000000000000&DIR&/test.log { create rotate 2 size 0 compress compresscmd gzip uncompresscmd gunzip compressext .gz mail user@invalid. } logrotate-3.21.0/test/test-config.77.in0000644000175000017500000000007513551062667014520 00000000000000tabooext + ,v include &DIR&/includedir &DIR&/test*.log { } logrotate-3.21.0/test/test-config.78.in0000644000175000017500000000011213551062667014511 00000000000000create &DIR&/test.log { monthly rotate 1 addextension .log } logrotate-3.21.0/test/test-config.79.in0000644000175000017500000000033313551062667014517 00000000000000create &DIR&/test*.log { rotate 1 prerotate echo "Final rotated log filename should be empty in prerotate: ${2}" endscript postrotate echo "Final rotated log filename is: ${2}" endscript } logrotate-3.21.0/test/test-config.7.in0000644000175000017500000000035613551062667014433 00000000000000create &DIR&/test.log &DIR&/anothertest.log { monthly rotate 3 start 6 mail user@invalid. maillast sharedscripts postrotate touch scriptout echo $(cat scriptout) foo > foo mv foo scriptout endscript } logrotate-3.21.0/test/test-config.80.in0000644000175000017500000000013413551062667014506 00000000000000create /var/log/does_not_exist.log &DIR&/test.log { rotate 14 size 2 daily missingok } logrotate-3.21.0/test/test-config.81.in0000644000175000017500000000022213551062667014505 00000000000000create /var/log/does_not_exist.log &DIR&/test.log { rotate 14 daily missingok } /var/log/something_else.log { rotate 14 size 2 missingok } logrotate-3.21.0/test/test-config.82.in0000644000175000017500000000007213551062667014511 00000000000000create &DIR&/test.log { rotate -1 copytruncate } logrotate-3.21.0/test/test-config.83.in0000644000175000017500000000006213551062667014511 00000000000000&DIR&/test.log { rotate 1 # invalid comment } logrotate-3.21.0/test/test-config.84.in0000644000175000017500000000003713551062667014514 00000000000000&DIR&/log/*/* { rotate 1 } logrotate-3.21.0/test/test-config.85.in0000644000175000017500000000006613640372664014517 00000000000000create &DIR&/test.log { rotate -1 maxage 1 } logrotate-3.21.0/test/test-config.86.in0000644000175000017500000000010213640372664014507 00000000000000create &DIR&/test.log { rotate -1 maxage 1 dateext } logrotate-3.21.0/test/test-config.87.in0000644000175000017500000000010013702022517014472 00000000000000&DIR&/test.log { postrotate sleep 8 endscript } logrotate-3.21.0/test/test-config.88.in0000644000175000017500000000007713703046642014516 00000000000000&DIR&/test.log { rotate 0 compress delaycompress } logrotate-3.21.0/test/test-config.89.in0000644000175000017500000000005214060660524014506 00000000000000&DIR&/test.log { daily rotate 2 } logrotate-3.21.0/test/test-config.8.in0000644000175000017500000000041513551062667014430 00000000000000create compress compresscmd gzip uncompresscmd gunzip compressext .gz &DIR&/test.log { monthly rotate 3 mail user@invalid. mailfirst sharedscripts postrotate touch scriptout echo $(cat scriptout) foo > foo mv foo scriptout endscript } logrotate-3.21.0/test/test-config.90.in0000644000175000017500000000004014077741363014504 00000000000000&DIR&/test.log { rotate 1 } logrotate-3.21.0/test/test-config.91.in0000644000175000017500000000010314077741363014505 00000000000000&DIR&/test.log { rotate 1 allowhardlink copytruncate } logrotate-3.21.0/test/test-config.92.in0000644000175000017500000000005314243352606014503 00000000000000&DIR&/test.log { rotate 1 create } logrotate-3.21.0/test/test-config.93.in0000644000175000017500000000012714346133207014504 00000000000000&DIR&/test.log { rotate 2 create prerotate sleep 2 endscript } logrotate-3.21.0/test/test-config.9.in0000644000175000017500000000032713551062667014433 00000000000000create compress &DIR&/test.log { monthly rotate 0 mail user@invalid. mailfirst sharedscripts postrotate touch scriptout echo $(cat scriptout) foo > foo mv foo scriptout endscript } logrotate-3.21.0/test-driver0000755000175000017500000001141714346133574012732 00000000000000#! /bin/sh # test-driver - basic testsuite driver script. scriptversion=2018-03-07.03; # UTC # Copyright (C) 2011-2021 Free Software Foundation, Inc. # # 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, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . # Make unconditional expansion of undefined variables an error. This # helps a lot in preventing typo-related bugs. set -u usage_error () { echo "$0: $*" >&2 print_usage >&2 exit 2 } print_usage () { cat <"$log_file" "$@" >>"$log_file" 2>&1 estatus=$? if test $enable_hard_errors = no && test $estatus -eq 99; then tweaked_estatus=1 else tweaked_estatus=$estatus fi case $tweaked_estatus:$expect_failure in 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; 0:*) col=$grn res=PASS recheck=no gcopy=no;; 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;; *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;; *:*) col=$red res=FAIL recheck=yes gcopy=yes;; esac # Report the test outcome and exit status in the logs, so that one can # know whether the test passed or failed simply by looking at the '.log' # file, without the need of also peaking into the corresponding '.trs' # file (automake bug#11814). echo "$res $test_name (exit status: $estatus)" >>"$log_file" # Report outcome to console. echo "${col}${res}${std}: $test_name" # Register the test result, and other relevant metadata. echo ":test-result: $res" > $trs_file echo ":global-test-result: $res" >> $trs_file echo ":recheck: $recheck" >> $trs_file echo ":copy-in-global-log: $gcopy" >> $trs_file # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: logrotate-3.21.0/.tarball-version0000644000175000017500000000000714346133605013625 000000000000003.21.0