From b68a1bba9b9a660558e539f92eb542aeedb6572f Mon Sep 17 00:00:00 2001 From: Timothy Stack Date: Tue, 5 Jun 2012 13:18:59 -0700 Subject: [PATCH] [test] some cleanup for tests and other things Just a cleanup pass --- Makefile.in | 72 +++-- aclocal.m4 | 72 +++-- configure | 611 ++++++++++++++++++++------------------ src/Makefile.in | 31 +- src/hist_source.cc | 15 +- src/hist_source.hh | 56 +++- src/line_buffer.cc | 10 +- src/line_buffer.hh | 9 +- src/listview_curses.cc | 1 + src/listview_curses.hh | 57 ++-- src/lnav.cc | 34 ++- src/log_format.cc | 4 +- src/log_format.hh | 8 + src/log_format_impls.cc | 7 +- src/logfile.cc | 4 +- src/piper_proc.cc | 3 + src/piper_proc.hh | 3 + src/statusview_curses.hh | 22 +- src/termios_guard.hh | 4 + src/view_curses.cc | 2 + src/view_curses.hh | 2 + test/Makefile.am | 15 + test/Makefile.in | 141 ++++++--- test/drive_view_colors.cc | 70 +++++ test/scripty.cc | 256 ++++++++++------ test/test_hist_source.cc | 24 ++ test/test_view_colors.sh | 6 + test/view_colors_output.0 | 1 + 28 files changed, 987 insertions(+), 553 deletions(-) create mode 100644 test/drive_view_colors.cc create mode 100644 test/test_hist_source.cc create mode 100644 test/test_view_colors.sh create mode 100644 test/view_colors_output.0 diff --git a/Makefile.in b/Makefile.in index f3a2b4b6..1bd6d55f 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -73,9 +73,11 @@ DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ - { test ! -d "$(distdir)" \ - || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ - && rm -fr "$(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__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ @@ -104,6 +106,8 @@ am__relativize = \ DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best 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@ @@ -226,7 +230,7 @@ EXTRA_DIST = \ all: all-recursive .SUFFIXES: -am--refresh: +am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ @@ -470,7 +474,11 @@ dist-gzip: distdir $(am__remove_distdir) dist-bzip2: distdir - tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 + tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 + $(am__remove_distdir) + +dist-lzip: distdir + tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__remove_distdir) dist-lzma: distdir @@ -478,7 +486,7 @@ dist-lzma: distdir $(am__remove_distdir) dist-xz: distdir - tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz + tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__remove_distdir) dist-tarZ: distdir @@ -509,6 +517,8 @@ distcheck: dist bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ + *.tar.lz*) \ + lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ @@ -528,6 +538,7 @@ distcheck: dist && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ @@ -556,8 +567,16 @@ distcheck: dist 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: - @$(am__cd) '$(distuninstallcheck_dir)' \ - && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ + @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)"; \ @@ -588,10 +607,15 @@ install-am: all-am installcheck: installcheck-recursive install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: @@ -678,15 +702,15 @@ uninstall-am: .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-generic \ ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \ - dist-lzma dist-shar dist-tarZ dist-xz dist-zip distcheck \ - distclean distclean-generic 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-pdf install-pdf-am install-ps \ - install-ps-am install-strip installcheck installcheck-am \ - installdirs installdirs-am maintainer-clean \ + dist-lzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \ + distcheck distclean distclean-generic 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-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am tags tags-recursive uninstall uninstall-am diff --git a/aclocal.m4 b/aclocal.m4 index e1872153..2809987b 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,7 +1,8 @@ -# generated automatically by aclocal 1.11.1 -*- Autoconf -*- +# generated automatically by aclocal 1.11.3 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +# 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -13,18 +14,21 @@ m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.65],, -[m4_warning([this file was generated for autoconf 2.65. +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],, +[m4_warning([this file was generated for autoconf 2.68. 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, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 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. +# serial 1 + # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been @@ -34,7 +38,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.11' 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.11.1], [], +m4_if([$1], [1.11.3], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -50,19 +54,21 @@ m4_define([_AM_AUTOCONF_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.11.1])dnl +[AM_AUTOMAKE_VERSION([1.11.3])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, 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003, 2005, 2011 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. +# serial 1 + # 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/../..'. @@ -144,14 +150,14 @@ AC_CONFIG_COMMANDS_PRE( Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 -# Free Software Foundation, Inc. +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, +# 2010, 2011 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. -# serial 10 +# serial 12 # 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, @@ -191,6 +197,7 @@ AC_CACHE_CHECK([dependency style of $depcc], # 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. @@ -255,7 +262,7 @@ AC_CACHE_CHECK([dependency style of $depcc], break fi ;; - msvisualcpp | msvcmsys) + 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. @@ -320,10 +327,13 @@ AC_DEFUN([AM_DEP_TRACK], 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 -*- @@ -557,12 +567,15 @@ for _am_header in $config_headers :; do done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003, 2005, 2008, 2011 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. +# serial 1 + # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. @@ -694,12 +707,15 @@ else fi ]) -# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# Copyright (C) 2003, 2004, 2005, 2006, 2011 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. +# serial 1 + # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. @@ -722,13 +738,14 @@ esac # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. +# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 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. -# serial 4 +# serial 5 # _AM_MANGLE_OPTION(NAME) # ----------------------- @@ -736,13 +753,13 @@ 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)])]) @@ -818,12 +835,14 @@ Check your system clock]) fi AC_MSG_RESULT(yes)]) -# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003, 2005, 2011 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. +# serial 1 + # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't @@ -846,13 +865,13 @@ fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006, 2008 Free Software Foundation, Inc. +# Copyright (C) 2006, 2008, 2010 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. -# serial 2 +# serial 3 # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- @@ -861,13 +880,13 @@ AC_SUBST([INSTALL_STRIP_PROGRAM])]) 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, 2005 Free Software Foundation, Inc. +# Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -889,10 +908,11 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], -[# Always define AMTAR for backward compatibility. -AM_MISSING_PROG([AMTAR], [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}']) m4_if([$1], [v7], - [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) diff --git a/configure b/configure index 403b2017..d11a28c9 100755 --- a/configure +++ b/configure @@ -1,13 +1,13 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.65 for lnav 0.4.0. +# Generated by GNU Autoconf 2.68 for lnav 0.4.0. # # Report bugs to . # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software +# Foundation, Inc. # # # This configure script is free software; the Free Software Foundation @@ -91,6 +91,7 @@ fi IFS=" "" $as_nl" # 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 @@ -216,11 +217,18 @@ IFS=$as_save_IFS # 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 export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} + 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+"$@"} fi if test x$as_have_required = xno; then : @@ -319,7 +327,7 @@ $as_echo X"$as_dir" | 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" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p @@ -359,19 +367,19 @@ else fi # as_fn_arith -# as_fn_error ERROR [LINENO LOG_FD] -# --------------------------------- +# 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. +# script with STATUS, using 1 if that was 0. as_fn_error () { - as_status=$?; test $as_status -eq 0 && as_status=1 - if test "$3"; then - as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $1" >&2 + $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error @@ -533,7 +541,7 @@ test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. -# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# 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` @@ -624,6 +632,7 @@ STATIC_LDFLAGS am__fastdepCXX_FALSE am__fastdepCXX_TRUE CXXDEPMODE +am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE @@ -794,8 +803,9 @@ do fi case $ac_option in - *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *) ac_optarg=yes ;; + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. @@ -840,7 +850,7 @@ do 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" + as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -866,7 +876,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error "invalid feature name: $ac_useropt" + as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1070,7 +1080,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error "invalid package name: $ac_useropt" + as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1086,7 +1096,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error "invalid package name: $ac_useropt" + as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1116,8 +1126,8 @@ do | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; - -*) as_fn_error "unrecognized option: \`$ac_option' -Try \`$0 --help' for more information." + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" ;; *=*) @@ -1125,7 +1135,7 @@ Try \`$0 --help' for more information." # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) - as_fn_error "invalid variable name: \`$ac_envvar'" ;; + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; @@ -1135,7 +1145,7 @@ Try \`$0 --help' for more information." $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac @@ -1143,13 +1153,13 @@ done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` - as_fn_error "missing argument to $ac_option" + 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" ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi @@ -1172,7 +1182,7 @@ do [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac - as_fn_error "expected an absolute directory name for --$ac_var: $ac_val" + 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' @@ -1186,8 +1196,8 @@ target=$target_alias if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used." >&2 + $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used" >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi @@ -1202,9 +1212,9 @@ 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" + 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" + as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. @@ -1243,11 +1253,11 @@ else 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" + 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" + 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 @@ -1287,7 +1297,7 @@ Configuration: --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking...' messages + -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files @@ -1446,9 +1456,9 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF lnav configure 0.4.0 -generated by GNU Autoconf 2.65 +generated by GNU Autoconf 2.68 -Copyright (C) 2009 Free Software Foundation, Inc. +Copyright (C) 2010 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1492,7 +1502,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_compile @@ -1530,7 +1540,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile @@ -1572,7 +1582,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run @@ -1750,7 +1760,7 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ rm -f conftest.val fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_compute_int @@ -1776,7 +1786,7 @@ $as_echo "$ac_try_echo"; } >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } >/dev/null && { + test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : @@ -1787,7 +1797,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp @@ -1801,7 +1811,7 @@ ac_fn_c_check_header_compile () as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -1819,7 +1829,7 @@ fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile @@ -1864,7 +1874,7 @@ fi # 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; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link @@ -1877,10 +1887,10 @@ fi ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 @@ -1916,7 +1926,7 @@ if ac_fn_c_try_cpp "$LINENO"; then : else ac_header_preproc=no fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } @@ -1939,17 +1949,15 @@ $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} -( cat <<\_ASBOX -## ------------------------------------------ ## +( $as_echo "## ------------------------------------------ ## ## Report this to timothyshanestack@gmail.com ## -## ------------------------------------------ ## -_ASBOX +## ------------------------------------------ ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" @@ -1958,7 +1966,7 @@ eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel cat >config.log <<_ACEOF @@ -1966,7 +1974,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by lnav $as_me 0.4.0, which was -generated by GNU Autoconf 2.65. Invocation command line was +generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2076,11 +2084,9 @@ trap 'exit_status=$? { echo - cat <<\_ASBOX -## ---------------- ## + $as_echo "## ---------------- ## ## Cache variables. ## -## ---------------- ## -_ASBOX +## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( @@ -2114,11 +2120,9 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; ) echo - cat <<\_ASBOX -## ----------------- ## + $as_echo "## ----------------- ## ## Output variables. ## -## ----------------- ## -_ASBOX +## ----------------- ##" echo for ac_var in $ac_subst_vars do @@ -2131,11 +2135,9 @@ _ASBOX echo if test -n "$ac_subst_files"; then - cat <<\_ASBOX -## ------------------- ## + $as_echo "## ------------------- ## ## File substitutions. ## -## ------------------- ## -_ASBOX +## ------------------- ##" echo for ac_var in $ac_subst_files do @@ -2149,11 +2151,9 @@ _ASBOX fi if test -s confdefs.h; then - cat <<\_ASBOX -## ----------- ## + $as_echo "## ----------- ## ## confdefs.h. ## -## ----------- ## -_ASBOX +## ----------- ##" echo cat confdefs.h echo @@ -2208,7 +2208,12 @@ _ACEOF ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then - ac_site_file1=$CONFIG_SITE + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site @@ -2223,7 +2228,11 @@ do { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$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 @@ -2299,7 +2308,7 @@ if $ac_cache_corrupted; then $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## @@ -2317,16 +2326,22 @@ am__api_version='1.11' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do - for ac_t in install-sh install.sh shtool; do - if test -f "$ac_dir/$ac_t"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/$ac_t -c" - break 2 - fi - done + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi done if test -z "$ac_aux_dir"; then - as_fn_error "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 + as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, @@ -2355,7 +2370,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then -if test "${ac_cv_path_install+set}" = set; then : +if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -2442,11 +2457,11 @@ am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) - as_fn_error "unsafe absolute working directory name" "$LINENO" 5;; + 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;; + as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; esac # Do `set' in a subshell so we don't clobber the current shell's @@ -2468,7 +2483,7 @@ if ( # 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 + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi @@ -2478,7 +2493,7 @@ then # Ok. : else - as_fn_error "newly created file is older than distributed files! + as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 @@ -2532,7 +2547,7 @@ if test "$cross_compiling" != no; then set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_STRIP+set}" = set; then : +if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then @@ -2572,7 +2587,7 @@ if test -z "$ac_cv_prog_STRIP"; then set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then @@ -2625,7 +2640,7 @@ INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then - if test "${ac_cv_path_mkdir+set}" = set; then : + if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -2676,7 +2691,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_AWK+set}" = set; then : +if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then @@ -2716,7 +2731,7 @@ done $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF @@ -2724,7 +2739,7 @@ SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +# 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;; @@ -2758,7 +2773,7 @@ if test "`cd $srcdir && pwd`" != "`pwd`"; then 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 + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi @@ -2804,11 +2819,11 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # We need awk for the "check" target. The system "awk" is bad on # some platforms. -# Always define AMTAR for backward compatibility. +# 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}' -AMTAR=${AMTAR-"${am_missing_run}tar"} - -am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' +am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' @@ -2819,27 +2834,27 @@ am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - as_fn_error "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } -if test "${ac_cv_build+set}" = set; then : +if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else 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 + 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 + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; -*) as_fn_error "invalid value of canonical build" "$LINENO" 5;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' @@ -2857,14 +2872,14 @@ case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } -if test "${ac_cv_host+set}" = set; then : +if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else 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 + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi @@ -2872,7 +2887,7 @@ fi $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; -*) as_fn_error "invalid value of canonical host" "$LINENO" 5;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' @@ -2928,7 +2943,7 @@ if test -z "$CXX"; then set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CXX+set}" = set; then : +if ${ac_cv_prog_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then @@ -2972,7 +2987,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then : +if ${ac_cv_prog_ac_ct_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then @@ -3135,9 +3150,8 @@ sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ as_fn_set_status 77 -as_fn_error "C++ compiler cannot create executables -See \`config.log' for more details." "$LINENO" 5; }; } +as_fn_error 77 "C++ compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } @@ -3179,8 +3193,8 @@ done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." "$LINENO" 5; } +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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 @@ -3237,9 +3251,9 @@ $as_echo "$ac_try_echo"; } >&5 else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "cannot run C++ compiled programs. +as_fn_error $? "cannot run C++ compiled programs. If you meant to cross compile, use \`--host'. -See \`config.log' for more details." "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5; } fi fi fi @@ -3250,7 +3264,7 @@ rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } -if test "${ac_cv_objext+set}" = set; then : +if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -3290,8 +3304,8 @@ sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "cannot compute suffix of object files: cannot compile -See \`config.log' for more details." "$LINENO" 5; } +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 @@ -3301,7 +3315,7 @@ OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } -if test "${ac_cv_cxx_compiler_gnu+set}" = set; then : +if ${ac_cv_cxx_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -3338,7 +3352,7 @@ ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } -if test "${ac_cv_prog_cxx_g+set}" = set; then : +if ${ac_cv_prog_cxx_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag @@ -3471,6 +3485,7 @@ 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= @@ -3486,7 +3501,7 @@ depcc="$CXX" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } -if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then : +if ${am_cv_CXX_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then @@ -3495,6 +3510,7 @@ else # 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. @@ -3554,7 +3570,7 @@ else break fi ;; - msvisualcpp | msvcmsys) + 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. @@ -3670,7 +3686,7 @@ if test -n "$ac_tool_prefix"; then set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_RANLIB+set}" = set; then : +if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then @@ -3710,7 +3726,7 @@ if test -z "$ac_cv_prog_RANLIB"; then set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then : +if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then @@ -3772,7 +3788,7 @@ fi $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF @@ -3780,7 +3796,7 @@ SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +# 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;; @@ -3810,7 +3826,7 @@ if test -n "$ac_tool_prefix"; then set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -3850,7 +3866,7 @@ if test -z "$ac_cv_prog_CC"; then set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : +if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -3903,7 +3919,7 @@ if test -z "$CC"; then set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -3943,7 +3959,7 @@ if test -z "$CC"; then set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -4002,7 +4018,7 @@ if test -z "$CC"; then set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -4046,7 +4062,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : +if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -4100,8 +4116,8 @@ fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "no acceptable C compiler found in \$PATH -See \`config.log' for more details." "$LINENO" 5; } +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 @@ -4130,7 +4146,7 @@ done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if test "${ac_cv_c_compiler_gnu+set}" = set; then : +if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4167,7 +4183,7 @@ ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } -if test "${ac_cv_prog_cc_g+set}" = set; then : +if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag @@ -4245,7 +4261,7 @@ else fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if test "${ac_cv_prog_cc_c89+set}" = set; then : +if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no @@ -4344,7 +4360,7 @@ depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } -if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then : +if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then @@ -4353,6 +4369,7 @@ else # 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. @@ -4412,7 +4429,7 @@ else break fi ;; - msvisualcpp | msvcmsys) + 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. @@ -4480,7 +4497,7 @@ if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then : + if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded @@ -4510,7 +4527,7 @@ else # Broken: fails on valid input. continue fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. @@ -4526,11 +4543,11 @@ else ac_preproc_ok=: break fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext +rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi @@ -4569,7 +4586,7 @@ else # Broken: fails on valid input. continue fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. @@ -4585,18 +4602,18 @@ else ac_preproc_ok=: break fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext +rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." "$LINENO" 5; } +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c @@ -4608,7 +4625,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if test "${ac_cv_path_GREP+set}" = set; then : +if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then @@ -4657,7 +4674,7 @@ esac done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then - as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP @@ -4671,7 +4688,7 @@ $as_echo "$ac_cv_path_GREP" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } -if test "${ac_cv_path_EGREP+set}" = set; then : +if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 @@ -4723,7 +4740,7 @@ esac done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then - as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP @@ -4738,7 +4755,7 @@ $as_echo "$ac_cv_path_EGREP" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } -if test "${ac_cv_header_stdc+set}" = set; then : +if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4855,8 +4872,7 @@ do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -4872,7 +4888,7 @@ done # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of off_t" >&5 $as_echo_n "checking size of off_t... " >&6; } -if test "${ac_cv_sizeof_off_t+set}" = set; then : +if ${ac_cv_sizeof_off_t+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off_t))" "ac_cv_sizeof_off_t" "$ac_includes_default"; then : @@ -4881,9 +4897,8 @@ else if test "$ac_cv_type_off_t" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ as_fn_set_status 77 -as_fn_error "cannot compute sizeof (off_t) -See \`config.log' for more details." "$LINENO" 5; }; } +as_fn_error 77 "cannot compute sizeof (off_t) +See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_off_t=0 fi @@ -4906,7 +4921,7 @@ _ACEOF # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of size_t" >&5 $as_echo_n "checking size of size_t... " >&6; } -if test "${ac_cv_sizeof_size_t+set}" = set; then : +if ${ac_cv_sizeof_size_t+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (size_t))" "ac_cv_sizeof_size_t" "$ac_includes_default"; then : @@ -4915,9 +4930,8 @@ else if test "$ac_cv_type_size_t" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ as_fn_set_status 77 -as_fn_error "cannot compute sizeof (size_t) -See \`config.log' for more details." "$LINENO" 5; }; } +as_fn_error 77 "cannot compute sizeof (size_t) +See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_size_t=0 fi @@ -4937,7 +4951,7 @@ _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing openpty" >&5 $as_echo_n "checking for library containing openpty... " >&6; } -if test "${ac_cv_search_openpty+set}" = set; then : +if ${ac_cv_search_openpty+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS @@ -4971,11 +4985,11 @@ for ac_lib in '' util; do fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext - if test "${ac_cv_search_openpty+set}" = set; then : + if ${ac_cv_search_openpty+:} false; then : break fi done -if test "${ac_cv_search_openpty+set}" = set; then : +if ${ac_cv_search_openpty+:} false; then : else ac_cv_search_openpty=no @@ -4993,7 +5007,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gzseek" >&5 $as_echo_n "checking for library containing gzseek... " >&6; } -if test "${ac_cv_search_gzseek+set}" = set; then : +if ${ac_cv_search_gzseek+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS @@ -5027,11 +5041,11 @@ for ac_lib in '' z; do fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext - if test "${ac_cv_search_gzseek+set}" = set; then : + if ${ac_cv_search_gzseek+:} false; then : break fi done -if test "${ac_cv_search_gzseek+set}" = set; then : +if ${ac_cv_search_gzseek+:} false; then : else ac_cv_search_gzseek=no @@ -5046,12 +5060,12 @@ if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" else - as_fn_error "libz required to build" "$LINENO" 5 + as_fn_error $? "libz required to build" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing BZ2_bzopen" >&5 $as_echo_n "checking for library containing BZ2_bzopen... " >&6; } -if test "${ac_cv_search_BZ2_bzopen+set}" = set; then : +if ${ac_cv_search_BZ2_bzopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS @@ -5085,11 +5099,11 @@ for ac_lib in '' bz2; do fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext - if test "${ac_cv_search_BZ2_bzopen+set}" = set; then : + if ${ac_cv_search_BZ2_bzopen+:} false; then : break fi done -if test "${ac_cv_search_BZ2_bzopen+set}" = set; then : +if ${ac_cv_search_BZ2_bzopen+:} false; then : else ac_cv_search_BZ2_bzopen=no @@ -5107,7 +5121,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5 $as_echo_n "checking for library containing dlopen... " >&6; } -if test "${ac_cv_search_dlopen+set}" = set; then : +if ${ac_cv_search_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS @@ -5141,11 +5155,11 @@ for ac_lib in '' dl; do fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext - if test "${ac_cv_search_dlopen+set}" = set; then : + if ${ac_cv_search_dlopen+:} false; then : break fi done -if test "${ac_cv_search_dlopen+set}" = set; then : +if ${ac_cv_search_dlopen+:} false; then : else ac_cv_search_dlopen=no @@ -5165,7 +5179,7 @@ fi # Sometimes, curses depends on these libraries being linked in... { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing cur_term" >&5 $as_echo_n "checking for library containing cur_term... " >&6; } -if test "${ac_cv_search_cur_term+set}" = set; then : +if ${ac_cv_search_cur_term+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS @@ -5199,11 +5213,11 @@ for ac_lib in '' tinfo; do fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext - if test "${ac_cv_search_cur_term+set}" = set; then : + if ${ac_cv_search_cur_term+:} false; then : break fi done -if test "${ac_cv_search_cur_term+set}" = set; then : +if ${ac_cv_search_cur_term+:} false; then : else ac_cv_search_cur_term=no @@ -5221,7 +5235,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing Gpm_Open" >&5 $as_echo_n "checking for library containing Gpm_Open... " >&6; } -if test "${ac_cv_search_Gpm_Open+set}" = set; then : +if ${ac_cv_search_Gpm_Open+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS @@ -5255,11 +5269,11 @@ for ac_lib in '' gpm; do fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext - if test "${ac_cv_search_Gpm_Open+set}" = set; then : + if ${ac_cv_search_Gpm_Open+:} false; then : break fi done -if test "${ac_cv_search_Gpm_Open+set}" = set; then : +if ${ac_cv_search_Gpm_Open+:} false; then : else ac_cv_search_Gpm_Open=no @@ -5280,8 +5294,7 @@ for ac_header in pty.h util.h zlib.h bzlib.h libutil.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -5327,7 +5340,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NcursesW wide-character library" >&5 $as_echo_n "checking for NcursesW wide-character library... " >&6; } -if test "${ax_cv_ncursesw+set}" = set; then : +if ${ax_cv_ncursesw+:} false; then : $as_echo_n "(cached) " >&6 else @@ -5362,7 +5375,7 @@ fi $as_echo "$ax_cv_ncursesw" >&6; } if test "x$ax_cv_ncursesw" = xno && test "x$with_ncursesw" = xyes; then : - as_fn_error "--with-ncursesw specified but could not find NcursesW library" "$LINENO" 5 + as_fn_error $? "--with-ncursesw specified but could not find NcursesW library" "$LINENO" 5 fi @@ -5380,7 +5393,7 @@ $as_echo "#define HAVE_CURSES 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working ncursesw/curses.h" >&5 $as_echo_n "checking for working ncursesw/curses.h... " >&6; } -if test "${ax_cv_header_ncursesw_curses_h+set}" = set; then : +if ${ax_cv_header_ncursesw_curses_h+:} false; then : $as_echo_n "(cached) " >&6 else @@ -5444,7 +5457,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working ncursesw.h" >&5 $as_echo_n "checking for working ncursesw.h... " >&6; } -if test "${ax_cv_header_ncursesw_h+set}" = set; then : +if ${ax_cv_header_ncursesw_h+:} false; then : $as_echo_n "(cached) " >&6 else @@ -5508,7 +5521,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working ncurses.h" >&5 $as_echo_n "checking for working ncurses.h... " >&6; } -if test "${ax_cv_header_ncurses_h_with_ncursesw+set}" = set; then : +if ${ax_cv_header_ncurses_h_with_ncursesw+:} false; then : $as_echo_n "(cached) " >&6 else @@ -5589,7 +5602,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Ncurses library" >&5 $as_echo_n "checking for Ncurses library... " >&6; } -if test "${ax_cv_ncurses+set}" = set; then : +if ${ax_cv_ncurses+:} false; then : $as_echo_n "(cached) " >&6 else @@ -5624,7 +5637,7 @@ fi $as_echo "$ax_cv_ncurses" >&6; } if test "x$ax_cv_ncurses" = xno && test "x$with_ncurses" = xyes; then : - as_fn_error "--with-ncurses specified but could not find Ncurses library" "$LINENO" 5 + as_fn_error $? "--with-ncurses specified but could not find Ncurses library" "$LINENO" 5 fi @@ -5642,7 +5655,7 @@ $as_echo "#define HAVE_CURSES 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working ncurses/curses.h" >&5 $as_echo_n "checking for working ncurses/curses.h... " >&6; } -if test "${ax_cv_header_ncurses_curses_h+set}" = set; then : +if ${ax_cv_header_ncurses_curses_h+:} false; then : $as_echo_n "(cached) " >&6 else @@ -5696,7 +5709,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working ncurses.h" >&5 $as_echo_n "checking for working ncurses.h... " >&6; } -if test "${ax_cv_header_ncurses_h+set}" = set; then : +if ${ax_cv_header_ncurses_h+:} false; then : $as_echo_n "(cached) " >&6 else @@ -5775,7 +5788,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Curses library" >&5 $as_echo_n "checking for Curses library... " >&6; } -if test "${ax_cv_plaincurses+set}" = set; then : +if ${ax_cv_plaincurses+:} false; then : $as_echo_n "(cached) " >&6 else @@ -5826,7 +5839,7 @@ $as_echo "#define HAVE_CURSES 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working curses.h" >&5 $as_echo_n "checking for working curses.h... " >&6; } -if test "${ax_cv_header_curses_h+set}" = set; then : +if ${ax_cv_header_curses_h+:} false; then : $as_echo_n "(cached) " >&6 else @@ -5868,7 +5881,7 @@ $as_echo "#define HAVE_CURSES_H 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X/Open Enhanced Curses conformance" >&5 $as_echo_n "checking for X/Open Enhanced Curses conformance... " >&6; } -if test "${ax_cv_plaincurses_enhanced+set}" = set; then : +if ${ax_cv_plaincurses_enhanced+:} false; then : $as_echo_n "(cached) " >&6 else @@ -5929,7 +5942,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Curses color functions" >&5 $as_echo_n "checking for Curses color functions... " >&6; } -if test "${ax_cv_plaincurses_color+set}" = set; then : +if ${ax_cv_plaincurses_color+:} false; then : $as_echo_n "(cached) " >&6 else @@ -5977,7 +5990,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for obsolete Curses functions" >&5 $as_echo_n "checking for obsolete Curses functions... " >&6; } -if test "${ax_cv_plaincurses_obsolete+set}" = set; then : +if ${ax_cv_plaincurses_obsolete+:} false; then : $as_echo_n "(cached) " >&6 else @@ -6061,13 +6074,13 @@ fi if test ".$with_pcre" = ".no" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 $as_echo "disabled" >&6; } - as_fn_error "pcre required to build" "$LINENO" 5 + as_fn_error $? "pcre required to build" "$LINENO" 5 else { $as_echo "$as_me:${as_lineno-$LINENO}: result: (testing)" >&5 $as_echo "(testing)" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pcre_study in -lpcre" >&5 $as_echo_n "checking for pcre_study in -lpcre... " >&6; } -if test "${ac_cv_lib_pcre_pcre_study+set}" = set; then : +if ${ac_cv_lib_pcre_pcre_study+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -6101,7 +6114,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pcre_pcre_study" >&5 $as_echo "$ac_cv_lib_pcre_pcre_study" >&6; } -if test "x$ac_cv_lib_pcre_pcre_study" = x""yes; then : +if test "x$ac_cv_lib_pcre_pcre_study" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBPCRE 1 _ACEOF @@ -6114,8 +6127,7 @@ fi do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -6136,7 +6148,7 @@ $as_echo "$PCRE_LIBS" >&6; } OLDCPPFLAGS="$CPPFLAGS" ; CPPFLAGS="$CPPFLAGS -I$with_pcre/include" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pcre_compile in -lpcre" >&5 $as_echo_n "checking for pcre_compile in -lpcre... " >&6; } -if test "${ac_cv_lib_pcre_pcre_compile+set}" = set; then : +if ${ac_cv_lib_pcre_pcre_compile+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -6170,7 +6182,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pcre_pcre_compile" >&5 $as_echo "$ac_cv_lib_pcre_pcre_compile" >&6; } -if test "x$ac_cv_lib_pcre_pcre_compile" = x""yes; then : +if test "x$ac_cv_lib_pcre_pcre_compile" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBPCRE 1 _ACEOF @@ -6197,7 +6209,7 @@ $as_echo "$PCRE_LIBS" >&6; } $as_echo_n "checking lib pcre... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, (WARNING)" >&5 $as_echo "no, (WARNING)" >&6; } - as_fn_error "pcre required to build" "$LINENO" 5 + as_fn_error $? "pcre required to build" "$LINENO" 5 fi fi fi @@ -6217,13 +6229,13 @@ fi if test ".$with_readline" = ".no" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 $as_echo "disabled" >&6; } - as_fn_error "readline required to build" "$LINENO" 5 + as_fn_error $? "readline required to build" "$LINENO" 5 else if test ".$with_readline" = ".yes"; then OLD_LIBS="$LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for readline in -lreadline" >&5 $as_echo_n "checking for readline in -lreadline... " >&6; } -if test "${ac_cv_lib_readline_readline+set}" = set; then : +if ${ac_cv_lib_readline_readline+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -6257,7 +6269,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_readline_readline" >&5 $as_echo "$ac_cv_lib_readline_readline" >&6; } -if test "x$ac_cv_lib_readline_readline" = x""yes; then : +if test "x$ac_cv_lib_readline_readline" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBREADLINE 1 _ACEOF @@ -6279,7 +6291,7 @@ $as_echo "$READLINE_LIBS" >&6; } $as_echo_n "checking lib readline... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, (WARNING)" >&5 $as_echo "no, (WARNING)" >&6; } - as_fn_error "readline required to build" "$LINENO" 5 + as_fn_error $? "readline required to build" "$LINENO" 5 fi else LIBS="$LIBS $with_readline/lib/libreadline.a" @@ -6288,8 +6300,7 @@ $as_echo "no, (WARNING)" >&6; } do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -6546,10 +6557,21 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then - test "x$cache_file" != "x/dev/null" && + if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} - cat confcache >$cache_file + 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 { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} @@ -6565,6 +6587,7 @@ 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$//' @@ -6588,19 +6611,19 @@ else fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then - as_fn_error "conditional \"AMDEP\" was never defined. + as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then - as_fn_error "conditional \"am__fastdepCXX\" was never defined. + as_fn_error $? "conditional \"am__fastdepCXX\" 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. + 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} +: "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" @@ -6701,6 +6724,7 @@ fi IFS=" "" $as_nl" # 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 @@ -6746,19 +6770,19 @@ export LANGUAGE (unset CDPATH) >/dev/null 2>&1 && unset CDPATH -# as_fn_error ERROR [LINENO LOG_FD] -# --------------------------------- +# 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. +# script with STATUS, using 1 if that was 0. as_fn_error () { - as_status=$?; test $as_status -eq 0 && as_status=1 - if test "$3"; then - as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $1" >&2 + $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error @@ -6954,7 +6978,7 @@ $as_echo X"$as_dir" | 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" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p @@ -7008,7 +7032,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # values after options handling. ac_log=" This file was extended by lnav $as_me 0.4.0, which was -generated by GNU Autoconf 2.65. Invocation command line was +generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -7074,10 +7098,10 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ lnav config.status 0.4.0 -configured by $0, generated by GNU Autoconf 2.65, +configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" -Copyright (C) 2009 Free Software Foundation, Inc. +Copyright (C) 2010 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -7095,11 +7119,16 @@ 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 @@ -7121,6 +7150,7 @@ do $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; @@ -7133,7 +7163,7 @@ do ac_need_defaults=false;; --he | --h) # Conflict between --help and --header - as_fn_error "ambiguous option: \`$1' + as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; @@ -7142,7 +7172,7 @@ Try \`$0 --help' for more information.";; ac_cs_silent=: ;; # This is an error. - -*) as_fn_error "unrecognized option: \`$1' + -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" @@ -7203,7 +7233,7 @@ do "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "test/Makefile") CONFIG_FILES="$CONFIG_FILES test/Makefile" ;; - *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done @@ -7226,9 +7256,10 @@ fi # after its creation but before its name has been assigned to `$tmp'. $debug || { - tmp= + tmp= ac_tmp= trap 'exit_status=$? - { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $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 } @@ -7236,12 +7267,13 @@ $debug || { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" + test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") -} || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5 +} || 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. @@ -7258,12 +7290,12 @@ if test "x$ac_cr" = x; then 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' + ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi -echo 'BEGIN {' >"$tmp/subs1.awk" && +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF @@ -7272,18 +7304,18 @@ _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 '$'` + 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 + 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 + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi @@ -7291,7 +7323,7 @@ done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$tmp/subs1.awk" <<\\_ACAWK && +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h @@ -7339,7 +7371,7 @@ t delim rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK -cat >>"\$tmp/subs1.awk" <<_ACAWK && +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" @@ -7371,21 +7403,29 @@ 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 < "$tmp/subs1.awk" > "$tmp/subs.awk" \ - || as_fn_error "could not setup config files machinery" "$LINENO" 5 +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 $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# 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[ ]*=/{ -s/:*\$(srcdir):*/:/ -s/:*\${srcdir}:*/:/ -s/:*@srcdir@:*/:/ -s/^\([^=]*=[ ]*\):*/\1/ + 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 @@ -7397,7 +7437,7 @@ fi # test -n "$CONFIG_FILES" # 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 >"$tmp/defines.awk" <<\_ACAWK || +cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF @@ -7409,11 +7449,11 @@ _ACEOF # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do - ac_t=`sed -n "/$ac_delim/p" confdefs.h` - if test -z "$ac_t"; then + 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 + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi @@ -7498,7 +7538,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - as_fn_error "could not setup config headers machinery" "$LINENO" 5 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" @@ -7511,7 +7551,7 @@ do esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) as_fn_error "invalid tag \`$ac_tag'" "$LINENO" 5;; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac @@ -7530,7 +7570,7 @@ do for ac_f do case $ac_f in - -) ac_f="$tmp/stdin";; + -) 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 `:'. @@ -7539,7 +7579,7 @@ do [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - as_fn_error "cannot find input file: \`$ac_f'" "$LINENO" 5;; + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" @@ -7565,8 +7605,8 @@ $as_echo "$as_me: creating $ac_file" >&6;} esac case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin" \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 ;; + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac @@ -7702,23 +7742,24 @@ 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 "$tmp/subs.awk" >$tmp/out \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 +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' "$tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&5 +which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&2;} +which seems to be undefined. Please make sure it is defined" >&2;} - rm -f "$tmp/stdin" + rm -f "$ac_tmp/stdin" case $ac_file in - -) cat "$tmp/out" && rm -f "$tmp/out";; - *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; + -) 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 + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # @@ -7727,21 +7768,21 @@ which seems to be undefined. Please make sure it is defined." >&2;} if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" - } >"$tmp/config.h" \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 - if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" - mv "$tmp/config.h" "$ac_file" \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ - || as_fn_error "could not create -" "$LINENO" 5 + && 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" @@ -7891,7 +7932,7 @@ _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || - as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5 + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. @@ -7912,7 +7953,7 @@ if test "$no_create" != yes; then 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 $? + $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 diff --git a/src/Makefile.in b/src/Makefile.in index 421b6188..d7ee9b29 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -328,10 +328,8 @@ $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__aclocal_m4_deps): config.h: stamp-h1 - @if test ! -f $@; then \ - rm -f stamp-h1; \ - $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ - else :; fi + @if test ! -f $@; then rm -f stamp-h1; else :; fi + @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 @@ -346,7 +344,7 @@ distclean-hdr: clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) -libdiag.a: $(libdiag_a_OBJECTS) $(libdiag_a_DEPENDENCIES) +libdiag.a: $(libdiag_a_OBJECTS) $(libdiag_a_DEPENDENCIES) $(EXTRA_libdiag_a_DEPENDENCIES) -rm -f libdiag.a $(libdiag_a_AR) libdiag.a $(libdiag_a_OBJECTS) $(libdiag_a_LIBADD) $(RANLIB) libdiag.a @@ -387,10 +385,10 @@ uninstall-binPROGRAMS: clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) -bin2c$(EXEEXT): $(bin2c_OBJECTS) $(bin2c_DEPENDENCIES) +bin2c$(EXEEXT): $(bin2c_OBJECTS) $(bin2c_DEPENDENCIES) $(EXTRA_bin2c_DEPENDENCIES) @rm -f bin2c$(EXEEXT) $(LINK) $(bin2c_OBJECTS) $(bin2c_LDADD) $(LIBS) -lnav$(EXEEXT): $(lnav_OBJECTS) $(lnav_DEPENDENCIES) +lnav$(EXEEXT): $(lnav_OBJECTS) $(lnav_DEPENDENCIES) $(EXTRA_lnav_DEPENDENCIES) @rm -f lnav$(EXEEXT) $(CXXLINK) $(lnav_OBJECTS) $(lnav_LDADD) $(LIBS) @@ -549,10 +547,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/src/hist_source.cc b/src/hist_source.cc index ffba8911..fa860adb 100644 --- a/src/hist_source.cc +++ b/src/hist_source.cc @@ -11,6 +11,7 @@ using namespace std; hist_source::hist_source() : hs_bucket_size(1), hs_group_size(100), + hs_analyzed(false), hs_label_source(NULL), hs_token_bucket(NULL) { } @@ -23,6 +24,8 @@ void hist_source::text_value_for_line(textview_curses &tc, int grow = row / (this->buckets_per_group() + 1); int brow = row % (this->buckets_per_group() + 1); + assert(this->hs_analyzed); + if (brow == 0) { unsigned long width; vis_line_t height; @@ -56,6 +59,8 @@ void hist_source::text_attrs_for_line(textview_curses &tc, int row, string_attrs_t &value_out) { + assert(this->hs_analyzed); + if (this->hs_token_bucket != NULL) { view_colors &vc = view_colors::singleton(); unsigned long width, avail_width; @@ -92,10 +97,14 @@ void hist_source::text_attrs_for_line(textview_curses &tc, } } -void hist_source::add_value(int value, bucket_type_t bt, bucket_count_t amount) +void hist_source::add_value(unsigned int value, + bucket_type_t bt, + bucket_count_t amount) { bucket_group_t bg; + this->hs_analyzed = false; + bg = bucket_group_t(value / this->hs_group_size); bucket_array_t &ba = this->hs_groups[bg]; @@ -104,7 +113,7 @@ void hist_source::add_value(int value, bucket_type_t bt, bucket_count_t amount) ba.resize(this->buckets_per_group()); } - bucket_count_t &bc = ba[abs(value % this->hs_group_size) / + bucket_count_t &bc = ba[(value % this->hs_group_size) / this->hs_bucket_size][bt]; bc += amount; @@ -146,4 +155,6 @@ void hist_source::analyze(void) } sort(this->hs_group_keys.begin(), this->hs_group_keys.end()); + + this->hs_analyzed = true; } diff --git a/src/hist_source.hh b/src/hist_source.hh index c98b2240..90758187 100644 --- a/src/hist_source.hh +++ b/src/hist_source.hh @@ -1,3 +1,7 @@ +/** + * @file hist_source.hh + */ + #ifndef __hist_source_hh #define __hist_source_hh @@ -10,14 +14,34 @@ typedef float bucket_count_t; +/** Type for indexes into a group of buckets. */ STRONG_INT_TYPE(int, bucket_group); + +/** Type used to differentiate values added to the same row in the histogram */ STRONG_INT_TYPE(int, bucket_type); +/** + * A text source that displays data as a histogram using horizontal bars. Data + * is added to the histogram using the add_value() method. Once all of the + * values have been added, the analyze() method needs to be called to analyze + * the data so that it can be displayed. + * + * For example, if the values (7, 3, 4, 2) were added, they would be displayed + * like so: + * + * ****** + * *** + * **** + * ** + */ class hist_source : public text_sub_source { public: typedef std::map bucket_t; + /** + * Source for labels on each bucket and group. + */ class label_source { public: virtual ~label_source() { }; @@ -33,11 +57,18 @@ public: hist_source(); virtual ~hist_source() { }; - void set_bucket_size(int bs) { this->hs_bucket_size = bs; }; - int get_bucket_size(void) const { return this->hs_bucket_size; }; + void set_bucket_size(unsigned int bs) { + assert(bs > 0); - void set_group_size(int gs) { this->hs_group_size = gs; }; - int get_group_size(void) const { return this->hs_group_size; }; + this->hs_bucket_size = bs; + }; + unsigned int get_bucket_size(void) const { return this->hs_bucket_size; }; + + void set_group_size(unsigned int gs) { + assert(gs > 0); + this->hs_group_size = gs; + }; + unsigned int get_group_size(void) const { return this->hs_group_size; }; void set_label_source(label_source *hls) { @@ -118,7 +149,16 @@ public: return retval; }; - void add_value(int value, bucket_type_t bt, bucket_count_t amount = 1.0); + /** + * Add a value to the histogram. + * + * @param value The row in the histogram. + * @param bt The type of data. + * @param amount The amount to add to this row in the histogram. + */ + void add_value(unsigned int value, + bucket_type_t bt, + bucket_count_t amount = 1.0); void analyze(void); protected: @@ -129,10 +169,12 @@ protected: std::map hs_groups; std::vector hs_group_keys; - int hs_bucket_size; /* hours */ - int hs_group_size; /* days */ + unsigned int hs_bucket_size; /* hours */ + unsigned int hs_group_size; /* days */ bucket_count_t hs_min_count; bucket_count_t hs_max_count; + /** Indicates that all of the data has been analyze()'d. */ + bool hs_analyzed; label_source *hs_label_source; bucket_t *hs_token_bucket; diff --git a/src/line_buffer.cc b/src/line_buffer.cc index f47664c8..bee8320a 100644 --- a/src/line_buffer.cc +++ b/src/line_buffer.cc @@ -191,6 +191,10 @@ throw (error) throw error(EFBIG); } + /* + * Check to see if the start is inside the cached range or immediately + * after. + */ if (start < this->lb_file_offset || start > (off_t)(this->lb_file_offset + this->lb_buffer_size)) { /* @@ -198,6 +202,7 @@ throw (error) * whole thing. */ prefill = 0; + this->lb_buffer_size = 0; if ((this->lb_file_size != (size_t)-1) && (start + this->lb_buffer_max > this->lb_file_size)) { /* @@ -210,10 +215,11 @@ throw (error) else { this->lb_file_offset = start; } - this->lb_buffer_size = 0; } else { - /* The request is in the cached range. */ + /* The request is in the cached range. Record how much extra data is in + * the buffer before the requested range. + */ prefill = start - this->lb_file_offset; } assert(this->lb_file_offset <= start); diff --git a/src/line_buffer.hh b/src/line_buffer.hh index 1b72f3d1..c8ce45c6 100644 --- a/src/line_buffer.hh +++ b/src/line_buffer.hh @@ -87,6 +87,7 @@ public: { this->lb_file_offset += this->lb_buffer_size; this->lb_buffer_size = 0; + this->lb_file_size = -1; }; /** Release any resources held by this object. */ @@ -170,9 +171,9 @@ private: }; auto_fd lb_fd; /*< The file to read data from. */ - gzFile lb_gz_file; - bool lb_bz_file; - off_t lb_gz_offset; + gzFile lb_gz_file; /*< File handle for gzipped files. */ + bool lb_bz_file; /*< Flag set for bzip2 compressed files. */ + off_t lb_gz_offset; /*< The offset into the compressed file. */ auto_mem lb_buffer; /*< The internal buffer where data is cached */ @@ -187,7 +188,7 @@ private: */ size_t lb_buffer_size; /*< The amount of cached data in the buffer. */ size_t lb_buffer_max; /*< The size of the buffer memory. */ - bool lb_seekable; + bool lb_seekable; /*< Flag set for seekable file descriptors. */ }; #endif diff --git a/src/listview_curses.cc b/src/listview_curses.cc index 6c059f17..8bf7765f 100644 --- a/src/listview_curses.cc +++ b/src/listview_curses.cc @@ -26,6 +26,7 @@ void listview_curses::reload_data(void) { if (this->lv_source == NULL) { this->lv_top = vis_line_t(0); + this->lv_left = 0; } else if (this->lv_top >= this->get_inner_height()) { this->lv_top = max(vis_line_t(0), diff --git a/src/listview_curses.hh b/src/listview_curses.hh index 950fed42..913a47d6 100644 --- a/src/listview_curses.hh +++ b/src/listview_curses.hh @@ -13,7 +13,7 @@ #include "strong_int.hh" #include "view_curses.hh" -/** Strongly-typed for lines to be displayed. */ +/** Strongly-typed integer for visible lines. */ STRONG_INT_TYPE(int, vis_line); class listview_curses; @@ -56,9 +56,7 @@ public: void set_data_source(list_data_source *src) { this->lv_source = src; - if (this->lv_source != NULL) { - this->reload_data(); - } + this->reload_data(); }; /** @return The data source delegate. */ @@ -85,14 +83,14 @@ public: /** @return The curses window this view is attached to. */ WINDOW *get_window() { return this->lv_window; }; - void set_y(int y) + void set_y(unsigned int y) { if (y != this->lv_y) { this->lv_y = y; this->lv_needs_update = true; } }; - int get_y() { return this->lv_y; }; + unsigned int get_y() { return this->lv_y; }; /** * Set the line number to be displayed at the top of the view. If the @@ -100,11 +98,13 @@ public: * new value will be set and the scroll action called. * * @param top The new value for top. + * @param suppress_flash Don't call flash() if the top is out-of-bounds. */ - void set_top(vis_line_t top) + void set_top(vis_line_t top, bool suppress_flash = false) { if (top < 0 || (top > 0 && top >= this->get_inner_height())) { - flash(); + if (!suppress_flash) + flash(); } else if (this->lv_top != top) { this->lv_top = top; @@ -116,6 +116,7 @@ public: /** @return The line number that is displayed at the top. */ vis_line_t get_top() { return this->lv_top; }; + /** @return The line number that is displayed at the bottom. */ vis_line_t get_bottom() { vis_line_t retval, height; @@ -132,15 +133,17 @@ public: * Shift the value of top by the given value. * * @param offset The amount to change top by. + * @param suppress_flash Don't call flash() if the offset is out-of-bounds. * @return The final value of top. */ - vis_line_t shift_top(vis_line_t offset) + vis_line_t shift_top(vis_line_t offset, bool suppress_flash = false) { if (offset < 0 && this->lv_top == 0) { - flash(); + if (suppress_flash == false) + flash(); } else { - this->set_top(std::max(vis_line_t(0), this->lv_top + offset)); + this->set_top(std::max(vis_line_t(0), this->lv_top + offset), suppress_flash); } return this->lv_top; @@ -154,9 +157,9 @@ public: * * @param left The new value for left. */ - void set_left(int left) + void set_left(unsigned int left) { - if (left >= 0 && this->lv_left != left) { + if (this->lv_left != left) { this->lv_left = left; this->lv_scroll.invoke(this); this->lv_needs_update = true; @@ -164,7 +167,7 @@ public: }; /** @return The column number that is displayed at the left. */ - int get_left() { return this->lv_left; }; + unsigned int get_left() { return this->lv_left; }; /** * Shift the value of left by the given value. @@ -172,9 +175,14 @@ public: * @param offset The amount to change top by. * @return The final value of top. */ - int shift_left(int offset) + unsigned int shift_left(int offset) { - this->set_left(std::max(0, this->lv_left + offset)); + if (offset < 0 && this->lv_left < (unsigned int)-offset) { + this->set_left(0); + } + else { + this->set_left(this->lv_left + offset); + } return this->lv_left; }; @@ -197,10 +205,11 @@ public: /** @return The absolute or relative height of the window. */ vis_line_t get_height() { return this->lv_height; }; - int get_inner_height() const + /** @return The number of rows of data in this view's source data. */ + vis_line_t get_inner_height() const { - return this->lv_source == NULL ? 0 : - this->lv_source->listview_rows(*this); + return vis_line_t(this->lv_source == NULL ? 0 : + this->lv_source->listview_rows(*this)); }; void set_needs_update() { this->lv_needs_update = true; }; @@ -244,12 +253,14 @@ protected: list_data_source *lv_source; /*< The data source delegate. */ action lv_scroll; /*< The scroll action. */ WINDOW *lv_window; /*< The window that contains this view. */ - int lv_y; + unsigned int lv_y; /*< The y offset of this view. */ vis_line_t lv_top; /*< The line at the top of the view. */ - int lv_left; /*< The column at the left of the view. */ + unsigned int lv_left; /*< The column at the left of the view. */ vis_line_t lv_height; /*< The abs/rel height of the view. */ - bool lv_needs_update; - bool lv_show_scrollbar; + bool lv_needs_update; /*< Flag to indicate if a display update + * is needed. + */ + bool lv_show_scrollbar; /*< Draw the scrollbar in the view. */ }; #endif diff --git a/src/lnav.cc b/src/lnav.cc index 1b133f58..fe4cdc4c 100644 --- a/src/lnav.cc +++ b/src/lnav.cc @@ -1262,7 +1262,6 @@ static void handle_paging_key(int ch) if (sscanf(dls.dls_rows[db_row][lpc].c_str(), "%d", &line_number) && - line_number >= 0 && line_number < tc->listview_rows(*tc)) { tc = &lnav_data.ld_views[LNV_LOG]; tc->set_top(vis_line_t(line_number)); @@ -2267,20 +2266,24 @@ public: if (lss) { if (this->lb_selection_start == vis_line_t(-1)) { this->lb_selection_start = vis_y; - - lss->toggle_user_mark(&textview_curses::BM_USER, - this->lb_selection_start, - vis_y); + this->lb_selection_last = vis_line_t(-1); } else { - lss->toggle_user_mark(&textview_curses::BM_USER, - this->lb_selection_start, - this->lb_selection_last); - lss->toggle_user_mark(&textview_curses::BM_USER, - this->lb_selection_start, - vis_y); + if (this->lb_selection_last != vis_line_t(-1)) { + lss->toggle_user_mark(&textview_curses::BM_USER, + this->lb_selection_start, + this->lb_selection_last); + } + if (this->lb_selection_start == vis_y) { + this->lb_selection_last = vis_line_t(-1); + } + else { + lss->toggle_user_mark(&textview_curses::BM_USER, + this->lb_selection_start, + vis_y); + this->lb_selection_last = vis_y; + } } - this->lb_selection_last = vis_y; tc->reload_data(); } break; @@ -2297,7 +2300,8 @@ public: timersub(&now, &this->lb_last_scroll_time, &scroll_diff); if (scroll_diff.tv_usec > 50000) { tc->shift_top(vis_line_t(this->scroll_polarity(button) * - this->lb_scroll_repeat)); + this->lb_scroll_repeat), + true); this->lb_scroll_repeat = 0; } else { @@ -2307,11 +2311,11 @@ public: else { this->lb_scroll_repeat = 1; this->lb_last_scroll_time = now; - tc->shift_top(vis_line_t(this->scroll_polarity(button))); + tc->shift_top(vis_line_t(this->scroll_polarity(button)), true); } } else { - tc->shift_top(vis_line_t(this->scroll_polarity(button))); + tc->shift_top(vis_line_t(this->scroll_polarity(button)), true); } break; } diff --git a/src/log_format.cc b/src/log_format.cc index 28d1b703..4be909bf 100644 --- a/src/log_format.cc +++ b/src/log_format.cc @@ -26,7 +26,7 @@ using namespace std; static time_t BAD_DATE = -1; -static time_t tm2sec(const struct tm *t) +time_t tm2sec(const struct tm *t) { int year; time_t days; @@ -57,6 +57,8 @@ static time_t tm2sec(const struct tm *t) return BAD_DATE; } /* must have overflowed */ else { + if (t->tm_zone) + days -= t->tm_gmtoff; return days; } /* must be a valid time */ } diff --git a/src/log_format.hh b/src/log_format.hh index 4c04e446..cb5dd7cb 100644 --- a/src/log_format.hh +++ b/src/log_format.hh @@ -152,4 +152,12 @@ protected: int lf_time_fmt_lock; }; +/** + * Convert the time stored in a 'tm' struct into epoch time. + * + * @param t The 'tm' structure to convert to epoch time. + * @return The given time in seconds since the epoch. + */ +time_t tm2sec(const struct tm *t); + #endif diff --git a/src/log_format_impls.cc b/src/log_format_impls.cc index c09a083f..9bae8c93 100644 --- a/src/log_format_impls.cc +++ b/src/log_format_impls.cc @@ -141,10 +141,15 @@ class tcsh_history_format : public log_format { struct tm log_tm; log_time = log_time_int; + /* + * NB: We convert any displayed dates to gm time, so we need to + * convert this time to local and then back to gmt. + */ memset(&log_tm, 0, sizeof(log_tm)); log_tm = *localtime( &log_time); - + log_tm.tm_zone = NULL; log_tm.tm_isdst = 0; + dst.push_back(logline(offset, tm2sec(&log_tm), 0, diff --git a/src/logfile.cc b/src/logfile.cc index 74bb6345..4d42bb8d 100644 --- a/src/logfile.cc +++ b/src/logfile.cc @@ -171,8 +171,6 @@ throw (line_buffer::error) } } - this->lf_line_buffer.invalidate(); - /* * The file can still grow between the above fstat and when we're * doing the scanning, so use the line buffer's notion of the file @@ -180,6 +178,8 @@ throw (line_buffer::error) */ this->lf_index_size = this->lf_line_buffer.get_file_size(); + this->lf_line_buffer.invalidate(); + retval = true; } diff --git a/src/piper_proc.cc b/src/piper_proc.cc index 3da23ea6..53e0307c 100644 --- a/src/piper_proc.cc +++ b/src/piper_proc.cc @@ -1,3 +1,6 @@ +/** + * @file piper_proc.cc + */ #include "config.h" diff --git a/src/piper_proc.hh b/src/piper_proc.hh index f132ad61..e2d25abb 100644 --- a/src/piper_proc.hh +++ b/src/piper_proc.hh @@ -1,3 +1,6 @@ +/** + * @file piper_proc.hh + */ #ifndef __piper_proc_hh #define __piper_proc_hh diff --git a/src/statusview_curses.hh b/src/statusview_curses.hh index 6d675566..cd54d099 100644 --- a/src/statusview_curses.hh +++ b/src/statusview_curses.hh @@ -118,20 +118,30 @@ protected: view_colors::role_t sf_role; /*< The color role for this field. */ }; -class telltale_field : public status_field { - -public: - -}; - +/** + * Data source for the fields to be displayed in a status view. + */ class status_data_source { public: virtual ~status_data_source() { }; + /** + * @return The number of status_fields in this source. + */ virtual size_t statusview_fields(void) = 0; + + /** + * Callback used to get a particular field. + * + * @param field The index of the field to return. + * @return A reference to the field at the given index. + */ virtual status_field &statusview_value_for_field(int field) = 0; }; +/** + * A view that displays a collection of fields in a line on the display. + */ class statusview_curses : public view_curses { public: diff --git a/src/termios_guard.hh b/src/termios_guard.hh index 3a6a71f6..00a5c4da 100644 --- a/src/termios_guard.hh +++ b/src/termios_guard.hh @@ -5,6 +5,10 @@ #ifndef __termios_guard_hh #define __termios_guard_hh +#include +#include +#include + /** * RAII class that saves the current termios for a tty and then restores them * during destruction. diff --git a/src/view_curses.cc b/src/view_curses.cc index 3e356e5d..3024104a 100644 --- a/src/view_curses.cc +++ b/src/view_curses.cc @@ -24,6 +24,8 @@ void view_curses::mvwattrline(WINDOW *window, std::vector tab_list; char *buffer; + assert(lr.lr_end != -1); + line_width = lr.length(); buffer = (char *)alloca(line_width + 1); diff --git a/src/view_curses.hh b/src/view_curses.hh index 67c5cb29..c471c095 100644 --- a/src/view_curses.hh +++ b/src/view_curses.hh @@ -5,6 +5,8 @@ #ifndef __view_curses_hh #define __view_curses_hh +#include "config.h" + #include #include #include diff --git a/test/Makefile.am b/test/Makefile.am index ad05ae35..b2589c6f 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -15,6 +15,7 @@ check_PROGRAMS = \ drive_listview \ drive_logfile \ drive_sequencer \ + drive_view_colors \ drive_vt52_curses \ drive_readline_curses \ slicer \ @@ -23,6 +24,7 @@ check_PROGRAMS = \ test_auto_mem \ test_bookmarks \ test_grep_proc2 \ + test_hist_source \ test_line_buffer2 \ test_pcrepp \ test_top_status @@ -44,6 +46,12 @@ test_grep_proc2_SOURCES = \ test_grep_proc2.cc test_grep_proc2_LDADD = $(PCRE_LIBS) -lz +test_hist_source_SOURCES = \ + ../src/hist_source.cc \ + ../src/view_curses.cc \ + test_hist_source.cc +test_hist_source_LDADD = $(CURSES_LIB) -lz + test_line_buffer2_SOURCES = \ ../src/line_buffer.cc \ test_line_buffer2.cc @@ -102,6 +110,11 @@ drive_data_scanner_SOURCES = \ ../src/data_scanner.cc \ drive_data_scanner.cc +drive_view_colors_SOURCES = \ + ../src/view_curses.cc \ + drive_view_colors.cc +drive_view_colors_LDADD = $(CURSES_LIB) + drive_vt52_curses_SOURCES = \ ../src/vt52_curses.cc \ ../src/view_curses.cc \ @@ -162,9 +175,11 @@ TESTS = test_bookmarks \ test_line_buffer2 \ test_grep_proc.sh \ test_grep_proc2 \ + test_hist_source \ test_listview.sh \ test_logfile.sh \ test_pcrepp \ + test_view_colors.sh \ test_vt52_curses.sh \ test_top_status \ test_data_parser.sh diff --git a/test/Makefile.in b/test/Makefile.in index 48b3cccf..ad1cd013 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. @@ -38,17 +38,19 @@ host_triplet = @host@ check_PROGRAMS = drive_data_scanner$(EXEEXT) \ drive_line_buffer$(EXEEXT) drive_grep_proc$(EXEEXT) \ drive_listview$(EXEEXT) drive_logfile$(EXEEXT) \ - drive_sequencer$(EXEEXT) drive_vt52_curses$(EXEEXT) \ - drive_readline_curses$(EXEEXT) slicer$(EXEEXT) \ - scripty$(EXEEXT) test_auto_fd$(EXEEXT) test_auto_mem$(EXEEXT) \ - test_bookmarks$(EXEEXT) test_grep_proc2$(EXEEXT) \ + drive_sequencer$(EXEEXT) drive_view_colors$(EXEEXT) \ + drive_vt52_curses$(EXEEXT) drive_readline_curses$(EXEEXT) \ + slicer$(EXEEXT) scripty$(EXEEXT) test_auto_fd$(EXEEXT) \ + test_auto_mem$(EXEEXT) test_bookmarks$(EXEEXT) \ + test_grep_proc2$(EXEEXT) test_hist_source$(EXEEXT) \ test_line_buffer2$(EXEEXT) test_pcrepp$(EXEEXT) \ test_top_status$(EXEEXT) TESTS = test_bookmarks$(EXEEXT) test_auto_fd$(EXEEXT) \ test_auto_mem$(EXEEXT) test_line_buffer.sh \ test_line_buffer2$(EXEEXT) test_grep_proc.sh \ - test_grep_proc2$(EXEEXT) test_listview.sh test_logfile.sh \ - test_pcrepp$(EXEEXT) test_vt52_curses.sh \ + test_grep_proc2$(EXEEXT) test_hist_source$(EXEEXT) \ + test_listview.sh test_logfile.sh test_pcrepp$(EXEEXT) \ + test_view_colors.sh test_vt52_curses.sh \ test_top_status$(EXEEXT) test_data_parser.sh subdir = test DIST_COMMON = $(dist_noinst_DATA) $(dist_noinst_SCRIPTS) \ @@ -97,6 +99,10 @@ am_drive_sequencer_OBJECTS = grep_proc.$(OBJEXT) logfile.$(OBJEXT) \ sequence_matcher.$(OBJEXT) drive_sequencer.$(OBJEXT) drive_sequencer_OBJECTS = $(am_drive_sequencer_OBJECTS) drive_sequencer_DEPENDENCIES = +am_drive_view_colors_OBJECTS = view_curses.$(OBJEXT) \ + drive_view_colors.$(OBJEXT) +drive_view_colors_OBJECTS = $(am_drive_view_colors_OBJECTS) +drive_view_colors_DEPENDENCIES = $(am__DEPENDENCIES_1) am_drive_vt52_curses_OBJECTS = vt52_curses.$(OBJEXT) \ view_curses.$(OBJEXT) drive_vt52_curses.$(OBJEXT) drive_vt52_curses_OBJECTS = $(am_drive_vt52_curses_OBJECTS) @@ -126,6 +132,10 @@ am_test_grep_proc2_OBJECTS = line_buffer.$(OBJEXT) grep_proc.$(OBJEXT) \ test_grep_proc2.$(OBJEXT) test_grep_proc2_OBJECTS = $(am_test_grep_proc2_OBJECTS) test_grep_proc2_DEPENDENCIES = $(am__DEPENDENCIES_1) +am_test_hist_source_OBJECTS = hist_source.$(OBJEXT) \ + view_curses.$(OBJEXT) test_hist_source.$(OBJEXT) +test_hist_source_OBJECTS = $(am_test_hist_source_OBJECTS) +test_hist_source_DEPENDENCIES = $(am__DEPENDENCIES_1) am_test_line_buffer2_OBJECTS = line_buffer.$(OBJEXT) \ test_line_buffer2.$(OBJEXT) test_line_buffer2_OBJECTS = $(am_test_line_buffer2_OBJECTS) @@ -156,20 +166,23 @@ CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ SOURCES = $(drive_data_scanner_SOURCES) $(drive_grep_proc_SOURCES) \ $(drive_line_buffer_SOURCES) $(drive_listview_SOURCES) \ $(drive_logfile_SOURCES) $(drive_readline_curses_SOURCES) \ - $(drive_sequencer_SOURCES) $(drive_vt52_curses_SOURCES) \ - $(scripty_SOURCES) $(slicer_SOURCES) $(test_auto_fd_SOURCES) \ + $(drive_sequencer_SOURCES) $(drive_view_colors_SOURCES) \ + $(drive_vt52_curses_SOURCES) $(scripty_SOURCES) \ + $(slicer_SOURCES) $(test_auto_fd_SOURCES) \ $(test_auto_mem_SOURCES) $(test_bookmarks_SOURCES) \ - $(test_grep_proc2_SOURCES) $(test_line_buffer2_SOURCES) \ - $(test_pcrepp_SOURCES) $(test_top_status_SOURCES) + $(test_grep_proc2_SOURCES) $(test_hist_source_SOURCES) \ + $(test_line_buffer2_SOURCES) $(test_pcrepp_SOURCES) \ + $(test_top_status_SOURCES) DIST_SOURCES = $(drive_data_scanner_SOURCES) \ $(drive_grep_proc_SOURCES) $(drive_line_buffer_SOURCES) \ $(drive_listview_SOURCES) $(drive_logfile_SOURCES) \ $(drive_readline_curses_SOURCES) $(drive_sequencer_SOURCES) \ - $(drive_vt52_curses_SOURCES) $(scripty_SOURCES) \ - $(slicer_SOURCES) $(test_auto_fd_SOURCES) \ + $(drive_view_colors_SOURCES) $(drive_vt52_curses_SOURCES) \ + $(scripty_SOURCES) $(slicer_SOURCES) $(test_auto_fd_SOURCES) \ $(test_auto_mem_SOURCES) $(test_bookmarks_SOURCES) \ - $(test_grep_proc2_SOURCES) $(test_line_buffer2_SOURCES) \ - $(test_pcrepp_SOURCES) $(test_top_status_SOURCES) + $(test_grep_proc2_SOURCES) $(test_hist_source_SOURCES) \ + $(test_line_buffer2_SOURCES) $(test_pcrepp_SOURCES) \ + $(test_top_status_SOURCES) DATA = $(dist_noinst_DATA) ETAGS = etags CTAGS = ctags @@ -306,6 +319,12 @@ test_grep_proc2_SOURCES = \ test_grep_proc2.cc test_grep_proc2_LDADD = $(PCRE_LIBS) -lz +test_hist_source_SOURCES = \ + ../src/hist_source.cc \ + ../src/view_curses.cc \ + test_hist_source.cc + +test_hist_source_LDADD = $(CURSES_LIB) -lz test_line_buffer2_SOURCES = \ ../src/line_buffer.cc \ test_line_buffer2.cc @@ -364,6 +383,11 @@ drive_data_scanner_SOURCES = \ ../src/data_scanner.cc \ drive_data_scanner.cc +drive_view_colors_SOURCES = \ + ../src/view_curses.cc \ + drive_view_colors.cc + +drive_view_colors_LDADD = $(CURSES_LIB) drive_vt52_curses_SOURCES = \ ../src/vt52_curses.cc \ ../src/view_curses.cc \ @@ -458,55 +482,61 @@ $(am__aclocal_m4_deps): clean-checkPROGRAMS: -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS) -drive_data_scanner$(EXEEXT): $(drive_data_scanner_OBJECTS) $(drive_data_scanner_DEPENDENCIES) +drive_data_scanner$(EXEEXT): $(drive_data_scanner_OBJECTS) $(drive_data_scanner_DEPENDENCIES) $(EXTRA_drive_data_scanner_DEPENDENCIES) @rm -f drive_data_scanner$(EXEEXT) $(CXXLINK) $(drive_data_scanner_OBJECTS) $(drive_data_scanner_LDADD) $(LIBS) -drive_grep_proc$(EXEEXT): $(drive_grep_proc_OBJECTS) $(drive_grep_proc_DEPENDENCIES) +drive_grep_proc$(EXEEXT): $(drive_grep_proc_OBJECTS) $(drive_grep_proc_DEPENDENCIES) $(EXTRA_drive_grep_proc_DEPENDENCIES) @rm -f drive_grep_proc$(EXEEXT) $(CXXLINK) $(drive_grep_proc_OBJECTS) $(drive_grep_proc_LDADD) $(LIBS) -drive_line_buffer$(EXEEXT): $(drive_line_buffer_OBJECTS) $(drive_line_buffer_DEPENDENCIES) +drive_line_buffer$(EXEEXT): $(drive_line_buffer_OBJECTS) $(drive_line_buffer_DEPENDENCIES) $(EXTRA_drive_line_buffer_DEPENDENCIES) @rm -f drive_line_buffer$(EXEEXT) $(CXXLINK) $(drive_line_buffer_OBJECTS) $(drive_line_buffer_LDADD) $(LIBS) -drive_listview$(EXEEXT): $(drive_listview_OBJECTS) $(drive_listview_DEPENDENCIES) +drive_listview$(EXEEXT): $(drive_listview_OBJECTS) $(drive_listview_DEPENDENCIES) $(EXTRA_drive_listview_DEPENDENCIES) @rm -f drive_listview$(EXEEXT) $(CXXLINK) $(drive_listview_OBJECTS) $(drive_listview_LDADD) $(LIBS) -drive_logfile$(EXEEXT): $(drive_logfile_OBJECTS) $(drive_logfile_DEPENDENCIES) +drive_logfile$(EXEEXT): $(drive_logfile_OBJECTS) $(drive_logfile_DEPENDENCIES) $(EXTRA_drive_logfile_DEPENDENCIES) @rm -f drive_logfile$(EXEEXT) $(CXXLINK) $(drive_logfile_OBJECTS) $(drive_logfile_LDADD) $(LIBS) -drive_readline_curses$(EXEEXT): $(drive_readline_curses_OBJECTS) $(drive_readline_curses_DEPENDENCIES) +drive_readline_curses$(EXEEXT): $(drive_readline_curses_OBJECTS) $(drive_readline_curses_DEPENDENCIES) $(EXTRA_drive_readline_curses_DEPENDENCIES) @rm -f drive_readline_curses$(EXEEXT) $(CXXLINK) $(drive_readline_curses_OBJECTS) $(drive_readline_curses_LDADD) $(LIBS) -drive_sequencer$(EXEEXT): $(drive_sequencer_OBJECTS) $(drive_sequencer_DEPENDENCIES) +drive_sequencer$(EXEEXT): $(drive_sequencer_OBJECTS) $(drive_sequencer_DEPENDENCIES) $(EXTRA_drive_sequencer_DEPENDENCIES) @rm -f drive_sequencer$(EXEEXT) $(CXXLINK) $(drive_sequencer_OBJECTS) $(drive_sequencer_LDADD) $(LIBS) -drive_vt52_curses$(EXEEXT): $(drive_vt52_curses_OBJECTS) $(drive_vt52_curses_DEPENDENCIES) +drive_view_colors$(EXEEXT): $(drive_view_colors_OBJECTS) $(drive_view_colors_DEPENDENCIES) $(EXTRA_drive_view_colors_DEPENDENCIES) + @rm -f drive_view_colors$(EXEEXT) + $(CXXLINK) $(drive_view_colors_OBJECTS) $(drive_view_colors_LDADD) $(LIBS) +drive_vt52_curses$(EXEEXT): $(drive_vt52_curses_OBJECTS) $(drive_vt52_curses_DEPENDENCIES) $(EXTRA_drive_vt52_curses_DEPENDENCIES) @rm -f drive_vt52_curses$(EXEEXT) $(CXXLINK) $(drive_vt52_curses_OBJECTS) $(drive_vt52_curses_LDADD) $(LIBS) -scripty$(EXEEXT): $(scripty_OBJECTS) $(scripty_DEPENDENCIES) +scripty$(EXEEXT): $(scripty_OBJECTS) $(scripty_DEPENDENCIES) $(EXTRA_scripty_DEPENDENCIES) @rm -f scripty$(EXEEXT) $(CXXLINK) $(scripty_OBJECTS) $(scripty_LDADD) $(LIBS) -slicer$(EXEEXT): $(slicer_OBJECTS) $(slicer_DEPENDENCIES) +slicer$(EXEEXT): $(slicer_OBJECTS) $(slicer_DEPENDENCIES) $(EXTRA_slicer_DEPENDENCIES) @rm -f slicer$(EXEEXT) $(CXXLINK) $(slicer_OBJECTS) $(slicer_LDADD) $(LIBS) -test_auto_fd$(EXEEXT): $(test_auto_fd_OBJECTS) $(test_auto_fd_DEPENDENCIES) +test_auto_fd$(EXEEXT): $(test_auto_fd_OBJECTS) $(test_auto_fd_DEPENDENCIES) $(EXTRA_test_auto_fd_DEPENDENCIES) @rm -f test_auto_fd$(EXEEXT) $(CXXLINK) $(test_auto_fd_OBJECTS) $(test_auto_fd_LDADD) $(LIBS) -test_auto_mem$(EXEEXT): $(test_auto_mem_OBJECTS) $(test_auto_mem_DEPENDENCIES) +test_auto_mem$(EXEEXT): $(test_auto_mem_OBJECTS) $(test_auto_mem_DEPENDENCIES) $(EXTRA_test_auto_mem_DEPENDENCIES) @rm -f test_auto_mem$(EXEEXT) $(CXXLINK) $(test_auto_mem_OBJECTS) $(test_auto_mem_LDADD) $(LIBS) -test_bookmarks$(EXEEXT): $(test_bookmarks_OBJECTS) $(test_bookmarks_DEPENDENCIES) +test_bookmarks$(EXEEXT): $(test_bookmarks_OBJECTS) $(test_bookmarks_DEPENDENCIES) $(EXTRA_test_bookmarks_DEPENDENCIES) @rm -f test_bookmarks$(EXEEXT) $(CXXLINK) $(test_bookmarks_OBJECTS) $(test_bookmarks_LDADD) $(LIBS) -test_grep_proc2$(EXEEXT): $(test_grep_proc2_OBJECTS) $(test_grep_proc2_DEPENDENCIES) +test_grep_proc2$(EXEEXT): $(test_grep_proc2_OBJECTS) $(test_grep_proc2_DEPENDENCIES) $(EXTRA_test_grep_proc2_DEPENDENCIES) @rm -f test_grep_proc2$(EXEEXT) $(CXXLINK) $(test_grep_proc2_OBJECTS) $(test_grep_proc2_LDADD) $(LIBS) -test_line_buffer2$(EXEEXT): $(test_line_buffer2_OBJECTS) $(test_line_buffer2_DEPENDENCIES) +test_hist_source$(EXEEXT): $(test_hist_source_OBJECTS) $(test_hist_source_DEPENDENCIES) $(EXTRA_test_hist_source_DEPENDENCIES) + @rm -f test_hist_source$(EXEEXT) + $(CXXLINK) $(test_hist_source_OBJECTS) $(test_hist_source_LDADD) $(LIBS) +test_line_buffer2$(EXEEXT): $(test_line_buffer2_OBJECTS) $(test_line_buffer2_DEPENDENCIES) $(EXTRA_test_line_buffer2_DEPENDENCIES) @rm -f test_line_buffer2$(EXEEXT) $(CXXLINK) $(test_line_buffer2_OBJECTS) $(test_line_buffer2_LDADD) $(LIBS) -test_pcrepp$(EXEEXT): $(test_pcrepp_OBJECTS) $(test_pcrepp_DEPENDENCIES) +test_pcrepp$(EXEEXT): $(test_pcrepp_OBJECTS) $(test_pcrepp_DEPENDENCIES) $(EXTRA_test_pcrepp_DEPENDENCIES) @rm -f test_pcrepp$(EXEEXT) $(CXXLINK) $(test_pcrepp_OBJECTS) $(test_pcrepp_LDADD) $(LIBS) -test_top_status$(EXEEXT): $(test_top_status_OBJECTS) $(test_top_status_DEPENDENCIES) +test_top_status$(EXEEXT): $(test_top_status_OBJECTS) $(test_top_status_DEPENDENCIES) $(EXTRA_test_top_status_DEPENDENCIES) @rm -f test_top_status$(EXEEXT) $(CXXLINK) $(test_top_status_OBJECTS) $(test_top_status_LDADD) $(LIBS) @@ -526,8 +556,10 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drive_logfile.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drive_readline_curses.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drive_sequencer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drive_view_colors.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drive_vt52_curses.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/grep_proc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hist_source.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/line_buffer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/listview_curses.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/log_format.Po@am__quote@ @@ -541,6 +573,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_auto_mem.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_bookmarks.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_grep_proc2.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_hist_source.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_line_buffer2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_pcrepp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_top_status.Po@am__quote@ @@ -730,6 +763,20 @@ bookmarks.obj: ../src/bookmarks.cc @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o bookmarks.obj `if test -f '../src/bookmarks.cc'; then $(CYGPATH_W) '../src/bookmarks.cc'; else $(CYGPATH_W) '$(srcdir)/../src/bookmarks.cc'; fi` +hist_source.o: ../src/hist_source.cc +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT hist_source.o -MD -MP -MF $(DEPDIR)/hist_source.Tpo -c -o hist_source.o `test -f '../src/hist_source.cc' || echo '$(srcdir)/'`../src/hist_source.cc +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/hist_source.Tpo $(DEPDIR)/hist_source.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='../src/hist_source.cc' object='hist_source.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o hist_source.o `test -f '../src/hist_source.cc' || echo '$(srcdir)/'`../src/hist_source.cc + +hist_source.obj: ../src/hist_source.cc +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT hist_source.obj -MD -MP -MF $(DEPDIR)/hist_source.Tpo -c -o hist_source.obj `if test -f '../src/hist_source.cc'; then $(CYGPATH_W) '../src/hist_source.cc'; else $(CYGPATH_W) '$(srcdir)/../src/hist_source.cc'; fi` +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/hist_source.Tpo $(DEPDIR)/hist_source.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='../src/hist_source.cc' object='hist_source.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o hist_source.obj `if test -f '../src/hist_source.cc'; then $(CYGPATH_W) '../src/hist_source.cc'; else $(CYGPATH_W) '$(srcdir)/../src/hist_source.cc'; fi` + logfile_sub_source.o: ../src/logfile_sub_source.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT logfile_sub_source.o -MD -MP -MF $(DEPDIR)/logfile_sub_source.Tpo -c -o logfile_sub_source.o `test -f '../src/logfile_sub_source.cc' || echo '$(srcdir)/'`../src/logfile_sub_source.cc @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/logfile_sub_source.Tpo $(DEPDIR)/logfile_sub_source.Po @@ -891,14 +938,15 @@ check-TESTS: $(TESTS) fi; \ dashes=`echo "$$dashes" | sed s/./=/g`; \ if test "$$failed" -eq 0; then \ - echo "$$grn$$dashes"; \ + col="$$grn"; \ else \ - echo "$$red$$dashes"; \ + col="$$red"; \ fi; \ - echo "$$banner"; \ - test -z "$$skipped" || echo "$$skipped"; \ - test -z "$$report" || echo "$$report"; \ - echo "$$dashes$$std"; \ + echo "$${col}$$dashes$${std}"; \ + echo "$${col}$$banner$${std}"; \ + test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \ + test -z "$$report" || echo "$${col}$$report$${std}"; \ + echo "$${col}$$dashes$${std}"; \ test "$$failed" -eq 0; \ else :; fi @@ -948,10 +996,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff --git a/test/drive_view_colors.cc b/test/drive_view_colors.cc new file mode 100644 index 00000000..02e34bbc --- /dev/null +++ b/test/drive_view_colors.cc @@ -0,0 +1,70 @@ + +#include "config.h" + +#include +#include +#include + +#include "view_curses.hh" + +class test_colors : public view_curses { + +public: + test_colors() + : tc_window(NULL) { + + } + + void do_update(void) { + int lpc; + + for (lpc = 0; lpc < 16; lpc++) { + char label[64]; + attr_line_t al; + line_range lr; + + snprintf(label, sizeof(label), "This is line: %d", lpc); + al = label; + lr.lr_start = 0; + lr.lr_end = 40; + this->mvwattrline(this->tc_window, + lpc, + 0, + al, + lr, + view_colors::singleton().next_highlight()); + } + }; + + WINDOW *tc_window; +}; + +int main(int argc, char *argv[]) +{ + int c, retval = EXIT_SUCCESS; + bool wait_for_input = false; + WINDOW *win; + test_colors tc; + + win = initscr(); + noecho(); + + while ((c = getopt(argc, argv, "w")) != -1) { + switch (c) { + case 'w': + wait_for_input = true; + break; + } + } + + view_colors::singleton().init(); + tc.tc_window = win; + tc.do_update(); + refresh(); + if (wait_for_input) { + getch(); + } + endwin(); + + return retval; +} diff --git a/test/scripty.cc b/test/scripty.cc index 7e6529fd..5545cf0d 100644 --- a/test/scripty.cc +++ b/test/scripty.cc @@ -3,6 +3,7 @@ #include #include +#include #include #include #include @@ -47,6 +48,9 @@ using namespace std; +/** + * An RAII class for opening a PTY and forking a child process. + */ class child_term { public: @@ -139,9 +143,15 @@ protected: }; +/** + * @param fd The file descriptor to switch to raw mode. + * @return Zero on success, -1 on error. + */ static int tty_raw(int fd) { struct termios attr[1]; + + assert(fd >= 0); if (tcgetattr(fd, attr) == -1) return -1; @@ -157,17 +167,105 @@ static int tty_raw(int fd) return tcsetattr(fd, TCSANOW, attr); } +static void dump_memory(FILE *dst, const char *src, int len) +{ + int lpc; + + for (lpc = 0; lpc < len; lpc++) { + fprintf(dst, "%02x", src[lpc]); + } +} + +static char *hex2bits(const char *src) +{ + int len, pos = sizeof(int); + char *retval; + + len = strlen(src) / 2; + retval = new char[sizeof(uint32_t) + len]; + *((uint32_t *)retval) = len; + while (pos < (sizeof(uint32_t) + len)) { + int val; + + sscanf(src, "%2x", &val); + src += 2; + retval[pos] = (char)val; + pos += 1; + } + + return retval; +} + typedef enum { + ET_NONE, ET_READ, } expect_type_t; +struct expect_read { + uint32_t er_length; + char er_data[]; +}; + struct expect { expect_type_t e_type; union { - char *b; + struct expect_read *read; } e_arg; }; +struct expect_read_state { + uint32_t ers_pos; +}; + +class expect_handler { +public: + expect_handler() { + memset(&this->eh_state, 0, sizeof(this->eh_state)); + }; + + int process_input(const char *buffer, size_t blen) { + if (this->eh_queue.empty()) + return 0; + + uint32_t &exp_pos = this->eh_state.es_read.ers_pos; + struct expect &next = this->eh_queue.front(); + int cmp_len = min((next.e_arg.read->er_length - exp_pos), (uint32_t)blen); + char *exp_start = &next.e_arg.read->er_data[this->eh_state.es_read.ers_pos]; + int retval = 0; + + assert(buffer != NULL || blen == 0); + + if (memcmp(exp_start, buffer, cmp_len) == 0) { + exp_pos += cmp_len; + if (exp_pos == next.e_arg.read->er_length) { + retval = 1; + if (!this->eh_queue.empty()) { + exp_pos = 0; + this->eh_queue.pop(); + } + } + } + else { + printf("Detected output differences at offset %d, " + "expecting:\n ", exp_pos); + dump_memory(stdout, exp_start, cmp_len); + printf("\nGot:\n "); + dump_memory(stdout, buffer, cmp_len); + retval = -1; + } + + fprintf(stderr, "pi ret %d\n", retval); + + return retval; + }; + + queue eh_queue; +private: + union { + struct expect_read_state es_read; + } eh_state; +}; + typedef enum { CT_SLEEP, CT_WRITE, @@ -193,38 +291,10 @@ static struct { FILE *sd_from_child; queue sd_replay; - queue sd_expected; + + bool sd_user_step; } scripty_data; -static void dump_memory(FILE *dst, char *src, int len) -{ - int lpc; - - for (lpc = 0; lpc < len; lpc++) { - fprintf(dst, "%02x", src[lpc]); - } -} - -static char *hex2bits(const char *src) -{ - int len, pos = sizeof(int); - char *retval; - - len = strlen(src) / 2; - retval = new char[sizeof(int) + len]; - *((int *)retval) = len; - while (pos < (sizeof(int) + len)) { - int val; - - sscanf(src, "%2x", &val); - src += 2; - retval[pos] = (char)val; - pos += 1; - } - - return retval; -} - static void sigchld(int sig) { } @@ -246,7 +316,18 @@ static void usage(void) " -t The file where any input sent to the child process\n" " should be stored.\n" " -f The file where any output from the child process\n" - " should be stored.\n"; + " should be stored.\n" + " -r The file containing the input to be sent to the child\n" + " process.\n" + " -e The file containing the expected output from the child\n" + " process.\n" + "\n" + "Examples:\n" + " To record a session for playback later:\n" + " $ scripty -t input.0 -f output.0 -- myCursesApp\n" + "\n" + " To replay the recorded session:\n" + " $ scripty -r input.0 -- myCursesApp\n"; fprintf(stderr, usage_msg, scripty_data.sd_program_name); } @@ -254,18 +335,22 @@ static void usage(void) int main(int argc, char *argv[]) { int c, fd, retval = EXIT_SUCCESS; + expect_handler ex_handler; bool passout = true; FILE *file; scripty_data.sd_program_name = argv[0]; scripty_data.sd_looping = true; - while ((c = getopt(argc, argv, "ht:f:r:e:n")) != -1) { + while ((c = getopt(argc, argv, "ht:f:r:e:ns")) != -1) { switch (c) { case 'h': usage(); exit(retval); break; + case 's': + scripty_data.sd_user_step = true; + break; case 't': scripty_data.sd_to_child_name = optarg; break; @@ -292,7 +377,7 @@ int main(int argc, char *argv[]) sp += 1; if (strcmp(line, "read") == 0) { exp.e_type = ET_READ; - exp.e_arg.b = hex2bits(sp); + exp.e_arg.read = (struct expect_read *)hex2bits(sp); } else { fprintf(stderr, @@ -300,7 +385,7 @@ int main(int argc, char *argv[]) line); retval = EXIT_FAILURE; } - scripty_data.sd_expected.push(exp); + ex_handler.eh_queue.push(exp); } } fclose(file); @@ -400,12 +485,12 @@ int main(int argc, char *argv[]) exit(-1); } else { - int maxfd, out_len = 0, exp_pos = 0, exp_len = 0; + int maxfd, out_len = 0; bool got_expected = true; + bool got_user_step; struct timeval last, now; char out_buffer[8192]; fd_set read_fds; - char *exp_data = NULL; scripty_data.sd_child_pid = ct.get_child_pid(); signal(SIGINT, sigpass); @@ -424,17 +509,7 @@ int main(int argc, char *argv[]) tty_raw(STDIN_FILENO); - if (!scripty_data.sd_expected.empty()) { - struct expect exp = scripty_data.sd_expected.front(); - - scripty_data.sd_expected.pop(); - switch (exp.e_type) { - case ET_READ: - exp_pos = sizeof(int); - exp_len = *((int *)exp.e_arg.b) + sizeof(int); - exp_data = exp.e_arg.b; - break; - } + if (!ex_handler.eh_queue.empty()) { got_expected = false; } @@ -448,27 +523,25 @@ int main(int argc, char *argv[]) to.tv_usec = 10000; rc = select(maxfd + 1, &ready_rfds, NULL, NULL, &to); if (rc == 0) { - if (exp_data != NULL && exp_pos == exp_len && !got_expected) { - exp_data = NULL; - if (!scripty_data.sd_expected.empty()) { - struct expect exp = scripty_data.sd_expected.front(); - - delete [] exp_data; - scripty_data.sd_expected.pop(); - switch (exp.e_type) { - case ET_READ: - exp_pos = sizeof(int); - exp_len = *((int *)exp.e_arg.b) + sizeof(int); - exp_data = exp.e_arg.b; - break; - } - } - got_expected = true; + if (!got_expected) { + switch (ex_handler.process_input(NULL, 0)) { + case -1: + scripty_data.sd_looping = false; + retval = EXIT_FAILURE; + break; + case 0: + break; + case 1: + got_expected = true; + break; } - if (!scripty_data.sd_replay.empty() && got_expected) { + } + if (!scripty_data.sd_replay.empty() && got_expected && + (!scripty_data.sd_user_step || got_user_step)) { struct command cmd = scripty_data.sd_replay.front(); int len; + fprintf(stderr, " us %d got %d\n", scripty_data.sd_user_step, got_user_step); scripty_data.sd_replay.pop(); fprintf(stderr, "replay %zd\n", scripty_data.sd_replay.size()); switch (cmd.c_type) { @@ -482,6 +555,7 @@ int main(int argc, char *argv[]) delete [] cmd.c_arg.b; break; } + got_user_step = false; got_expected = false; } } @@ -498,6 +572,7 @@ int main(int argc, char *argv[]) else { char buffer[1024]; + fprintf(stderr, "fds ready %d\n", rc); gettimeofday(&now, NULL); timersub(&now, &last, &diff); if (FD_ISSET(STDIN_FILENO, &ready_rfds)) { @@ -508,6 +583,11 @@ int main(int argc, char *argv[]) else if (rc == 0) { FD_CLR(STDIN_FILENO, &read_fds); } + else if (!scripty_data.sd_replay.empty()) { + if (scripty_data.sd_user_step) { + got_user_step = true; + } + } else { write(ct.get_fd(), buffer, rc); if (scripty_data.sd_to_child != NULL) { @@ -539,6 +619,7 @@ int main(int argc, char *argv[]) } if (FD_ISSET(ct.get_fd(), &ready_rfds)) { rc = read(ct.get_fd(), buffer, sizeof(buffer)); + fprintf(stderr, "read rc %d\n", rc); if (rc <= 0) { scripty_data.sd_looping = false; if (scripty_data.sd_from_child) { @@ -560,37 +641,16 @@ int main(int argc, char *argv[]) rc); out_len += rc; } - if (exp_data != NULL) { - int clen = min((exp_len - exp_pos), rc); - - fprintf(stderr, "cmp %d %d %d %d\n", exp_len, exp_pos, rc, clen); - if (memcmp(&exp_data[exp_pos], - buffer, - clen) == 0) { - exp_pos += clen; - fprintf(stderr, "exp %d %d\n", exp_pos, clen); - if (exp_pos == exp_len) { - exp_data = NULL; - if (!scripty_data.sd_expected.empty()) { - struct expect exp = scripty_data.sd_expected.front(); - - delete [] exp_data; - scripty_data.sd_expected.pop(); - switch (exp.e_type) { - case ET_READ: - exp_pos = sizeof(int); - exp_len = *((int *)exp.e_arg.b) + sizeof(int); - exp_data = exp.e_arg.b; - break; - } - } - got_expected = true; - } - } - else { - scripty_data.sd_looping = false; - retval = EXIT_FAILURE; - } + switch (ex_handler.process_input(buffer, rc)) { + case -1: + scripty_data.sd_looping = false; + retval = EXIT_FAILURE; + break; + case 0: + break; + case 1: + got_expected = true; + break; } } } @@ -599,8 +659,10 @@ int main(int argc, char *argv[]) } } - if (!scripty_data.sd_expected.empty()) + if (!ex_handler.eh_queue.empty()) { + fprintf(stderr, "More input expected from child\n"); retval = EXIT_FAILURE; + } retval = ct.wait_for_child() || retval; } diff --git a/test/test_hist_source.cc b/test/test_hist_source.cc new file mode 100644 index 00000000..7670dfbb --- /dev/null +++ b/test/test_hist_source.cc @@ -0,0 +1,24 @@ + +#include "config.h" + +#include +#include + +#include "hist_source.hh" + +int main(int argc, char *argv[]) +{ + int retval = EXIT_SUCCESS; + hist_source hs; + + assert(hs.text_line_count() == 0); + hs.analyze(); + + hs.add_value(1, bucket_type_t(1)); + assert(hs.text_line_count() == 101); + + hs.add_value(2, bucket_type_t(1)); + assert(hs.text_line_count() == 101); + + return retval; +} \ No newline at end of file diff --git a/test/test_view_colors.sh b/test/test_view_colors.sh new file mode 100644 index 00000000..39d02a23 --- /dev/null +++ b/test/test_view_colors.sh @@ -0,0 +1,6 @@ +#! /bin/bash + +run_test ./scripty -n -e ${srcdir}/view_colors_output.0 -- \ + ./drive_view_colors < /dev/null + +on_error_fail_with "view colors are wrong?" diff --git a/test/view_colors_output.0 b/test/view_colors_output.0 new file mode 100644 index 00000000..d1767c4b --- /dev/null +++ b/test/view_colors_output.0 @@ -0,0 +1 @@ +read 1b29301b371b5b3f3437681b5b313b3234721b5b6d1b5b346c1b5b6d1b5b6d1b5b33376d1b5b34306d1b5b313b314820202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020201b5b323b314820202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020201b5b333b314820202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020201b5b343b314820202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020201b5b353b314820202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020201b5b363b314820202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020201b5b373b314820202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020201b5b383b314820202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020201b5b393b314820202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020201b5b31303b314820202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020201b5b31313b314820202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020201b5b31323b314820202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020201b5b31333b314820202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020201b5b31343b314820202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020201b5b31353b314820202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020201b5b31363b314820202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020201b5b31373b314820202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020201b5b31383b314820202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020201b5b31393b314820202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020201b5b32303b314820202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020201b5b32313b314820202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020201b5b32323b314820202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020201b5b32333b314820202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020201b5b32343b3148202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020200820081b5b3468201b5b346c1b5b481b5b33346d1b5b34306d54686973206973206c696e653a2030202020202020202020202020202020202020202020202020200d0a1b5b316d54686973206973206c696e653a2031202020202020202020202020202020202020202020202020200d0a1b5b6d1b5b33366d1b5b34306d54686973206973206c696e653a2032202020202020202020202020202020202020202020202020200d0a1b5b316d54686973206973206c696e653a2033202020202020202020202020202020202020202020202020200d0a1b5b6d1b5b33326d1b5b34306d54686973206973206c696e653a2034202020202020202020202020202020202020202020202020200d0a1b5b316d54686973206973206c696e653a2035202020202020202020202020202020202020202020202020200d0a1b5b6d1b5b33356d1b5b34306d54686973206973206c696e653a2036202020202020202020202020202020202020202020202020200d0a1b5b316d54686973206973206c696e653a2037202020202020202020202020202020202020202020202020200d0a1b5b6d1b5b33346d1b5b34306d54686973206973206c696e653a2038202020202020202020202020202020202020202020202020200d0a1b5b316d54686973206973206c696e653a2039202020202020202020202020202020202020202020202020200d0a1b5b6d1b5b33366d1b5b34306d54686973206973206c696e653a2031302020202020202020202020202020202020202020202020200d0a1b5b316d54686973206973206c696e653a2031312020202020202020202020202020202020202020202020200d0a1b5b6d1b5b33326d1b5b34306d54686973206973206c696e653a2031322020202020202020202020202020202020202020202020200d0a1b5b316d54686973206973206c696e653a2031332020202020202020202020202020202020202020202020200d0a1b5b6d1b5b33356d1b5b34306d54686973206973206c696e653a2031342020202020202020202020202020202020202020202020200d0a1b5b316d54686973206973206c696e653a2031352020202020202020202020202020202020202020202020201b5b31363b3137481b5b6d1b5b6d1b5b33376d1b5b34306d1b5b6d0d1b5b38421b5b4b1b5b32343b31481b5b324a1b5b3f34376c1b380d1b5b3f316c1b3e