pax_global_header00006660000000000000000000000064145265502170014521gustar00rootroot0000000000000052 comment=7d50f925035642a7505c05129420cae2c9c92935 pv-1.8.5/000077500000000000000000000000001452655021700121615ustar00rootroot00000000000000pv-1.8.5/ABOUT-NLS000066400000000000000000000001031452655021700134020ustar00rootroot00000000000000 pv-1.8.5/Makefile.am000066400000000000000000000073021452655021700142170ustar00rootroot00000000000000## Process this file with automake to produce Makefile.in AUTOMAKE_OPTIONS = subdir-objects SUBDIRS = po bin_PROGRAMS = pv dist_doc_DATA = README.md docs/INSTALL docs/COPYING docs/NEWS.md docs/ACKNOWLEDGEMENTS.md docs/DEVELOPERS.md docs/TODO.md docs/benchmark.sh dist_man1_MANS = docs/pv.1 EXTRA_DIST = docs/pv.1.md pv_SOURCES = \ src/main/debug.c \ src/main/help.c \ src/main/main.c \ src/main/options.c \ src/main/remote.c \ src/main/version.c \ src/pv/cursor.c \ src/pv/display.c \ src/pv/elapsedtime.c \ src/pv/file.c \ src/pv/loop.c \ src/pv/number.c \ src/pv/signal.c \ src/pv/state.c \ src/pv/string.c \ src/pv/transfer.c \ src/pv/watchpid.c \ src/include/config-aux.h \ src/include/options.h \ src/include/pv-internal.h \ src/include/pv.h ## Allow tests to write diagnostic info to fd 9 to reach the original ## stderr even when the test driver is sending test output to a file. AM_TESTS_FD_REDIRECT = 9>&2 AM_TESTS_ENVIRONMENT = \ . $(srcdir)/tests/test-env.sh \ ; TESTS = \ tests/Bug_-_Display_length_at_magnitude_boundary_-_Bytes.test \ tests/Bug_-_Display_length_at_magnitude_boundary_-_Rate.test \ tests/Bug_-_Install_all_files.test \ tests/Display_-_--average-rate.test \ tests/Display_-_--bits.test \ tests/Display_-_--buffer-percent.test \ tests/Display_-_--bytes.test \ tests/Display_-_--eta_-_plausible_values.test \ tests/Display_-_--fineta_-_plausible_values.test \ tests/Display_-_--last-written.test \ tests/Display_-_--numeric_--bytes_--line-mode.test \ tests/Display_-_--numeric_--bytes.test \ tests/Display_-_--numeric.test \ tests/Display_-_--numeric_--timer.test \ tests/Display_-_--progress_-_basic_movement.test \ tests/Display_-_--progress_-_increasing.test \ tests/Display_-_--quiet.test \ tests/Display_-_--rate_-_displayed_value_changes.test \ tests/Display_-_--timer_-_displayed_value_changes.test \ tests/General_-_--pidfile.test \ tests/General_-_--size_argument_handling.test \ tests/Integrity_-_Basic.test \ tests/Integrity_-_Binary_data.test \ tests/Integrity_-_From_bursty_source.test \ tests/Integrity_-_Large_file_support.test \ tests/Integrity_-_On_output_pipe_close.test \ tests/Integrity_-_When_adjusted_remotely.test \ tests/Memory_safety_-_Basic.test \ tests/Memory_safety_-_Remote_control_receiver.test \ tests/Memory_safety_-_Remote_control_sender.test \ tests/Modifiers_-_--direct-io.test \ tests/Modifiers_-_--force.test \ tests/Modifiers_-_--interval.test \ tests/Modifiers_-_--line-mode.test \ tests/Modifiers_-_--size_from_file_size.test \ tests/Modifiers_-_--size.test \ tests/Modifiers_-_--sync.test \ tests/Terminal_-_Detect_width.test \ tests/Transfer_-_--rate-limit.test \ tests/Transfer_-_--remote.test \ tests/Transfer_-_--stop-at-size.test EXTRA_DIST += $(TESTS) tests/run-valgrind.sh tests/test-env.sh docs/pv.1.md: $(srcdir)/docs/pv.1 test -d docs || mkdir docs pandoc --from man --to markdown < $< | sed '/\*\*\*\*/{s/\*//g;s/^/**/;s/$$/**/}' | sed '/^```/,/^```/d' > $@ SUFFIXES = .c .o .e .c.e: -splint -badflag +posixlib $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) -DSPLINT=1 $< > $@ 2>&1 -flawfinder $< >> $@ 2>&1 indent: cd $(srcdir) && indent -npro -kr -i8 -cd42 -c45 -l120 src/*/*.c indentclean: rm -f $(srcdir)/*/*.c~ analyse: $(pv_SOURCES:.c=.e) FORCE grep -E -e '^Finished checking --' -e 'Hits = ' $+ 2>/dev/null || true FORCE: clean-local: rm -f src/*/*.e # Convenience alias for "make check": "make test" test: check # "release" target - requires MAINTAINER variable to select GPG key. release: distcheck gpg --list-secret-keys 2>&1 | grep -F 'uid' | grep -Fq "$(MAINTAINER)" gpg -u "$(MAINTAINER)" -ab $(distdir).tar.gz cp -f $(distdir).tar.gz.asc $(distdir).tar.gz.txt chmod 644 $(distdir).tar.gz $(distdir).tar.gz.asc $(distdir).tar.gz.txt pv-1.8.5/Makefile.in000066400000000000000000001546251452655021700142430ustar00rootroot00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = pv$(EXEEXT) subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ $(am__configure_deps) $(dist_doc_DATA) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/include/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" \ "$(DESTDIR)$(docdir)" PROGRAMS = $(bin_PROGRAMS) am__dirstamp = $(am__leading_dot)dirstamp am_pv_OBJECTS = src/main/debug.$(OBJEXT) src/main/help.$(OBJEXT) \ src/main/main.$(OBJEXT) src/main/options.$(OBJEXT) \ src/main/remote.$(OBJEXT) src/main/version.$(OBJEXT) \ src/pv/cursor.$(OBJEXT) src/pv/display.$(OBJEXT) \ src/pv/elapsedtime.$(OBJEXT) src/pv/file.$(OBJEXT) \ src/pv/loop.$(OBJEXT) src/pv/number.$(OBJEXT) \ src/pv/signal.$(OBJEXT) src/pv/state.$(OBJEXT) \ src/pv/string.$(OBJEXT) src/pv/transfer.$(OBJEXT) \ src/pv/watchpid.$(OBJEXT) pv_OBJECTS = $(am_pv_OBJECTS) pv_LDADD = $(LDADD) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = src/main/$(DEPDIR)/debug.Po \ src/main/$(DEPDIR)/help.Po src/main/$(DEPDIR)/main.Po \ src/main/$(DEPDIR)/options.Po src/main/$(DEPDIR)/remote.Po \ src/main/$(DEPDIR)/version.Po src/pv/$(DEPDIR)/cursor.Po \ src/pv/$(DEPDIR)/display.Po src/pv/$(DEPDIR)/elapsedtime.Po \ src/pv/$(DEPDIR)/file.Po src/pv/$(DEPDIR)/loop.Po \ src/pv/$(DEPDIR)/number.Po src/pv/$(DEPDIR)/signal.Po \ src/pv/$(DEPDIR)/state.Po src/pv/$(DEPDIR)/string.Po \ src/pv/$(DEPDIR)/transfer.Po src/pv/$(DEPDIR)/watchpid.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(pv_SOURCES) DIST_SOURCES = $(pv_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man1dir = $(mandir)/man1 NROFF = nroff MANS = $(dist_man1_MANS) DATA = $(dist_doc_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope check recheck distdir distdir-am dist dist-all \ distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } am__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* # A command that, given a newline-separated list of test names on the # standard input, print the name of the tests that are to be re-run # upon "make recheck". am__list_recheck_tests = $(AWK) '{ \ recheck = 1; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ { \ if ((getline line2 < ($$0 ".log")) < 0) \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ { \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ { \ break; \ } \ }; \ if (recheck) \ print $$0; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # A command that, given a newline-separated list of test names on the # standard input, create the global log from their .trs and .log files. am__create_global_log = $(AWK) ' \ function fatal(msg) \ { \ print "fatal: making $@: " msg | "cat >&2"; \ exit 1; \ } \ function rst_section(header) \ { \ print header; \ len = length(header); \ for (i = 1; i <= len; i = i + 1) \ printf "="; \ printf "\n\n"; \ } \ { \ copy_in_global_log = 1; \ global_test_result = "RUN"; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".trs"); \ if (line ~ /$(am__global_test_result_rx)/) \ { \ sub("$(am__global_test_result_rx)", "", line); \ sub("[ ]*$$", "", line); \ global_test_result = line; \ } \ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ copy_in_global_log = 0; \ }; \ if (copy_in_global_log) \ { \ rst_section(global_test_result ": " $$0); \ while ((rc = (getline line < ($$0 ".log"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".log"); \ print line; \ }; \ printf "\n"; \ }; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # Restructured Text title. am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } # Solaris 10 'make', and several other traditional 'make' implementations, # pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it # by disabling -e (using the XSI extension "set +e") if it's set. am__sh_e_setup = case $$- in *e*) set +e;; esac # Default flags passed to test drivers. am__common_driver_flags = \ --color-tests "$$am__color_tests" \ --enable-hard-errors "$$am__enable_hard_errors" \ --expect-failure "$$am__expect_failure" # To be inserted before the command running the test. Creates the # directory for the log if needed. Stores in $dir the directory # containing $f, in $tst the test, in $log the log. Executes the # developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and # passes TESTS_ENVIRONMENT. Set up options for the wrapper that # will run the test scripts (or their associated LOG_COMPILER, if # thy have one). am__check_pre = \ $(am__sh_e_setup); \ $(am__vpath_adj_setup) $(am__vpath_adj) \ $(am__tty_colors); \ srcdir=$(srcdir); export srcdir; \ case "$@" in \ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ *) am__odir=.;; \ esac; \ test "x$$am__odir" = x"." || test -d "$$am__odir" \ || $(MKDIR_P) "$$am__odir" || exit $$?; \ if test -f "./$$f"; then dir=./; \ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; \ if test -n '$(DISABLE_HARD_ERRORS)'; then \ am__enable_hard_errors=no; \ else \ am__enable_hard_errors=yes; \ fi; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ am__expect_failure=yes;; \ *) \ am__expect_failure=no;; \ esac; \ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) # A shell command to get the names of the tests scripts with any registered # extension removed (i.e., equivalently, the names of the test logs, with # the '.log' extension removed). The result is saved in the shell variable # '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, # we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", # since that might cause problem with VPATH rewrites for suffix-less tests. # See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' RECHECK_LOGS = $(TEST_LOGS) TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test am__test_logs1 = $(TESTS:=.log) am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) TEST_LOGS = $(am__test_logs2:.test.log=.log) TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) am__set_b = \ case '$@' in \ */*) \ case '$*' in \ */*) b='$*';; \ *) b=`echo '$@' | sed 's/\.log$$//'`; \ esac;; \ *) \ b='$*';; \ esac DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(dist_man1_MANS) $(srcdir)/Makefile.in \ $(top_srcdir)/build-aux/compile \ $(top_srcdir)/build-aux/config.guess \ $(top_srcdir)/build-aux/config.rpath \ $(top_srcdir)/build-aux/config.sub \ $(top_srcdir)/build-aux/depcomp \ $(top_srcdir)/build-aux/install-sh \ $(top_srcdir)/build-aux/missing \ $(top_srcdir)/build-aux/test-driver \ $(top_srcdir)/src/include/config.h.in ABOUT-NLS README.md \ build-aux/ar-lib build-aux/compile build-aux/config.guess \ build-aux/config.rpath build-aux/config.sub build-aux/depcomp \ build-aux/install-sh build-aux/missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best DIST_TARGETS = dist-gzip # Exists only to be overridden by the user if desired. AM_DISTCHECK_DVI_TARGET = dvi distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGMERGE = @MSGMERGE@ MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POSUB = @POSUB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = subdir-objects SUBDIRS = po dist_doc_DATA = README.md docs/INSTALL docs/COPYING docs/NEWS.md docs/ACKNOWLEDGEMENTS.md docs/DEVELOPERS.md docs/TODO.md docs/benchmark.sh dist_man1_MANS = docs/pv.1 EXTRA_DIST = docs/pv.1.md $(TESTS) tests/run-valgrind.sh \ tests/test-env.sh pv_SOURCES = \ src/main/debug.c \ src/main/help.c \ src/main/main.c \ src/main/options.c \ src/main/remote.c \ src/main/version.c \ src/pv/cursor.c \ src/pv/display.c \ src/pv/elapsedtime.c \ src/pv/file.c \ src/pv/loop.c \ src/pv/number.c \ src/pv/signal.c \ src/pv/state.c \ src/pv/string.c \ src/pv/transfer.c \ src/pv/watchpid.c \ src/include/config-aux.h \ src/include/options.h \ src/include/pv-internal.h \ src/include/pv.h AM_TESTS_FD_REDIRECT = 9>&2 AM_TESTS_ENVIRONMENT = \ . $(srcdir)/tests/test-env.sh \ ; TESTS = \ tests/Bug_-_Display_length_at_magnitude_boundary_-_Bytes.test \ tests/Bug_-_Display_length_at_magnitude_boundary_-_Rate.test \ tests/Bug_-_Install_all_files.test \ tests/Display_-_--average-rate.test \ tests/Display_-_--bits.test \ tests/Display_-_--buffer-percent.test \ tests/Display_-_--bytes.test \ tests/Display_-_--eta_-_plausible_values.test \ tests/Display_-_--fineta_-_plausible_values.test \ tests/Display_-_--last-written.test \ tests/Display_-_--numeric_--bytes_--line-mode.test \ tests/Display_-_--numeric_--bytes.test \ tests/Display_-_--numeric.test \ tests/Display_-_--numeric_--timer.test \ tests/Display_-_--progress_-_basic_movement.test \ tests/Display_-_--progress_-_increasing.test \ tests/Display_-_--quiet.test \ tests/Display_-_--rate_-_displayed_value_changes.test \ tests/Display_-_--timer_-_displayed_value_changes.test \ tests/General_-_--pidfile.test \ tests/General_-_--size_argument_handling.test \ tests/Integrity_-_Basic.test \ tests/Integrity_-_Binary_data.test \ tests/Integrity_-_From_bursty_source.test \ tests/Integrity_-_Large_file_support.test \ tests/Integrity_-_On_output_pipe_close.test \ tests/Integrity_-_When_adjusted_remotely.test \ tests/Memory_safety_-_Basic.test \ tests/Memory_safety_-_Remote_control_receiver.test \ tests/Memory_safety_-_Remote_control_sender.test \ tests/Modifiers_-_--direct-io.test \ tests/Modifiers_-_--force.test \ tests/Modifiers_-_--interval.test \ tests/Modifiers_-_--line-mode.test \ tests/Modifiers_-_--size_from_file_size.test \ tests/Modifiers_-_--size.test \ tests/Modifiers_-_--sync.test \ tests/Terminal_-_Detect_width.test \ tests/Transfer_-_--rate-limit.test \ tests/Transfer_-_--remote.test \ tests/Transfer_-_--stop-at-size.test SUFFIXES = .c .o .e all: all-recursive .SUFFIXES: .SUFFIXES: .c .o .e .log .obj .test .test$(EXEEXT) .trs am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): src/include/config.h: src/include/stamp-h1 @test -f $@ || rm -f src/include/stamp-h1 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) src/include/stamp-h1 src/include/stamp-h1: $(top_srcdir)/src/include/config.h.in $(top_builddir)/config.status @rm -f src/include/stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status src/include/config.h $(top_srcdir)/src/include/config.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f src/include/stamp-h1 touch $@ distclean-hdr: -rm -f src/include/config.h src/include/stamp-h1 install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) src/main/$(am__dirstamp): @$(MKDIR_P) src/main @: > src/main/$(am__dirstamp) src/main/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) src/main/$(DEPDIR) @: > src/main/$(DEPDIR)/$(am__dirstamp) src/main/debug.$(OBJEXT): src/main/$(am__dirstamp) \ src/main/$(DEPDIR)/$(am__dirstamp) src/main/help.$(OBJEXT): src/main/$(am__dirstamp) \ src/main/$(DEPDIR)/$(am__dirstamp) src/main/main.$(OBJEXT): src/main/$(am__dirstamp) \ src/main/$(DEPDIR)/$(am__dirstamp) src/main/options.$(OBJEXT): src/main/$(am__dirstamp) \ src/main/$(DEPDIR)/$(am__dirstamp) src/main/remote.$(OBJEXT): src/main/$(am__dirstamp) \ src/main/$(DEPDIR)/$(am__dirstamp) src/main/version.$(OBJEXT): src/main/$(am__dirstamp) \ src/main/$(DEPDIR)/$(am__dirstamp) src/pv/$(am__dirstamp): @$(MKDIR_P) src/pv @: > src/pv/$(am__dirstamp) src/pv/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) src/pv/$(DEPDIR) @: > src/pv/$(DEPDIR)/$(am__dirstamp) src/pv/cursor.$(OBJEXT): src/pv/$(am__dirstamp) \ src/pv/$(DEPDIR)/$(am__dirstamp) src/pv/display.$(OBJEXT): src/pv/$(am__dirstamp) \ src/pv/$(DEPDIR)/$(am__dirstamp) src/pv/elapsedtime.$(OBJEXT): src/pv/$(am__dirstamp) \ src/pv/$(DEPDIR)/$(am__dirstamp) src/pv/file.$(OBJEXT): src/pv/$(am__dirstamp) \ src/pv/$(DEPDIR)/$(am__dirstamp) src/pv/loop.$(OBJEXT): src/pv/$(am__dirstamp) \ src/pv/$(DEPDIR)/$(am__dirstamp) src/pv/number.$(OBJEXT): src/pv/$(am__dirstamp) \ src/pv/$(DEPDIR)/$(am__dirstamp) src/pv/signal.$(OBJEXT): src/pv/$(am__dirstamp) \ src/pv/$(DEPDIR)/$(am__dirstamp) src/pv/state.$(OBJEXT): src/pv/$(am__dirstamp) \ src/pv/$(DEPDIR)/$(am__dirstamp) src/pv/string.$(OBJEXT): src/pv/$(am__dirstamp) \ src/pv/$(DEPDIR)/$(am__dirstamp) src/pv/transfer.$(OBJEXT): src/pv/$(am__dirstamp) \ src/pv/$(DEPDIR)/$(am__dirstamp) src/pv/watchpid.$(OBJEXT): src/pv/$(am__dirstamp) \ src/pv/$(DEPDIR)/$(am__dirstamp) pv$(EXEEXT): $(pv_OBJECTS) $(pv_DEPENDENCIES) $(EXTRA_pv_DEPENDENCIES) @rm -f pv$(EXEEXT) $(AM_V_CCLD)$(LINK) $(pv_OBJECTS) $(pv_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f src/main/*.$(OBJEXT) -rm -f src/pv/*.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@src/main/$(DEPDIR)/debug.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/main/$(DEPDIR)/help.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/main/$(DEPDIR)/main.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/main/$(DEPDIR)/options.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/main/$(DEPDIR)/remote.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/main/$(DEPDIR)/version.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/pv/$(DEPDIR)/cursor.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/pv/$(DEPDIR)/display.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/pv/$(DEPDIR)/elapsedtime.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/pv/$(DEPDIR)/file.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/pv/$(DEPDIR)/loop.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/pv/$(DEPDIR)/number.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/pv/$(DEPDIR)/signal.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/pv/$(DEPDIR)/state.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/pv/$(DEPDIR)/string.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/pv/$(DEPDIR)/transfer.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/pv/$(DEPDIR)/watchpid.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` install-man1: $(dist_man1_MANS) @$(NORMAL_INSTALL) @list1='$(dist_man1_MANS)'; \ list2=''; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list='$(dist_man1_MANS)'; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) install-dist_docDATA: $(dist_doc_DATA) @$(NORMAL_INSTALL) @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(docdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(docdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(docdir)" || exit $$?; \ done uninstall-dist_docDATA: @$(NORMAL_UNINSTALL) @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(docdir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files # Recover from deleted '.trs' file; this should ensure that # "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create # both 'foo.log' and 'foo.trs'. Break the recipe in two subshells # to avoid problems with "make -n". .log.trs: rm -f $< $@ $(MAKE) $(AM_MAKEFLAGS) $< # Leading 'am--fnord' is there to ensure the list of targets does not # expand to empty, as could happen e.g. with make check TESTS=''. am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) am--force-recheck: @: $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__set_TESTS_bases); \ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ redo_bases=`for i in $$bases; do \ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ done`; \ if test -n "$$redo_bases"; then \ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ if $(am__make_dryrun); then :; else \ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ fi; \ if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ elif test -n "$$redo_logs"; then \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ st=0; \ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ for i in $$redo_bases; do \ test -f $$i.trs && test -r $$i.trs \ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ test -f $$i.log && test -r $$i.log \ || { echo "$$errmsg $$i.log" >&2; st=1; }; \ done; \ test $$st -eq 0 || exit 1; \ fi @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ ws='[ ]'; \ results=`for b in $$bases; do echo $$b.trs; done`; \ test -n "$$results" || results=/dev/null; \ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ if test `expr $$fail + $$xpass + $$error` -eq 0; then \ success=true; \ else \ success=false; \ fi; \ br='==================='; br=$$br$$br$$br$$br; \ result_count () \ { \ if test x"$$1" = x"--maybe-color"; then \ maybe_colorize=yes; \ elif test x"$$1" = x"--no-color"; then \ maybe_colorize=no; \ else \ echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ shift; \ desc=$$1 count=$$2; \ if test $$maybe_colorize = yes && test $$count -gt 0; then \ color_start=$$3 color_end=$$std; \ else \ color_start= color_end=; \ fi; \ echo "$${color_start}# $$desc $$count$${color_end}"; \ }; \ create_testsuite_report () \ { \ result_count $$1 "TOTAL:" $$all "$$brg"; \ result_count $$1 "PASS: " $$pass "$$grn"; \ result_count $$1 "SKIP: " $$skip "$$blu"; \ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ result_count $$1 "FAIL: " $$fail "$$red"; \ result_count $$1 "XPASS:" $$xpass "$$red"; \ result_count $$1 "ERROR:" $$error "$$mgn"; \ }; \ { \ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ $(am__rst_title); \ create_testsuite_report --no-color; \ echo; \ echo ".. contents:: :depth: 2"; \ echo; \ for b in $$bases; do echo $$b; done \ | $(am__create_global_log); \ } >$(TEST_SUITE_LOG).tmp || exit 1; \ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ if $$success; then \ col="$$grn"; \ else \ col="$$red"; \ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ if $$success; then :; else \ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ if test -n "$(PACKAGE_BUGREPORT)"; then \ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ fi; \ echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 check-TESTS: @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ log_list=`for i in $$bases; do echo $$i.log; done`; \ trs_list=`for i in $$bases; do echo $$i.trs; done`; \ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; recheck: all @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ | $(am__list_recheck_tests)` || exit 1; \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? .test.log: @p='$<'; \ $(am__set_b); \ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) @am__EXEEXT_TRUE@.test$(EXEEXT).log: @am__EXEEXT_TRUE@ @p='$<'; \ @am__EXEEXT_TRUE@ $(am__set_b); \ @am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-zstd: distdir tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ *.tar.zst*) \ zstd -dc $(distdir).tar.zst | $(am__untar) ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build/sub \ && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-recursive all-am: Makefile $(PROGRAMS) $(MANS) $(DATA) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(docdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f src/main/$(DEPDIR)/$(am__dirstamp) -rm -f src/main/$(am__dirstamp) -rm -f src/pv/$(DEPDIR)/$(am__dirstamp) -rm -f src/pv/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-binPROGRAMS clean-generic clean-local mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f src/main/$(DEPDIR)/debug.Po -rm -f src/main/$(DEPDIR)/help.Po -rm -f src/main/$(DEPDIR)/main.Po -rm -f src/main/$(DEPDIR)/options.Po -rm -f src/main/$(DEPDIR)/remote.Po -rm -f src/main/$(DEPDIR)/version.Po -rm -f src/pv/$(DEPDIR)/cursor.Po -rm -f src/pv/$(DEPDIR)/display.Po -rm -f src/pv/$(DEPDIR)/elapsedtime.Po -rm -f src/pv/$(DEPDIR)/file.Po -rm -f src/pv/$(DEPDIR)/loop.Po -rm -f src/pv/$(DEPDIR)/number.Po -rm -f src/pv/$(DEPDIR)/signal.Po -rm -f src/pv/$(DEPDIR)/state.Po -rm -f src/pv/$(DEPDIR)/string.Po -rm -f src/pv/$(DEPDIR)/transfer.Po -rm -f src/pv/$(DEPDIR)/watchpid.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dist_docDATA install-man install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-man1 install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f src/main/$(DEPDIR)/debug.Po -rm -f src/main/$(DEPDIR)/help.Po -rm -f src/main/$(DEPDIR)/main.Po -rm -f src/main/$(DEPDIR)/options.Po -rm -f src/main/$(DEPDIR)/remote.Po -rm -f src/main/$(DEPDIR)/version.Po -rm -f src/pv/$(DEPDIR)/cursor.Po -rm -f src/pv/$(DEPDIR)/display.Po -rm -f src/pv/$(DEPDIR)/elapsedtime.Po -rm -f src/pv/$(DEPDIR)/file.Po -rm -f src/pv/$(DEPDIR)/loop.Po -rm -f src/pv/$(DEPDIR)/number.Po -rm -f src/pv/$(DEPDIR)/signal.Po -rm -f src/pv/$(DEPDIR)/state.Po -rm -f src/pv/$(DEPDIR)/string.Po -rm -f src/pv/$(DEPDIR)/transfer.Po -rm -f src/pv/$(DEPDIR)/watchpid.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-dist_docDATA \ uninstall-man uninstall-man: uninstall-man1 .MAKE: $(am__recursive_targets) check-am install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--depfiles am--refresh check check-TESTS check-am clean \ clean-binPROGRAMS clean-cscope clean-generic clean-local \ cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \ dist-zstd distcheck distclean distclean-compile \ distclean-generic distclean-hdr distclean-tags distcleancheck \ distdir distuninstallcheck dvi dvi-am html html-am info \ info-am install install-am install-binPROGRAMS install-data \ install-data-am install-dist_docDATA install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-man1 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-compile \ mostlyclean-generic pdf pdf-am ps ps-am recheck tags tags-am \ uninstall uninstall-am uninstall-binPROGRAMS \ uninstall-dist_docDATA uninstall-man uninstall-man1 .PRECIOUS: Makefile docs/pv.1.md: $(srcdir)/docs/pv.1 test -d docs || mkdir docs pandoc --from man --to markdown < $< | sed '/\*\*\*\*/{s/\*//g;s/^/**/;s/$$/**/}' | sed '/^```/,/^```/d' > $@ .c.e: -splint -badflag +posixlib $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) -DSPLINT=1 $< > $@ 2>&1 -flawfinder $< >> $@ 2>&1 indent: cd $(srcdir) && indent -npro -kr -i8 -cd42 -c45 -l120 src/*/*.c indentclean: rm -f $(srcdir)/*/*.c~ analyse: $(pv_SOURCES:.c=.e) FORCE grep -E -e '^Finished checking --' -e 'Hits = ' $+ 2>/dev/null || true FORCE: clean-local: rm -f src/*/*.e # Convenience alias for "make check": "make test" test: check # "release" target - requires MAINTAINER variable to select GPG key. release: distcheck gpg --list-secret-keys 2>&1 | grep -F 'uid' | grep -Fq "$(MAINTAINER)" gpg -u "$(MAINTAINER)" -ab $(distdir).tar.gz cp -f $(distdir).tar.gz.asc $(distdir).tar.gz.txt chmod 644 $(distdir).tar.gz $(distdir).tar.gz.asc $(distdir).tar.gz.txt # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: pv-1.8.5/README.md000066400000000000000000000046641452655021700134520ustar00rootroot00000000000000# Introduction This is the README for **pv** ("Pipe Viewer"), a terminal-based tool for monitoring the progress of data through a pipeline. It can be inserted into any normal pipeline between two processes to give a visual indication of how quickly data is passing through, how long it has taken, how near to completion it is, and an estimate of how long it will be until completion. # Documentation A manual page is included in this distribution ("`man pv`"). Before installation, it is in "[docs/pv.1](./docs/pv.1.md)". Changes are listed in "[docs/NEWS.md](./docs/NEWS.md)". The to-do list is "[docs/TODO.md](./docs/TODO.md)". Developers and translators, please see "[docs/DEVELOPERS.md](./docs/DEVELOPERS.md)". # Compilation To compile the package, type "`sh ./configure`", which should generate a Makefile for your system. You may then type "`make`" to build everything, and "`make install`" to install it. See the file "[docs/INSTALL](./docs/INSTALL)" for more about the _configure_ script. If this is not a packaged release, you will need the GNU build system tools (`autoconf`, `aclocal`, `autopoint`, `automake`) and the `gettext` development tools. You can then run "`autoreconf -is`" to generate the "`configure`" script. # Copyright, bug reporting, and acknowledgements Copyright (C) 2002-2008, 2010, 2012-2015, 2017, 2021, 2023 Andrew Wood. License GPLv3+: GNU GPL version 3 or later . This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License, version 3, in "[docs/COPYING](./docs/COPYING)". If not, see . Please report any bugs to **pv@ivarch.com**, or use the issue tracker linked from the **pv** home page. The **pv** home page is at: [https://www.ivarch.com/programs/pv.shtml](https://www.ivarch.com/programs/pv.shtml) The latest version can always be found here. **Please see "[docs/ACKNOWLEDGEMENTS.md](./docs/ACKNOWLEDGEMENTS.md)" for a list of contributors.** --- pv-1.8.5/aclocal.m4000066400000000000000000005070631452655021700140340ustar00rootroot00000000000000# generated automatically by aclocal 1.16.5 -*- Autoconf -*- # Copyright (C) 1996-2021 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],, [m4_warning([this file was generated for autoconf 2.71. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # gettext.m4 serial 71 (gettext-0.20.2) dnl Copyright (C) 1995-2014, 2016, 2018-2020 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can be used in projects which are not available under dnl the GNU General Public License or the GNU Lesser General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Lesser General Public License, and the rest of the GNU dnl gettext package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2006, 2008-2010. dnl Macro to add for using GNU gettext. dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]). dnl INTLSYMBOL must be one of 'external', 'use-libtool'. dnl INTLSYMBOL should be 'external' for packages other than GNU gettext, and dnl 'use-libtool' for the packages 'gettext-runtime' and 'gettext-tools'. dnl If INTLSYMBOL is 'use-libtool', then a libtool library dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static, dnl depending on --{enable,disable}-{shared,static} and on the presence of dnl AM-DISABLE-SHARED). dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext dnl implementations (in libc or libintl) without the ngettext() function dnl will be ignored. If NEEDSYMBOL is specified and is dnl 'need-formatstring-macros', then GNU gettext implementations that don't dnl support the ISO C 99 formatstring macros will be ignored. dnl INTLDIR is used to find the intl libraries. If empty, dnl the value '$(top_builddir)/intl/' is used. dnl dnl The result of the configuration is one of three cases: dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled dnl and used. dnl Catalog format: GNU --> install in $(datadir) dnl Catalog extension: .mo after installation, .gmo in source tree dnl 2) GNU gettext has been found in the system's C library. dnl Catalog format: GNU --> install in $(datadir) dnl Catalog extension: .mo after installation, .gmo in source tree dnl 3) No internationalization, always use English msgid. dnl Catalog format: none dnl Catalog extension: none dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur. dnl The use of .gmo is historical (it was needed to avoid overwriting the dnl GNU format catalogs when building on a platform with an X/Open gettext), dnl but we keep it in order not to force irrelevant filename changes on the dnl maintainers. dnl AC_DEFUN([AM_GNU_GETTEXT], [ dnl Argument checking. ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [use-libtool], , [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT ])])])]) ifelse(ifelse([$1], [], [old])[]ifelse([$1], [no-libtool], [old]), [old], [errprint([ERROR: Use of AM_GNU_GETTEXT without [external] argument is no longer supported. ])]) ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], , [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT ])])])]) define([gt_included_intl], ifelse([$1], [external], [no], [yes])) gt_NEEDS_INIT AM_GNU_GETTEXT_NEED([$2]) AC_REQUIRE([AM_PO_SUBDIRS])dnl ifelse(gt_included_intl, yes, [ AC_REQUIRE([AM_INTL_SUBDIR])dnl ]) dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) dnl Sometimes libintl requires libiconv, so first search for libiconv. dnl Ideally we would do this search only after the dnl if test "$USE_NLS" = "yes"; then dnl if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT dnl the configure script would need to contain the same shell code dnl again, outside any 'if'. There are two solutions: dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'. dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE. dnl Since AC_PROVIDE_IFELSE is not documented, we avoid it. ifelse(gt_included_intl, yes, , [ AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) ]) dnl Sometimes, on Mac OS X, libintl requires linking with CoreFoundation. gt_INTL_MACOSX dnl Set USE_NLS. AC_REQUIRE([AM_NLS]) ifelse(gt_included_intl, yes, [ BUILD_INCLUDED_LIBINTL=no USE_INCLUDED_LIBINTL=no ]) LIBINTL= LTLIBINTL= POSUB= dnl Add a version number to the cache macros. case " $gt_needs " in *" need-formatstring-macros "*) gt_api_version=3 ;; *" need-ngettext "*) gt_api_version=2 ;; *) gt_api_version=1 ;; esac gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc" gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl" dnl If we use NLS figure out what method if test "$USE_NLS" = "yes"; then gt_use_preinstalled_gnugettext=no ifelse(gt_included_intl, yes, [ AC_MSG_CHECKING([whether included gettext is requested]) AC_ARG_WITH([included-gettext], [ --with-included-gettext use the GNU gettext library included here], nls_cv_force_use_gnu_gettext=$withval, nls_cv_force_use_gnu_gettext=no) AC_MSG_RESULT([$nls_cv_force_use_gnu_gettext]) nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" if test "$nls_cv_force_use_gnu_gettext" != "yes"; then ]) dnl User does not insist on using GNU NLS library. Figure out what dnl to use. If GNU gettext is available we use this. Else we have dnl to fall back to GNU NLS library. if test $gt_api_version -ge 3; then gt_revision_test_code=' #ifndef __GNU_GETTEXT_SUPPORTED_REVISION #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) #endif changequote(,)dnl typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; changequote([,])dnl ' else gt_revision_test_code= fi if test $gt_api_version -ge 2; then gt_expression_test_code=' + * ngettext ("", "", 0)' else gt_expression_test_code= fi AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc], [AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[ #include #ifndef __GNU_GETTEXT_SUPPORTED_REVISION extern int _nl_msg_cat_cntr; extern int *_nl_domain_bindings; #define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_domain_bindings) #else #define __GNU_GETTEXT_SYMBOL_EXPRESSION 0 #endif $gt_revision_test_code ]], [[ bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION ]])], [eval "$gt_func_gnugettext_libc=yes"], [eval "$gt_func_gnugettext_libc=no"])]) if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then dnl Sometimes libintl requires libiconv, so first search for libiconv. ifelse(gt_included_intl, yes, , [ AM_ICONV_LINK ]) dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv]) dnl because that would add "-liconv" to LIBINTL and LTLIBINTL dnl even if libiconv doesn't exist. AC_LIB_LINKFLAGS_BODY([intl]) AC_CACHE_CHECK([for GNU gettext in libintl], [$gt_func_gnugettext_libintl], [gt_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $INCINTL" gt_save_LIBS="$LIBS" LIBS="$LIBS $LIBINTL" dnl Now see whether libintl exists and does not depend on libiconv. AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[ #include #ifndef __GNU_GETTEXT_SUPPORTED_REVISION extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *); #define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias ("")) #else #define __GNU_GETTEXT_SYMBOL_EXPRESSION 0 #endif $gt_revision_test_code ]], [[ bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION ]])], [eval "$gt_func_gnugettext_libintl=yes"], [eval "$gt_func_gnugettext_libintl=no"]) dnl Now see whether libintl exists and depends on libiconv. if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then LIBS="$LIBS $LIBICONV" AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[ #include #ifndef __GNU_GETTEXT_SUPPORTED_REVISION extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *); #define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias ("")) #else #define __GNU_GETTEXT_SYMBOL_EXPRESSION 0 #endif $gt_revision_test_code ]], [[ bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION ]])], [LIBINTL="$LIBINTL $LIBICONV" LTLIBINTL="$LTLIBINTL $LTLIBICONV" eval "$gt_func_gnugettext_libintl=yes" ]) fi CPPFLAGS="$gt_save_CPPFLAGS" LIBS="$gt_save_LIBS"]) fi dnl If an already present or preinstalled GNU gettext() is found, dnl use it. But if this macro is used in GNU gettext, and GNU dnl gettext is already preinstalled in libintl, we update this dnl libintl. (Cf. the install rule in intl/Makefile.in.) if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \ || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \ && test "$PACKAGE" != gettext-runtime \ && test "$PACKAGE" != gettext-tools; }; then gt_use_preinstalled_gnugettext=yes else dnl Reset the values set by searching for libintl. LIBINTL= LTLIBINTL= INCINTL= fi ifelse(gt_included_intl, yes, [ if test "$gt_use_preinstalled_gnugettext" != "yes"; then dnl GNU gettext is not found in the C library. dnl Fall back on included GNU gettext library. nls_cv_use_gnu_gettext=yes fi fi if test "$nls_cv_use_gnu_gettext" = "yes"; then dnl Mark actions used to generate GNU NLS library. BUILD_INCLUDED_LIBINTL=yes USE_INCLUDED_LIBINTL=yes LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.la $LIBICONV $LIBTHREAD" LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.la $LTLIBICONV $LTLIBTHREAD" LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` fi CATOBJEXT= if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then dnl Mark actions to use GNU gettext tools. CATOBJEXT=.gmo fi ]) if test -n "$INTL_MACOSX_LIBS"; then if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then dnl Some extra flags are needed during linking. LIBINTL="$LIBINTL $INTL_MACOSX_LIBS" LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS" fi fi if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then AC_DEFINE([ENABLE_NLS], [1], [Define to 1 if translation of program messages to the user's native language is requested.]) else USE_NLS=no fi fi AC_MSG_CHECKING([whether to use NLS]) AC_MSG_RESULT([$USE_NLS]) if test "$USE_NLS" = "yes"; then AC_MSG_CHECKING([where the gettext function comes from]) if test "$gt_use_preinstalled_gnugettext" = "yes"; then if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then gt_source="external libintl" else gt_source="libc" fi else gt_source="included intl directory" fi AC_MSG_RESULT([$gt_source]) fi if test "$USE_NLS" = "yes"; then if test "$gt_use_preinstalled_gnugettext" = "yes"; then if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then AC_MSG_CHECKING([how to link with libintl]) AC_MSG_RESULT([$LIBINTL]) AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL]) fi dnl For backward compatibility. Some packages may be using this. AC_DEFINE([HAVE_GETTEXT], [1], [Define if the GNU gettext() function is already present or preinstalled.]) AC_DEFINE([HAVE_DCGETTEXT], [1], [Define if the GNU dcgettext() function is already present or preinstalled.]) fi dnl We need to process the po/ directory. POSUB=po fi ifelse(gt_included_intl, yes, [ dnl In GNU gettext we have to set BUILD_INCLUDED_LIBINTL to 'yes' dnl because some of the testsuite requires it. BUILD_INCLUDED_LIBINTL=yes dnl Make all variables we use known to autoconf. AC_SUBST([BUILD_INCLUDED_LIBINTL]) AC_SUBST([USE_INCLUDED_LIBINTL]) AC_SUBST([CATOBJEXT]) ]) dnl For backward compatibility. Some Makefiles may be using this. INTLLIBS="$LIBINTL" AC_SUBST([INTLLIBS]) dnl Make all documented variables known to autoconf. AC_SUBST([LIBINTL]) AC_SUBST([LTLIBINTL]) AC_SUBST([POSUB]) ]) dnl gt_NEEDS_INIT ensures that the gt_needs variable is initialized. m4_define([gt_NEEDS_INIT], [ m4_divert_text([DEFAULTS], [gt_needs=]) m4_define([gt_NEEDS_INIT], []) ]) dnl Usage: AM_GNU_GETTEXT_NEED([NEEDSYMBOL]) AC_DEFUN([AM_GNU_GETTEXT_NEED], [ m4_divert_text([INIT_PREPARE], [gt_needs="$gt_needs $1"]) ]) dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version]) AC_DEFUN([AM_GNU_GETTEXT_VERSION], []) dnl Usage: AM_GNU_GETTEXT_REQUIRE_VERSION([gettext-version]) AC_DEFUN([AM_GNU_GETTEXT_REQUIRE_VERSION], []) # host-cpu-c-abi.m4 serial 13 dnl Copyright (C) 2002-2020 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible and Sam Steingold. dnl Sets the HOST_CPU variable to the canonical name of the CPU. dnl Sets the HOST_CPU_C_ABI variable to the canonical name of the CPU with its dnl C language ABI (application binary interface). dnl Also defines __${HOST_CPU}__ and __${HOST_CPU_C_ABI}__ as C macros in dnl config.h. dnl dnl This canonical name can be used to select a particular assembly language dnl source file that will interoperate with C code on the given host. dnl dnl For example: dnl * 'i386' and 'sparc' are different canonical names, because code for i386 dnl will not run on SPARC CPUs and vice versa. They have different dnl instruction sets. dnl * 'sparc' and 'sparc64' are different canonical names, because code for dnl 'sparc' and code for 'sparc64' cannot be linked together: 'sparc' code dnl contains 32-bit instructions, whereas 'sparc64' code contains 64-bit dnl instructions. A process on a SPARC CPU can be in 32-bit mode or in 64-bit dnl mode, but not both. dnl * 'mips' and 'mipsn32' are different canonical names, because they use dnl different argument passing and return conventions for C functions, and dnl although the instruction set of 'mips' is a large subset of the dnl instruction set of 'mipsn32'. dnl * 'mipsn32' and 'mips64' are different canonical names, because they use dnl different sizes for the C types like 'int' and 'void *', and although dnl the instruction sets of 'mipsn32' and 'mips64' are the same. dnl * The same canonical name is used for different endiannesses. You can dnl determine the endianness through preprocessor symbols: dnl - 'arm': test __ARMEL__. dnl - 'mips', 'mipsn32', 'mips64': test _MIPSEB vs. _MIPSEL. dnl - 'powerpc64': test _BIG_ENDIAN vs. _LITTLE_ENDIAN. dnl * The same name 'i386' is used for CPUs of type i386, i486, i586 dnl (Pentium), AMD K7, Pentium II, Pentium IV, etc., because dnl - Instructions that do not exist on all of these CPUs (cmpxchg, dnl MMX, SSE, SSE2, 3DNow! etc.) are not frequently used. If your dnl assembly language source files use such instructions, you will dnl need to make the distinction. dnl - Speed of execution of the common instruction set is reasonable across dnl the entire family of CPUs. If you have assembly language source files dnl that are optimized for particular CPU types (like GNU gmp has), you dnl will need to make the distinction. dnl See . AC_DEFUN([gl_HOST_CPU_C_ABI], [ AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([gl_C_ASM]) AC_CACHE_CHECK([host CPU and C ABI], [gl_cv_host_cpu_c_abi], [case "$host_cpu" in changequote(,)dnl i[34567]86 ) changequote([,])dnl gl_cv_host_cpu_c_abi=i386 ;; x86_64 ) # On x86_64 systems, the C compiler may be generating code in one of # these ABIs: # - 64-bit instruction set, 64-bit pointers, 64-bit 'long': x86_64. # - 64-bit instruction set, 64-bit pointers, 32-bit 'long': x86_64 # with native Windows (mingw, MSVC). # - 64-bit instruction set, 32-bit pointers, 32-bit 'long': x86_64-x32. # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': i386. AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#if (defined __x86_64__ || defined __amd64__ \ || defined _M_X64 || defined _M_AMD64) int ok; #else error fail #endif ]])], [AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#if defined __ILP32__ || defined _ILP32 int ok; #else error fail #endif ]])], [gl_cv_host_cpu_c_abi=x86_64-x32], [gl_cv_host_cpu_c_abi=x86_64])], [gl_cv_host_cpu_c_abi=i386]) ;; changequote(,)dnl alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] ) changequote([,])dnl gl_cv_host_cpu_c_abi=alpha ;; arm* | aarch64 ) # Assume arm with EABI. # On arm64 systems, the C compiler may be generating code in one of # these ABIs: # - aarch64 instruction set, 64-bit pointers, 64-bit 'long': arm64. # - aarch64 instruction set, 32-bit pointers, 32-bit 'long': arm64-ilp32. # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': arm or armhf. AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#ifdef __aarch64__ int ok; #else error fail #endif ]])], [AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#if defined __ILP32__ || defined _ILP32 int ok; #else error fail #endif ]])], [gl_cv_host_cpu_c_abi=arm64-ilp32], [gl_cv_host_cpu_c_abi=arm64])], [# Don't distinguish little-endian and big-endian arm, since they # don't require different machine code for simple operations and # since the user can distinguish them through the preprocessor # defines __ARMEL__ vs. __ARMEB__. # But distinguish arm which passes floating-point arguments and # return values in integer registers (r0, r1, ...) - this is # gcc -mfloat-abi=soft or gcc -mfloat-abi=softfp - from arm which # passes them in float registers (s0, s1, ...) and double registers # (d0, d1, ...) - this is gcc -mfloat-abi=hard. GCC 4.6 or newer # sets the preprocessor defines __ARM_PCS (for the first case) and # __ARM_PCS_VFP (for the second case), but older GCC does not. echo 'double ddd; void func (double dd) { ddd = dd; }' > conftest.c # Look for a reference to the register d0 in the .s file. AC_TRY_COMMAND(${CC-cc} $CFLAGS $CPPFLAGS $gl_c_asm_opt conftest.c) >/dev/null 2>&1 if LC_ALL=C grep 'd0,' conftest.$gl_asmext >/dev/null; then gl_cv_host_cpu_c_abi=armhf else gl_cv_host_cpu_c_abi=arm fi rm -f conftest* ]) ;; hppa1.0 | hppa1.1 | hppa2.0* | hppa64 ) # On hppa, the C compiler may be generating 32-bit code or 64-bit # code. In the latter case, it defines _LP64 and __LP64__. AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#ifdef __LP64__ int ok; #else error fail #endif ]])], [gl_cv_host_cpu_c_abi=hppa64], [gl_cv_host_cpu_c_abi=hppa]) ;; ia64* ) # On ia64 on HP-UX, the C compiler may be generating 64-bit code or # 32-bit code. In the latter case, it defines _ILP32. AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#ifdef _ILP32 int ok; #else error fail #endif ]])], [gl_cv_host_cpu_c_abi=ia64-ilp32], [gl_cv_host_cpu_c_abi=ia64]) ;; mips* ) # We should also check for (_MIPS_SZPTR == 64), but gcc keeps this # at 32. AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#if defined _MIPS_SZLONG && (_MIPS_SZLONG == 64) int ok; #else error fail #endif ]])], [gl_cv_host_cpu_c_abi=mips64], [# In the n32 ABI, _ABIN32 is defined, _ABIO32 is not defined (but # may later get defined by ), and _MIPS_SIM == _ABIN32. # In the 32 ABI, _ABIO32 is defined, _ABIN32 is not defined (but # may later get defined by ), and _MIPS_SIM == _ABIO32. AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#if (_MIPS_SIM == _ABIN32) int ok; #else error fail #endif ]])], [gl_cv_host_cpu_c_abi=mipsn32], [gl_cv_host_cpu_c_abi=mips])]) ;; powerpc* ) # Different ABIs are in use on AIX vs. Mac OS X vs. Linux,*BSD. # No need to distinguish them here; the caller may distinguish # them based on the OS. # On powerpc64 systems, the C compiler may still be generating # 32-bit code. And on powerpc-ibm-aix systems, the C compiler may # be generating 64-bit code. AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#if defined __powerpc64__ || defined _ARCH_PPC64 int ok; #else error fail #endif ]])], [# On powerpc64, there are two ABIs on Linux: The AIX compatible # one and the ELFv2 one. The latter defines _CALL_ELF=2. AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#if defined _CALL_ELF && _CALL_ELF == 2 int ok; #else error fail #endif ]])], [gl_cv_host_cpu_c_abi=powerpc64-elfv2], [gl_cv_host_cpu_c_abi=powerpc64]) ], [gl_cv_host_cpu_c_abi=powerpc]) ;; rs6000 ) gl_cv_host_cpu_c_abi=powerpc ;; riscv32 | riscv64 ) # There are 2 architectures (with variants): rv32* and rv64*. AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#if __riscv_xlen == 64 int ok; #else error fail #endif ]])], [cpu=riscv64], [cpu=riscv32]) # There are 6 ABIs: ilp32, ilp32f, ilp32d, lp64, lp64f, lp64d. # Size of 'long' and 'void *': AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#if defined __LP64__ int ok; #else error fail #endif ]])], [main_abi=lp64], [main_abi=ilp32]) # Float ABIs: # __riscv_float_abi_double: # 'float' and 'double' are passed in floating-point registers. # __riscv_float_abi_single: # 'float' are passed in floating-point registers. # __riscv_float_abi_soft: # No values are passed in floating-point registers. AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#if defined __riscv_float_abi_double int ok; #else error fail #endif ]])], [float_abi=d], [AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#if defined __riscv_float_abi_single int ok; #else error fail #endif ]])], [float_abi=f], [float_abi='']) ]) gl_cv_host_cpu_c_abi="${cpu}-${main_abi}${float_abi}" ;; s390* ) # On s390x, the C compiler may be generating 64-bit (= s390x) code # or 31-bit (= s390) code. AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#if defined __LP64__ || defined __s390x__ int ok; #else error fail #endif ]])], [gl_cv_host_cpu_c_abi=s390x], [gl_cv_host_cpu_c_abi=s390]) ;; sparc | sparc64 ) # UltraSPARCs running Linux have `uname -m` = "sparc64", but the # C compiler still generates 32-bit code. AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#if defined __sparcv9 || defined __arch64__ int ok; #else error fail #endif ]])], [gl_cv_host_cpu_c_abi=sparc64], [gl_cv_host_cpu_c_abi=sparc]) ;; *) gl_cv_host_cpu_c_abi="$host_cpu" ;; esac ]) dnl In most cases, $HOST_CPU and $HOST_CPU_C_ABI are the same. HOST_CPU=`echo "$gl_cv_host_cpu_c_abi" | sed -e 's/-.*//'` HOST_CPU_C_ABI="$gl_cv_host_cpu_c_abi" AC_SUBST([HOST_CPU]) AC_SUBST([HOST_CPU_C_ABI]) # This was # AC_DEFINE_UNQUOTED([__${HOST_CPU}__]) # AC_DEFINE_UNQUOTED([__${HOST_CPU_C_ABI}__]) # earlier, but KAI C++ 3.2d doesn't like this. sed -e 's/-/_/g' >> confdefs.h < #include ]], [[iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);]])], [am_cv_func_iconv=yes]) if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[ #include #include ]], [[iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);]])], [am_cv_lib_iconv=yes] [am_cv_func_iconv=yes]) LIBS="$am_save_LIBS" fi ]) if test "$am_cv_func_iconv" = yes; then AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [ dnl This tests against bugs in AIX 5.1, AIX 6.1..7.1, HP-UX 11.11, dnl Solaris 10. am_save_LIBS="$LIBS" if test $am_cv_lib_iconv = yes; then LIBS="$LIBS $LIBICONV" fi am_cv_func_iconv_works=no for ac_iconv_const in '' 'const'; do AC_RUN_IFELSE( [AC_LANG_PROGRAM( [[ #include #include #ifndef ICONV_CONST # define ICONV_CONST $ac_iconv_const #endif ]], [[int result = 0; /* Test against AIX 5.1 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); if (cd_utf8_to_88591 != (iconv_t)(-1)) { static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */ char buf[10]; ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_utf8_to_88591, &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) result |= 1; iconv_close (cd_utf8_to_88591); } } /* Test against Solaris 10 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); if (cd_ascii_to_88591 != (iconv_t)(-1)) { static ICONV_CONST char input[] = "\263"; char buf[10]; ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_ascii_to_88591, &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) result |= 2; iconv_close (cd_ascii_to_88591); } } /* Test against AIX 6.1..7.1 bug: Buffer overrun. */ { iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { static ICONV_CONST char input[] = "\304"; static char buf[2] = { (char)0xDE, (char)0xAD }; ICONV_CONST char *inptr = input; size_t inbytesleft = 1; char *outptr = buf; size_t outbytesleft = 1; size_t res = iconv (cd_88591_to_utf8, &inptr, &inbytesleft, &outptr, &outbytesleft); if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD) result |= 4; iconv_close (cd_88591_to_utf8); } } #if 0 /* This bug could be worked around by the caller. */ /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ { iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; char buf[50]; ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_88591_to_utf8, &inptr, &inbytesleft, &outptr, &outbytesleft); if ((int)res > 0) result |= 8; iconv_close (cd_88591_to_utf8); } } #endif /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is provided. */ { /* Try standardized names. */ iconv_t cd1 = iconv_open ("UTF-8", "EUC-JP"); /* Try IRIX, OSF/1 names. */ iconv_t cd2 = iconv_open ("UTF-8", "eucJP"); /* Try AIX names. */ iconv_t cd3 = iconv_open ("UTF-8", "IBM-eucJP"); /* Try HP-UX names. */ iconv_t cd4 = iconv_open ("utf8", "eucJP"); if (cd1 == (iconv_t)(-1) && cd2 == (iconv_t)(-1) && cd3 == (iconv_t)(-1) && cd4 == (iconv_t)(-1)) result |= 16; if (cd1 != (iconv_t)(-1)) iconv_close (cd1); if (cd2 != (iconv_t)(-1)) iconv_close (cd2); if (cd3 != (iconv_t)(-1)) iconv_close (cd3); if (cd4 != (iconv_t)(-1)) iconv_close (cd4); } return result; ]])], [am_cv_func_iconv_works=yes], , [case "$host_os" in aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; *) am_cv_func_iconv_works="guessing yes" ;; esac]) test "$am_cv_func_iconv_works" = no || break done LIBS="$am_save_LIBS" ]) case "$am_cv_func_iconv_works" in *no) am_func_iconv=no am_cv_lib_iconv=no ;; *) am_func_iconv=yes ;; esac else am_func_iconv=no am_cv_lib_iconv=no fi if test "$am_func_iconv" = yes; then AC_DEFINE([HAVE_ICONV], [1], [Define if you have the iconv() function and it works.]) fi if test "$am_cv_lib_iconv" = yes; then AC_MSG_CHECKING([how to link with libiconv]) AC_MSG_RESULT([$LIBICONV]) else dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV dnl either. CPPFLAGS="$am_save_CPPFLAGS" LIBICONV= LTLIBICONV= fi AC_SUBST([LIBICONV]) AC_SUBST([LTLIBICONV]) ]) dnl Define AM_ICONV using AC_DEFUN_ONCE for Autoconf >= 2.64, in order to dnl avoid warnings like dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required". dnl This is tricky because of the way 'aclocal' is implemented: dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN. dnl Otherwise aclocal's initial scan pass would miss the macro definition. dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions. dnl Otherwise aclocal would emit many "Use of uninitialized value $1" dnl warnings. m4_define([gl_iconv_AC_DEFUN], m4_version_prereq([2.64], [[AC_DEFUN_ONCE( [$1], [$2])]], [m4_ifdef([gl_00GNULIB], [[AC_DEFUN_ONCE( [$1], [$2])]], [[AC_DEFUN( [$1], [$2])]])])) gl_iconv_AC_DEFUN([AM_ICONV], [ AM_ICONV_LINK if test "$am_cv_func_iconv" = yes; then AC_MSG_CHECKING([for iconv declaration]) AC_CACHE_VAL([am_cv_proto_iconv], [ AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[ #include #include extern #ifdef __cplusplus "C" #endif #if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); #else size_t iconv(); #endif ]], [[]])], [am_cv_proto_iconv_arg1=""], [am_cv_proto_iconv_arg1="const"]) am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` AC_MSG_RESULT([ $am_cv_proto_iconv]) else dnl When compiling GNU libiconv on a system that does not have iconv yet, dnl pick the POSIX compliant declaration without 'const'. am_cv_proto_iconv_arg1="" fi AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1], [Define as const if the declaration of iconv() needs const.]) dnl Also substitute ICONV_CONST in the gnulib generated . m4_ifdef([gl_ICONV_H_DEFAULTS], [AC_REQUIRE([gl_ICONV_H_DEFAULTS]) if test -n "$am_cv_proto_iconv_arg1"; then ICONV_CONST="const" fi ]) ]) # intlmacosx.m4 serial 8 (gettext-0.20.2) dnl Copyright (C) 2004-2014, 2016, 2019-2020 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can be used in projects which are not available under dnl the GNU General Public License or the GNU Lesser General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Lesser General Public License, and the rest of the GNU dnl gettext package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Checks for special options needed on Mac OS X. dnl Defines INTL_MACOSX_LIBS. AC_DEFUN([gt_INTL_MACOSX], [ dnl Check for API introduced in Mac OS X 10.4. AC_CACHE_CHECK([for CFPreferencesCopyAppValue], [gt_cv_func_CFPreferencesCopyAppValue], [gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [[CFPreferencesCopyAppValue(NULL, NULL)]])], [gt_cv_func_CFPreferencesCopyAppValue=yes], [gt_cv_func_CFPreferencesCopyAppValue=no]) LIBS="$gt_save_LIBS"]) if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1], [Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in the CoreFoundation framework.]) fi dnl Don't check for the API introduced in Mac OS X 10.5, CFLocaleCopyCurrent, dnl because in macOS 10.13.4 it has the following behaviour: dnl When two or more languages are specified in the dnl "System Preferences > Language & Region > Preferred Languages" panel, dnl it returns en_CC where CC is the territory (even when English is not among dnl the preferred languages!). What we want instead is what dnl CFLocaleCopyCurrent returned in earlier macOS releases and what dnl CFPreferencesCopyAppValue still returns, namely ll_CC where ll is the dnl first among the preferred languages and CC is the territory. AC_CACHE_CHECK([for CFLocaleCopyPreferredLanguages], [gt_cv_func_CFLocaleCopyPreferredLanguages], [gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [[CFLocaleCopyPreferredLanguages();]])], [gt_cv_func_CFLocaleCopyPreferredLanguages=yes], [gt_cv_func_CFLocaleCopyPreferredLanguages=no]) LIBS="$gt_save_LIBS"]) if test $gt_cv_func_CFLocaleCopyPreferredLanguages = yes; then AC_DEFINE([HAVE_CFLOCALECOPYPREFERREDLANGUAGES], [1], [Define to 1 if you have the Mac OS X function CFLocaleCopyPreferredLanguages in the CoreFoundation framework.]) fi INTL_MACOSX_LIBS= if test $gt_cv_func_CFPreferencesCopyAppValue = yes \ || test $gt_cv_func_CFLocaleCopyPreferredLanguages = yes; then INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" fi AC_SUBST([INTL_MACOSX_LIBS]) ]) # lib-ld.m4 serial 9 dnl Copyright (C) 1996-2003, 2009-2020 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl Subroutines of libtool.m4, dnl with replacements s/_*LT_PATH/AC_LIB_PROG/ and s/lt_/acl_/ to avoid dnl collision with libtool.m4. dnl From libtool-2.4. Sets the variable with_gnu_ld to yes or no. AC_DEFUN([AC_LIB_PROG_LD_GNU], [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld], [# I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 /dev/null 2>&1 \ && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ || PATH_SEPARATOR=';' } fi if test -n "$LD"; then AC_MSG_CHECKING([for ld]) elif test "$GCC" = yes; then AC_MSG_CHECKING([for ld used by $CC]) elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi if test -n "$LD"; then # Let the user override the test with a path. : else AC_CACHE_VAL([acl_cv_path_LD], [ acl_cv_path_LD= # Final result of this test ac_prog=ld # Program to search in $PATH if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw acl_output=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) acl_output=`($CC -print-prog-name=ld) 2>&5` ;; esac case $acl_output in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld acl_output=`echo "$acl_output" | sed 's%\\\\%/%g'` while echo "$acl_output" | grep "$re_direlt" > /dev/null 2>&1; do acl_output=`echo $acl_output | sed "s%$re_direlt%/%"` done # Got the pathname. No search in PATH is needed. acl_cv_path_LD="$acl_output" ac_prog= ;; "") # If it fails, then pretend we aren't using GCC. ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac fi if test -n "$ac_prog"; then # Search for $ac_prog in $PATH. acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$acl_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then acl_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$acl_cv_path_LD" -v 2>&1 conftest.sh . ./conftest.sh rm -f ./conftest.sh acl_cv_rpath=done ]) wl="$acl_cv_wl" acl_libext="$acl_cv_libext" acl_shlibext="$acl_cv_shlibext" acl_libname_spec="$acl_cv_libname_spec" acl_library_names_spec="$acl_cv_library_names_spec" acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" acl_hardcode_direct="$acl_cv_hardcode_direct" acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" dnl Determine whether the user wants rpath handling at all. AC_ARG_ENABLE([rpath], [ --disable-rpath do not hardcode runtime library paths], :, enable_rpath=yes) ]) dnl AC_LIB_FROMPACKAGE(name, package) dnl declares that libname comes from the given package. The configure file dnl will then not have a --with-libname-prefix option but a dnl --with-package-prefix option. Several libraries can come from the same dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar dnl macro call that searches for libname. AC_DEFUN([AC_LIB_FROMPACKAGE], [ pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) define([acl_frompackage_]NAME, [$2]) popdef([NAME]) pushdef([PACK],[$2]) pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) define([acl_libsinpackage_]PACKUP, m4_ifdef([acl_libsinpackage_]PACKUP, [m4_defn([acl_libsinpackage_]PACKUP)[, ]],)[lib$1]) popdef([PACKUP]) popdef([PACK]) ]) dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and dnl the libraries corresponding to explicit and implicit dependencies. dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem. AC_DEFUN([AC_LIB_LINKFLAGS_BODY], [ AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])]) pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])]) dnl By default, look in $includedir and $libdir. use_additional=yes AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\" eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\" ]) AC_ARG_WITH(PACK[-prefix], [[ --with-]]PACK[[-prefix[=DIR] search for ]PACKLIBS[ in DIR/include and DIR/lib --without-]]PACK[[-prefix don't search for ]PACKLIBS[ in includedir and libdir]], [ if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\" eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\" ]) else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" additional_libdir2="$withval/$acl_libdirstem2" additional_libdir3="$withval/$acl_libdirstem3" fi fi ]) if test "X$additional_libdir2" = "X$additional_libdir"; then additional_libdir2= fi if test "X$additional_libdir3" = "X$additional_libdir"; then additional_libdir3= fi dnl Search the library and its dependencies in $additional_libdir and dnl $LDFLAGS. Using breadth-first-seach. LIB[]NAME= LTLIB[]NAME= INC[]NAME= LIB[]NAME[]_PREFIX= dnl HAVE_LIB${NAME} is an indicator that LIB${NAME}, LTLIB${NAME} have been dnl computed. So it has to be reset here. HAVE_LIB[]NAME= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='$1 $2' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" dnl See if it was already located by an earlier AC_LIB_LINKFLAGS dnl or AC_LIB_HAVE_LINKFLAGS call. uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value" else dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined dnl that this library doesn't exist. So just drop it. : fi else dnl Search the library lib$name in $additional_libdir and $LDFLAGS dnl and the already constructed $LIBNAME/$LTLIBNAME. found_dir= found_la= found_so= found_a= eval libname=\"$acl_libname_spec\" # typically: libname=lib$name if test -n "$acl_shlibext"; then shrext=".$acl_shlibext" # typically: shrext=.so else shrext= fi if test $use_additional = yes; then for additional_libdir_variable in additional_libdir additional_libdir2 additional_libdir3; do if test "X$found_dir" = "X"; then eval dir=\$$additional_libdir_variable if test -n "$dir"; then dnl The same code as in the loop below: dnl First look for a shared library. if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver" && acl_is_expected_elfclass < "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f" && acl_is_expected_elfclass < "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi dnl Then look for a static library. if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi fi fi done fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` dnl First look for a shared library. if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver" && acl_is_expected_elfclass < "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f" && acl_is_expected_elfclass < "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi dnl Then look for a static library. if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then dnl Found the library. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then dnl Linking with a shared library. We attempt to hardcode its dnl directory into the executable's runpath, unless it's the dnl standard /usr/lib. if test "$enable_rpath" = no \ || test "X$found_dir" = "X/usr/$acl_libdirstem" \ || test "X$found_dir" = "X/usr/$acl_libdirstem2" \ || test "X$found_dir" = "X/usr/$acl_libdirstem3"; then dnl No hardcoding is needed. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else dnl Use an explicit option to hardcode DIR into the resulting dnl binary. dnl Potentially add DIR to ltrpathdirs. dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi dnl The hardcoding into $LIBNAME is system dependent. if test "$acl_hardcode_direct" = yes; then dnl Using DIR/libNAME.so during linking hardcodes DIR into the dnl resulting binary. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then dnl Use an explicit option to hardcode DIR into the resulting dnl binary. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" dnl Potentially add DIR to rpathdirs. dnl The rpathdirs will be appended to $LIBNAME at the end. haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else dnl Rely on "-L$found_dir". dnl But don't add it if it's already contained in the LDFLAGS dnl or the already constructed $LIBNAME haveit= for x in $LDFLAGS $LIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" fi if test "$acl_hardcode_minus_L" != no; then dnl FIXME: Not sure whether we should use dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" dnl here. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH dnl here, because this doesn't fit in flags passed to the dnl compiler. So give up. No hardcoding. This affects only dnl very old systems. dnl FIXME: Not sure whether we should use dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" dnl here. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then dnl Linking with a static library. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a" else dnl We shouldn't come here, but anyway it's good to have a dnl fallback. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" fi fi dnl Assume the include files are nearby. additional_includedir= case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` if test "$name" = '$1'; then LIB[]NAME[]_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; */$acl_libdirstem2 | */$acl_libdirstem2/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` if test "$name" = '$1'; then LIB[]NAME[]_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; */$acl_libdirstem3 | */$acl_libdirstem3/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem3/"'*$,,'` if test "$name" = '$1'; then LIB[]NAME[]_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then dnl Potentially add $additional_includedir to $INCNAME. dnl But don't add it dnl 1. if it's the standard /usr/include, dnl 2. if it's /usr/local/include and we are using GCC on Linux, dnl 3. if it's already present in $CPPFLAGS or the already dnl constructed $INCNAME, dnl 4. if it doesn't exist as a directory. if test "X$additional_includedir" != "X/usr/include"; then haveit= if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then for x in $CPPFLAGS $INC[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then dnl Really add $additional_includedir to $INCNAME. INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir" fi fi fi fi fi dnl Look for dependencies. if test -n "$found_la"; then dnl Read the .la file. It defines the variables dnl dlname, library_names, old_library, dependency_libs, current, dnl age, revision, installed, dlopen, dlpreopen, libdir. save_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$save_libdir" dnl We use only dependency_libs. for dep in $dependency_libs; do case "$dep" in -L*) dependency_libdir=`echo "X$dep" | sed -e 's/^X-L//'` dnl Potentially add $dependency_libdir to $LIBNAME and $LTLIBNAME. dnl But don't add it dnl 1. if it's the standard /usr/lib, dnl 2. if it's /usr/local/lib and we are using GCC on Linux, dnl 3. if it's already present in $LDFLAGS or the already dnl constructed $LIBNAME, dnl 4. if it doesn't exist as a directory. if test "X$dependency_libdir" != "X/usr/$acl_libdirstem" \ && test "X$dependency_libdir" != "X/usr/$acl_libdirstem2" \ && test "X$dependency_libdir" != "X/usr/$acl_libdirstem3"; then haveit= if test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem" \ || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem2" \ || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem3"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$dependency_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$dependency_libdir"; then dnl Really add $dependency_libdir to $LIBNAME. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$dependency_libdir" fi fi haveit= for x in $LDFLAGS $LTLIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$dependency_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$dependency_libdir"; then dnl Really add $dependency_libdir to $LTLIBNAME. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$dependency_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then dnl Potentially add DIR to rpathdirs. dnl The rpathdirs will be appended to $LIBNAME at the end. haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi dnl Potentially add DIR to ltrpathdirs. dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) dnl Handle this in the next round. names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) dnl Handle this in the next round. Throw away the .la's dnl directory; it is already contained in a preceding -L dnl option. names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) dnl Most likely an immediate library name. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep" LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep" ;; esac done fi else dnl Didn't find the library; assume it is in the system directories dnl known to the linker and runtime loader. (All the system dnl directories known to the linker should also be known to the dnl runtime loader, otherwise the system is severely misconfigured.) LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$acl_hardcode_libdir_separator"; then dnl Weird platform: only the last -rpath option counts, the user must dnl pass all path elements in one option. We can arrange that for a dnl single library, but not when more than one $LIBNAMEs are used. alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" done dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl. acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" else dnl The -rpath options are cumulative. for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then dnl When using libtool, the option that works for both libraries and dnl executables is -R. The -R options are cumulative. for found_dir in $ltrpathdirs; do LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" done fi popdef([PACKLIBS]) popdef([PACKUP]) popdef([PACK]) popdef([NAME]) ]) dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, dnl unless already present in VAR. dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes dnl contains two or three consecutive elements that belong together. AC_DEFUN([AC_LIB_APPENDTOVAR], [ for element in [$2]; do haveit= for x in $[$1]; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then [$1]="${[$1]}${[$1]:+ }$element" fi done ]) dnl For those cases where a variable contains several -L and -l options dnl referring to unknown libraries and directories, this macro determines the dnl necessary additional linker options for the runtime path. dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL]) dnl sets LDADDVAR to linker options needed together with LIBSVALUE. dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed, dnl otherwise linking without libtool is assumed. AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS], [ AC_REQUIRE([AC_LIB_RPATH]) AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) $1= if test "$enable_rpath" != no; then if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then dnl Use an explicit option to hardcode directories into the resulting dnl binary. rpathdirs= next= for opt in $2; do if test -n "$next"; then dir="$next" dnl No need to hardcode the standard /usr/lib. if test "X$dir" != "X/usr/$acl_libdirstem" \ && test "X$dir" != "X/usr/$acl_libdirstem2" \ && test "X$dir" != "X/usr/$acl_libdirstem3"; then rpathdirs="$rpathdirs $dir" fi next= else case $opt in -L) next=yes ;; -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'` dnl No need to hardcode the standard /usr/lib. if test "X$dir" != "X/usr/$acl_libdirstem" \ && test "X$dir" != "X/usr/$acl_libdirstem2" \ && test "X$dir" != "X/usr/$acl_libdirstem3"; then rpathdirs="$rpathdirs $dir" fi next= ;; *) next= ;; esac fi done if test "X$rpathdirs" != "X"; then if test -n ""$3""; then dnl libtool is used for linking. Use -R options. for dir in $rpathdirs; do $1="${$1}${$1:+ }-R$dir" done else dnl The linker is used for linking directly. if test -n "$acl_hardcode_libdir_separator"; then dnl Weird platform: only the last -rpath option counts, the user dnl must pass all path elements in one option. alldirs= for dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir" done acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" $1="$flag" else dnl The -rpath options are cumulative. for dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" $1="${$1}${$1:+ }$flag" done fi fi fi fi fi AC_SUBST([$1]) ]) # lib-prefix.m4 serial 17 dnl Copyright (C) 2001-2005, 2008-2020 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed dnl to access previously installed libraries. The basic assumption is that dnl a user will want packages to use other packages he previously installed dnl with the same --prefix option. dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate dnl libraries, but is otherwise very convenient. AC_DEFUN([AC_LIB_PREFIX], [ AC_BEFORE([$0], [AC_LIB_LINKFLAGS]) AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) dnl By default, look in $includedir and $libdir. use_additional=yes AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) AC_ARG_WITH([lib-prefix], [[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib --without-lib-prefix don't search for libraries in includedir and libdir]], [ if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" fi fi ]) if test $use_additional = yes; then dnl Potentially add $additional_includedir to $CPPFLAGS. dnl But don't add it dnl 1. if it's the standard /usr/include, dnl 2. if it's already present in $CPPFLAGS, dnl 3. if it's /usr/local/include and we are using GCC on Linux, dnl 4. if it doesn't exist as a directory. if test "X$additional_includedir" != "X/usr/include"; then haveit= for x in $CPPFLAGS; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then if test -d "$additional_includedir"; then dnl Really add $additional_includedir to $CPPFLAGS. CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir" fi fi fi fi dnl Potentially add $additional_libdir to $LDFLAGS. dnl But don't add it dnl 1. if it's the standard /usr/lib, dnl 2. if it's already present in $LDFLAGS, dnl 3. if it's /usr/local/lib and we are using GCC on Linux, dnl 4. if it doesn't exist as a directory. if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then haveit= for x in $LDFLAGS; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then if test -n "$GCC"; then case $host_os in linux*) haveit=yes;; esac fi fi if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LDFLAGS. LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir" fi fi fi fi fi ]) dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix, dnl acl_final_exec_prefix, containing the values to which $prefix and dnl $exec_prefix will expand at the end of the configure script. AC_DEFUN([AC_LIB_PREPARE_PREFIX], [ dnl Unfortunately, prefix and exec_prefix get only finally determined dnl at the end of configure. if test "X$prefix" = "XNONE"; then acl_final_prefix="$ac_default_prefix" else acl_final_prefix="$prefix" fi if test "X$exec_prefix" = "XNONE"; then acl_final_exec_prefix='${prefix}' else acl_final_exec_prefix="$exec_prefix" fi acl_save_prefix="$prefix" prefix="$acl_final_prefix" eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" prefix="$acl_save_prefix" ]) dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the dnl variables prefix and exec_prefix bound to the values they will have dnl at the end of the configure script. AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], [ acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" $1 exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" ]) dnl AC_LIB_PREPARE_MULTILIB creates dnl - a function acl_is_expected_elfclass, that tests whether standard input dn; has a 32-bit or 64-bit ELF header, depending on the host CPU ABI, dnl - 3 variables acl_libdirstem, acl_libdirstem2, acl_libdirstem3, containing dnl the basename of the libdir to try in turn, either "lib" or "lib64" or dnl "lib/64" or "lib32" or "lib/sparcv9" or "lib/amd64" or similar. AC_DEFUN([AC_LIB_PREPARE_MULTILIB], [ dnl There is no formal standard regarding lib, lib32, and lib64. dnl On most glibc systems, the current practice is that on a system supporting dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. However, on dnl Arch Linux based distributions, it's the opposite: 32-bit libraries go dnl under $prefix/lib32 and 64-bit libraries go under $prefix/lib. dnl We determine the compiler's default mode by looking at the compiler's dnl library search path. If at least one of its elements ends in /lib64 or dnl points to a directory whose absolute pathname ends in /lib64, we use that dnl for 64-bit ABIs. Similarly for 32-bit ABIs. Otherwise we use the default, dnl namely "lib". dnl On Solaris systems, the current practice is that on a system supporting dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib. AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([gl_HOST_CPU_C_ABI_32BIT]) AC_CACHE_CHECK([for ELF binary format], [gl_cv_elf], [AC_EGREP_CPP([Extensible Linking Format], [#ifdef __ELF__ Extensible Linking Format #endif ], [gl_cv_elf=yes], [gl_cv_elf=no]) ]) if test $gl_cv_elf; then # Extract the ELF class of a file (5th byte) in decimal. # Cf. https://en.wikipedia.org/wiki/Executable_and_Linkable_Format#File_header if od -A x < /dev/null >/dev/null 2>/dev/null; then # Use POSIX od. func_elfclass () { od -A n -t d1 -j 4 -N 1 } else # Use BSD hexdump. func_elfclass () { dd bs=1 count=1 skip=4 2>/dev/null | hexdump -e '1/1 "%3d "' echo } fi changequote(,)dnl case $HOST_CPU_C_ABI_32BIT in yes) # 32-bit ABI. acl_is_expected_elfclass () { test "`func_elfclass | sed -e 's/[ ]//g'`" = 1 } ;; no) # 64-bit ABI. acl_is_expected_elfclass () { test "`func_elfclass | sed -e 's/[ ]//g'`" = 2 } ;; *) # Unknown. acl_is_expected_elfclass () { : } ;; esac changequote([,])dnl else acl_is_expected_elfclass () { : } fi dnl Allow the user to override the result by setting acl_cv_libdirstems. AC_CACHE_CHECK([for the common suffixes of directories in the library search path], [acl_cv_libdirstems], [dnl Try 'lib' first, because that's the default for libdir in GNU, see dnl . acl_libdirstem=lib acl_libdirstem2= acl_libdirstem3= case "$host_os" in solaris*) dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment dnl . dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link." dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the dnl symlink is missing, so we set acl_libdirstem2 too. if test $HOST_CPU_C_ABI_32BIT = no; then acl_libdirstem2=lib/64 case "$host_cpu" in sparc*) acl_libdirstem3=lib/sparcv9 ;; i*86 | x86_64) acl_libdirstem3=lib/amd64 ;; esac fi ;; *) dnl If $CC generates code for a 32-bit ABI, the libraries are dnl surely under $prefix/lib or $prefix/lib32, not $prefix/lib64. dnl Similarly, if $CC generates code for a 64-bit ABI, the libraries dnl are surely under $prefix/lib or $prefix/lib64, not $prefix/lib32. dnl Find the compiler's search path. However, non-system compilers dnl sometimes have odd library search paths. But we can't simply invoke dnl '/usr/bin/gcc -print-search-dirs' because that would not take into dnl account the -m32/-m31 or -m64 options from the $CC or $CFLAGS. searchpath=`(LC_ALL=C $CC $CPPFLAGS $CFLAGS -print-search-dirs) 2>/dev/null \ | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` if test $HOST_CPU_C_ABI_32BIT != no; then # 32-bit or unknown ABI. if test -d /usr/lib32; then acl_libdirstem2=lib32 fi fi if test $HOST_CPU_C_ABI_32BIT != yes; then # 64-bit or unknown ABI. if test -d /usr/lib64; then acl_libdirstem3=lib64 fi fi if test -n "$searchpath"; then acl_save_IFS="${IFS= }"; IFS=":" for searchdir in $searchpath; do if test -d "$searchdir"; then case "$searchdir" in */lib32/ | */lib32 ) acl_libdirstem2=lib32 ;; */lib64/ | */lib64 ) acl_libdirstem3=lib64 ;; */../ | */.. ) # Better ignore directories of this form. They are misleading. ;; *) searchdir=`cd "$searchdir" && pwd` case "$searchdir" in */lib32 ) acl_libdirstem2=lib32 ;; */lib64 ) acl_libdirstem3=lib64 ;; esac ;; esac fi done IFS="$acl_save_IFS" if test $HOST_CPU_C_ABI_32BIT = yes; then # 32-bit ABI. acl_libdirstem3= fi if test $HOST_CPU_C_ABI_32BIT = no; then # 64-bit ABI. acl_libdirstem2= fi fi ;; esac test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" test -n "$acl_libdirstem3" || acl_libdirstem3="$acl_libdirstem" acl_cv_libdirstems="$acl_libdirstem,$acl_libdirstem2,$acl_libdirstem3" ]) dnl Decompose acl_cv_libdirstems into acl_libdirstem, acl_libdirstem2, and dnl acl_libdirstem3. changequote(,)dnl acl_libdirstem=`echo "$acl_cv_libdirstems" | sed -e 's/,.*//'` acl_libdirstem2=`echo "$acl_cv_libdirstems" | sed -e 's/^[^,]*,//' -e 's/,.*//'` acl_libdirstem3=`echo "$acl_cv_libdirstems" | sed -e 's/^[^,]*,[^,]*,//' -e 's/,.*//'` changequote([,])dnl ]) # nls.m4 serial 6 (gettext-0.20.2) dnl Copyright (C) 1995-2003, 2005-2006, 2008-2014, 2016, 2019-2020 Free dnl Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can be used in projects which are not available under dnl the GNU General Public License or the GNU Lesser General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Lesser General Public License, and the rest of the GNU dnl gettext package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2003. AC_PREREQ([2.50]) AC_DEFUN([AM_NLS], [ AC_MSG_CHECKING([whether NLS is requested]) dnl Default is enabled NLS AC_ARG_ENABLE([nls], [ --disable-nls do not use Native Language Support], USE_NLS=$enableval, USE_NLS=yes) AC_MSG_RESULT([$USE_NLS]) AC_SUBST([USE_NLS]) ]) # po.m4 serial 31 (gettext-0.20.2) dnl Copyright (C) 1995-2014, 2016, 2018-2020 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can be used in projects which are not available under dnl the GNU General Public License or the GNU Lesser General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Lesser General Public License, and the rest of the GNU dnl gettext package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2003. AC_PREREQ([2.60]) dnl Checks for all prerequisites of the po subdirectory. AC_DEFUN([AM_PO_SUBDIRS], [ AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl AC_REQUIRE([AC_PROG_SED])dnl AC_REQUIRE([AM_NLS])dnl dnl Release version of the gettext macros. This is used to ensure that dnl the gettext macros and po/Makefile.in.in are in sync. AC_SUBST([GETTEXT_MACRO_VERSION], [0.20]) dnl Perform the following tests also if --disable-nls has been given, dnl because they are needed for "make dist" to work. dnl Search for GNU msgfmt in the PATH. dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions. dnl The second test excludes FreeBSD msgfmt. AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 && (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], :) AC_PATH_PROG([GMSGFMT], [gmsgfmt], [$MSGFMT]) dnl Test whether it is GNU msgfmt >= 0.15. changequote(,)dnl case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;; *) GMSGFMT_015=$GMSGFMT ;; esac changequote([,])dnl AC_SUBST([GMSGFMT_015]) dnl Search for GNU xgettext 0.12 or newer in the PATH. dnl The first test excludes Solaris xgettext and early GNU xgettext versions. dnl The second test excludes FreeBSD xgettext. AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 && (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], :) dnl Remove leftover from FreeBSD xgettext call. rm -f messages.po dnl Test whether it is GNU xgettext >= 0.15. changequote(,)dnl case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;; *) XGETTEXT_015=$XGETTEXT ;; esac changequote([,])dnl AC_SUBST([XGETTEXT_015]) dnl Search for GNU msgmerge 0.11 or newer in the PATH. AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge, [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :) dnl Test whether it is GNU msgmerge >= 0.20. if LC_ALL=C $MSGMERGE --help | grep ' --for-msgfmt ' >/dev/null; then MSGMERGE_FOR_MSGFMT_OPTION='--for-msgfmt' else dnl Test whether it is GNU msgmerge >= 0.12. if LC_ALL=C $MSGMERGE --help | grep ' --no-fuzzy-matching ' >/dev/null; then MSGMERGE_FOR_MSGFMT_OPTION='--no-fuzzy-matching --no-location --quiet' else dnl With these old versions, $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) is dnl slow. But this is not a big problem, as such old gettext versions are dnl hardly in use any more. MSGMERGE_FOR_MSGFMT_OPTION='--no-location --quiet' fi fi AC_SUBST([MSGMERGE_FOR_MSGFMT_OPTION]) dnl Support for AM_XGETTEXT_OPTION. test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS= AC_SUBST([XGETTEXT_EXTRA_OPTIONS]) AC_CONFIG_COMMANDS([po-directories], [[ for ac_file in $CONFIG_FILES; do # Support "outfile[:infile[:infile...]]" case "$ac_file" in *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; esac # PO directories have a Makefile.in generated from Makefile.in.in. case "$ac_file" in */Makefile.in) # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'` ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; *) top_srcdir="$ac_dots$ac_given_srcdir" ;; esac # Treat a directory as a PO directory if and only if it has a # POTFILES.in file. This allows packages to have multiple PO # directories under different names or in different locations. if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then rm -f "$ac_dir/POTFILES" test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" gt_tab=`printf '\t'` cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ${gt_tab}]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" POMAKEFILEDEPS="POTFILES.in" # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend # on $ac_dir but don't depend on user-specified configuration # parameters. if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then # The LINGUAS file contains the set of available languages. if test -n "$OBSOLETE_ALL_LINGUAS"; then test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" fi ALL_LINGUAS=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" else # The set of available languages was given in configure.in. ALL_LINGUAS=$OBSOLETE_ALL_LINGUAS fi # Compute POFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) # Compute UPDATEPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) # Compute DUMMYPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) # Compute GMOFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) case "$ac_given_srcdir" in .) srcdirpre= ;; *) srcdirpre='$(srcdir)/' ;; esac POFILES= UPDATEPOFILES= DUMMYPOFILES= GMOFILES= for lang in $ALL_LINGUAS; do POFILES="$POFILES $srcdirpre$lang.po" UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" DUMMYPOFILES="$DUMMYPOFILES $lang.nop" GMOFILES="$GMOFILES $srcdirpre$lang.gmo" done # CATALOGS depends on both $ac_dir and the user's LINGUAS # environment variable. INST_LINGUAS= if test -n "$ALL_LINGUAS"; then for presentlang in $ALL_LINGUAS; do useit=no if test "%UNSET%" != "$LINGUAS"; then desiredlanguages="$LINGUAS" else desiredlanguages="$ALL_LINGUAS" fi for desiredlang in $desiredlanguages; do # Use the presentlang catalog if desiredlang is # a. equal to presentlang, or # b. a variant of presentlang (because in this case, # presentlang can be used as a fallback for messages # which are not translated in the desiredlang catalog). case "$desiredlang" in "$presentlang"*) useit=yes;; esac done if test $useit = yes; then INST_LINGUAS="$INST_LINGUAS $presentlang" fi done fi CATALOGS= if test -n "$INST_LINGUAS"; then for lang in $INST_LINGUAS; do CATALOGS="$CATALOGS $lang.gmo" done fi test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do if test -f "$f"; then case "$f" in *.orig | *.bak | *~) ;; *) cat "$f" >> "$ac_dir/Makefile" ;; esac fi done fi ;; esac done]], [# Capture the value of obsolete ALL_LINGUAS because we need it to compute # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. OBSOLETE_ALL_LINGUAS="$ALL_LINGUAS" # Capture the value of LINGUAS because we need it to compute CATALOGS. LINGUAS="${LINGUAS-%UNSET%}" ]) ]) dnl Postprocesses a Makefile in a directory containing PO files. AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE], [ # When this code is run, in config.status, two variables have already been # set: # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in, # - LINGUAS is the value of the environment variable LINGUAS at configure # time. changequote(,)dnl # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'` ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; *) top_srcdir="$ac_dots$ac_given_srcdir" ;; esac # Find a way to echo strings without interpreting backslash. if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then gt_echo='echo' else if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then gt_echo='printf %s\n' else echo_func () { cat < "$ac_file.tmp" tab=`printf '\t'` if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then # Add dependencies that cannot be formulated as a simple suffix rule. for lang in $ALL_LINGUAS; do frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` cat >> "$ac_file.tmp" < /dev/null; then # Add dependencies that cannot be formulated as a simple suffix rule. for lang in $ALL_LINGUAS; do frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'` cat >> "$ac_file.tmp" <> "$ac_file.tmp" <, 1996. AC_PREREQ([2.50]) # Search path for a program which passes the given test. dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) AC_DEFUN([AM_PATH_PROG_WITH_TEST], [ # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which # contains only /bin. Note that ksh looks also at the FPATH variable, # so we have to set that as well for the test. PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ || PATH_SEPARATOR=';' } fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "$2", so it can be a program name with args. set dummy $2; ac_word=[$]2 AC_MSG_CHECKING([for $ac_word]) AC_CACHE_VAL([ac_cv_path_$1], [case "[$]$1" in [[\\/]]* | ?:[[\\/]]*) ac_cv_path_$1="[$]$1" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in ifelse([$5], , $PATH, [$5]); do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD if [$3]; then ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" dnl If no 4th arg is given, leave the cache variable unset, dnl so AC_PATH_PROGS will keep looking. ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" ])dnl ;; esac])dnl $1="$ac_cv_path_$1" if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then AC_MSG_RESULT([$][$1]) else AC_MSG_RESULT([no]) fi AC_SUBST([$1])dnl ]) # Copyright (C) 2002-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.16' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.16.5], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.16.5])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to # '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], [$1], [UPC], [depcc="$UPC" am_compiler_list=], [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. # TODO: see whether this extra hack can be removed once we start # requiring Autoconf 2.70 or later. AS_CASE([$CONFIG_FILES], [*\'*], [eval set x "$CONFIG_FILES"], [*], [set x $CONFIG_FILES]) shift # Used to flag and report bootstrapping failures. am_rc=0 for am_mf do # Strip MF so we end up with the name of the file. am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ || continue am_dirpart=`AS_DIRNAME(["$am_mf"])` am_filepart=`AS_BASENAME(["$am_mf"])` AM_RUN_LOG([cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles]) || am_rc=$? done if test $am_rc -ne 0; then AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments for automatic dependency tracking. If GNU make was not used, consider re-running the configure script with MAKE="gmake" (or whatever is necessary). You can also try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking).]) fi AS_UNSET([am_dirpart]) AS_UNSET([am_filepart]) AS_UNSET([am_mf]) AS_UNSET([am_rc]) rm -f conftest-deps.mk } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking is enabled. # This creates each '.Po' and '.Plo' makefile fragment that we'll need in # order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC]) [_AM_PROG_CC_C_O ]) # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl m4_ifdef([_$0_ALREADY_INIT], [m4_fatal([$0 expanded multiple times ]m4_defn([_$0_ALREADY_INIT]))], [m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) # Variables for tags utilities; see am/tags.am if test -z "$CTAGS"; then CTAGS=ctags fi AC_SUBST([CTAGS]) if test -z "$ETAGS"; then ETAGS=etags fi AC_SUBST([ETAGS]) if test -z "$CSCOPE"; then CSCOPE=cscope fi AC_SUBST([CSCOPE]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi dnl The trailing newline in this macro's definition is deliberate, for dnl backward compatibility and to allow trailing 'dnl'-style comments dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) # Copyright (C) 2003-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAKE_INCLUDE() # ----------------- # Check whether make has an 'include' directive that can support all # the idioms we need for our automatic dependency tracking code. AC_DEFUN([AM_MAKE_INCLUDE], [AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out .PHONY: am__doit END am__include="#" am__quote= # BSD make does it like this. echo '.include "confinc.mk" # ignored' > confmf.BSD # Other make implementations (GNU, Solaris 10, AIX) do it like this. echo 'include confinc.mk # ignored' > confmf.GNU _am_result=no for s in GNU BSD; do AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) AS_CASE([$?:`cat confinc.out 2>/dev/null`], ['0:this is the am__doit target'], [AS_CASE([$s], [BSD], [am__include='.include' am__quote='"'], [am__include='include' am__quote=''])]) if test "$am__include" != "#"; then _am_result="yes ($s style)" break fi done rm -f confinc.* confmf.* AC_MSG_RESULT([${_am_result}]) AC_SUBST([am__include])]) AC_SUBST([am__quote])]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it is modern enough. # If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then MISSING="\${SHELL} '$am_aux_dir/missing'" fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_CC_C_O # --------------- # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC # to automatically call this. AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl AC_LANG_PUSH([C])dnl AC_CACHE_CHECK( [whether $CC understands -c and -o together], [am_cv_prog_cc_c_o], [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i]) if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT([yes]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar # AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR pv-1.8.5/build-aux/000077500000000000000000000000001452655021700140535ustar00rootroot00000000000000pv-1.8.5/build-aux/ar-lib000077500000000000000000000133631452655021700151550ustar00rootroot00000000000000#! /bin/sh # Wrapper for Microsoft lib.exe me=ar-lib scriptversion=2019-07-04.01; # UTC # Copyright (C) 2010-2021 Free Software Foundation, Inc. # Written by Peter Rosin . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . # func_error message func_error () { echo "$me: $1" 1>&2 exit 1 } file_conv= # func_file_conv build_file # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN* | MSYS*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv in mingw) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin | msys) file=`cygpath -m "$file" || echo "$file"` ;; wine) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_at_file at_file operation archive # Iterate over all members in AT_FILE performing OPERATION on ARCHIVE # for each of them. # When interpreting the content of the @FILE, do NOT use func_file_conv, # since the user would need to supply preconverted file names to # binutils ar, at least for MinGW. func_at_file () { operation=$2 archive=$3 at_file_contents=`cat "$1"` eval set x "$at_file_contents" shift for member do $AR -NOLOGO $operation:"$member" "$archive" || exit $? done } case $1 in '') func_error "no command. Try '$0 --help' for more information." ;; -h | --h*) cat <. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN* | MSYS*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/* | msys/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: pv-1.8.5/build-aux/config.guess000077500000000000000000001405121452655021700163760ustar00rootroot00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2022 Free Software Foundation, Inc. # shellcheck disable=SC2006,SC2268 # see below for rationale timestamp='2022-01-09' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: # https://git.savannah.gnu.org/cgit/config.git/plain/config.guess # # Please send patches to . # The "shellcheck disable" line above the timestamp inhibits complaints # about features and limitations of the classic Bourne shell that were # superseded or lifted in POSIX. However, this script identifies a wide # variety of pre-POSIX systems that do not have POSIX shells at all, and # even some reasonably current systems (Solaris 10 as case-in-point) still # have a pre-POSIX /bin/sh. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright 1992-2022 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi # Just in case it came from the environment. GUESS= # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. tmp= # shellcheck disable=SC2172 trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15 set_cc_for_build() { # prevent multiple calls if $tmp is already set test "$tmp" && return 0 : "${TMPDIR=/tmp}" # shellcheck disable=SC2039,SC3028 { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } dummy=$tmp/dummy case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in ,,) echo "int x;" > "$dummy.c" for driver in cc gcc c89 c99 ; do if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then CC_FOR_BUILD=$driver break fi done if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac } # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if test -f /.attbin/uname ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case $UNAME_SYSTEM in Linux|GNU|GNU/*) LIBC=unknown set_cc_for_build cat <<-EOF > "$dummy.c" #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #elif defined(__GLIBC__) LIBC=gnu #else #include /* First heuristic to detect musl libc. */ #ifdef __DEFINED_va_list LIBC=musl #endif #endif EOF cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` eval "$cc_set_libc" # Second heuristic to detect musl libc. if [ "$LIBC" = unknown ] && command -v ldd >/dev/null && ldd --version 2>&1 | grep -q ^musl; then LIBC=musl fi # If the system lacks a compiler, then just pick glibc. # We could probably try harder. if [ "$LIBC" = unknown ]; then LIBC=gnu fi ;; esac # Note: order is significant - the case branches are not exclusive. case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ /sbin/sysctl -n hw.machine_arch 2>/dev/null || \ /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \ echo unknown)` case $UNAME_MACHINE_ARCH in aarch64eb) machine=aarch64_be-unknown ;; armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; earmv*) arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` machine=${arch}${endian}-unknown ;; *) machine=$UNAME_MACHINE_ARCH-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently (or will in the future) and ABI. case $UNAME_MACHINE_ARCH in earm*) os=netbsdelf ;; arm*|i386|m68k|ns32k|sh3*|sparc|vax) set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # Determine ABI tags. case $UNAME_MACHINE_ARCH in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case $UNAME_VERSION in Debian*) release='-gnu' ;; *) release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. GUESS=$machine-${os}${release}${abi-} ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-openbsd$UNAME_RELEASE ;; *:SecBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-secbsd$UNAME_RELEASE ;; *:LibertyBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE ;; *:MidnightBSD:*:*) GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE ;; *:ekkoBSD:*:*) GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE ;; *:SolidBSD:*:*) GUESS=$UNAME_MACHINE-unknown-solidbsd$UNAME_RELEASE ;; *:OS108:*:*) GUESS=$UNAME_MACHINE-unknown-os108_$UNAME_RELEASE ;; macppc:MirBSD:*:*) GUESS=powerpc-unknown-mirbsd$UNAME_RELEASE ;; *:MirBSD:*:*) GUESS=$UNAME_MACHINE-unknown-mirbsd$UNAME_RELEASE ;; *:Sortix:*:*) GUESS=$UNAME_MACHINE-unknown-sortix ;; *:Twizzler:*:*) GUESS=$UNAME_MACHINE-unknown-twizzler ;; *:Redox:*:*) GUESS=$UNAME_MACHINE-unknown-redox ;; mips:OSF1:*.*) GUESS=mips-dec-osf1 ;; alpha:OSF1:*:*) # Reset EXIT trap before exiting to avoid spurious non-zero exit code. trap '' 0 case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case $ALPHA_CPU_TYPE in "EV4 (21064)") UNAME_MACHINE=alpha ;; "EV4.5 (21064)") UNAME_MACHINE=alpha ;; "LCA4 (21066/21068)") UNAME_MACHINE=alpha ;; "EV5 (21164)") UNAME_MACHINE=alphaev5 ;; "EV5.6 (21164A)") UNAME_MACHINE=alphaev56 ;; "EV5.6 (21164PC)") UNAME_MACHINE=alphapca56 ;; "EV5.7 (21164PC)") UNAME_MACHINE=alphapca57 ;; "EV6 (21264)") UNAME_MACHINE=alphaev6 ;; "EV6.7 (21264A)") UNAME_MACHINE=alphaev67 ;; "EV6.8CB (21264C)") UNAME_MACHINE=alphaev68 ;; "EV6.8AL (21264B)") UNAME_MACHINE=alphaev68 ;; "EV6.8CX (21264D)") UNAME_MACHINE=alphaev68 ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE=alphaev69 ;; "EV7 (21364)") UNAME_MACHINE=alphaev7 ;; "EV7.9 (21364A)") UNAME_MACHINE=alphaev79 ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. OSF_REL=`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` GUESS=$UNAME_MACHINE-dec-osf$OSF_REL ;; Amiga*:UNIX_System_V:4.0:*) GUESS=m68k-unknown-sysv4 ;; *:[Aa]miga[Oo][Ss]:*:*) GUESS=$UNAME_MACHINE-unknown-amigaos ;; *:[Mm]orph[Oo][Ss]:*:*) GUESS=$UNAME_MACHINE-unknown-morphos ;; *:OS/390:*:*) GUESS=i370-ibm-openedition ;; *:z/VM:*:*) GUESS=s390-ibm-zvmoe ;; *:OS400:*:*) GUESS=powerpc-ibm-os400 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) GUESS=arm-acorn-riscix$UNAME_RELEASE ;; arm*:riscos:*:*|arm*:RISCOS:*:*) GUESS=arm-unknown-riscos ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) GUESS=hppa1.1-hitachi-hiuxmpp ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. case `(/bin/universe) 2>/dev/null` in att) GUESS=pyramid-pyramid-sysv3 ;; *) GUESS=pyramid-pyramid-bsd ;; esac ;; NILE*:*:*:dcosx) GUESS=pyramid-pyramid-svr4 ;; DRS?6000:unix:4.0:6*) GUESS=sparc-icl-nx6 ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) GUESS=sparc-icl-nx7 ;; esac ;; s390x:SunOS:*:*) SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL ;; sun4H:SunOS:5.*:*) SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=sparc-hal-solaris2$SUN_REL ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=sparc-sun-solaris2$SUN_REL ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) GUESS=i386-pc-auroraux$UNAME_RELEASE ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) set_cc_for_build SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if test "$CC_FOR_BUILD" != no_compiler_found; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -m64 -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH=x86_64 fi fi SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=$SUN_ARCH-pc-solaris2$SUN_REL ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=sparc-sun-solaris3$SUN_REL ;; sun4*:SunOS:*:*) case `/usr/bin/arch -k` in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'` GUESS=sparc-sun-sunos$SUN_REL ;; sun3*:SunOS:*:*) GUESS=m68k-sun-sunos$UNAME_RELEASE ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 case `/bin/arch` in sun3) GUESS=m68k-sun-sunos$UNAME_RELEASE ;; sun4) GUESS=sparc-sun-sunos$UNAME_RELEASE ;; esac ;; aushp:SunOS:*:*) GUESS=sparc-auspex-sunos$UNAME_RELEASE ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) GUESS=m68k-atari-mint$UNAME_RELEASE ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) GUESS=m68k-atari-mint$UNAME_RELEASE ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) GUESS=m68k-atari-mint$UNAME_RELEASE ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) GUESS=m68k-milan-mint$UNAME_RELEASE ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) GUESS=m68k-hades-mint$UNAME_RELEASE ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) GUESS=m68k-unknown-mint$UNAME_RELEASE ;; m68k:machten:*:*) GUESS=m68k-apple-machten$UNAME_RELEASE ;; powerpc:machten:*:*) GUESS=powerpc-apple-machten$UNAME_RELEASE ;; RISC*:Mach:*:*) GUESS=mips-dec-mach_bsd4.3 ;; RISC*:ULTRIX:*:*) GUESS=mips-dec-ultrix$UNAME_RELEASE ;; VAX*:ULTRIX*:*:*) GUESS=vax-dec-ultrix$UNAME_RELEASE ;; 2020:CLIX:*:* | 2430:CLIX:*:*) GUESS=clipper-intergraph-clix$UNAME_RELEASE ;; mips:*:*:UMIPS | mips:*:*:RISCos) set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" && dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`"$dummy" "$dummyarg"` && { echo "$SYSTEM_NAME"; exit; } GUESS=mips-mips-riscos$UNAME_RELEASE ;; Motorola:PowerMAX_OS:*:*) GUESS=powerpc-motorola-powermax ;; Motorola:*:4.3:PL8-*) GUESS=powerpc-harris-powermax ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) GUESS=powerpc-harris-powermax ;; Night_Hawk:Power_UNIX:*:*) GUESS=powerpc-harris-powerunix ;; m88k:CX/UX:7*:*) GUESS=m88k-harris-cxux7 ;; m88k:*:4*:R4*) GUESS=m88k-motorola-sysv4 ;; m88k:*:3*:R3*) GUESS=m88k-motorola-sysv3 ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110 then if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \ test "$TARGET_BINARY_INTERFACE"x = x then GUESS=m88k-dg-dgux$UNAME_RELEASE else GUESS=m88k-dg-dguxbcs$UNAME_RELEASE fi else GUESS=i586-dg-dgux$UNAME_RELEASE fi ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) GUESS=m88k-dolphin-sysv3 ;; M88*:*:R3*:*) # Delta 88k system running SVR3 GUESS=m88k-motorola-sysv3 ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) GUESS=m88k-tektronix-sysv3 ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) GUESS=m68k-tektronix-bsd ;; *:IRIX*:*:*) IRIX_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/g'` GUESS=mips-sgi-irix$IRIX_REL ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. GUESS=romp-ibm-aix # uname -m gives an 8 hex-code CPU id ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) GUESS=i386-ibm-aix ;; ia64:AIX:*:*) if test -x /usr/bin/oslevel ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=$UNAME_VERSION.$UNAME_RELEASE fi GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` then GUESS=$SYSTEM_NAME else GUESS=rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then GUESS=rs6000-ibm-aix3.2.4 else GUESS=rs6000-ibm-aix3.2 fi ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if test -x /usr/bin/lslpp ; then IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | \ awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else IBM_REV=$UNAME_VERSION.$UNAME_RELEASE fi GUESS=$IBM_ARCH-ibm-aix$IBM_REV ;; *:AIX:*:*) GUESS=rs6000-ibm-aix ;; ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) GUESS=romp-ibm-bsd4.4 ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and GUESS=romp-ibm-bsd$UNAME_RELEASE # 4.3 with uname added to ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) GUESS=rs6000-bull-bosx ;; DPX/2?00:B.O.S.:*:*) GUESS=m68k-bull-sysv3 ;; 9000/[34]??:4.3bsd:1.*:*) GUESS=m68k-hp-bsd ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) GUESS=m68k-hp-bsd4.4 ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` case $UNAME_MACHINE in 9000/31?) HP_ARCH=m68000 ;; 9000/[34]??) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if test -x /usr/bin/getconf; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case $sc_cpu_version in 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case $sc_kernel_bits in 32) HP_ARCH=hppa2.0n ;; 64) HP_ARCH=hppa2.0w ;; '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi if test "$HP_ARCH" = ""; then set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if test "$HP_ARCH" = hppa2.0w then set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH=hppa2.0w else HP_ARCH=hppa64 fi fi GUESS=$HP_ARCH-hp-hpux$HPUX_REV ;; ia64:HP-UX:*:*) HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` GUESS=ia64-hp-hpux$HPUX_REV ;; 3050*:HI-UX:*:*) set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } GUESS=unknown-hitachi-hiuxwe2 ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) GUESS=hppa1.1-hp-bsd ;; 9000/8??:4.3bsd:*:*) GUESS=hppa1.0-hp-bsd ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) GUESS=hppa1.0-hp-mpeix ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) GUESS=hppa1.1-hp-osf ;; hp8??:OSF1:*:*) GUESS=hppa1.0-hp-osf ;; i*86:OSF1:*:*) if test -x /usr/sbin/sysversion ; then GUESS=$UNAME_MACHINE-unknown-osf1mk else GUESS=$UNAME_MACHINE-unknown-osf1 fi ;; parisc*:Lites*:*:*) GUESS=hppa1.1-hp-lites ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) GUESS=c1-convex-bsd ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) GUESS=c34-convex-bsd ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) GUESS=c38-convex-bsd ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) GUESS=c4-convex-bsd ;; CRAY*Y-MP:*:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=ymp-cray-unicos$CRAY_REL ;; CRAY*[A-Z]90:*:*:*) echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=t90-cray-unicos$CRAY_REL ;; CRAY*T3E:*:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=alphaev5-cray-unicosmk$CRAY_REL ;; CRAY*SV1:*:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=sv1-cray-unicos$CRAY_REL ;; *:UNICOS/mp:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=craynv-cray-unicosmp$CRAY_REL ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE ;; sparc*:BSD/OS:*:*) GUESS=sparc-unknown-bsdi$UNAME_RELEASE ;; *:BSD/OS:*:*) GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE ;; arm:FreeBSD:*:*) UNAME_PROCESSOR=`uname -p` set_cc_for_build if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabi else FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabihf fi ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case $UNAME_PROCESSOR in amd64) UNAME_PROCESSOR=x86_64 ;; i386) UNAME_PROCESSOR=i586 ;; esac FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL ;; i*:CYGWIN*:*) GUESS=$UNAME_MACHINE-pc-cygwin ;; *:MINGW64*:*) GUESS=$UNAME_MACHINE-pc-mingw64 ;; *:MINGW*:*) GUESS=$UNAME_MACHINE-pc-mingw32 ;; *:MSYS*:*) GUESS=$UNAME_MACHINE-pc-msys ;; i*:PW*:*) GUESS=$UNAME_MACHINE-pc-pw32 ;; *:SerenityOS:*:*) GUESS=$UNAME_MACHINE-pc-serenity ;; *:Interix*:*) case $UNAME_MACHINE in x86) GUESS=i586-pc-interix$UNAME_RELEASE ;; authenticamd | genuineintel | EM64T) GUESS=x86_64-unknown-interix$UNAME_RELEASE ;; IA64) GUESS=ia64-unknown-interix$UNAME_RELEASE ;; esac ;; i*:UWIN*:*) GUESS=$UNAME_MACHINE-pc-uwin ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) GUESS=x86_64-pc-cygwin ;; prep*:SunOS:5.*:*) SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=powerpcle-unknown-solaris2$SUN_REL ;; *:GNU:*:*) # the GNU system GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,'` GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'` GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL ;; *:GNU/*:*:*) # other systems with GNU libc and userland GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"` GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC ;; *:Minix:*:*) GUESS=$UNAME_MACHINE-unknown-minix ;; aarch64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC=gnulibc1 ; fi GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; arc:Linux:*:* | arceb:Linux:*:* | arc32:Linux:*:* | arc64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; arm*:Linux:*:*) set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then GUESS=$UNAME_MACHINE-unknown-linux-$LIBC else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi else GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf fi fi ;; avr32*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; cris:Linux:*:*) GUESS=$UNAME_MACHINE-axis-linux-$LIBC ;; crisv32:Linux:*:*) GUESS=$UNAME_MACHINE-axis-linux-$LIBC ;; e2k:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; frv:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; hexagon:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; i*86:Linux:*:*) GUESS=$UNAME_MACHINE-pc-linux-$LIBC ;; ia64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; k1om:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; m32r*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; m68*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; mips:Linux:*:* | mips64:Linux:*:*) set_cc_for_build IS_GLIBC=0 test x"${LIBC}" = xgnu && IS_GLIBC=1 sed 's/^ //' << EOF > "$dummy.c" #undef CPU #undef mips #undef mipsel #undef mips64 #undef mips64el #if ${IS_GLIBC} && defined(_ABI64) LIBCABI=gnuabi64 #else #if ${IS_GLIBC} && defined(_ABIN32) LIBCABI=gnuabin32 #else LIBCABI=${LIBC} #endif #endif #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 CPU=mipsisa64r6 #else #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 CPU=mipsisa32r6 #else #if defined(__mips64) CPU=mips64 #else CPU=mips #endif #endif #endif #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) MIPS_ENDIAN=el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) MIPS_ENDIAN= #else MIPS_ENDIAN= #endif #endif EOF cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'` eval "$cc_set_vars" test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; } ;; mips64el:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; openrisc*:Linux:*:*) GUESS=or1k-unknown-linux-$LIBC ;; or32:Linux:*:* | or1k*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; padre:Linux:*:*) GUESS=sparc-unknown-linux-$LIBC ;; parisc64:Linux:*:* | hppa64:Linux:*:*) GUESS=hppa64-unknown-linux-$LIBC ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;; PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;; *) GUESS=hppa-unknown-linux-$LIBC ;; esac ;; ppc64:Linux:*:*) GUESS=powerpc64-unknown-linux-$LIBC ;; ppc:Linux:*:*) GUESS=powerpc-unknown-linux-$LIBC ;; ppc64le:Linux:*:*) GUESS=powerpc64le-unknown-linux-$LIBC ;; ppcle:Linux:*:*) GUESS=powerpcle-unknown-linux-$LIBC ;; riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; s390:Linux:*:* | s390x:Linux:*:*) GUESS=$UNAME_MACHINE-ibm-linux-$LIBC ;; sh64*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; sh*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; sparc:Linux:*:* | sparc64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; tile*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; vax:Linux:*:*) GUESS=$UNAME_MACHINE-dec-linux-$LIBC ;; x86_64:Linux:*:*) set_cc_for_build LIBCABI=$LIBC if test "$CC_FOR_BUILD" != no_compiler_found; then if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_X32 >/dev/null then LIBCABI=${LIBC}x32 fi fi GUESS=$UNAME_MACHINE-pc-linux-$LIBCABI ;; xtensa*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. GUESS=i386-sequent-sysv4 ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. GUESS=$UNAME_MACHINE-pc-os2-emx ;; i*86:XTS-300:*:STOP) GUESS=$UNAME_MACHINE-unknown-stop ;; i*86:atheos:*:*) GUESS=$UNAME_MACHINE-unknown-atheos ;; i*86:syllable:*:*) GUESS=$UNAME_MACHINE-pc-syllable ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) GUESS=i386-unknown-lynxos$UNAME_RELEASE ;; i*86:*DOS:*:*) GUESS=$UNAME_MACHINE-pc-msdosdjgpp ;; i*86:*:4.*:*) UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL else GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL fi ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac GUESS=$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL else GUESS=$UNAME_MACHINE-pc-sysv32 fi ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. GUESS=i586-pc-msdosdjgpp ;; Intel:Mach:3*:*) GUESS=i386-pc-mach3 ;; paragon:*:*:*) GUESS=i860-intel-osf1 ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then GUESS=i860-stardent-sysv$UNAME_RELEASE # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. GUESS=i860-unknown-sysv$UNAME_RELEASE # Unknown i860-SVR4 fi ;; mini*:CTIX:SYS*5:*) # "miniframe" GUESS=m68010-convergent-sysv ;; mc68k:UNIX:SYSTEM5:3.51m) GUESS=m68k-convergent-sysv ;; M680?0:D-NIX:5.3:*) GUESS=m68k-diab-dnix ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) GUESS=m68k-unknown-lynxos$UNAME_RELEASE ;; mc68030:UNIX_System_V:4.*:*) GUESS=m68k-atari-sysv4 ;; TSUNAMI:LynxOS:2.*:*) GUESS=sparc-unknown-lynxos$UNAME_RELEASE ;; rs6000:LynxOS:2.*:*) GUESS=rs6000-unknown-lynxos$UNAME_RELEASE ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) GUESS=powerpc-unknown-lynxos$UNAME_RELEASE ;; SM[BE]S:UNIX_SV:*:*) GUESS=mips-dde-sysv$UNAME_RELEASE ;; RM*:ReliantUNIX-*:*:*) GUESS=mips-sni-sysv4 ;; RM*:SINIX-*:*:*) GUESS=mips-sni-sysv4 ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` GUESS=$UNAME_MACHINE-sni-sysv4 else GUESS=ns32k-sni-sysv fi ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says GUESS=i586-unisys-sysv4 ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm GUESS=hppa1.1-stratus-sysv4 ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. GUESS=i860-stratus-sysv4 ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. GUESS=$UNAME_MACHINE-stratus-vos ;; *:VOS:*:*) # From Paul.Green@stratus.com. GUESS=hppa1.1-stratus-vos ;; mc68*:A/UX:*:*) GUESS=m68k-apple-aux$UNAME_RELEASE ;; news*:NEWS-OS:6*:*) GUESS=mips-sony-newsos6 ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if test -d /usr/nec; then GUESS=mips-nec-sysv$UNAME_RELEASE else GUESS=mips-unknown-sysv$UNAME_RELEASE fi ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. GUESS=powerpc-be-beos ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. GUESS=powerpc-apple-beos ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. GUESS=i586-pc-beos ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. GUESS=i586-pc-haiku ;; x86_64:Haiku:*:*) GUESS=x86_64-unknown-haiku ;; SX-4:SUPER-UX:*:*) GUESS=sx4-nec-superux$UNAME_RELEASE ;; SX-5:SUPER-UX:*:*) GUESS=sx5-nec-superux$UNAME_RELEASE ;; SX-6:SUPER-UX:*:*) GUESS=sx6-nec-superux$UNAME_RELEASE ;; SX-7:SUPER-UX:*:*) GUESS=sx7-nec-superux$UNAME_RELEASE ;; SX-8:SUPER-UX:*:*) GUESS=sx8-nec-superux$UNAME_RELEASE ;; SX-8R:SUPER-UX:*:*) GUESS=sx8r-nec-superux$UNAME_RELEASE ;; SX-ACE:SUPER-UX:*:*) GUESS=sxace-nec-superux$UNAME_RELEASE ;; Power*:Rhapsody:*:*) GUESS=powerpc-apple-rhapsody$UNAME_RELEASE ;; *:Rhapsody:*:*) GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE ;; arm64:Darwin:*:*) GUESS=aarch64-apple-darwin$UNAME_RELEASE ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` case $UNAME_PROCESSOR in unknown) UNAME_PROCESSOR=powerpc ;; esac if command -v xcode-select > /dev/null 2> /dev/null && \ ! xcode-select --print-path > /dev/null 2> /dev/null ; then # Avoid executing cc if there is no toolchain installed as # cc will be a stub that puts up a graphical alert # prompting the user to install developer tools. CC_FOR_BUILD=no_compiler_found else set_cc_for_build fi if test "$CC_FOR_BUILD" != no_compiler_found; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_PPC >/dev/null then UNAME_PROCESSOR=powerpc fi elif test "$UNAME_PROCESSOR" = i386 ; then # uname -m returns i386 or x86_64 UNAME_PROCESSOR=$UNAME_MACHINE fi GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE ;; *:QNX:*:4*) GUESS=i386-pc-qnx ;; NEO-*:NONSTOP_KERNEL:*:*) GUESS=neo-tandem-nsk$UNAME_RELEASE ;; NSE-*:NONSTOP_KERNEL:*:*) GUESS=nse-tandem-nsk$UNAME_RELEASE ;; NSR-*:NONSTOP_KERNEL:*:*) GUESS=nsr-tandem-nsk$UNAME_RELEASE ;; NSV-*:NONSTOP_KERNEL:*:*) GUESS=nsv-tandem-nsk$UNAME_RELEASE ;; NSX-*:NONSTOP_KERNEL:*:*) GUESS=nsx-tandem-nsk$UNAME_RELEASE ;; *:NonStop-UX:*:*) GUESS=mips-compaq-nonstopux ;; BS2000:POSIX*:*:*) GUESS=bs2000-siemens-sysv ;; DS/*:UNIX_System_V:*:*) GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "${cputype-}" = 386; then UNAME_MACHINE=i386 elif test "x${cputype-}" != x; then UNAME_MACHINE=$cputype fi GUESS=$UNAME_MACHINE-unknown-plan9 ;; *:TOPS-10:*:*) GUESS=pdp10-unknown-tops10 ;; *:TENEX:*:*) GUESS=pdp10-unknown-tenex ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) GUESS=pdp10-dec-tops20 ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) GUESS=pdp10-xkl-tops20 ;; *:TOPS-20:*:*) GUESS=pdp10-unknown-tops20 ;; *:ITS:*:*) GUESS=pdp10-unknown-its ;; SEI:*:*:SEIUX) GUESS=mips-sei-seiux$UNAME_RELEASE ;; *:DragonFly:*:*) DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case $UNAME_MACHINE in A*) GUESS=alpha-dec-vms ;; I*) GUESS=ia64-dec-vms ;; V*) GUESS=vax-dec-vms ;; esac ;; *:XENIX:*:SysV) GUESS=i386-pc-xenix ;; i*86:skyos:*:*) SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'` GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL ;; i*86:rdos:*:*) GUESS=$UNAME_MACHINE-pc-rdos ;; i*86:Fiwix:*:*) GUESS=$UNAME_MACHINE-pc-fiwix ;; *:AROS:*:*) GUESS=$UNAME_MACHINE-unknown-aros ;; x86_64:VMkernel:*:*) GUESS=$UNAME_MACHINE-unknown-esx ;; amd64:Isilon\ OneFS:*:*) GUESS=x86_64-unknown-onefs ;; *:Unleashed:*:*) GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE ;; esac # Do we have a guess based on uname results? if test "x$GUESS" != x; then echo "$GUESS" exit fi # No uname command or uname output not recognized. set_cc_for_build cat > "$dummy.c" < #include #endif #if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) #if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) #include #if defined(_SIZE_T_) || defined(SIGLOST) #include #endif #endif #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) #if !defined (ultrix) #include #if defined (BSD) #if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); #else #if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); #else printf ("vax-dec-bsd\n"); exit (0); #endif #endif #else printf ("vax-dec-bsd\n"); exit (0); #endif #else #if defined(_SIZE_T_) || defined(SIGLOST) struct utsname un; uname (&un); printf ("vax-dec-ultrix%s\n", un.release); exit (0); #else printf ("vax-dec-ultrix\n"); exit (0); #endif #endif #endif #if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) #if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) #if defined(_SIZE_T_) || defined(SIGLOST) struct utsname *un; uname (&un); printf ("mips-dec-ultrix%s\n", un.release); exit (0); #else printf ("mips-dec-ultrix\n"); exit (0); #endif #endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; } echo "$0: unable to guess system type" >&2 case $UNAME_MACHINE:$UNAME_SYSTEM in mips:Linux | mips64:Linux) # If we got here on MIPS GNU/Linux, output extra information. cat >&2 <&2 <&2 </dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = "$UNAME_MACHINE" UNAME_RELEASE = "$UNAME_RELEASE" UNAME_SYSTEM = "$UNAME_SYSTEM" UNAME_VERSION = "$UNAME_VERSION" EOF fi exit 1 # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: pv-1.8.5/build-aux/config.rpath000077500000000000000000000442161452655021700163720ustar00rootroot00000000000000#! /bin/sh # Output a system dependent set of variables, describing how to set the # run time search path of shared libraries in an executable. # # Copyright 1996-2020 Free Software Foundation, Inc. # Taken from GNU libtool, 2001 # Originally by Gordon Matzigkeit , 1996 # # 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. # # The first argument passed to this file is the canonical host specification, # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld # should be set by the caller. # # The set of defined variables is at the end of this script. # Known limitations: # - On IRIX 6.5 with CC="cc", the run time search patch must not be longer # than 256 bytes, otherwise the compiler driver will dump core. The only # known workaround is to choose shorter directory names for the build # directory and/or the installation directory. # All known linkers require a '.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a shrext=.so host="$1" host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` # Code taken from libtool.m4's _LT_CC_BASENAME. for cc_temp in $CC""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'` # Code taken from libtool.m4's _LT_COMPILER_PIC. wl= if test "$GCC" = yes; then wl='-Wl,' else case "$host_os" in aix*) wl='-Wl,' ;; mingw* | cygwin* | pw32* | os2* | cegcc*) ;; hpux9* | hpux10* | hpux11*) wl='-Wl,' ;; irix5* | irix6* | nonstopux*) wl='-Wl,' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in ecc*) wl='-Wl,' ;; icc* | ifort*) wl='-Wl,' ;; lf95*) wl='-Wl,' ;; nagfor*) wl='-Wl,-Wl,,' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) wl='-Wl,' ;; ccc*) wl='-Wl,' ;; xl* | bgxl* | bgf* | mpixl*) wl='-Wl,' ;; como) wl='-lopt=' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ F* | *Sun*Fortran*) wl= ;; *Sun\ C*) wl='-Wl,' ;; esac ;; esac ;; newsos6) ;; *nto* | *qnx*) ;; osf3* | osf4* | osf5*) wl='-Wl,' ;; rdos*) ;; solaris*) case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) wl='-Qoption ld ' ;; *) wl='-Wl,' ;; esac ;; sunos4*) wl='-Qoption ld ' ;; sysv4 | sysv4.2uw2* | sysv4.3*) wl='-Wl,' ;; sysv4*MP*) ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) wl='-Wl,' ;; unicos*) wl='-Wl,' ;; uts4*) ;; esac fi # Code taken from libtool.m4's _LT_LINKER_SHLIBS. hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no case "$host_os" in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. # Unlike libtool, we use -rpath here, not --rpath, since the documented # option of GNU ld is called -rpath, not --rpath. hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' case "$host_os" in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no fi ;; amigaos*) case "$host_cpu" in powerpc) ;; m68k) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then : else ld_shlibs=no fi ;; haiku*) ;; interix[3-9]*) hardcode_direct=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; netbsd*) ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs=no elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' else ld_shlibs=no fi ;; esac ;; sunos4*) hardcode_direct=yes ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then hardcode_libdir_flag_spec= fi else case "$host_os" in aix3*) # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac fi hardcode_direct=yes hardcode_libdir_separator=':' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac fi # Begin _LT_AC_SYS_LIBPATH_AIX. echo 'int main () { return 0; }' > conftest.c ${CC} ${LDFLAGS} conftest.c -o conftest aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` fi if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib" fi rm -f conftest.c conftest # End _LT_AC_SYS_LIBPATH_AIX. if test "$aix_use_runtimelinking" = yes; then hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' else hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" fi fi ;; amigaos*) case "$host_cpu" in powerpc) ;; m68k) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' libext=lib ;; darwin* | rhapsody*) hardcode_direct=no if { case $cc_basename in ifort*) true;; *) test "$GCC" = yes;; esac; }; then : else ld_shlibs=no fi ;; dgux*) hardcode_libdir_flag_spec='-L$libdir' ;; freebsd2.[01]*) hardcode_direct=yes hardcode_minus_L=yes ;; freebsd* | dragonfly*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; hpux9*) hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; hpux10*) if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no ;; *) hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; netbsd*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; newsos6) hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then hardcode_libdir_flag_spec='${wl}-rpath,$libdir' else case "$host_os" in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) hardcode_libdir_flag_spec='-R$libdir' ;; *) hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; osf3*) hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) if test "$GCC" = yes; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else # Both cc and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi hardcode_libdir_separator=: ;; solaris*) hardcode_libdir_flag_spec='-R$libdir' ;; sunos4*) hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes ;; sysv4) case $host_vendor in sni) hardcode_direct=yes # is this really true??? ;; siemens) hardcode_direct=no ;; motorola) hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac ;; sysv4.3*) ;; sysv4*MP*) if test -d /usr/nec; then ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) ;; sysv5* | sco3.2v5* | sco5v6*) hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator=':' ;; uts4*) hardcode_libdir_flag_spec='-L$libdir' ;; *) ld_shlibs=no ;; esac fi # Check dynamic linker characteristics # Code taken from libtool.m4's _LT_SYS_DYNAMIC_LINKER. # Unlike libtool.m4, here we don't care about _all_ names of the library, but # only about the one the linker finds when passed -lNAME. This is the last # element of library_names_spec in libtool.m4, or possibly two of them if the # linker has special search rules. library_names_spec= # the last element of library_names_spec in libtool.m4 libname_spec='lib$name' case "$host_os" in aix3*) library_names_spec='$libname.a' ;; aix[4-9]*) library_names_spec='$libname$shrext' ;; amigaos*) case "$host_cpu" in powerpc*) library_names_spec='$libname$shrext' ;; m68k) library_names_spec='$libname.a' ;; esac ;; beos*) library_names_spec='$libname$shrext' ;; bsdi[45]*) library_names_spec='$libname$shrext' ;; cygwin* | mingw* | pw32* | cegcc*) shrext=.dll library_names_spec='$libname.dll.a $libname.lib' ;; darwin* | rhapsody*) shrext=.dylib library_names_spec='$libname$shrext' ;; dgux*) library_names_spec='$libname$shrext' ;; freebsd[23].*) library_names_spec='$libname$shrext$versuffix' ;; freebsd* | dragonfly*) library_names_spec='$libname$shrext' ;; gnu*) library_names_spec='$libname$shrext' ;; haiku*) library_names_spec='$libname$shrext' ;; hpux9* | hpux10* | hpux11*) case $host_cpu in ia64*) shrext=.so ;; hppa*64*) shrext=.sl ;; *) shrext=.sl ;; esac library_names_spec='$libname$shrext' ;; interix[3-9]*) library_names_spec='$libname$shrext' ;; irix5* | irix6* | nonstopux*) library_names_spec='$libname$shrext' case "$host_os" in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;; *) libsuff= shlibsuff= ;; esac ;; esac ;; linux*oldld* | linux*aout* | linux*coff*) ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) library_names_spec='$libname$shrext' ;; knetbsd*-gnu) library_names_spec='$libname$shrext' ;; netbsd*) library_names_spec='$libname$shrext' ;; newsos6) library_names_spec='$libname$shrext' ;; *nto* | *qnx*) library_names_spec='$libname$shrext' ;; openbsd*) library_names_spec='$libname$shrext$versuffix' ;; os2*) libname_spec='$name' shrext=.dll library_names_spec='$libname.a' ;; osf3* | osf4* | osf5*) library_names_spec='$libname$shrext' ;; rdos*) ;; solaris*) library_names_spec='$libname$shrext' ;; sunos4*) library_names_spec='$libname$shrext$versuffix' ;; sysv4 | sysv4.3*) library_names_spec='$libname$shrext' ;; sysv4*MP*) library_names_spec='$libname$shrext' ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) library_names_spec='$libname$shrext' ;; tpf*) library_names_spec='$libname$shrext' ;; uts4*) library_names_spec='$libname$shrext' ;; esac sed_quote_subst='s/\(["`$\\]\)/\\\1/g' escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"` shlibext=`echo "$shrext" | sed -e 's,^\.,,'` escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches to . # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # https://git.savannah.gnu.org/cgit/config.git/plain/config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. # The "shellcheck disable" line above the timestamp inhibits complaints # about features and limitations of the classic Bourne shell that were # superseded or lifted in POSIX. However, this script identifies a wide # variety of pre-POSIX systems that do not have POSIX shells at all, and # even some reasonably current systems (Solaris 10 as case-in-point) still # have a pre-POSIX /bin/sh. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright 1992-2022 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; *local*) # First pass through any local machine types. echo "$1" exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Split fields of configuration type # shellcheck disable=SC2162 saved_IFS=$IFS IFS="-" read field1 field2 field3 field4 <&2 exit 1 ;; *-*-*-*) basic_machine=$field1-$field2 basic_os=$field3-$field4 ;; *-*-*) # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two # parts maybe_os=$field2-$field3 case $maybe_os in nto-qnx* | linux-* | uclinux-uclibc* \ | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ | storm-chaos* | os2-emx* | rtmk-nova*) basic_machine=$field1 basic_os=$maybe_os ;; android-linux) basic_machine=$field1-unknown basic_os=linux-android ;; *) basic_machine=$field1-$field2 basic_os=$field3 ;; esac ;; *-*) # A lone config we happen to match not fitting any pattern case $field1-$field2 in decstation-3100) basic_machine=mips-dec basic_os= ;; *-*) # Second component is usually, but not always the OS case $field2 in # Prevent following clause from handling this valid os sun*os*) basic_machine=$field1 basic_os=$field2 ;; zephyr*) basic_machine=$field1-unknown basic_os=$field2 ;; # Manufacturers dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \ | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \ | unicom* | ibm* | next | hp | isi* | apollo | altos* \ | convergent* | ncr* | news | 32* | 3600* | 3100* \ | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \ | ultra | tti* | harris | dolphin | highlevel | gould \ | cbm | ns | masscomp | apple | axis | knuth | cray \ | microblaze* | sim | cisco \ | oki | wec | wrs | winbond) basic_machine=$field1-$field2 basic_os= ;; *) basic_machine=$field1 basic_os=$field2 ;; esac ;; esac ;; *) # Convert single-component short-hands not valid as part of # multi-component configurations. case $field1 in 386bsd) basic_machine=i386-pc basic_os=bsd ;; a29khif) basic_machine=a29k-amd basic_os=udi ;; adobe68k) basic_machine=m68010-adobe basic_os=scout ;; alliant) basic_machine=fx80-alliant basic_os= ;; altos | altos3068) basic_machine=m68k-altos basic_os= ;; am29k) basic_machine=a29k-none basic_os=bsd ;; amdahl) basic_machine=580-amdahl basic_os=sysv ;; amiga) basic_machine=m68k-unknown basic_os= ;; amigaos | amigados) basic_machine=m68k-unknown basic_os=amigaos ;; amigaunix | amix) basic_machine=m68k-unknown basic_os=sysv4 ;; apollo68) basic_machine=m68k-apollo basic_os=sysv ;; apollo68bsd) basic_machine=m68k-apollo basic_os=bsd ;; aros) basic_machine=i386-pc basic_os=aros ;; aux) basic_machine=m68k-apple basic_os=aux ;; balance) basic_machine=ns32k-sequent basic_os=dynix ;; blackfin) basic_machine=bfin-unknown basic_os=linux ;; cegcc) basic_machine=arm-unknown basic_os=cegcc ;; convex-c1) basic_machine=c1-convex basic_os=bsd ;; convex-c2) basic_machine=c2-convex basic_os=bsd ;; convex-c32) basic_machine=c32-convex basic_os=bsd ;; convex-c34) basic_machine=c34-convex basic_os=bsd ;; convex-c38) basic_machine=c38-convex basic_os=bsd ;; cray) basic_machine=j90-cray basic_os=unicos ;; crds | unos) basic_machine=m68k-crds basic_os= ;; da30) basic_machine=m68k-da30 basic_os= ;; decstation | pmax | pmin | dec3100 | decstatn) basic_machine=mips-dec basic_os= ;; delta88) basic_machine=m88k-motorola basic_os=sysv3 ;; dicos) basic_machine=i686-pc basic_os=dicos ;; djgpp) basic_machine=i586-pc basic_os=msdosdjgpp ;; ebmon29k) basic_machine=a29k-amd basic_os=ebmon ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson basic_os=ose ;; gmicro) basic_machine=tron-gmicro basic_os=sysv ;; go32) basic_machine=i386-pc basic_os=go32 ;; h8300hms) basic_machine=h8300-hitachi basic_os=hms ;; h8300xray) basic_machine=h8300-hitachi basic_os=xray ;; h8500hms) basic_machine=h8500-hitachi basic_os=hms ;; harris) basic_machine=m88k-harris basic_os=sysv3 ;; hp300 | hp300hpux) basic_machine=m68k-hp basic_os=hpux ;; hp300bsd) basic_machine=m68k-hp basic_os=bsd ;; hppaosf) basic_machine=hppa1.1-hp basic_os=osf ;; hppro) basic_machine=hppa1.1-hp basic_os=proelf ;; i386mach) basic_machine=i386-mach basic_os=mach ;; isi68 | isi) basic_machine=m68k-isi basic_os=sysv ;; m68knommu) basic_machine=m68k-unknown basic_os=linux ;; magnum | m3230) basic_machine=mips-mips basic_os=sysv ;; merlin) basic_machine=ns32k-utek basic_os=sysv ;; mingw64) basic_machine=x86_64-pc basic_os=mingw64 ;; mingw32) basic_machine=i686-pc basic_os=mingw32 ;; mingw32ce) basic_machine=arm-unknown basic_os=mingw32ce ;; monitor) basic_machine=m68k-rom68k basic_os=coff ;; morphos) basic_machine=powerpc-unknown basic_os=morphos ;; moxiebox) basic_machine=moxie-unknown basic_os=moxiebox ;; msdos) basic_machine=i386-pc basic_os=msdos ;; msys) basic_machine=i686-pc basic_os=msys ;; mvs) basic_machine=i370-ibm basic_os=mvs ;; nacl) basic_machine=le32-unknown basic_os=nacl ;; ncr3000) basic_machine=i486-ncr basic_os=sysv4 ;; netbsd386) basic_machine=i386-pc basic_os=netbsd ;; netwinder) basic_machine=armv4l-rebel basic_os=linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony basic_os=newsos ;; news1000) basic_machine=m68030-sony basic_os=newsos ;; necv70) basic_machine=v70-nec basic_os=sysv ;; nh3000) basic_machine=m68k-harris basic_os=cxux ;; nh[45]000) basic_machine=m88k-harris basic_os=cxux ;; nindy960) basic_machine=i960-intel basic_os=nindy ;; mon960) basic_machine=i960-intel basic_os=mon960 ;; nonstopux) basic_machine=mips-compaq basic_os=nonstopux ;; os400) basic_machine=powerpc-ibm basic_os=os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson basic_os=ose ;; os68k) basic_machine=m68k-none basic_os=os68k ;; paragon) basic_machine=i860-intel basic_os=osf ;; parisc) basic_machine=hppa-unknown basic_os=linux ;; psp) basic_machine=mipsallegrexel-sony basic_os=psp ;; pw32) basic_machine=i586-unknown basic_os=pw32 ;; rdos | rdos64) basic_machine=x86_64-pc basic_os=rdos ;; rdos32) basic_machine=i386-pc basic_os=rdos ;; rom68k) basic_machine=m68k-rom68k basic_os=coff ;; sa29200) basic_machine=a29k-amd basic_os=udi ;; sei) basic_machine=mips-sei basic_os=seiux ;; sequent) basic_machine=i386-sequent basic_os= ;; sps7) basic_machine=m68k-bull basic_os=sysv2 ;; st2000) basic_machine=m68k-tandem basic_os= ;; stratus) basic_machine=i860-stratus basic_os=sysv4 ;; sun2) basic_machine=m68000-sun basic_os= ;; sun2os3) basic_machine=m68000-sun basic_os=sunos3 ;; sun2os4) basic_machine=m68000-sun basic_os=sunos4 ;; sun3) basic_machine=m68k-sun basic_os= ;; sun3os3) basic_machine=m68k-sun basic_os=sunos3 ;; sun3os4) basic_machine=m68k-sun basic_os=sunos4 ;; sun4) basic_machine=sparc-sun basic_os= ;; sun4os3) basic_machine=sparc-sun basic_os=sunos3 ;; sun4os4) basic_machine=sparc-sun basic_os=sunos4 ;; sun4sol2) basic_machine=sparc-sun basic_os=solaris2 ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun basic_os= ;; sv1) basic_machine=sv1-cray basic_os=unicos ;; symmetry) basic_machine=i386-sequent basic_os=dynix ;; t3e) basic_machine=alphaev5-cray basic_os=unicos ;; t90) basic_machine=t90-cray basic_os=unicos ;; toad1) basic_machine=pdp10-xkl basic_os=tops20 ;; tpf) basic_machine=s390x-ibm basic_os=tpf ;; udi29k) basic_machine=a29k-amd basic_os=udi ;; ultra3) basic_machine=a29k-nyu basic_os=sym1 ;; v810 | necv810) basic_machine=v810-nec basic_os=none ;; vaxv) basic_machine=vax-dec basic_os=sysv ;; vms) basic_machine=vax-dec basic_os=vms ;; vsta) basic_machine=i386-pc basic_os=vsta ;; vxworks960) basic_machine=i960-wrs basic_os=vxworks ;; vxworks68) basic_machine=m68k-wrs basic_os=vxworks ;; vxworks29k) basic_machine=a29k-wrs basic_os=vxworks ;; xbox) basic_machine=i686-pc basic_os=mingw32 ;; ymp) basic_machine=ymp-cray basic_os=unicos ;; *) basic_machine=$1 basic_os= ;; esac ;; esac # Decode 1-component or ad-hoc basic machines case $basic_machine in # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) cpu=hppa1.1 vendor=winbond ;; op50n) cpu=hppa1.1 vendor=oki ;; op60c) cpu=hppa1.1 vendor=oki ;; ibm*) cpu=i370 vendor=ibm ;; orion105) cpu=clipper vendor=highlevel ;; mac | mpw | mac-mpw) cpu=m68k vendor=apple ;; pmac | pmac-mpw) cpu=powerpc vendor=apple ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) cpu=m68000 vendor=att ;; 3b*) cpu=we32k vendor=att ;; bluegene*) cpu=powerpc vendor=ibm basic_os=cnk ;; decsystem10* | dec10*) cpu=pdp10 vendor=dec basic_os=tops10 ;; decsystem20* | dec20*) cpu=pdp10 vendor=dec basic_os=tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) cpu=m68k vendor=motorola ;; dpx2*) cpu=m68k vendor=bull basic_os=sysv3 ;; encore | umax | mmax) cpu=ns32k vendor=encore ;; elxsi) cpu=elxsi vendor=elxsi basic_os=${basic_os:-bsd} ;; fx2800) cpu=i860 vendor=alliant ;; genix) cpu=ns32k vendor=ns ;; h3050r* | hiux*) cpu=hppa1.1 vendor=hitachi basic_os=hiuxwe2 ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) cpu=hppa1.0 vendor=hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) cpu=m68000 vendor=hp ;; hp9k3[2-9][0-9]) cpu=m68k vendor=hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) cpu=hppa1.0 vendor=hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) cpu=hppa1.1 vendor=hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp cpu=hppa1.1 vendor=hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp cpu=hppa1.1 vendor=hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) cpu=hppa1.1 vendor=hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) cpu=hppa1.0 vendor=hp ;; i*86v32) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=sysv32 ;; i*86v4*) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=sysv4 ;; i*86v) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=sysv ;; i*86sol2) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=solaris2 ;; j90 | j90-cray) cpu=j90 vendor=cray basic_os=${basic_os:-unicos} ;; iris | iris4d) cpu=mips vendor=sgi case $basic_os in irix*) ;; *) basic_os=irix4 ;; esac ;; miniframe) cpu=m68000 vendor=convergent ;; *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*) cpu=m68k vendor=atari basic_os=mint ;; news-3600 | risc-news) cpu=mips vendor=sony basic_os=newsos ;; next | m*-next) cpu=m68k vendor=next case $basic_os in openstep*) ;; nextstep*) ;; ns2*) basic_os=nextstep2 ;; *) basic_os=nextstep3 ;; esac ;; np1) cpu=np1 vendor=gould ;; op50n-* | op60c-*) cpu=hppa1.1 vendor=oki basic_os=proelf ;; pa-hitachi) cpu=hppa1.1 vendor=hitachi basic_os=hiuxwe2 ;; pbd) cpu=sparc vendor=tti ;; pbb) cpu=m68k vendor=tti ;; pc532) cpu=ns32k vendor=pc532 ;; pn) cpu=pn vendor=gould ;; power) cpu=power vendor=ibm ;; ps2) cpu=i386 vendor=ibm ;; rm[46]00) cpu=mips vendor=siemens ;; rtpc | rtpc-*) cpu=romp vendor=ibm ;; sde) cpu=mipsisa32 vendor=sde basic_os=${basic_os:-elf} ;; simso-wrs) cpu=sparclite vendor=wrs basic_os=vxworks ;; tower | tower-32) cpu=m68k vendor=ncr ;; vpp*|vx|vx-*) cpu=f301 vendor=fujitsu ;; w65) cpu=w65 vendor=wdc ;; w89k-*) cpu=hppa1.1 vendor=winbond basic_os=proelf ;; none) cpu=none vendor=none ;; leon|leon[3-9]) cpu=sparc vendor=$basic_machine ;; leon-*|leon[3-9]-*) cpu=sparc vendor=`echo "$basic_machine" | sed 's/-.*//'` ;; *-*) # shellcheck disable=SC2162 saved_IFS=$IFS IFS="-" read cpu vendor <&2 exit 1 ;; esac ;; esac # Here we canonicalize certain aliases for manufacturers. case $vendor in digital*) vendor=dec ;; commodore*) vendor=cbm ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if test x$basic_os != x then # First recognize some ad-hoc cases, or perhaps split kernel-os, or else just # set os. case $basic_os in gnu/linux*) kernel=linux os=`echo "$basic_os" | sed -e 's|gnu/linux|gnu|'` ;; os2-emx) kernel=os2 os=`echo "$basic_os" | sed -e 's|os2-emx|emx|'` ;; nto-qnx*) kernel=nto os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'` ;; *-*) # shellcheck disable=SC2162 saved_IFS=$IFS IFS="-" read kernel os <&2 exit 1 ;; esac # As a final step for OS-related things, validate the OS-kernel combination # (given a valid OS), if there is a kernel. case $kernel-$os in linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \ | linux-musl* | linux-relibc* | linux-uclibc* ) ;; uclinux-uclibc* ) ;; -dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* ) # These are just libc implementations, not actual OSes, and thus # require a kernel. echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2 exit 1 ;; kfreebsd*-gnu* | kopensolaris*-gnu*) ;; vxworks-simlinux | vxworks-simwindows | vxworks-spe) ;; nto-qnx*) ;; os2-emx) ;; *-eabi* | *-gnueabi*) ;; -*) # Blank kernel with real OS is always fine. ;; *-*) echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2 exit 1 ;; esac # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. case $vendor in unknown) case $cpu-$os in *-riscix*) vendor=acorn ;; *-sunos*) vendor=sun ;; *-cnk* | *-aix*) vendor=ibm ;; *-beos*) vendor=be ;; *-hpux*) vendor=hp ;; *-mpeix*) vendor=hp ;; *-hiux*) vendor=hitachi ;; *-unos*) vendor=crds ;; *-dgux*) vendor=dg ;; *-luna*) vendor=omron ;; *-genix*) vendor=ns ;; *-clix*) vendor=intergraph ;; *-mvs* | *-opened*) vendor=ibm ;; *-os400*) vendor=ibm ;; s390-* | s390x-*) vendor=ibm ;; *-ptx*) vendor=sequent ;; *-tpf*) vendor=ibm ;; *-vxsim* | *-vxworks* | *-windiss*) vendor=wrs ;; *-aux*) vendor=apple ;; *-hms*) vendor=hitachi ;; *-mpw* | *-macos*) vendor=apple ;; *-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*) vendor=atari ;; *-vos*) vendor=stratus ;; esac ;; esac echo "$cpu-$vendor-${kernel:+$kernel-}$os" exit # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: pv-1.8.5/build-aux/depcomp000077500000000000000000000560201452655021700154330ustar00rootroot00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2018-03-07.03; # UTC # Copyright (C) 1999-2021 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # Get the directory component of the given path, and save it in the # global variables '$dir'. Note that this directory component will # be either empty or ending with a '/' character. This is deliberate. set_dir_from () { case $1 in */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; *) dir=;; esac } # Get the suffix-stripped basename of the given path, and save it the # global variable '$base'. set_base_from () { base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` } # If no dependency file was actually created by the compiler invocation, # we still have to create a dummy depfile, to avoid errors with the # Makefile "include basename.Plo" scheme. make_dummy_depfile () { echo "#dummy" > "$depfile" } # Factor out some common post-processing of the generated depfile. # Requires the auxiliary global variable '$tmpdepfile' to be set. aix_post_process_depfile () { # If the compiler actually managed to produce a dependency file, # post-process it. if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependency.h'. # Do two passes, one to just change these to # $object: dependency.h # and one to simply output # dependency.h: # which is needed to avoid the deleted-header problem. { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" } > "$depfile" rm -f "$tmpdepfile" else make_dummy_depfile fi } # A tabulation character. tab=' ' # A newline character. nl=' ' # Character ranges might be problematic outside the C locale. # These definitions help. upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ lower=abcdefghijklmnopqrstuvwxyz digits=0123456789 alpha=${upper}${lower} if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Avoid interferences from the environment. gccflag= dashmflag= # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. ## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. ## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). Also, it might not be ## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The second -e expression handles DOS-style file names with drive # letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ | tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done aix_post_process_depfile ;; tcc) # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 # FIXME: That version still under development at the moment of writing. # Make that this statement remains true also for stable, released # versions. # It will wrap lines (doesn't matter whether long or short) with a # trailing '\', as in: # # foo.o : \ # foo.c \ # foo.h \ # # It will put a trailing '\' even on the last line, and will use leading # spaces rather than leading tabs (at least since its commit 0394caf7 # "Emit spaces for -MD"). "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. # We have to change lines of the first kind to '$object: \'. sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" # And for each line of the second kind, we have to emit a 'dep.h:' # dummy dependency, to avoid the deleted-header problem. sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; ## The order of this option in the case statement is important, since the ## shell code in configure will try each of these formats in the order ## listed in this file. A plain '-MD' option would be understood by many ## compilers, so we must ensure this comes after the gcc and icc options. pgcc) # Portland's C compiler understands '-MD'. # Will always output deps to 'file.d' where file is the root name of the # source file under compilation, even if file resides in a subdirectory. # The object file name does not affect the name of the '.d' file. # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... set_dir_from "$object" # Use the source, not the object, to determine the base name, since # that's sadly what pgcc will do too. set_base_from "$source" tmpdepfile=$base.d # For projects that build the same source file twice into different object # files, the pgcc approach of using the *source* file root name can cause # problems in parallel builds. Use a locking strategy to avoid stomping on # the same $tmpdepfile. lockdir=$base.d-lock trap " echo '$0: caught signal, cleaning up...' >&2 rmdir '$lockdir' exit 1 " 1 2 13 15 numtries=100 i=$numtries while test $i -gt 0; do # mkdir is a portable test-and-set. if mkdir "$lockdir" 2>/dev/null; then # This process acquired the lock. "$@" -MD stat=$? # Release the lock. rmdir "$lockdir" break else # If the lock is being held by a different process, wait # until the winning process is done or we timeout. while test -d "$lockdir" && test $i -gt 0; do sleep 1 i=`expr $i - 1` done fi i=`expr $i - 1` done trap - 1 2 13 15 if test $i -le 0; then echo "$0: failed to acquire lock after $numtries attempts" >&2 echo "$0: check lockdir '$lockdir'" >&2 exit 1 fi if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then # Libtool generates 2 separate objects for the 2 libraries. These # two compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir$base.o.d # libtool 1.5 tmpdepfile2=$dir.libs/$base.o.d # Likewise. tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d "$@" -MD fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done # Same post-processing that is required for AIX mode. aix_post_process_depfile ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this sed invocation # correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process the last invocation # correctly. Breaking it into two sed invocations is a workaround. sed '1,2d' "$tmpdepfile" \ | tr ' ' "$nl" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E \ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: pv-1.8.5/build-aux/install-sh000077500000000000000000000357761452655021700161010ustar00rootroot00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2020-11-14.01; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. tab=' ' nl=' ' IFS=" $tab$nl" # Set DOITPROG to "echo" to test this script. doit=${DOITPROG-} doit_exec=${doit:-exec} # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_mkdir= # Desired mode of installed file. mode=0755 # Create dirs (including intermediate dirs) using mode 755. # This is like GNU 'install' as of coreutils 8.32 (2020). mkdir_umask=22 backupsuffix= chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false is_target_a_directory=possibly usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -p pass -p to $cpprog. -s $stripprog installed files. -S SUFFIX attempt to back up existing files, with suffix SUFFIX. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG By default, rm is invoked with -f; when overridden with RMPROG, it's up to you to specify -f if you want it. If -S is not specified, no backups are attempted. Email bug reports to bug-automake@gnu.org. Automake home page: https://www.gnu.org/software/automake/ " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -p) cpprog="$cpprog -p";; -s) stripcmd=$stripprog;; -S) backupsuffix="$2" shift;; -t) is_target_a_directory=always dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done # We allow the use of options -d and -T together, by making -d # take the precedence; this is for compatibility with GNU install. if test -n "$dir_arg"; then if test -n "$dst_arg"; then echo "$0: target directory not allowed when installing a directory." >&2 exit 1 fi fi if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then if test $# -gt 1 || test "$is_target_a_directory" = always; then if test ! -d "$dst_arg"; then echo "$0: $dst_arg: Is not a directory." >&2 exit 1 fi fi fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? # Don't chown directories that already exist. if test $dstdir_status = 0; then chowncmd="" fi else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename. if test -d "$dst"; then if test "$is_target_a_directory" = never; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dstbase=`basename "$src"` case $dst in */) dst=$dst$dstbase;; *) dst=$dst/$dstbase;; esac dstdir_status=0 else dstdir=`dirname "$dst"` test -d "$dstdir" dstdir_status=$? fi fi case $dstdir in */) dstdirslash=$dstdir;; *) dstdirslash=$dstdir/;; esac obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false # The $RANDOM variable is not portable (e.g., dash). Use it # here however when possible just to lower collision chance. tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap ' ret=$? rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null exit $ret ' 0 # Because "mkdir -p" follows existing symlinks and we likely work # directly in world-writeable /tmp, make sure that the '$tmpdir' # directory is successfully created first before we actually test # 'mkdir -p'. if (umask $mkdir_umask && $mkdirprog $mkdir_mode "$tmpdir" && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. test_tmpdir="$tmpdir/a" ls_ld_tmpdir=`ls -ld "$test_tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null fi trap '' 0;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac oIFS=$IFS IFS=/ set -f set fnord $dstdir shift set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=${dstdirslash}_inst.$$_ rmtmp=${dstdirslash}_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && { test -z "$stripcmd" || { # Create $dsttmp read-write so that cp doesn't create it read-only, # which would cause strip to fail. if test -z "$doit"; then : >"$dsttmp" # No need to fork-exec 'touch'. else $doit touch "$dsttmp" fi } } && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # If $backupsuffix is set, and the file being installed # already exists, attempt a backup. Don't worry if it fails, # e.g., if mv doesn't support -f. if test -n "$backupsuffix" && test -f "$dst"; then $doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null fi # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: pv-1.8.5/build-aux/missing000077500000000000000000000153361452655021700154620ustar00rootroot00000000000000#! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1996-2021 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=https://www.perl.org/ flex_URL=https://github.com/westes/flex gnu_software_URL=https://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: pv-1.8.5/build-aux/test-driver000077500000000000000000000114171452655021700162550ustar00rootroot00000000000000#! /bin/sh # test-driver - basic testsuite driver script. scriptversion=2018-03-07.03; # UTC # Copyright (C) 2011-2021 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . # Make unconditional expansion of undefined variables an error. This # helps a lot in preventing typo-related bugs. set -u usage_error () { echo "$0: $*" >&2 print_usage >&2 exit 2 } print_usage () { cat <"$log_file" "$@" >>"$log_file" 2>&1 estatus=$? if test $enable_hard_errors = no && test $estatus -eq 99; then tweaked_estatus=1 else tweaked_estatus=$estatus fi case $tweaked_estatus:$expect_failure in 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; 0:*) col=$grn res=PASS recheck=no gcopy=no;; 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;; *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;; *:*) col=$red res=FAIL recheck=yes gcopy=yes;; esac # Report the test outcome and exit status in the logs, so that one can # know whether the test passed or failed simply by looking at the '.log' # file, without the need of also peaking into the corresponding '.trs' # file (automake bug#11814). echo "$res $test_name (exit status: $estatus)" >>"$log_file" # Report outcome to console. echo "${col}${res}${std}: $test_name" # Register the test result, and other relevant metadata. echo ":test-result: $res" > $trs_file echo ":global-test-result: $res" >> $trs_file echo ":recheck: $recheck" >> $trs_file echo ":copy-in-global-log: $gcopy" >> $trs_file # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: pv-1.8.5/configure000077500000000000000000011357451452655021700141100ustar00rootroot00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.71 for pv 1.8.5. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, # Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh as_nop=: if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi # Reset variables that may have inherited troublesome values from # the environment. # IFS needs to be set, to space, tab, and newline, in precisely that order. # (If _AS_PATH_WALK were called with IFS unset, it would have the # side effect of setting IFS to empty, thus disabling word splitting.) # Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl IFS=" "" $as_nl" PS1='$ ' PS2='> ' PS4='+ ' # Ensure predictable behavior from utilities with locale-dependent output. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # We cannot yet rely on "unset" to work, but we need these variables # to be unset--not just set to an empty or harmless value--now, to # avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct # also avoids known problems related to "unset" and subshell syntax # in other old shells (e.g. bash 2.01 and pdksh 5.2.14). for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH do eval test \${$as_var+y} \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done # Ensure that fds 0, 1, and 2 are open. if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="as_nop=: if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else \$as_nop case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ) then : else \$as_nop exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 blah=\$(echo \$(echo blah)) test x\"\$blah\" = xblah || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null then : as_have_required=yes else $as_nop as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null then : else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$as_shell as_have_required=yes if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null then : break 2 fi fi done;; esac as_found=false done IFS=$as_save_IFS if $as_found then : else $as_nop if { test -f "$SHELL" || test -f "$SHELL.exe"; } && as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$SHELL as_have_required=yes fi fi if test "x$CONFIG_SHELL" != x then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno then : printf "%s\n" "$0: This script requires a shell more modern than all" printf "%s\n" "$0: the shells that I found on your system." if test ${ZSH_VERSION+y} ; then printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." else printf "%s\n" "$0: Please tell bug-autoconf@gnu.org and pv@ivarch.com $0: about your system, including any error possibly output $0: before this message. Then install a modern shell, or $0: manually run the script under such a shell if you do $0: have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_nop # --------- # Do nothing but, unlike ":", preserve the value of $?. as_fn_nop () { return $? } as_nop=as_fn_nop # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null then : eval 'as_fn_append () { eval $1+=\$2 }' else $as_nop as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null then : eval 'as_fn_arith () { as_val=$(( $* )) }' else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_nop # --------- # Do nothing but, unlike ":", preserve the value of $?. as_fn_nop () { return $? } as_nop=as_fn_nop # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } # Determine whether it's possible to make 'echo' print without a newline. # These variables are no longer used directly by Autoconf, but are AC_SUBSTed # for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac # For backward compatibility with old third-party macros, we provide # the shell variables $as_echo and $as_echo_n. New code should use # AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. as_echo='printf %s\n' as_echo_n='printf %s' rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='pv' PACKAGE_TARNAME='pv' PACKAGE_VERSION='1.8.5' PACKAGE_STRING='pv 1.8.5' PACKAGE_BUGREPORT='pv@ivarch.com' PACKAGE_URL='https://www.ivarch.com/programs/pv.shtml' ac_unique_file="src/include/config.h.in" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_STDIO_H # include #endif #ifdef HAVE_STDLIB_H # include #endif #ifdef HAVE_STRING_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_header_c_list= gt_needs= ac_c_werror_flag= ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS POSUB LTLIBINTL LIBINTL INTLLIBS LTLIBICONV LIBICONV INTL_MACOSX_LIBS EGREP GREP CPP host_os host_vendor host_cpu host build_os build_vendor build_cpu build XGETTEXT_EXTRA_OPTIONS MSGMERGE_FOR_MSGFMT_OPTION MSGMERGE XGETTEXT_015 XGETTEXT GMSGFMT_015 GMSGFMT MSGFMT GETTEXT_MACRO_VERSION USE_NLS SED am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V CSCOPE ETAGS CTAGS am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir runstatedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL am__quote' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_dependency_tracking enable_largefile enable_nls with_gnu_ld enable_rpath with_libiconv_prefix with_libintl_prefix enable_debugging enable_profiling enable_splice enable_ipc enable_static ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -runstatedir | --runstatedir | --runstatedi | --runstated \ | --runstate | --runstat | --runsta | --runst | --runs \ | --run | --ru | --r) ac_prev=runstatedir ;; -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ | --run=* | --ru=* | --r=*) runstatedir=$ac_optarg ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures pv 1.8.5 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/pv] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of pv 1.8.5:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --disable-largefile omit support for large files --disable-nls do not use Native Language Support --disable-rpath do not hardcode runtime library paths --enable-debugging compile with debugging support --enable-profiling compile with profiling support --disable-splice do not use splice system call --disable-ipc turn off IPC messaging --enable-static enable static linking Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib --without-libiconv-prefix don't search for libiconv in includedir and libdir --with-libintl-prefix[=DIR] search for libintl in DIR/include and DIR/lib --without-libintl-prefix don't search for libintl in includedir and libdir Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . pv home page: . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for configure.gnu first; this name is used for a wrapper for # Metaconfig's "Configure" on case-insensitive file systems. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF pv configure 1.8.5 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest.beam if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext then : ac_retval=0 else $as_nop printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$3=yes" else $as_nop eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else $as_nop eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else $as_nop eval "$3=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err } then : ac_retval=0 else $as_nop printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext } then : ac_retval=0 else $as_nop printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_try_run LINENO # ---------------------- # Try to run conftest.$ac_ext, and return whether this succeeded. Assumes that # executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; } then : ac_retval=0 else $as_nop printf "%s\n" "$as_me: program exited with status $ac_status" >&5 printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. */ #include #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main (void) { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$3=yes" else $as_nop eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES # ---------------------------------------------------- # Tries to find if the field MEMBER exists in type AGGR, after including # INCLUDES, setting cache variable VAR accordingly. ac_fn_c_check_member () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 printf %s "checking for $2.$3... " >&6; } if eval test \${$4+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int main (void) { static $2 ac_aggr; if (ac_aggr.$3) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$4=yes" else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int main (void) { static $2 ac_aggr; if (sizeof ac_aggr.$3) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$4=yes" else $as_nop eval "$4=no" fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi eval ac_res=\$$4 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_member # ac_fn_c_find_intX_t LINENO BITS VAR # ----------------------------------- # Finds a signed integer type with width BITS, setting cache variable VAR # accordingly. ac_fn_c_find_intX_t () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for int$2_t" >&5 printf %s "checking for int$2_t... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else $as_nop eval "$3=no" # Order is important - never check a type that is potentially smaller # than half of the expected target width. for ac_type in int$2_t 'int' 'long int' \ 'long long int' 'short int' 'signed char'; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default enum { N = $2 / 2 - 1 }; int main (void) { static int test_array [1 - 2 * !(0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1))]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default enum { N = $2 / 2 - 1 }; int main (void) { static int test_array [1 - 2 * !(($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1) < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 2))]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else $as_nop case $ac_type in #( int$2_t) : eval "$3=yes" ;; #( *) : eval "$3=\$ac_type" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext if eval test \"x\$"$3"\" = x"no" then : else $as_nop break fi done fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_find_intX_t ac_configure_args_raw= for ac_arg do case $ac_arg in *\'*) ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append ac_configure_args_raw " '$ac_arg'" done case $ac_configure_args_raw in *$as_nl*) ac_safe_unquote= ;; *) ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab. ac_unsafe_a="$ac_unsafe_z#~" ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; esac cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by pv $as_me 1.8.5, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac printf "%s\n" "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Sanitize IFS. IFS=" "" $as_nl" # Save into config.log some information that might help in debugging. { echo printf "%s\n" "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo printf "%s\n" "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then printf "%s\n" "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then printf "%s\n" "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && printf "%s\n" "$as_me: caught signal $ac_signal" printf "%s\n" "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h printf "%s\n" "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then ac_site_files="$CONFIG_SITE" elif test "x$prefix" != xNONE; then ac_site_files="$prefix/share/config.site $prefix/etc/config.site" else ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi for ac_site_file in $ac_site_files do case $ac_site_file in #( */*) : ;; #( *) : ac_site_file=./$ac_site_file ;; esac if test -f "$ac_site_file" && test -r "$ac_site_file"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 printf "%s\n" "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 printf "%s\n" "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Test code for whether the C compiler supports C89 (global declarations) ac_c_conftest_c89_globals=' /* Does the compiler advertise C89 conformance? Do not test the value of __STDC__, because some compilers set it to 0 while being otherwise adequately conformant. */ #if !defined __STDC__ # error "Compiler does not advertise C89 conformance" #endif #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ struct buf { int x; }; struct buf * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not \xHH hex character constants. These do not provoke an error unfortunately, instead are silently treated as an "x". The following induces an error, until -std is added to get proper ANSI mode. Curiously \x00 != x always comes out true, for an array size at least. It is necessary to write \x00 == 0 to get something that is true only with -std. */ int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) '\''x'\'' int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int), int, int);' # Test code for whether the C compiler supports C89 (body of main). ac_c_conftest_c89_main=' ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); ' # Test code for whether the C compiler supports C99 (global declarations) ac_c_conftest_c99_globals=' // Does the compiler advertise C99 conformance? #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L # error "Compiler does not advertise C99 conformance" #endif #include extern int puts (const char *); extern int printf (const char *, ...); extern int dprintf (int, const char *, ...); extern void *malloc (size_t); // Check varargs macros. These examples are taken from C99 6.10.3.5. // dprintf is used instead of fprintf to avoid needing to declare // FILE and stderr. #define debug(...) dprintf (2, __VA_ARGS__) #define showlist(...) puts (#__VA_ARGS__) #define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) static void test_varargs_macros (void) { int x = 1234; int y = 5678; debug ("Flag"); debug ("X = %d\n", x); showlist (The first, second, and third items.); report (x>y, "x is %d but y is %d", x, y); } // Check long long types. #define BIG64 18446744073709551615ull #define BIG32 4294967295ul #define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) #if !BIG_OK #error "your preprocessor is broken" #endif #if BIG_OK #else #error "your preprocessor is broken" #endif static long long int bignum = -9223372036854775807LL; static unsigned long long int ubignum = BIG64; struct incomplete_array { int datasize; double data[]; }; struct named_init { int number; const wchar_t *name; double average; }; typedef const char *ccp; static inline int test_restrict (ccp restrict text) { // See if C++-style comments work. // Iterate through items via the restricted pointer. // Also check for declarations in for loops. for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) continue; return 0; } // Check varargs and va_copy. static bool test_varargs (const char *format, ...) { va_list args; va_start (args, format); va_list args_copy; va_copy (args_copy, args); const char *str = ""; int number = 0; float fnumber = 0; while (*format) { switch (*format++) { case '\''s'\'': // string str = va_arg (args_copy, const char *); break; case '\''d'\'': // int number = va_arg (args_copy, int); break; case '\''f'\'': // float fnumber = va_arg (args_copy, double); break; default: break; } } va_end (args_copy); va_end (args); return *str && number && fnumber; } ' # Test code for whether the C compiler supports C99 (body of main). ac_c_conftest_c99_main=' // Check bool. _Bool success = false; success |= (argc != 0); // Check restrict. if (test_restrict ("String literal") == 0) success = true; char *restrict newvar = "Another string"; // Check varargs. success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); test_varargs_macros (); // Check flexible array members. struct incomplete_array *ia = malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); ia->datasize = 10; for (int i = 0; i < ia->datasize; ++i) ia->data[i] = i * 1.234; // Check named initializers. struct named_init ni = { .number = 34, .name = L"Test wide string", .average = 543.34343, }; ni.number = 58; int dynamic_array[ni.number]; dynamic_array[0] = argv[0][0]; dynamic_array[ni.number - 1] = 543; // work around unused variable warnings ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' || dynamic_array[ni.number - 1] != 543); ' # Test code for whether the C compiler supports C11 (global declarations) ac_c_conftest_c11_globals=' // Does the compiler advertise C11 conformance? #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L # error "Compiler does not advertise C11 conformance" #endif // Check _Alignas. char _Alignas (double) aligned_as_double; char _Alignas (0) no_special_alignment; extern char aligned_as_int; char _Alignas (0) _Alignas (int) aligned_as_int; // Check _Alignof. enum { int_alignment = _Alignof (int), int_array_alignment = _Alignof (int[100]), char_alignment = _Alignof (char) }; _Static_assert (0 < -_Alignof (int), "_Alignof is signed"); // Check _Noreturn. int _Noreturn does_not_return (void) { for (;;) continue; } // Check _Static_assert. struct test_static_assert { int x; _Static_assert (sizeof (int) <= sizeof (long int), "_Static_assert does not work in struct"); long int y; }; // Check UTF-8 literals. #define u8 syntax error! char const utf8_literal[] = u8"happens to be ASCII" "another string"; // Check duplicate typedefs. typedef long *long_ptr; typedef long int *long_ptr; typedef long_ptr long_ptr; // Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. struct anonymous { union { struct { int i; int j; }; struct { int k; long int l; } w; }; int m; } v1; ' # Test code for whether the C compiler supports C11 (body of main). ac_c_conftest_c11_main=' _Static_assert ((offsetof (struct anonymous, i) == offsetof (struct anonymous, w.k)), "Anonymous union alignment botch"); v1.i = 2; v1.w.k = 5; ok |= v1.i != 5; ' # Test code for whether the C compiler supports C11 (complete). ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} ${ac_c_conftest_c99_globals} ${ac_c_conftest_c11_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} ${ac_c_conftest_c99_main} ${ac_c_conftest_c11_main} return ok; } " # Test code for whether the C compiler supports C99 (complete). ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} ${ac_c_conftest_c99_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} ${ac_c_conftest_c99_main} return ok; } " # Test code for whether the C compiler supports C89 (complete). ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} return ok; } " as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H" as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H" as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" as_fn_append ac_header_c_list " wchar.h wchar_h HAVE_WCHAR_H" as_fn_append ac_header_c_list " minix/config.h minix_config_h HAVE_MINIX_CONFIG_H" gt_needs="$gt_needs " # Auxiliary files required by this configure script. ac_aux_files="config.guess config.sub config.rpath compile missing install-sh" # Locations in which to look for auxiliary files. ac_aux_dir_candidates="${srcdir}/build-aux" # Search for a directory containing all of the required auxiliary files, # $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates. # If we don't find one directory that contains all the files we need, # we report the set of missing files from the *first* directory in # $ac_aux_dir_candidates and give up. ac_missing_aux_files="" ac_first_candidate=: printf "%s\n" "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in $ac_aux_dir_candidates do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac as_found=: printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5 ac_aux_dir_found=yes ac_install_sh= for ac_aux in $ac_aux_files do # As a special case, if "install-sh" is required, that requirement # can be satisfied by any of "install-sh", "install.sh", or "shtool", # and $ac_install_sh is set appropriately for whichever one is found. if test x"$ac_aux" = x"install-sh" then if test -f "${as_dir}install-sh"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install-sh found" >&5 ac_install_sh="${as_dir}install-sh -c" elif test -f "${as_dir}install.sh"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install.sh found" >&5 ac_install_sh="${as_dir}install.sh -c" elif test -f "${as_dir}shtool"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}shtool found" >&5 ac_install_sh="${as_dir}shtool install -c" else ac_aux_dir_found=no if $ac_first_candidate; then ac_missing_aux_files="${ac_missing_aux_files} install-sh" else break fi fi else if test -f "${as_dir}${ac_aux}"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5 else ac_aux_dir_found=no if $ac_first_candidate; then ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}" else break fi fi fi done if test "$ac_aux_dir_found" = yes; then ac_aux_dir="$as_dir" break fi ac_first_candidate=false as_found=false done IFS=$as_save_IFS if $as_found then : else $as_nop as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. if test -f "${ac_aux_dir}config.guess"; then ac_config_guess="$SHELL ${ac_aux_dir}config.guess" fi if test -f "${ac_aux_dir}config.sub"; then ac_config_sub="$SHELL ${ac_aux_dir}config.sub" fi if test -f "$ac_aux_dir/configure"; then ac_configure="$SHELL ${ac_aux_dir}configure" fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_headers="$ac_config_headers src/include/config.h" am__api_version='1.16' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 printf %s "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if test ${ac_cv_path_install+y} then : printf %s "(cached) " >&6 else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac # Account for fact that we put trailing slashes in our PATH walk. case $as_dir in #(( ./ | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir/" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test ${ac_cv_path_install+y}; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 printf "%s\n" "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 printf %s "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`printf "%s\n" "$program_transform_name" | sed "$ac_script"` # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then MISSING="\${SHELL} '$am_aux_dir/missing'" fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 printf "%s\n" "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_STRIP+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 printf "%s\n" "$STRIP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_STRIP+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 printf "%s\n" "$ac_ct_STRIP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a race-free mkdir -p" >&5 printf %s "checking for a race-free mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if test ${ac_cv_path_mkdir+y} then : printf %s "(cached) " >&6 else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext" || continue case `"$as_dir$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir ('*'coreutils) '* | \ 'BusyBox '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test ${ac_cv_path_mkdir+y}; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 printf "%s\n" "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_AWK+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 printf "%s\n" "$AWK" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$AWK" && break done { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval test \${ac_cv_prog_make_${ac_make}_set+y} then : printf %s "(cached) " >&6 else $as_nop cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } SET_MAKE= else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. if test ${enable_silent_rules+y} then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 printf %s "checking whether $am_make supports nested variables... " >&6; } if test ${am_cv_make_support_nested_variables+y} then : printf %s "(cached) " >&6 else $as_nop if printf "%s\n" 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 printf "%s\n" "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='pv' VERSION='1.8.5' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h printf "%s\n" "#define VERSION \"$VERSION\"" >>confdefs.h # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' # Variables for tags utilities; see am/tags.am if test -z "$CTAGS"; then CTAGS=ctags fi if test -z "$ETAGS"; then ETAGS=etags fi if test -z "$CSCOPE"; then CSCOPE=cscope fi # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. set dummy ${ac_tool_prefix}clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "clang", so it can be a program name with args. set dummy clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi fi test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion -version; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 printf %s "checking whether the C compiler works... " >&6; } ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else $as_nop ac_file='' fi if test -z "$ac_file" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 printf %s "checking for C compiler default output file name... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 printf "%s\n" "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 printf %s "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else $as_nop { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 printf "%s\n" "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 printf %s "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 printf "%s\n" "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 printf %s "checking for suffix of object files... " >&6; } if test ${ac_cv_objext+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_nop printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 printf "%s\n" "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 printf %s "checking whether the compiler supports GNU C... " >&6; } if test ${ac_cv_c_compiler_gnu+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_compiler_gnu=yes else $as_nop ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } ac_compiler_gnu=$ac_cv_c_compiler_gnu if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+y} ac_save_CFLAGS=$CFLAGS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 printf %s "checking whether $CC accepts -g... " >&6; } if test ${ac_cv_prog_cc_g+y} then : printf %s "(cached) " >&6 else $as_nop ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes else $as_nop CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else $as_nop ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 printf "%s\n" "$ac_cv_prog_cc_g" >&6; } if test $ac_test_CFLAGS; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi ac_prog_cc_stdc=no if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 printf %s "checking for $CC option to enable C11 features... " >&6; } if test ${ac_cv_prog_cc_c11+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cc_c11=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c11_program _ACEOF for ac_arg in '' -std=gnu11 do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c11=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c11" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi if test "x$ac_cv_prog_cc_c11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cc_c11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } CC="$CC $ac_cv_prog_cc_c11" fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 ac_prog_cc_stdc=c11 fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 printf %s "checking for $CC option to enable C99 features... " >&6; } if test ${ac_cv_prog_cc_c99+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c99_program _ACEOF for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c99=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi if test "x$ac_cv_prog_cc_c99" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cc_c99" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } CC="$CC $ac_cv_prog_cc_c99" fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 ac_prog_cc_stdc=c99 fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 printf %s "checking for $CC option to enable C89 features... " >&6; } if test ${ac_cv_prog_cc_c89+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c89_program _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi if test "x$ac_cv_prog_cc_c89" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cc_c89" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } CC="$CC $ac_cv_prog_cc_c89" fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 ac_prog_cc_stdc=c89 fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 printf %s "checking whether $CC understands -c and -o together... " >&6; } if test ${am_cv_prog_cc_c_o+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 printf "%s\n" "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 printf %s "checking whether ${MAKE-make} supports the include directive... " >&6; } cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out .PHONY: am__doit END am__include="#" am__quote= # BSD make does it like this. echo '.include "confinc.mk" # ignored' > confmf.BSD # Other make implementations (GNU, Solaris 10, AIX) do it like this. echo 'include confinc.mk # ignored' > confmf.GNU _am_result=no for s in GNU BSD; do { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } case $?:`cat confinc.out 2>/dev/null` in #( '0:this is the am__doit target') : case $s in #( BSD) : am__include='.include' am__quote='"' ;; #( *) : am__include='include' am__quote='' ;; esac ;; #( *) : ;; esac if test "$am__include" != "#"; then _am_result="yes ($s style)" break fi done rm -f confinc.* confmf.* { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 printf "%s\n" "${_am_result}" >&6; } # Check whether --enable-dependency-tracking was given. if test ${enable_dependency_tracking+y} then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 printf %s "checking dependency style of $depcc... " >&6; } if test ${am_cv_CC_dependencies_compiler_type+y} then : printf %s "(cached) " >&6 else $as_nop if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 printf "%s\n" "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi ac_header= ac_cache= for ac_item in $ac_header_c_list do if test $ac_cache; then ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then printf "%s\n" "#define $ac_item 1" >> confdefs.h fi ac_header= ac_cache= elif test $ac_header; then ac_cache=$ac_item else ac_header=$ac_item fi done if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes then : printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 printf %s "checking whether it is safe to define __EXTENSIONS__... " >&6; } if test ${ac_cv_safe_to_define___extensions__+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # define __EXTENSIONS__ 1 $ac_includes_default int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_safe_to_define___extensions__=yes else $as_nop ac_cv_safe_to_define___extensions__=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 printf "%s\n" "$ac_cv_safe_to_define___extensions__" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether _XOPEN_SOURCE should be defined" >&5 printf %s "checking whether _XOPEN_SOURCE should be defined... " >&6; } if test ${ac_cv_should_define__xopen_source+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_should_define__xopen_source=no if test $ac_cv_header_wchar_h = yes then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include mbstate_t x; int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _XOPEN_SOURCE 500 #include mbstate_t x; int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_should_define__xopen_source=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_should_define__xopen_source" >&5 printf "%s\n" "$ac_cv_should_define__xopen_source" >&6; } printf "%s\n" "#define _ALL_SOURCE 1" >>confdefs.h printf "%s\n" "#define _DARWIN_C_SOURCE 1" >>confdefs.h printf "%s\n" "#define _GNU_SOURCE 1" >>confdefs.h printf "%s\n" "#define _HPUX_ALT_XOPEN_SOCKET_API 1" >>confdefs.h printf "%s\n" "#define _NETBSD_SOURCE 1" >>confdefs.h printf "%s\n" "#define _OPENBSD_SOURCE 1" >>confdefs.h printf "%s\n" "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h printf "%s\n" "#define __STDC_WANT_IEC_60559_ATTRIBS_EXT__ 1" >>confdefs.h printf "%s\n" "#define __STDC_WANT_IEC_60559_BFP_EXT__ 1" >>confdefs.h printf "%s\n" "#define __STDC_WANT_IEC_60559_DFP_EXT__ 1" >>confdefs.h printf "%s\n" "#define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1" >>confdefs.h printf "%s\n" "#define __STDC_WANT_IEC_60559_TYPES_EXT__ 1" >>confdefs.h printf "%s\n" "#define __STDC_WANT_LIB_EXT2__ 1" >>confdefs.h printf "%s\n" "#define __STDC_WANT_MATH_SPEC_FUNCS__ 1" >>confdefs.h printf "%s\n" "#define _TANDEM_SOURCE 1" >>confdefs.h if test $ac_cv_header_minix_config_h = yes then : MINIX=yes printf "%s\n" "#define _MINIX 1" >>confdefs.h printf "%s\n" "#define _POSIX_SOURCE 1" >>confdefs.h printf "%s\n" "#define _POSIX_1_SOURCE 2" >>confdefs.h else $as_nop MINIX= fi if test $ac_cv_safe_to_define___extensions__ = yes then : printf "%s\n" "#define __EXTENSIONS__ 1" >>confdefs.h fi if test $ac_cv_should_define__xopen_source = yes then : printf "%s\n" "#define _XOPEN_SOURCE 500" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 printf %s "checking for an ANSI C-conforming const... " >&6; } if test ${ac_cv_c_const+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #ifndef __cplusplus /* Ultrix mips cc rejects this sort of thing. */ typedef int charset[2]; const charset cs = { 0, 0 }; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* IBM XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this sort of thing. */ char tx; char *t = &tx; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* IBM XL C 1.02.0.0 rejects this sort of thing, saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; } bx; struct s *b = &bx; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_c_const=yes else $as_nop ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 printf "%s\n" "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then printf "%s\n" "#define const /**/" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" if test "x$ac_cv_type__Bool" = xyes then : printf "%s\n" "#define HAVE__BOOL 1" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 printf %s "checking for stdbool.h that conforms to C99... " >&6; } if test ${ac_cv_header_stdbool_h+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifndef __bool_true_false_are_defined #error "__bool_true_false_are_defined is not defined" #endif char a[__bool_true_false_are_defined == 1 ? 1 : -1]; /* Regardless of whether this is C++ or "_Bool" is a valid type name, "true" and "false" should be usable in #if expressions and integer constant expressions, and "bool" should be a valid type name. */ #if !true #error "'true' is not true" #endif #if true != 1 #error "'true' is not equal to 1" #endif char b[true == 1 ? 1 : -1]; char c[true]; #if false #error "'false' is not false" #endif #if false != 0 #error "'false' is not equal to 0" #endif char d[false == 0 ? 1 : -1]; enum { e = false, f = true, g = false * true, h = true * 256 }; char i[(bool) 0.5 == true ? 1 : -1]; char j[(bool) 0.0 == false ? 1 : -1]; char k[sizeof (bool) > 0 ? 1 : -1]; struct sb { bool s: 1; bool t; } s; char l[sizeof s.t > 0 ? 1 : -1]; /* The following fails for HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ bool m[h]; char n[sizeof m == h * sizeof m[0] ? 1 : -1]; char o[-1 - (bool) 0 < 0 ? 1 : -1]; /* Catch a bug in an HP-UX C compiler. See https://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html https://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html */ bool p = true; bool *pp = &p; /* C 1999 specifies that bool, true, and false are to be macros, but C++ 2011 and later overrule this. */ #if __cplusplus < 201103 #ifndef bool #error "bool is not defined" #endif #ifndef false #error "false is not defined" #endif #ifndef true #error "true is not defined" #endif #endif /* If _Bool is available, repeat with it all the tests above that used bool. */ #ifdef HAVE__BOOL struct sB { _Bool s: 1; _Bool t; } t; char q[(_Bool) 0.5 == true ? 1 : -1]; char r[(_Bool) 0.0 == false ? 1 : -1]; char u[sizeof (_Bool) > 0 ? 1 : -1]; char v[sizeof t.t > 0 ? 1 : -1]; _Bool w[h]; char x[sizeof m == h * sizeof m[0] ? 1 : -1]; char y[-1 - (_Bool) 0 < 0 ? 1 : -1]; _Bool z = true; _Bool *pz = &p; #endif int main (void) { bool ps = &s; *pp |= p; *pp |= ! p; #ifdef HAVE__BOOL _Bool pt = &t; *pz |= z; *pz |= ! z; #endif /* Refer to every declared value, so they cannot be discarded as unused. */ return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !j + !k + !l + !m + !n + !o + !p + !pp + !ps #ifdef HAVE__BOOL + !q + !r + !u + !v + !w + !x + !y + !z + !pt #endif ); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_header_stdbool_h=yes else $as_nop ac_cv_header_stdbool_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 printf "%s\n" "$ac_cv_header_stdbool_h" >&6; } if test $ac_cv_header_stdbool_h = yes; then printf "%s\n" "#define HAVE_STDBOOL_H 1" >>confdefs.h fi # Check whether --enable-largefile was given. if test ${enable_largefile+y} then : enableval=$enable_largefile; fi if test "$enable_largefile" != no; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 printf %s "checking for special C compiler options needed for large files... " >&6; } if test ${ac_cv_sys_largefile_CC+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_sys_largefile_CC=no if test "$GCC" != yes; then ac_save_CC=$CC while :; do # IRIX 6.2 and later do not support large files by default, # so use the C compiler's -n32 option if that helps. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : break fi rm -f core conftest.err conftest.$ac_objext conftest.beam CC="$CC -n32" if ac_fn_c_try_compile "$LINENO" then : ac_cv_sys_largefile_CC=' -n32'; break fi rm -f core conftest.err conftest.$ac_objext conftest.beam break done CC=$ac_save_CC rm -f conftest.$ac_ext fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 printf "%s\n" "$ac_cv_sys_largefile_CC" >&6; } if test "$ac_cv_sys_largefile_CC" != no; then CC=$CC$ac_cv_sys_largefile_CC fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 printf %s "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } if test ${ac_cv_sys_file_offset_bits+y} then : printf %s "(cached) " >&6 else $as_nop while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_sys_file_offset_bits=no; break fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _FILE_OFFSET_BITS 64 #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_sys_file_offset_bits=64; break fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_sys_file_offset_bits=unknown break done fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 printf "%s\n" "$ac_cv_sys_file_offset_bits" >&6; } case $ac_cv_sys_file_offset_bits in #( no | unknown) ;; *) printf "%s\n" "#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits" >>confdefs.h ;; esac rm -rf conftest* if test $ac_cv_sys_file_offset_bits = unknown; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 printf %s "checking for _LARGE_FILES value needed for large files... " >&6; } if test ${ac_cv_sys_large_files+y} then : printf %s "(cached) " >&6 else $as_nop while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_sys_large_files=no; break fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _LARGE_FILES 1 #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_sys_large_files=1; break fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_sys_large_files=unknown break done fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 printf "%s\n" "$ac_cv_sys_large_files" >&6; } case $ac_cv_sys_large_files in #( no | unknown) ;; *) printf "%s\n" "#define _LARGE_FILES $ac_cv_sys_large_files" >>confdefs.h ;; esac rm -rf conftest* fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 printf %s "checking for a sed that does not truncate output... " >&6; } if test ${ac_cv_path_SED+y} then : printf %s "(cached) " >&6 else $as_nop ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in sed gsed do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 printf "%s\n" "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested" >&5 printf %s "checking whether NLS is requested... " >&6; } # Check whether --enable-nls was given. if test ${enable_nls+y} then : enableval=$enable_nls; USE_NLS=$enableval else $as_nop USE_NLS=yes fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 printf "%s\n" "$USE_NLS" >&6; } GETTEXT_MACRO_VERSION=0.20 # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which # contains only /bin. Note that ksh looks also at the FPATH variable, # so we have to set that as well for the test. PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ || PATH_SEPARATOR=';' } fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_MSGFMT+y} then : printf %s "(cached) " >&6 else $as_nop case "$MSGFMT" in [\\/]* | ?:[\\/]*) ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then echo "$as_me: trying $ac_dir/$ac_word..." >&5 if $ac_dir/$ac_word --statistics /dev/null >&5 2>&1 && (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then ac_cv_path_MSGFMT="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":" ;; esac fi MSGFMT="$ac_cv_path_MSGFMT" if test "$MSGFMT" != ":"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5 printf "%s\n" "$MSGFMT" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_GMSGFMT+y} then : printf %s "(cached) " >&6 else $as_nop case $GMSGFMT in [\\/]* | ?:[\\/]*) ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_GMSGFMT="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" ;; esac fi GMSGFMT=$ac_cv_path_GMSGFMT if test -n "$GMSGFMT"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GMSGFMT" >&5 printf "%s\n" "$GMSGFMT" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;; *) GMSGFMT_015=$GMSGFMT ;; esac # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which # contains only /bin. Note that ksh looks also at the FPATH variable, # so we have to set that as well for the test. PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ || PATH_SEPARATOR=';' } fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_XGETTEXT+y} then : printf %s "(cached) " >&6 else $as_nop case "$XGETTEXT" in [\\/]* | ?:[\\/]*) ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then echo "$as_me: trying $ac_dir/$ac_word..." >&5 if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&5 2>&1 && (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then ac_cv_path_XGETTEXT="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" ;; esac fi XGETTEXT="$ac_cv_path_XGETTEXT" if test "$XGETTEXT" != ":"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5 printf "%s\n" "$XGETTEXT" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi rm -f messages.po case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;; *) XGETTEXT_015=$XGETTEXT ;; esac # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which # contains only /bin. Note that ksh looks also at the FPATH variable, # so we have to set that as well for the test. PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ || PATH_SEPARATOR=';' } fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "msgmerge", so it can be a program name with args. set dummy msgmerge; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_MSGMERGE+y} then : printf %s "(cached) " >&6 else $as_nop case "$MSGMERGE" in [\\/]* | ?:[\\/]*) ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then echo "$as_me: trying $ac_dir/$ac_word..." >&5 if $ac_dir/$ac_word --update -q /dev/null /dev/null >&5 2>&1; then ac_cv_path_MSGMERGE="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" test -z "$ac_cv_path_MSGMERGE" && ac_cv_path_MSGMERGE=":" ;; esac fi MSGMERGE="$ac_cv_path_MSGMERGE" if test "$MSGMERGE" != ":"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MSGMERGE" >&5 printf "%s\n" "$MSGMERGE" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if LC_ALL=C $MSGMERGE --help | grep ' --for-msgfmt ' >/dev/null; then MSGMERGE_FOR_MSGFMT_OPTION='--for-msgfmt' else if LC_ALL=C $MSGMERGE --help | grep ' --no-fuzzy-matching ' >/dev/null; then MSGMERGE_FOR_MSGFMT_OPTION='--no-fuzzy-matching --no-location --quiet' else MSGMERGE_FOR_MSGFMT_OPTION='--no-location --quiet' fi fi test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS= ac_config_commands="$ac_config_commands po-directories" if test "X$prefix" = "XNONE"; then acl_final_prefix="$ac_default_prefix" else acl_final_prefix="$prefix" fi if test "X$exec_prefix" = "XNONE"; then acl_final_exec_prefix='${prefix}' else acl_final_exec_prefix="$exec_prefix" fi acl_save_prefix="$prefix" prefix="$acl_final_prefix" eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" prefix="$acl_save_prefix" # Make sure we can run config.sub. $SHELL "${ac_aux_dir}config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL ${ac_aux_dir}config.sub" "$LINENO" 5 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 printf %s "checking build system type... " >&6; } if test ${ac_cv_build+y} then : printf %s "(cached) " >&6 else $as_nop ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` || as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5 fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 printf "%s\n" "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 printf %s "checking host system type... " >&6; } if test ${ac_cv_host+y} then : printf %s "(cached) " >&6 else $as_nop if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` || as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5 fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 printf "%s\n" "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac # Check whether --with-gnu-ld was given. if test ${with_gnu_ld+y} then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else $as_nop with_gnu_ld=no fi # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which # contains only /bin. Note that ksh looks also at the FPATH variable, # so we have to set that as well for the test. PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ || PATH_SEPARATOR=';' } fi if test -n "$LD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld" >&5 printf %s "checking for ld... " >&6; } elif test "$GCC" = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 printf %s "checking for ld used by $CC... " >&6; } elif test "$with_gnu_ld" = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 printf %s "checking for GNU ld... " >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 printf %s "checking for non-GNU ld... " >&6; } fi if test -n "$LD"; then # Let the user override the test with a path. : else if test ${acl_cv_path_LD+y} then : printf %s "(cached) " >&6 else $as_nop acl_cv_path_LD= # Final result of this test ac_prog=ld # Program to search in $PATH if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw acl_output=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) acl_output=`($CC -print-prog-name=ld) 2>&5` ;; esac case $acl_output in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld acl_output=`echo "$acl_output" | sed 's%\\\\%/%g'` while echo "$acl_output" | grep "$re_direlt" > /dev/null 2>&1; do acl_output=`echo $acl_output | sed "s%$re_direlt%/%"` done # Got the pathname. No search in PATH is needed. acl_cv_path_LD="$acl_output" ac_prog= ;; "") # If it fails, then pretend we aren't using GCC. ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac fi if test -n "$ac_prog"; then # Search for $ac_prog in $PATH. acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$acl_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then acl_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$acl_cv_path_LD" -v 2>&1 conftest.$ac_ext /* end confdefs.h. */ #if defined __powerpc64__ || defined _ARCH_PPC64 int ok; #else error fail #endif _ACEOF if ac_fn_c_try_compile "$LINENO" then : # The compiler produces 64-bit code. Add option '-b64' so that the # linker groks 64-bit object files. case "$acl_cv_path_LD " in *" -b64 "*) ;; *) acl_cv_path_LD="$acl_cv_path_LD -b64" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; sparc64-*-netbsd*) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined __sparcv9 || defined __arch64__ int ok; #else error fail #endif _ACEOF if ac_fn_c_try_compile "$LINENO" then : else $as_nop # The compiler produces 32-bit code. Add option '-m elf32_sparc' # so that the linker groks 32-bit object files. case "$acl_cv_path_LD " in *" -m elf32_sparc "*) ;; *) acl_cv_path_LD="$acl_cv_path_LD -m elf32_sparc" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi LD="$acl_cv_path_LD" fi if test -n "$LD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 printf "%s\n" "$LD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 printf %s "checking if the linker ($LD) is GNU ld... " >&6; } if test ${acl_cv_prog_gnu_ld+y} then : printf %s "(cached) " >&6 else $as_nop # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 printf "%s\n" "$acl_cv_prog_gnu_ld" >&6; } with_gnu_ld=$acl_cv_prog_gnu_ld { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shared library run path origin" >&5 printf %s "checking for shared library run path origin... " >&6; } if test ${acl_cv_rpath+y} then : printf %s "(cached) " >&6 else $as_nop CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh . ./conftest.sh rm -f ./conftest.sh acl_cv_rpath=done fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $acl_cv_rpath" >&5 printf "%s\n" "$acl_cv_rpath" >&6; } wl="$acl_cv_wl" acl_libext="$acl_cv_libext" acl_shlibext="$acl_cv_shlibext" acl_libname_spec="$acl_cv_libname_spec" acl_library_names_spec="$acl_cv_library_names_spec" acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" acl_hardcode_direct="$acl_cv_hardcode_direct" acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" # Check whether --enable-rpath was given. if test ${enable_rpath+y} then : enableval=$enable_rpath; : else $as_nop enable_rpath=yes fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking 32-bit host C ABI" >&5 printf %s "checking 32-bit host C ABI... " >&6; } if test ${gl_cv_host_cpu_c_abi_32bit+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$gl_cv_host_cpu_c_abi"; then case "$gl_cv_host_cpu_c_abi" in i386 | x86_64-x32 | arm | armhf | arm64-ilp32 | hppa | ia64-ilp32 | mips | mipsn32 | powerpc | riscv*-ilp32* | s390 | sparc) gl_cv_host_cpu_c_abi_32bit=yes ;; x86_64 | alpha | arm64 | hppa64 | ia64 | mips64 | powerpc64 | powerpc64-elfv2 | riscv*-lp64* | s390x | sparc64 ) gl_cv_host_cpu_c_abi_32bit=no ;; *) gl_cv_host_cpu_c_abi_32bit=unknown ;; esac else case "$host_cpu" in # CPUs that only support a 32-bit ABI. arc \ | bfin \ | cris* \ | csky \ | epiphany \ | ft32 \ | h8300 \ | m68k \ | microblaze | microblazeel \ | nds32 | nds32le | nds32be \ | nios2 | nios2eb | nios2el \ | or1k* \ | or32 \ | sh | sh1234 | sh1234elb \ | tic6x \ | xtensa* ) gl_cv_host_cpu_c_abi_32bit=yes ;; # CPUs that only support a 64-bit ABI. alpha | alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] \ | mmix ) gl_cv_host_cpu_c_abi_32bit=no ;; i[34567]86 ) gl_cv_host_cpu_c_abi_32bit=yes ;; x86_64 ) # On x86_64 systems, the C compiler may be generating code in one of # these ABIs: # - 64-bit instruction set, 64-bit pointers, 64-bit 'long': x86_64. # - 64-bit instruction set, 64-bit pointers, 32-bit 'long': x86_64 # with native Windows (mingw, MSVC). # - 64-bit instruction set, 32-bit pointers, 32-bit 'long': x86_64-x32. # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': i386. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if (defined __x86_64__ || defined __amd64__ \ || defined _M_X64 || defined _M_AMD64) \ && !(defined __ILP32__ || defined _ILP32) int ok; #else error fail #endif _ACEOF if ac_fn_c_try_compile "$LINENO" then : gl_cv_host_cpu_c_abi_32bit=no else $as_nop gl_cv_host_cpu_c_abi_32bit=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; arm* | aarch64 ) # Assume arm with EABI. # On arm64 systems, the C compiler may be generating code in one of # these ABIs: # - aarch64 instruction set, 64-bit pointers, 64-bit 'long': arm64. # - aarch64 instruction set, 32-bit pointers, 32-bit 'long': arm64-ilp32. # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': arm or armhf. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined __aarch64__ && !(defined __ILP32__ || defined _ILP32) int ok; #else error fail #endif _ACEOF if ac_fn_c_try_compile "$LINENO" then : gl_cv_host_cpu_c_abi_32bit=no else $as_nop gl_cv_host_cpu_c_abi_32bit=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; hppa1.0 | hppa1.1 | hppa2.0* | hppa64 ) # On hppa, the C compiler may be generating 32-bit code or 64-bit # code. In the latter case, it defines _LP64 and __LP64__. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __LP64__ int ok; #else error fail #endif _ACEOF if ac_fn_c_try_compile "$LINENO" then : gl_cv_host_cpu_c_abi_32bit=no else $as_nop gl_cv_host_cpu_c_abi_32bit=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; ia64* ) # On ia64 on HP-UX, the C compiler may be generating 64-bit code or # 32-bit code. In the latter case, it defines _ILP32. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef _ILP32 int ok; #else error fail #endif _ACEOF if ac_fn_c_try_compile "$LINENO" then : gl_cv_host_cpu_c_abi_32bit=yes else $as_nop gl_cv_host_cpu_c_abi_32bit=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; mips* ) # We should also check for (_MIPS_SZPTR == 64), but gcc keeps this # at 32. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined _MIPS_SZLONG && (_MIPS_SZLONG == 64) int ok; #else error fail #endif _ACEOF if ac_fn_c_try_compile "$LINENO" then : gl_cv_host_cpu_c_abi_32bit=no else $as_nop gl_cv_host_cpu_c_abi_32bit=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; powerpc* ) # Different ABIs are in use on AIX vs. Mac OS X vs. Linux,*BSD. # No need to distinguish them here; the caller may distinguish # them based on the OS. # On powerpc64 systems, the C compiler may still be generating # 32-bit code. And on powerpc-ibm-aix systems, the C compiler may # be generating 64-bit code. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined __powerpc64__ || defined _ARCH_PPC64 int ok; #else error fail #endif _ACEOF if ac_fn_c_try_compile "$LINENO" then : gl_cv_host_cpu_c_abi_32bit=no else $as_nop gl_cv_host_cpu_c_abi_32bit=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; rs6000 ) gl_cv_host_cpu_c_abi_32bit=yes ;; riscv32 | riscv64 ) # There are 6 ABIs: ilp32, ilp32f, ilp32d, lp64, lp64f, lp64d. # Size of 'long' and 'void *': cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined __LP64__ int ok; #else error fail #endif _ACEOF if ac_fn_c_try_compile "$LINENO" then : gl_cv_host_cpu_c_abi_32bit=no else $as_nop gl_cv_host_cpu_c_abi_32bit=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; s390* ) # On s390x, the C compiler may be generating 64-bit (= s390x) code # or 31-bit (= s390) code. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined __LP64__ || defined __s390x__ int ok; #else error fail #endif _ACEOF if ac_fn_c_try_compile "$LINENO" then : gl_cv_host_cpu_c_abi_32bit=no else $as_nop gl_cv_host_cpu_c_abi_32bit=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; sparc | sparc64 ) # UltraSPARCs running Linux have `uname -m` = "sparc64", but the # C compiler still generates 32-bit code. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined __sparcv9 || defined __arch64__ int ok; #else error fail #endif _ACEOF if ac_fn_c_try_compile "$LINENO" then : gl_cv_host_cpu_c_abi_32bit=no else $as_nop gl_cv_host_cpu_c_abi_32bit=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; *) gl_cv_host_cpu_c_abi_32bit=unknown ;; esac fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_host_cpu_c_abi_32bit" >&5 printf "%s\n" "$gl_cv_host_cpu_c_abi_32bit" >&6; } HOST_CPU_C_ABI_32BIT="$gl_cv_host_cpu_c_abi_32bit" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 printf %s "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test ${ac_cv_prog_CPP+y} then : printf %s "(cached) " >&6 else $as_nop # Double quotes because $CC needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" cpp /lib/cpp do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO" then : else $as_nop # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO" then : # Broken: success on invalid input. continue else $as_nop # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 printf "%s\n" "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO" then : else $as_nop # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO" then : # Broken: success on invalid input. continue else $as_nop # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok then : else $as_nop { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 printf %s "checking for grep that handles long lines and -e... " >&6; } if test ${ac_cv_path_GREP+y} then : printf %s "(cached) " >&6 else $as_nop if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in grep ggrep do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done 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 fi else ac_cv_path_GREP=$GREP fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 printf "%s\n" "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 printf %s "checking for egrep... " >&6; } if test ${ac_cv_path_EGREP+y} then : printf %s "(cached) " >&6 else $as_nop if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in egrep do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done 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 fi else ac_cv_path_EGREP=$EGREP fi fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 printf "%s\n" "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ELF binary format" >&5 printf %s "checking for ELF binary format... " >&6; } if test ${gl_cv_elf+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __ELF__ Extensible Linking Format #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "Extensible Linking Format" >/dev/null 2>&1 then : gl_cv_elf=yes else $as_nop gl_cv_elf=no fi rm -rf conftest* fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_elf" >&5 printf "%s\n" "$gl_cv_elf" >&6; } if test $gl_cv_elf; then # Extract the ELF class of a file (5th byte) in decimal. # Cf. https://en.wikipedia.org/wiki/Executable_and_Linkable_Format#File_header if od -A x < /dev/null >/dev/null 2>/dev/null; then # Use POSIX od. func_elfclass () { od -A n -t d1 -j 4 -N 1 } else # Use BSD hexdump. func_elfclass () { dd bs=1 count=1 skip=4 2>/dev/null | hexdump -e '1/1 "%3d "' echo } fi case $HOST_CPU_C_ABI_32BIT in yes) # 32-bit ABI. acl_is_expected_elfclass () { test "`func_elfclass | sed -e 's/[ ]//g'`" = 1 } ;; no) # 64-bit ABI. acl_is_expected_elfclass () { test "`func_elfclass | sed -e 's/[ ]//g'`" = 2 } ;; *) # Unknown. acl_is_expected_elfclass () { : } ;; esac else acl_is_expected_elfclass () { : } fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the common suffixes of directories in the library search path" >&5 printf %s "checking for the common suffixes of directories in the library search path... " >&6; } if test ${acl_cv_libdirstems+y} then : printf %s "(cached) " >&6 else $as_nop acl_libdirstem=lib acl_libdirstem2= acl_libdirstem3= case "$host_os" in solaris*) if test $HOST_CPU_C_ABI_32BIT = no; then acl_libdirstem2=lib/64 case "$host_cpu" in sparc*) acl_libdirstem3=lib/sparcv9 ;; i*86 | x86_64) acl_libdirstem3=lib/amd64 ;; esac fi ;; *) searchpath=`(LC_ALL=C $CC $CPPFLAGS $CFLAGS -print-search-dirs) 2>/dev/null \ | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` if test $HOST_CPU_C_ABI_32BIT != no; then # 32-bit or unknown ABI. if test -d /usr/lib32; then acl_libdirstem2=lib32 fi fi if test $HOST_CPU_C_ABI_32BIT != yes; then # 64-bit or unknown ABI. if test -d /usr/lib64; then acl_libdirstem3=lib64 fi fi if test -n "$searchpath"; then acl_save_IFS="${IFS= }"; IFS=":" for searchdir in $searchpath; do if test -d "$searchdir"; then case "$searchdir" in */lib32/ | */lib32 ) acl_libdirstem2=lib32 ;; */lib64/ | */lib64 ) acl_libdirstem3=lib64 ;; */../ | */.. ) # Better ignore directories of this form. They are misleading. ;; *) searchdir=`cd "$searchdir" && pwd` case "$searchdir" in */lib32 ) acl_libdirstem2=lib32 ;; */lib64 ) acl_libdirstem3=lib64 ;; esac ;; esac fi done IFS="$acl_save_IFS" if test $HOST_CPU_C_ABI_32BIT = yes; then # 32-bit ABI. acl_libdirstem3= fi if test $HOST_CPU_C_ABI_32BIT = no; then # 64-bit ABI. acl_libdirstem2= fi fi ;; esac test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" test -n "$acl_libdirstem3" || acl_libdirstem3="$acl_libdirstem" acl_cv_libdirstems="$acl_libdirstem,$acl_libdirstem2,$acl_libdirstem3" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $acl_cv_libdirstems" >&5 printf "%s\n" "$acl_cv_libdirstems" >&6; } acl_libdirstem=`echo "$acl_cv_libdirstems" | sed -e 's/,.*//'` acl_libdirstem2=`echo "$acl_cv_libdirstems" | sed -e 's/^[^,]*,//' -e 's/,.*//'` acl_libdirstem3=`echo "$acl_cv_libdirstems" | sed -e 's/^[^,]*,[^,]*,//' -e 's/,.*//'` use_additional=yes acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\" eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" # Check whether --with-libiconv-prefix was given. if test ${with_libiconv_prefix+y} then : withval=$with_libiconv_prefix; if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\" eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" additional_libdir2="$withval/$acl_libdirstem2" additional_libdir3="$withval/$acl_libdirstem3" fi fi fi if test "X$additional_libdir2" = "X$additional_libdir"; then additional_libdir2= fi if test "X$additional_libdir3" = "X$additional_libdir"; then additional_libdir3= fi LIBICONV= LTLIBICONV= INCICONV= LIBICONV_PREFIX= HAVE_LIBICONV= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='iconv ' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIBICONV="${LIBICONV}${LIBICONV:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$value" else : fi else found_dir= found_la= found_so= found_a= eval libname=\"$acl_libname_spec\" # typically: libname=lib$name if test -n "$acl_shlibext"; then shrext=".$acl_shlibext" # typically: shrext=.so else shrext= fi if test $use_additional = yes; then for additional_libdir_variable in additional_libdir additional_libdir2 additional_libdir3; do if test "X$found_dir" = "X"; then eval dir=\$$additional_libdir_variable if test -n "$dir"; then if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver" && acl_is_expected_elfclass < "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f" && acl_is_expected_elfclass < "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi fi fi done fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver" && acl_is_expected_elfclass < "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f" && acl_is_expected_elfclass < "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then if test "$enable_rpath" = no \ || test "X$found_dir" = "X/usr/$acl_libdirstem" \ || test "X$found_dir" = "X/usr/$acl_libdirstem2" \ || test "X$found_dir" = "X/usr/$acl_libdirstem3"; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi if test "$acl_hardcode_direct" = yes; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else haveit= for x in $LDFLAGS $LIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir" fi if test "$acl_hardcode_minus_L" != no; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_a" else LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir -l$name" fi fi additional_includedir= case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` if test "$name" = 'iconv'; then LIBICONV_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; */$acl_libdirstem2 | */$acl_libdirstem2/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` if test "$name" = 'iconv'; then LIBICONV_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; */$acl_libdirstem3 | */$acl_libdirstem3/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem3/"'*$,,'` if test "$name" = 'iconv'; then LIBICONV_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then if test "X$additional_includedir" != "X/usr/include"; then haveit= if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then for x in $CPPFLAGS $INCICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then INCICONV="${INCICONV}${INCICONV:+ }-I$additional_includedir" fi fi fi fi fi if test -n "$found_la"; then save_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$save_libdir" for dep in $dependency_libs; do case "$dep" in -L*) dependency_libdir=`echo "X$dep" | sed -e 's/^X-L//'` if test "X$dependency_libdir" != "X/usr/$acl_libdirstem" \ && test "X$dependency_libdir" != "X/usr/$acl_libdirstem2" \ && test "X$dependency_libdir" != "X/usr/$acl_libdirstem3"; then haveit= if test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem" \ || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem2" \ || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem3"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$dependency_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$dependency_libdir"; then LIBICONV="${LIBICONV}${LIBICONV:+ }-L$dependency_libdir" fi fi haveit= for x in $LDFLAGS $LTLIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$dependency_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$dependency_libdir"; then LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$dependency_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) LIBICONV="${LIBICONV}${LIBICONV:+ }$dep" LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$dep" ;; esac done fi else LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$acl_hardcode_libdir_separator"; then alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" done acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" else for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then for found_dir in $ltrpathdirs; do LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-R$found_dir" done fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for CFPreferencesCopyAppValue" >&5 printf %s "checking for CFPreferencesCopyAppValue... " >&6; } if test ${gt_cv_func_CFPreferencesCopyAppValue+y} then : printf %s "(cached) " >&6 else $as_nop gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { CFPreferencesCopyAppValue(NULL, NULL) ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : gt_cv_func_CFPreferencesCopyAppValue=yes else $as_nop gt_cv_func_CFPreferencesCopyAppValue=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS="$gt_save_LIBS" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFPreferencesCopyAppValue" >&5 printf "%s\n" "$gt_cv_func_CFPreferencesCopyAppValue" >&6; } if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then printf "%s\n" "#define HAVE_CFPREFERENCESCOPYAPPVALUE 1" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for CFLocaleCopyPreferredLanguages" >&5 printf %s "checking for CFLocaleCopyPreferredLanguages... " >&6; } if test ${gt_cv_func_CFLocaleCopyPreferredLanguages+y} then : printf %s "(cached) " >&6 else $as_nop gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { CFLocaleCopyPreferredLanguages(); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : gt_cv_func_CFLocaleCopyPreferredLanguages=yes else $as_nop gt_cv_func_CFLocaleCopyPreferredLanguages=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS="$gt_save_LIBS" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFLocaleCopyPreferredLanguages" >&5 printf "%s\n" "$gt_cv_func_CFLocaleCopyPreferredLanguages" >&6; } if test $gt_cv_func_CFLocaleCopyPreferredLanguages = yes; then printf "%s\n" "#define HAVE_CFLOCALECOPYPREFERREDLANGUAGES 1" >>confdefs.h fi INTL_MACOSX_LIBS= if test $gt_cv_func_CFPreferencesCopyAppValue = yes \ || test $gt_cv_func_CFLocaleCopyPreferredLanguages = yes; then INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" fi LIBINTL= LTLIBINTL= POSUB= case " $gt_needs " in *" need-formatstring-macros "*) gt_api_version=3 ;; *" need-ngettext "*) gt_api_version=2 ;; *) gt_api_version=1 ;; esac gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc" gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl" if test "$USE_NLS" = "yes"; then gt_use_preinstalled_gnugettext=no if test $gt_api_version -ge 3; then gt_revision_test_code=' #ifndef __GNU_GETTEXT_SUPPORTED_REVISION #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) #endif typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; ' else gt_revision_test_code= fi if test $gt_api_version -ge 2; then gt_expression_test_code=' + * ngettext ("", "", 0)' else gt_expression_test_code= fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libc" >&5 printf %s "checking for GNU gettext in libc... " >&6; } if eval test \${$gt_func_gnugettext_libc+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifndef __GNU_GETTEXT_SUPPORTED_REVISION extern int _nl_msg_cat_cntr; extern int *_nl_domain_bindings; #define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_domain_bindings) #else #define __GNU_GETTEXT_SYMBOL_EXPRESSION 0 #endif $gt_revision_test_code int main (void) { bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$gt_func_gnugettext_libc=yes" else $as_nop eval "$gt_func_gnugettext_libc=no" fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$gt_func_gnugettext_libc { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then am_save_CPPFLAGS="$CPPFLAGS" for element in $INCICONV; do haveit= for x in $CPPFLAGS; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" fi done { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5 printf %s "checking for iconv... " >&6; } if test ${am_cv_func_iconv+y} then : printf %s "(cached) " >&6 else $as_nop am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main (void) { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : am_cv_func_iconv=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main (void) { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : am_cv_lib_iconv=yes am_cv_func_iconv=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS="$am_save_LIBS" fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv" >&5 printf "%s\n" "$am_cv_func_iconv" >&6; } if test "$am_cv_func_iconv" = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working iconv" >&5 printf %s "checking for working iconv... " >&6; } if test ${am_cv_func_iconv_works+y} then : printf %s "(cached) " >&6 else $as_nop am_save_LIBS="$LIBS" if test $am_cv_lib_iconv = yes; then LIBS="$LIBS $LIBICONV" fi am_cv_func_iconv_works=no for ac_iconv_const in '' 'const'; do if test "$cross_compiling" = yes then : case "$host_os" in aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; *) am_cv_func_iconv_works="guessing yes" ;; esac else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #ifndef ICONV_CONST # define ICONV_CONST $ac_iconv_const #endif int main (void) { int result = 0; /* Test against AIX 5.1 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); if (cd_utf8_to_88591 != (iconv_t)(-1)) { static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */ char buf[10]; ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_utf8_to_88591, &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) result |= 1; iconv_close (cd_utf8_to_88591); } } /* Test against Solaris 10 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); if (cd_ascii_to_88591 != (iconv_t)(-1)) { static ICONV_CONST char input[] = "\263"; char buf[10]; ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_ascii_to_88591, &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) result |= 2; iconv_close (cd_ascii_to_88591); } } /* Test against AIX 6.1..7.1 bug: Buffer overrun. */ { iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { static ICONV_CONST char input[] = "\304"; static char buf[2] = { (char)0xDE, (char)0xAD }; ICONV_CONST char *inptr = input; size_t inbytesleft = 1; char *outptr = buf; size_t outbytesleft = 1; size_t res = iconv (cd_88591_to_utf8, &inptr, &inbytesleft, &outptr, &outbytesleft); if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD) result |= 4; iconv_close (cd_88591_to_utf8); } } #if 0 /* This bug could be worked around by the caller. */ /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ { iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; char buf[50]; ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_88591_to_utf8, &inptr, &inbytesleft, &outptr, &outbytesleft); if ((int)res > 0) result |= 8; iconv_close (cd_88591_to_utf8); } } #endif /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is provided. */ { /* Try standardized names. */ iconv_t cd1 = iconv_open ("UTF-8", "EUC-JP"); /* Try IRIX, OSF/1 names. */ iconv_t cd2 = iconv_open ("UTF-8", "eucJP"); /* Try AIX names. */ iconv_t cd3 = iconv_open ("UTF-8", "IBM-eucJP"); /* Try HP-UX names. */ iconv_t cd4 = iconv_open ("utf8", "eucJP"); if (cd1 == (iconv_t)(-1) && cd2 == (iconv_t)(-1) && cd3 == (iconv_t)(-1) && cd4 == (iconv_t)(-1)) result |= 16; if (cd1 != (iconv_t)(-1)) iconv_close (cd1); if (cd2 != (iconv_t)(-1)) iconv_close (cd2); if (cd3 != (iconv_t)(-1)) iconv_close (cd3); if (cd4 != (iconv_t)(-1)) iconv_close (cd4); } return result; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO" then : am_cv_func_iconv_works=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi test "$am_cv_func_iconv_works" = no || break done LIBS="$am_save_LIBS" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv_works" >&5 printf "%s\n" "$am_cv_func_iconv_works" >&6; } case "$am_cv_func_iconv_works" in *no) am_func_iconv=no am_cv_lib_iconv=no ;; *) am_func_iconv=yes ;; esac else am_func_iconv=no am_cv_lib_iconv=no fi if test "$am_func_iconv" = yes; then printf "%s\n" "#define HAVE_ICONV 1" >>confdefs.h fi if test "$am_cv_lib_iconv" = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to link with libiconv" >&5 printf %s "checking how to link with libiconv... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBICONV" >&5 printf "%s\n" "$LIBICONV" >&6; } else CPPFLAGS="$am_save_CPPFLAGS" LIBICONV= LTLIBICONV= fi use_additional=yes acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\" eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" # Check whether --with-libintl-prefix was given. if test ${with_libintl_prefix+y} then : withval=$with_libintl_prefix; if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\" eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" additional_libdir2="$withval/$acl_libdirstem2" additional_libdir3="$withval/$acl_libdirstem3" fi fi fi if test "X$additional_libdir2" = "X$additional_libdir"; then additional_libdir2= fi if test "X$additional_libdir3" = "X$additional_libdir"; then additional_libdir3= fi LIBINTL= LTLIBINTL= INCINTL= LIBINTL_PREFIX= HAVE_LIBINTL= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='intl ' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIBINTL="${LIBINTL}${LIBINTL:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$value" else : fi else found_dir= found_la= found_so= found_a= eval libname=\"$acl_libname_spec\" # typically: libname=lib$name if test -n "$acl_shlibext"; then shrext=".$acl_shlibext" # typically: shrext=.so else shrext= fi if test $use_additional = yes; then for additional_libdir_variable in additional_libdir additional_libdir2 additional_libdir3; do if test "X$found_dir" = "X"; then eval dir=\$$additional_libdir_variable if test -n "$dir"; then if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver" && acl_is_expected_elfclass < "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f" && acl_is_expected_elfclass < "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi fi fi done fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver" && acl_is_expected_elfclass < "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f" && acl_is_expected_elfclass < "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then if test "$enable_rpath" = no \ || test "X$found_dir" = "X/usr/$acl_libdirstem" \ || test "X$found_dir" = "X/usr/$acl_libdirstem2" \ || test "X$found_dir" = "X/usr/$acl_libdirstem3"; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" else haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi if test "$acl_hardcode_direct" = yes; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" else if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else haveit= for x in $LDFLAGS $LIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir" fi if test "$acl_hardcode_minus_L" != no; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" else LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_a" else LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir -l$name" fi fi additional_includedir= case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` if test "$name" = 'intl'; then LIBINTL_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; */$acl_libdirstem2 | */$acl_libdirstem2/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` if test "$name" = 'intl'; then LIBINTL_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; */$acl_libdirstem3 | */$acl_libdirstem3/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem3/"'*$,,'` if test "$name" = 'intl'; then LIBINTL_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then if test "X$additional_includedir" != "X/usr/include"; then haveit= if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then for x in $CPPFLAGS $INCINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then INCINTL="${INCINTL}${INCINTL:+ }-I$additional_includedir" fi fi fi fi fi if test -n "$found_la"; then save_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$save_libdir" for dep in $dependency_libs; do case "$dep" in -L*) dependency_libdir=`echo "X$dep" | sed -e 's/^X-L//'` if test "X$dependency_libdir" != "X/usr/$acl_libdirstem" \ && test "X$dependency_libdir" != "X/usr/$acl_libdirstem2" \ && test "X$dependency_libdir" != "X/usr/$acl_libdirstem3"; then haveit= if test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem" \ || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem2" \ || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem3"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$dependency_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$dependency_libdir"; then LIBINTL="${LIBINTL}${LIBINTL:+ }-L$dependency_libdir" fi fi haveit= for x in $LDFLAGS $LTLIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$dependency_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$dependency_libdir"; then LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$dependency_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) LIBINTL="${LIBINTL}${LIBINTL:+ }$dep" LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$dep" ;; esac done fi else LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$acl_hardcode_libdir_separator"; then alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" done acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" else for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then for found_dir in $ltrpathdirs; do LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-R$found_dir" done fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libintl" >&5 printf %s "checking for GNU gettext in libintl... " >&6; } if eval test \${$gt_func_gnugettext_libintl+y} then : printf %s "(cached) " >&6 else $as_nop gt_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $INCINTL" gt_save_LIBS="$LIBS" LIBS="$LIBS $LIBINTL" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifndef __GNU_GETTEXT_SUPPORTED_REVISION extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *); #define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias ("")) #else #define __GNU_GETTEXT_SYMBOL_EXPRESSION 0 #endif $gt_revision_test_code int main (void) { bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$gt_func_gnugettext_libintl=yes" else $as_nop eval "$gt_func_gnugettext_libintl=no" fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then LIBS="$LIBS $LIBICONV" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifndef __GNU_GETTEXT_SUPPORTED_REVISION extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *); #define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias ("")) #else #define __GNU_GETTEXT_SYMBOL_EXPRESSION 0 #endif $gt_revision_test_code int main (void) { bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : LIBINTL="$LIBINTL $LIBICONV" LTLIBINTL="$LTLIBINTL $LTLIBICONV" eval "$gt_func_gnugettext_libintl=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi CPPFLAGS="$gt_save_CPPFLAGS" LIBS="$gt_save_LIBS" fi eval ac_res=\$$gt_func_gnugettext_libintl { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } fi if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \ || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \ && test "$PACKAGE" != gettext-runtime \ && test "$PACKAGE" != gettext-tools; }; then gt_use_preinstalled_gnugettext=yes else LIBINTL= LTLIBINTL= INCINTL= fi if test -n "$INTL_MACOSX_LIBS"; then if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then LIBINTL="$LIBINTL $INTL_MACOSX_LIBS" LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS" fi fi if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then printf "%s\n" "#define ENABLE_NLS 1" >>confdefs.h else USE_NLS=no fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use NLS" >&5 printf %s "checking whether to use NLS... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 printf "%s\n" "$USE_NLS" >&6; } if test "$USE_NLS" = "yes"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking where the gettext function comes from" >&5 printf %s "checking where the gettext function comes from... " >&6; } if test "$gt_use_preinstalled_gnugettext" = "yes"; then if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then gt_source="external libintl" else gt_source="libc" fi else gt_source="included intl directory" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_source" >&5 printf "%s\n" "$gt_source" >&6; } fi if test "$USE_NLS" = "yes"; then if test "$gt_use_preinstalled_gnugettext" = "yes"; then if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to link with libintl" >&5 printf %s "checking how to link with libintl... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBINTL" >&5 printf "%s\n" "$LIBINTL" >&6; } for element in $INCINTL; do haveit= for x in $CPPFLAGS; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" fi done fi printf "%s\n" "#define HAVE_GETTEXT 1" >>confdefs.h printf "%s\n" "#define HAVE_DCGETTEXT 1" >>confdefs.h fi POSUB=po fi INTLLIBS="$LIBINTL" if test "$USE_NLS" = "yes"; then CPPFLAGS="$CPPFLAGS -DLOCALEDIR=\\\"\$(localedir)\\\"" LIBS="$LIBS $LIBINTL" fi ac_fn_c_check_func "$LINENO" "getopt_long" "ac_cv_func_getopt_long" if test "x$ac_cv_func_getopt_long" = xyes then : printf "%s\n" "#define HAVE_GETOPT_LONG 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "vsnprintf" "ac_cv_func_vsnprintf" if test "x$ac_cv_func_vsnprintf" = xyes then : printf "%s\n" "#define HAVE_VSNPRINTF 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "strlcat" "ac_cv_func_strlcat" if test "x$ac_cv_func_strlcat" = xyes then : printf "%s\n" "#define HAVE_STRLCAT 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "strtoul" "ac_cv_func_strtoul" if test "x$ac_cv_func_strtoul" = xyes then : printf "%s\n" "#define HAVE_STRTOUL 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "memrchr" "ac_cv_func_memrchr" if test "x$ac_cv_func_memrchr" = xyes then : printf "%s\n" "#define HAVE_MEMRCHR 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "fdatasync" "ac_cv_func_fdatasync" if test "x$ac_cv_func_fdatasync" = xyes then : printf "%s\n" "#define HAVE_FDATASYNC 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "fpathconf" "ac_cv_func_fpathconf" if test "x$ac_cv_func_fpathconf" = xyes then : printf "%s\n" "#define HAVE_FPATHCONF 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "sysconf" "ac_cv_func_sysconf" if test "x$ac_cv_func_sysconf" = xyes then : printf "%s\n" "#define HAVE_SYSCONF 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "posix_memalign" "ac_cv_func_posix_memalign" if test "x$ac_cv_func_posix_memalign" = xyes then : printf "%s\n" "#define HAVE_POSIX_MEMALIGN 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "posix_fadvise" "ac_cv_func_posix_fadvise" if test "x$ac_cv_func_posix_fadvise" = xyes then : printf "%s\n" "#define HAVE_POSIX_FADVISE 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "nanosleep" "ac_cv_func_nanosleep" if test "x$ac_cv_func_nanosleep" = xyes then : printf "%s\n" "#define HAVE_NANOSLEEP 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "getopt.h" "ac_cv_header_getopt_h" "$ac_includes_default" if test "x$ac_cv_header_getopt_h" = xyes then : printf "%s\n" "#define HAVE_GETOPT_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "limits.h" "ac_cv_header_limits_h" "$ac_includes_default" if test "x$ac_cv_header_limits_h" = xyes then : printf "%s\n" "#define HAVE_LIMITS_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "wctype.h" "ac_cv_header_wctype_h" "$ac_includes_default" if test "x$ac_cv_header_wctype_h" = xyes then : printf "%s\n" "#define HAVE_WCTYPE_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "termios.h" "ac_cv_header_termios_h" "$ac_includes_default" if test "x$ac_cv_header_termios_h" = xyes then : printf "%s\n" "#define HAVE_TERMIOS_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "libgen.h" "ac_cv_header_libgen_h" "$ac_includes_default" if test "x$ac_cv_header_libgen_h" = xyes then : printf "%s\n" "#define HAVE_LIBGEN_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "sys/ioctl.h" "ac_cv_header_sys_ioctl_h" "$ac_includes_default" if test "x$ac_cv_header_sys_ioctl_h" = xyes then : printf "%s\n" "#define HAVE_SYS_IOCTL_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "libintl.h" "ac_cv_header_libintl_h" "$ac_includes_default" if test "x$ac_cv_header_libintl_h" = xyes then : printf "%s\n" "#define HAVE_LIBINTL_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "locale.h" "ac_cv_header_locale_h" "$ac_includes_default" if test "x$ac_cv_header_locale_h" = xyes then : printf "%s\n" "#define HAVE_LOCALE_H 1" >>confdefs.h fi ac_fn_c_check_member "$LINENO" "struct stat" "st_blksize" "ac_cv_member_struct_stat_st_blksize" "$ac_includes_default" if test "x$ac_cv_member_struct_stat_st_blksize" = xyes then : printf "%s\n" "#define HAVE_STRUCT_STAT_ST_BLKSIZE 1" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5 printf %s "checking for library containing clock_gettime... " >&6; } if test ${ac_cv_search_clock_gettime+y} then : printf %s "(cached) " >&6 else $as_nop ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char clock_gettime (); int main (void) { return clock_gettime (); ; return 0; } _ACEOF for ac_lib in '' rt do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO" then : ac_cv_search_clock_gettime=$ac_res fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext if test ${ac_cv_search_clock_gettime+y} then : break fi done if test ${ac_cv_search_clock_gettime+y} then : else $as_nop ac_cv_search_clock_gettime=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_gettime" >&5 printf "%s\n" "$ac_cv_search_clock_gettime" >&6; } ac_res=$ac_cv_search_clock_gettime if test "$ac_res" != no then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi for ac_func in alarm basename clock_gettime dup2 getcwd memcpy memmove memset select setlocale strchr strerror strrchr strstr do : as_ac_var=`printf "%s\n" "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes" then : cat >>confdefs.h <<_ACEOF #define `printf "%s\n" "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else $as_nop as_fn_error $? "required function is missing" "$LINENO" 5 fi done for ac_header in fcntl.h sys/file.h sys/time.h unistd.h do : as_ac_Header=`printf "%s\n" "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes" then : cat >>confdefs.h <<_ACEOF #define `printf "%s\n" "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF else $as_nop as_fn_error $? "required header file is missing" "$LINENO" 5 fi done ac_fn_c_find_intX_t "$LINENO" "32" "ac_cv_c_int32_t" case $ac_cv_c_int32_t in #( no|yes) ;; #( *) printf "%s\n" "#define int32_t $ac_cv_c_int32_t" >>confdefs.h ;; esac ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default" if test "x$ac_cv_type_mode_t" = xyes then : else $as_nop printf "%s\n" "#define mode_t int" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" if test "x$ac_cv_type_off_t" = xyes then : else $as_nop printf "%s\n" "#define off_t long int" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default " if test "x$ac_cv_type_pid_t" = xyes then : else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined _WIN64 && !defined __CYGWIN__ LLP64 #endif int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_pid_type='int' else $as_nop ac_pid_type='__int64' fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext printf "%s\n" "#define pid_t $ac_pid_type" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes then : else $as_nop printf "%s\n" "#define size_t unsigned int" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default" if test "x$ac_cv_type_ssize_t" = xyes then : else $as_nop printf "%s\n" "#define ssize_t int" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5 printf %s "checking for uid_t in sys/types.h... " >&6; } if test ${ac_cv_type_uid_t+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "uid_t" >/dev/null 2>&1 then : ac_cv_type_uid_t=yes else $as_nop ac_cv_type_uid_t=no fi rm -rf conftest* fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5 printf "%s\n" "$ac_cv_type_uid_t" >&6; } if test $ac_cv_type_uid_t = no; then printf "%s\n" "#define uid_t int" >>confdefs.h printf "%s\n" "#define gid_t int" >>confdefs.h fi # Check whether --enable-debugging was given. if test ${enable_debugging+y} then : enableval=$enable_debugging; if test "$enable_debugging" = "yes"; then CFLAGS="$CFLAGS -g -Wall" printf "%s\n" "#define ENABLE_DEBUGGING 1" >>confdefs.h fi fi # Check whether --enable-profiling was given. if test ${enable_profiling+y} then : enableval=$enable_profiling; if test "$enable_profiling" = "yes"; then CFLAGS="-pg $CFLAGS" fi fi SPLICE_SUPPORT="no" # Check whether --enable-splice was given. if test ${enable_splice+y} then : enableval=$enable_splice; if test "$enable_splice" = "yes"; then SPLICE_SUPPORT="yes" fi else $as_nop SPLICE_SUPPORT="yes" fi IPC_SUPPORT="no" # Check whether --enable-ipc was given. if test ${enable_ipc+y} then : enableval=$enable_ipc; if test "$enable_ipc" = "yes"; then IPC_SUPPORT="yes" fi else $as_nop IPC_SUPPORT="yes" fi # Check whether --enable-static was given. if test ${enable_static+y} then : enableval=$enable_static; if test "$enable_static" = "yes"; then CFLAGS="$CFLAGS -static" fi fi cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef _AIX yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "^yes$" >/dev/null 2>&1 then : LIBS="$LIBS -lc128" fi rm -rf conftest* if test "$IPC_SUPPORT" = "yes"; then for ac_header in sys/ipc.h do : ac_fn_c_check_header_compile "$LINENO" "sys/ipc.h" "ac_cv_header_sys_ipc_h" "$ac_includes_default" if test "x$ac_cv_header_sys_ipc_h" = xyes then : printf "%s\n" "#define HAVE_SYS_IPC_H 1" >>confdefs.h else $as_nop IPC_SUPPORT=no fi done ac_fn_c_check_header_compile "$LINENO" "sys/param.h" "ac_cv_header_sys_param_h" "$ac_includes_default" if test "x$ac_cv_header_sys_param_h" = xyes then : printf "%s\n" "#define HAVE_SYS_PARAM_H 1" >>confdefs.h fi if test "$IPC_SUPPORT" = "yes"; then for ac_func in shmget do : ac_fn_c_check_func "$LINENO" "shmget" "ac_cv_func_shmget" if test "x$ac_cv_func_shmget" = xyes then : printf "%s\n" "#define HAVE_SHMGET 1" >>confdefs.h else $as_nop IPC_SUPPORT=no fi done fi fi if test "$IPC_SUPPORT" = "yes"; then printf "%s\n" "#define HAVE_IPC 1" >>confdefs.h fi if test "$SPLICE_SUPPORT" = "yes"; then ac_fn_c_check_func "$LINENO" "splice" "ac_cv_func_splice" if test "x$ac_cv_func_splice" = xyes then : printf "%s\n" "#define HAVE_SPLICE 1" >>confdefs.h fi fi CPPFLAGS="$CPPFLAGS -I\$(top_srcdir)/src/include" ac_c_werror_flag=yes ac_config_files="$ac_config_files po/Makefile.in Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 printf "%s\n" "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 printf %s "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: done" >&5 printf "%s\n" "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh as_nop=: if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi # Reset variables that may have inherited troublesome values from # the environment. # IFS needs to be set, to space, tab, and newline, in precisely that order. # (If _AS_PATH_WALK were called with IFS unset, it would have the # side effect of setting IFS to empty, thus disabling word splitting.) # Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl IFS=" "" $as_nl" PS1='$ ' PS2='> ' PS4='+ ' # Ensure predictable behavior from utilities with locale-dependent output. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # We cannot yet rely on "unset" to work, but we need these variables # to be unset--not just set to an empty or harmless value--now, to # avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct # also avoids known problems related to "unset" and subshell syntax # in other old shells (e.g. bash 2.01 and pdksh 5.2.14). for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH do eval test \${$as_var+y} \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done # Ensure that fds 0, 1, and 2 are open. if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null then : eval 'as_fn_append () { eval $1+=\$2 }' else $as_nop as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null then : eval 'as_fn_arith () { as_val=$(( $* )) }' else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # Determine whether it's possible to make 'echo' print without a newline. # These variables are no longer used directly by Autoconf, but are AC_SUBSTed # for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac # For backward compatibility with old third-party macros, we provide # the shell variables $as_echo and $as_echo_n. New code should use # AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. as_echo='printf %s\n' as_echo_n='printf %s' rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by pv $as_me 1.8.5, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to . pv home page: ." _ACEOF ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ pv config.status 1.8.5 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" Copyright (C) 2021 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) printf "%s\n" "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) printf "%s\n" "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) printf "%s\n" "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX printf "%s\n" "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" # Capture the value of obsolete ALL_LINGUAS because we need it to compute # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. OBSOLETE_ALL_LINGUAS="$ALL_LINGUAS" # Capture the value of LINGUAS because we need it to compute CATALOGS. LINGUAS="${LINGUAS-%UNSET%}" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "src/include/config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/include/config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "po-directories") CONFIG_COMMANDS="$CONFIG_COMMANDS po-directories" ;; "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers test ${CONFIG_COMMANDS+y} || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 printf "%s\n" "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`printf "%s\n" "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 printf "%s\n" "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 printf "%s\n" "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. # TODO: see whether this extra hack can be removed once we start # requiring Autoconf 2.70 or later. case $CONFIG_FILES in #( *\'*) : eval set x "$CONFIG_FILES" ;; #( *) : set x $CONFIG_FILES ;; #( *) : ;; esac shift # Used to flag and report bootstrapping failures. am_rc=0 for am_mf do # Strip MF so we end up with the name of the file. am_mf=`printf "%s\n" "$am_mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ || continue am_dirpart=`$as_dirname -- "$am_mf" || $as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$am_mf" : 'X\(//\)[^/]' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$am_mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` am_filepart=`$as_basename -- "$am_mf" || $as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X/"$am_mf" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` { echo "$as_me:$LINENO: cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles" >&5 (cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } || am_rc=$? done if test $am_rc -ne 0; then { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "Something went wrong bootstrapping makefile fragments for automatic dependency tracking. If GNU make was not used, consider re-running the configure script with MAKE=\"gmake\" (or whatever is necessary). You can also try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking). See \`config.log' for more details" "$LINENO" 5; } fi { am_dirpart=; unset am_dirpart;} { am_filepart=; unset am_filepart;} { am_mf=; unset am_mf;} { am_rc=; unset am_rc;} rm -f conftest-deps.mk } ;; "po-directories":C) for ac_file in $CONFIG_FILES; do # Support "outfile[:infile[:infile...]]" case "$ac_file" in *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; esac # PO directories have a Makefile.in generated from Makefile.in.in. case "$ac_file" in */Makefile.in) # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'` ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; *) top_srcdir="$ac_dots$ac_given_srcdir" ;; esac # Treat a directory as a PO directory if and only if it has a # POTFILES.in file. This allows packages to have multiple PO # directories under different names or in different locations. if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then rm -f "$ac_dir/POTFILES" test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" gt_tab=`printf '\t'` cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ${gt_tab}]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" POMAKEFILEDEPS="POTFILES.in" # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend # on $ac_dir but don't depend on user-specified configuration # parameters. if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then # The LINGUAS file contains the set of available languages. if test -n "$OBSOLETE_ALL_LINGUAS"; then test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" fi ALL_LINGUAS=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" else # The set of available languages was given in configure.in. ALL_LINGUAS=$OBSOLETE_ALL_LINGUAS fi # Compute POFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) # Compute UPDATEPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) # Compute DUMMYPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) # Compute GMOFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) case "$ac_given_srcdir" in .) srcdirpre= ;; *) srcdirpre='$(srcdir)/' ;; esac POFILES= UPDATEPOFILES= DUMMYPOFILES= GMOFILES= for lang in $ALL_LINGUAS; do POFILES="$POFILES $srcdirpre$lang.po" UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" DUMMYPOFILES="$DUMMYPOFILES $lang.nop" GMOFILES="$GMOFILES $srcdirpre$lang.gmo" done # CATALOGS depends on both $ac_dir and the user's LINGUAS # environment variable. INST_LINGUAS= if test -n "$ALL_LINGUAS"; then for presentlang in $ALL_LINGUAS; do useit=no if test "%UNSET%" != "$LINGUAS"; then desiredlanguages="$LINGUAS" else desiredlanguages="$ALL_LINGUAS" fi for desiredlang in $desiredlanguages; do # Use the presentlang catalog if desiredlang is # a. equal to presentlang, or # b. a variant of presentlang (because in this case, # presentlang can be used as a fallback for messages # which are not translated in the desiredlang catalog). case "$desiredlang" in "$presentlang"*) useit=yes;; esac done if test $useit = yes; then INST_LINGUAS="$INST_LINGUAS $presentlang" fi done fi CATALOGS= if test -n "$INST_LINGUAS"; then for lang in $INST_LINGUAS; do CATALOGS="$CATALOGS $lang.gmo" done fi test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do if test -f "$f"; then case "$f" in *.orig | *.bak | *~) ;; *) cat "$f" >> "$ac_dir/Makefile" ;; esac fi done fi ;; esac done ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi pv-1.8.5/configure.ac000066400000000000000000000066641452655021700144630ustar00rootroot00000000000000dnl Process this file with autoconf to produce a configure script. dnl dnl Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023 Andrew Wood dnl dnl License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'. AC_INIT([pv], [1.8.5], [pv@ivarch.com], [pv], [https://www.ivarch.com/programs/pv.shtml]) AC_CONFIG_SRCDIR([src/include/config.h.in]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_HEADERS([src/include/config.h]) AM_INIT_AUTOMAKE([-Wall -Werror foreign]) AC_LANG(C) AC_PROG_CC AC_PROG_INSTALL AC_USE_SYSTEM_EXTENSIONS AC_C_CONST AC_HEADER_STDBOOL AC_SYS_LARGEFILE AM_GNU_GETTEXT_VERSION([0.21]) AM_GNU_GETTEXT([external]) if test "$USE_NLS" = "yes"; then CPPFLAGS="$CPPFLAGS -DLOCALEDIR=\\\"\$(localedir)\\\"" LIBS="$LIBS $LIBINTL" fi dnl Items we can use if present, but can do without if not present. AC_CHECK_FUNCS([getopt_long]) AC_CHECK_FUNCS([vsnprintf strlcat strtoul memrchr]) AC_CHECK_FUNCS([fdatasync]) AC_CHECK_FUNCS([fpathconf sysconf posix_memalign posix_fadvise]) AC_CHECK_FUNCS([nanosleep]) AC_CHECK_HEADERS([getopt.h]) AC_CHECK_HEADERS([limits.h]) AC_CHECK_HEADERS([wctype.h]) AC_CHECK_HEADERS([termios.h]) AC_CHECK_HEADERS([libgen.h]) AC_CHECK_HEADERS([sys/ioctl.h]) AC_CHECK_HEADERS([libintl.h locale.h]) AC_CHECK_MEMBERS([struct stat.st_blksize]) dnl Libraries that may contain key functions. AC_SEARCH_LIBS([clock_gettime],[rt]) dnl Items we can't do without. AC_CHECK_FUNCS([alarm basename clock_gettime dup2 getcwd memcpy memmove memset select setlocale strchr strerror strrchr strstr], [], [AC_MSG_ERROR([required function is missing])]) AC_CHECK_HEADERS([fcntl.h sys/file.h sys/time.h unistd.h], [], [AC_MSG_ERROR([required header file is missing])]) dnl Make sure all the types we use are defined. AC_TYPE_INT32_T AC_TYPE_MODE_T AC_TYPE_OFF_T AC_TYPE_PID_T AC_TYPE_SIZE_T AC_TYPE_SSIZE_T AC_TYPE_UID_T AH_BOTTOM([#include "config-aux.h"]) AC_ARG_ENABLE([debugging], [ --enable-debugging compile with debugging support], if test "$enable_debugging" = "yes"; then CFLAGS="$CFLAGS -g -Wall" AC_DEFINE([ENABLE_DEBUGGING], [1], [Debugging support enabled]) fi ) AC_ARG_ENABLE([profiling], [ --enable-profiling compile with profiling support], if test "$enable_profiling" = "yes"; then CFLAGS="-pg $CFLAGS" fi ) SPLICE_SUPPORT="no" AC_ARG_ENABLE([splice], [ --disable-splice do not use splice system call], if test "$enable_splice" = "yes"; then SPLICE_SUPPORT="yes" fi, SPLICE_SUPPORT="yes" ) IPC_SUPPORT="no" AC_ARG_ENABLE([ipc], [ --disable-ipc turn off IPC messaging], if test "$enable_ipc" = "yes"; then IPC_SUPPORT="yes" fi, IPC_SUPPORT="yes" ) AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static], [enable static linking])], [ if test "$enable_static" = "yes"; then CFLAGS="$CFLAGS -static" fi ]) dnl AIX needs -lc128 AC_EGREP_CPP([^yes$], [#ifdef _AIX yes #endif ], [LIBS="$LIBS -lc128"]) if test "$IPC_SUPPORT" = "yes"; then AC_CHECK_HEADERS([sys/ipc.h], [], [IPC_SUPPORT=no]) AC_CHECK_HEADERS([sys/param.h]) if test "$IPC_SUPPORT" = "yes"; then AC_CHECK_FUNCS([shmget], [], [IPC_SUPPORT=no]) fi fi if test "$IPC_SUPPORT" = "yes"; then AC_DEFINE([HAVE_IPC], [1], [IPC support enabled]) fi if test "$SPLICE_SUPPORT" = "yes"; then AC_CHECK_FUNCS([splice]) fi CPPFLAGS="$CPPFLAGS -I\$(top_srcdir)/src/include" dnl This must go after all the compiler based tests above. AC_LANG_WERROR AC_CONFIG_FILES([ po/Makefile.in Makefile ]) AC_OUTPUT pv-1.8.5/docs/000077500000000000000000000000001452655021700131115ustar00rootroot00000000000000pv-1.8.5/docs/ACKNOWLEDGEMENTS.md000066400000000000000000000203261452655021700157700ustar00rootroot00000000000000The following people have contributed to this project, and their assistance is acknowledged and greatly appreciated: * Antoine Beaupré - Debian package maintainer * Kevin Coyner - previous Debian package maintainer * Cédric Delfosse - previous Debian package maintainer * Jakub Hrozek - Fedora package maintainer * Eduardo Aguiar - provided Portuguese (Brazilian) translation * Stéphane Lacasse - provided French translation * Marcos Kreinacke - provided German translation * Bartosz FeÅ„ski - provided Polish translation along with Krystian Zubel * Joshua Jensen - reported RPM installation bug * Boris Folgmann - reported cursor handling bug * Mathias Gumz - reported NLS bug * Daniel Roethlisberger - submitted patch to use lockfiles for "`-c`" if terminal locking fails * Adam Buchbinder - lots of help with a Cygwin port of "`-c`" * Mark Tomich - suggested "`-B`" option * Gert Menke - reported bug when piping to `dd` with a large input buffer size * Ville Herva - informative bug report about rate limiting performance * Elias Pipping - patch to compile properly on Darwin 9; potential NULL deref report * Patrick Collison - similar patch for OS X * Boris Lohner - reported problem that "`-L`" does not complain if given non-numeric value * Sebastian Kayser - supplied testing for *SIGPIPE*, demonstrated internationalisation problem * Laszlo Ersek - reported shared memory leak on *SIGINT* with "`-c`" * Phil Rutschman - provided a patch for fully restoring terminal state on exit * Henry Precheur - reporting and suggestions for "`--rate-limit`" bug when rate is under 10 * E. Rosten - supplied patch for block buffering in line mode * Kjetil Torgrim Homme - reported compilation error with default *CFLAGS* on non-GCC compilers * Alexandre de Verteuil - reported bug in OS X build and supplied test environment to fix in * Martin Baum - supplied patch to return nonzero exit status if terminated by signal * Sam Nelson - supplied patch to fix trailing slash on *DESTDIR* * Daniel Pape - reported Cygwin installation problem due to *DESTDIR* * Philipp Beckers - ported to the Syabas PopcornHour A-100 series * Henry Gebhard - supplied patches to improve SI prefixes and add "`--average-rate`" * Vladimir Kokarev, Alexander Leo - reported that exit status did not reflect file errors * Thomas Rachel - submitted patches for IEEE1541 (MiB suffixes), 1+e03 bug * Guillaume Marcais - submitted speedup patch for line mode * Moritz Barsnick - submitted patch for compile warning in size calculation * Pawel Piatek - submitted RPM and patches for AIX * Sami Liedes - submitted patch for "`--timer`" and "`--bytes`" with "`--numeric`" * Steven Willis - reported problem with "`-R`" killing non-PV remote processes * Vladimir Pal, Vladimir Ermakov - submitted patch which led to development of "`--format`" option * Peter Samuelson - submitted patch to calculate size if stdout is a block device * Miguel Diaz - much Cygwin help (and packaging), found narrow-terminal bug * Jim Salter - commissioned work on the "`--skip-errors`" option * Wouter Pronk - reported build problem on SCO * Bryan Dongray - provided patches for test scripts failing on older Red Hats * Zev Weiss - provided patch to fix `splice()` not using stdin * Zing Shishak - provided patch for "`--null`" / "`-0`" (count null terminated lines) * Jacek Wielemborek - implemented fdwatch in Python, suggested PV port; reported bug with "`-l`" and ETA / size; many other contributions * Kim Krecht - suggested buffer fill status and last bytes output display options * Cristian Ciupitu , Josh Stone - pointed out file descriptor leak with helpful suggestions (Josh Stone initially noticed the missing close) * Jan Seda - found issue with `splice()` and *SPLICE_F_NONBLOCK* causing slowdown * André Stapf - pointed out formatting problem e.g. 13GB -> 13.1GB which should be shown 13.0GB -> 13.1GB; highlighted on-startup row swapping in "`-c`", and suggested "`--discard`" * Damon Harper - suggested "`-D`" / "`--delay-start`" option * Ganaël Laplanche - provided patch for `lstat64()` on systems that do not support it * Peter Korsgaard - provided similar patch for `lstat64()`, specifically for uClibc support; provided AIX cross-compilation patch to fix bug in "`-lc128`" check * Ralf Ramsauer - reported bug which dropped transfer rate on terminal resize * Michiel Van Herwegen - reported and discussed bug with "`-l`" and ETA / size * Erkki Seppälä - provided patch implementing "`-I`" * Eric A. Borisch - provided details of compatibility fix for "`%Lu`" in watchpid code * Jan Venekamp - reported MacOS buffer size interactions with pipes * Matt - provided "rate-window" patches for rate calculation * [Filippo Valsorda](https://github.com/FiloSottile) - provided patch for stat64 issue on Apple Silicon * Matt Koscica, William Dillon - also reported stat64 issue on Apple Silicon * [Demitri Muna](https://github.com/demitri) - assisted with stat64 patch on Apple Silicon * Norman Rasmussen - suggested "`-c`" with "`-d PID:FD`", reject "`-N`" with "`-d PID`" * Andriy Gapon, Jonathan Elchison - reported bug where "`pv /dev/zero >/dev/null &`" stops immediately * Marcelo Chiesa - reported unused-result warnings when compiling PV 1.6.6 * Jered Floyd - provided patches to improve "`--rate-limit`" * Christoph Biedl - provided ETA and dynamic interval patches * Richard Fonfara - provided German translations for "`pv --help`" * Johannes Gerer - suggested that "`-B`" should enable "`-C`" * Sam James - provided fix for number.c build issue caused by missing stddef.h * Jakub Wilk - corrected README encoding * Frederik Eaton - reported issue with `<()` shell constructs * [gray](https://github.com/gray) - reported issue with "`--force`" and terminal process groups, and proposed a patch * [Luc Gommans](https://github.com/lgommans) / https://lgms.nl/ - provided a "momentary ETA" patch * [ikasty](https://github.com/ikasty) - added relative filename display to "`--watchfd`" * [Michael Weiß](https://github.com/quitschbo) - corrected behaviour when not attached to a terminal * [christoph-zededa](https://github.com/christoph-zededa) - provided OS X support for "`--watchfd`" * [Dave Beckett](https://github.com/dajobe) - added "`@filename`" syntax to "`--size`", and corrected an autoconf problem with stat64 on OS X * [Volodymyr Bychkovyak](https://github.com/vbychkoviak) - provided fix for rate limit behaviour with bursty traffic * [Nick Black](https://nick-black.com) - added "`--bits`" option * [Andrew Schulman](https://github.com/andrew-schulman) - provided reproducible example of terminal size detection issue in 1.7.17/1.7.18 * [fuschia74](https://github.com/fuchsia74) - provided "`--enable-static`" patch for "`configure`" * [Wilhelm von Thiele](https://github.com/TurtleWilly) - assisted with OS X cleanups ([#73](https://codeberg.org/a-j-wood/pv/issues/73), [#74](https://codeberg.org/a-j-wood/pv/issues/74)) * MatÄ›jů Miroslav, Ing. - suggested fix for ETA and elapsed time faults when suspending and resuming a machine ([#13](https://codeberg.org/a-j-wood/pv/issues/13)) * Anthony DeRobertis - suggested the "`--error-skip-block`" option ([#37](https://codeberg.org/a-j-wood/pv/issues/37)) * Benoit Pierre - provided patches for compilation without IPC support, without HAVE_STRUCT_STAT_ST_BLKSIZE, and on MacOS * [gustav-b](https://codeberg.org/gustav-b) - suggested percentage formatting correction ([#80](https://codeberg.org/a-j-wood/pv/issues/80)) --- pv-1.8.5/docs/COPYING000066400000000000000000001045151452655021700141520ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . pv-1.8.5/docs/DEVELOPERS.md000066400000000000000000000134471452655021700151140ustar00rootroot00000000000000# Notes for developers and translators The following "`configure`" options will be of interest to developers and translators: * `--enable-debugging` - build in debugging support * `--enable-profiling` - build in support for profiling These "`make`" targets are available: * `make analyse` - run _splint_ and _flawfinder_ on all C source files ## Debugging and profiling support When "`./configure --enable-debugging`" is used, the "`pv`" produced by "`make`" will support an extra option, "`--debug FILE`", which will cause debugging output to be written to *FILE*. This is not recommended for production builds due to the extra processing it introduces, and the potential size of the output. Within the code, "`debug()`" is used in a similar way to "`printf()`". It will automatically include the calling function, source file, and line number, so they don't need to be included in the parameters. When debugging support is not enabled, it evaluates to a null statement. This does mean that if you call "`debug()`", make sure it has no side effects, as they won't be present in builds without debugging support. Builds produced after "`./configure --enable-profiling`" will write profile data when run, to be used with _gprof_. See "`man gprof`" for details. Please note that the memory safety checks will fail with profiling enabled. ## Source code analysis Running "`make analyse`" runs _splint_ and _flawfinder_ on all C sources, writing the output of both programs to files named "`*.e`" for each "`*.c`". There are no dependency rules set up for these "`.e`" files, so if a header file is altered, manually remove the relevant "`.e`" files, or update the timestamp of the relevant "`.c`" files, before running "`make analyse`" again. The goal is for all C source files to generate zero warnings from either tool. Wherever warnings are disabled by annotations to the source, there should be associated commentary nearby explaining the rationale behind it, and any assumptions made. This is so that there can be some assurance that the issue highlighted by the analyser has been considered properly, as well as documenting anything that might need further work if the surrounding code is altered in future. ## Translation notes The message catalogues used to translate program messages into other languages are in the "`po/`" directory, named "`xx.po`", where "`xx`" is the ISO 639-1 2-letter language code, such as "`fr`" for French. Each of these files contains lines like this: #: src/pv/cursor.c:85 msgid "failed to get terminal name" msgstr "erro ao ler o nome do terminal" The comment line, starting "`#`", shows the source filename and line number at which this message can be found. The "`msgid`" is the original message in the program, in English. The "`msgstr`" is the translated text. It is the "`msgstr`" lines which need to be updated by translators. Message catalogue files should all be encoded as UTF-8. _FIXME: The test below doesn't work on Debian with only en_GB installed, and also it looks like the compiled-in LOCALEDIR is overriding LOCPATH._ After making a change to a "`.po`" file, test it by compiling it and installing to a temporary location, like this: make install DESTDIR=/tmp/yourtest localedef -f UTF-8 -i de_DE /tmp/yourtest/usr/local/share/locale/de_DE.UTF-8 LOCPATH=/tmp/yourtest/usr/local/share/locale \ LC_ALL=de_DE.UTF-8 ./pv --help Replace "`--help`" with whatever is appropriate for your test. In this example, the language being tested is "`de`" (German), on a system which is running with UTF-8 support. To add a new language, create the new message catalogue file under "`po/`" by copying "`po/pv.pot`" to "`po/xx.po`", where "`xx`" is the language code, and adjusting it. The "`.pot`" file is generated automatically by "`make`". Next, add the language code to "`po/LINGUAS`" - this is a list of the 2-letter codes of the supported languages. Finally, run "`./config.status`" and "`make -C po update-po`". When the source code is updated, running "`make -C po update-po`" will update the "`pv.pot`" file so that it lists where all the messages are in the source. It will also use _msgmerge_ to update all of the "`.po`" files from the updated "`pv.pot`" file. After doing this, look for missing translations (empty "`msgstr`" lines) or translations marked as "fuzzy", as these will need to be corrected by translators. ## Release checklist The package maintainer should run through these steps for a new release: * Check for patches and bug reports at https://tracker.debian.org/pkg/pv * Run "`make indent; make indent indentclean check`" * Run "`make -C po update-po`" * Run "`make analyse`" and see whether remaining warnings can be addressed * Version bump and documentation checks: * Update the version in `configure.ac` and `docs/NEWS.md` * Check that `docs/NEWS.md` is up to date * Check that `docs/TODO.md` is up to date * Check that the manual `docs/pv.1` is up to date * Run "`make docs/pv.1.md`" and, if using VPATH, copy the result to the source directory * Ensure everything has been committed to the repository * Run "`autoreconf`" in the source directory * Consistency and build checks: * Wipe the build directory, and run "`configure`" there * Run "`make distcheck`" * Run "`./configure && make check`" on all test systems including Cygwin, using the `tar.gz` that was just created * Run "`make release MAINTAINER=`" * Update the project web site: * Copy the release `.tar.gz`, `.txt`, and `.asc` files to the web site * Use "`pandoc --from markdown --to html`" to convert the TODO, news, and manual to HTML * Update the TODO, news, and manual on the web site * Update the version numbers on the web site * Update the package index on the web site * Create a new release in the repository, and apply the associated tag pv-1.8.5/docs/INSTALL000066400000000000000000000172301452655021700141450ustar00rootroot00000000000000Basic Installation ================== These are generic installation instructions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, a file `config.cache' that saves the results of its tests to speed up reconfiguring, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.in' is used to create `configure' by a program called `autoconf'. You only need `configure.in' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. You can give `configure' initial values for variables by setting them in the environment. Using a Bourne-compatible shell, you can do that on the command line like this: CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure Or on systems that have the `env' program, you can do it like this: env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of `make' that supports the `VPATH' variable, such as GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. If you have to use a `make' that does not supports the `VPATH' variable, you have to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' will install the package's files in `/usr/local/bin', `/usr/local/man', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PATH'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec-prefix=PATH', the package will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=PATH' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' can not figure out automatically, but needs to determine by the type of host the package will run on. Usually `configure' can figure that out, but if it prints a message saying it can not guess the host type, give it the `--host=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name with three fields: CPU-COMPANY-SYSTEM See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the host type. If you are building compiler tools for cross-compiling, you can also use the `--target=TYPE' option to select the type of system they will produce code for and the `--build=TYPE' option to select the type of system on which you are compiling the package. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Operation Controls ================== `configure' recognizes the following options to control how it operates. `--cache-file=FILE' Use and save the results of the tests in FILE instead of `./config.cache'. Set FILE to `/dev/null' to disable caching, for debugging `configure'. `--help' Print a summary of the options to `configure', and exit. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--version' Print the version of Autoconf used to generate the `configure' script, and exit. `configure' also accepts some other, not widely useful, options. pv-1.8.5/docs/NEWS.md000066400000000000000000000615131452655021700142150ustar00rootroot00000000000000### 1.8.5 - 19 November 2023 * fix: corrected percentage formatting so it doesn't jump from 2 to 3 characters wide at 100% ([#80](https://codeberg.org/a-j-wood/pv/issues/80)) * fix: replaced "`--remote`" mechanism, using a temporary file instead of SysV IPC, so it can work reliably even when there are multiple PV instances * fix: corrected compilation failure when without IPC support * security: addressed all issues highlighted by the software auditing tools "`splint`" and "`flawfinder`" (see "`make analyse`") ([#77](https://codeberg.org/a-j-wood/pv/issues/77)) * cleanup: compilation warnings fixed on non-IPC and MacOS systems ### 1.8.0 - 24 September 2023 #### Features * feature: new "`--discard`" option to discard input as if writing to */dev/null* ([#42](https://codeberg.org/a-j-wood/pv/issues/42)) * feature: new "`--error-skip-block`" option to make "`--skip-errors`" skip whole blocks ([#37](https://codeberg.org/a-j-wood/pv/issues/37)) * feature: use `posix_fadvise()` like `cat`(1) does, to improve efficiency ([#39](https://codeberg.org/a-j-wood/pv/issues/39)) * feature: new "`--enable-static`" option to "`configure`" for static builds ([#75](https://codeberg.org/a-j-wood/pv/pull/75)) #### Security * security: with "`--pidfile`", write to a temporary file and rename it into place, to improve security * security: keep self-contained copies of name and format string in PV internal state for memory safety * security: ignore _TMP_ / _TMPDIR_ environment variables when using a terminal lock file #### Fixes * fix: only report errors about missing files when starting to transfer from them, not while calculating size, and behave more like `cat`(1) by skipping them and moving on * fix: auto-calculate total line count with "`--line-mode`" when all inputs are regular files * fix: use `clock_gettime()` in ETA calculation to cope with machine suspend/resume ([#13](https://codeberg.org/a-j-wood/pv/issues/13)) * fix: if "`--width`" or "`--height`" were provided, do not change them when the window size changes ([#36](https://codeberg.org/a-j-wood/pv/issues/36)) * fix: when a file descriptor position in "`--watchfd`" moves backwards, show the rate using the correct prefix ([#41](https://codeberg.org/a-j-wood/pv/issues/41)) * fix: rewrite terminal state save/restore so state is not intermittently garbled on exit when using "`--cursor`" ([#20](https://codeberg.org/a-j-wood/pv/issues/20)), ([#24](https://codeberg.org/a-j-wood/pv/issues/24)) #### Cleanups * cleanup: addressed many potential issues highlighted by the software auditing tools "`splint`" and "`flawfinder`" (see new target "`make analyse`") * cleanup: switched the build system to GNU Automake * cleanup: replaced the test harness with the one native to GNU Automake * cleanup: added a test for terminal width detection to "`make check`" * cleanup: added a test to "`make check`" to ensure that "`make install`" installs everything expected * cleanup: replaced *AC_HEADER_TIOCGWINSZ* with *AC_CHECK_HEADERS(sys/ioctl.h)* for better MacOS compatibility ([#74](https://codeberg.org/a-j-wood/pv/issues/74)) * cleanup: with "`--sync`", call `fsync()` instead of `fdatasync()` on incapable systems ([#73](https://codeberg.org/a-j-wood/pv/issues/73)) * cleanup: the manual is now a static file instead of needing to be built with "`configure`" #### Dropped items * dropped: dropped support for "`--enable-static-nls`" * dropped: removed the Linux Software Map file, as the LSM project appears to be long dead * dropped: will no longer publish to SourceForge as it has a chequered history and is unnecessary * dropped: removed project from GitHub and moved to Codeberg - see "[Give Up GitHub](https://giveupgithub.org/)" #### Other items * licensing change from Artistic 2.0 to GPLv3+ ### 1.7.24 - 30 July 2023 * fix: correct terminal size detection, broken in 1.7.17 by the configuration script rewrite ([#72](https://codeberg.org/a-j-wood/pv/issues/72)) * security: removed *DEBUG* environment variable in debug mode, added "`--debug`" instead * cleanup: added "`make analyse`" to run "`splint`" and "`flawfinder`" on all source files * cleanup: corrected detection of boolean capability * cleanup: word wrapping of "`--help`" output is now multi-byte locale aware * cleanup: adjusted "`indent`" rules to line length of 120 and reformatted code ### 1.7.18 - 28 July 2023 * fix: language file installation had been broken by the configuration script rewrite ### 1.7.17 - 27 July 2023 * feature: new "`--sync`" option to flush cache to disk after every write (related to [#6](https://codeberg.org/a-j-wood/pv/issues/6), to improve accuracy when writing to slow disks) * feature: new "`--direct-io`" option to bypass cache - implements [#29 "Option to enable *O_DIRECT*"](https://codeberg.org/a-j-wood/pv/issues/29) - requested by Romain Kang, Jacek Wielemborek * fix: correct byte prefix size to 2 spaces in rate display, so progress display size remains constant at low transfer rates * cleanup: rewrote `configure.in` as per suggestions in newer "`autoconf`" manuals * cleanup: replaced `header.in` with one generated by "`autoheader`", moving custom logic to a separate header file "`config-aux.h`" * cleanup: added copyright notice to all source files as per GNU standards * cleanup: changed "`--version`" output to conform to GNU standards * cleanup: replaced backticks with `$()` in all shell scripts that did not come from elsewhere, as backticks are deprecated and harder to read * cleanup: improved the output formatting of "`make test`" * cleanup: extended the "`make test`" mechanism to allow certain tests to be skipped on platforms that cannot support them * cleanup: skip the "pipe" test (for *SIGPIPE*) if GNU "`head`" is not available, so that "`make test`" on stock OpenBSD 7.3 works * cleanup: added a lot more tests to "`make test`" * cleanup: replace all calls to `sprintf()` and `snprintf()` with a new wrapper function `pv_snprintf()` to improve security and compatibility * cleanup: replace all calls to `strcat()` with a wrapper `pv_strlcat()` to improve security and compatibility * cleanup: replace all `write()` calls to the terminal with a wrapper `pv_write_retry()` for consistency * cleanup: tidy up and fix compilation warning in "`--watchfd`" code * cleanup: rewrote all local shell scripts to pass analysis by [ShellCheck](https://www.shellcheck.net) ### 1.7.0 - 17 July 2023 * dropped: support for Red Hat Enterprise Linux and its derivatives has been dropped; removed the RPM spec file, and will no longer build binaries * feature: the "`--size`" option now accepts "`@filename`" to use the size of another file (pull request [#57](https://codeberg.org/a-j-wood/pv/pull/57) supplied by [Dave Beckett](https://github.com/dajobe)) * feature: the "`--watchfd`" option is now available on OS X (pull request [#60](https://codeberg.org/a-j-wood/pv/pull/60) supplied by [christoph-zededa](https://github.com/christoph-zededa)) * feature: new "`--bits`" option to show bit count instead of byte count (adapted from pull request [#63](https://codeberg.org/a-j-wood/pv/pull/63) supplied by [Nick Black](https://nick-black.com)) * feature: new "`--average-rate-window`" option, to set the window over which the average rate is calculated, also used for ETA (modified from pull request [#65](https://codeberg.org/a-j-wood/pv/pull/65) supplied by [lemonsqueeze](https://github.com/lemonsqueeze)) * feature: the "`--watchfd`" option will now show relative filenames, if they are under the current directory (pull request [#66](https://codeberg.org/a-j-wood/pv/pull/66) supplied by [ikasty](https://github.com/ikasty)) * fix: correction to `pv_in_foreground()` to behave as its comment block says it should, when not on a terminal - corrects [#19 "No output in Arch Linux initcpio after 1.6.6"](https://codeberg.org/a-j-wood/pv/issues/19), [#31 "No output written from inside zsh <() construct"](https://codeberg.org/a-j-wood/pv/issues/31), [#55 "pv Stopped Working in the Background"](https://codeberg.org/a-j-wood/pv/issues/55) (pull request [#64](https://codeberg.org/a-j-wood/pv/pull/64) supplied by [Michael Weiß](https://github.com/quitschbo)) * fix: workaround for OS X 11 behaviour in configure script regarding stat64 at compile time (pull request [#57](https://codeberg.org/a-j-wood/pv/pull/57) supplied by [Dave Beckett](https://github.com/dajobe)) * fix: workaround for macOS equivalence of stat to stat64 - patches from [Filippo Valsorda](https://github.com/FiloSottile) and [Demitri Muna](https://github.com/demitri), correcting [#33 "Fix compilation problems due to `stat64()` on Apple Silicon"](https://codeberg.org/a-j-wood/pv/issues/33) * fix: add burst rate limit to transfer, so rate limits are not broken by bursty traffic (pull request [#62](https://codeberg.org/a-j-wood/pv/pull/62) supplied by [Volodymyr Bychkovyak](https://github.com/vbychkoviak)) * fix: corrected "`--force`" option so it will still output progress when not in the same process group as the owner of the terminal - corrects [#23 "No output with "`-f`" when run in background after 1.6.6"](https://codeberg.org/a-j-wood/pv/issues/23) and helps to correct [#31 "No output written from inside zsh <() construct"](https://codeberg.org/a-j-wood/pv/issues/31) * fix: corrected elapsed time display to show as D:HH:MM:SS after 1 day, like the ETA does - corrects [#16 "Show days in same format in ETA as in elapsed time"](https://codeberg.org/a-j-wood/pv/issues/16) * fix: corrected bug where percentages went down after 100% when in "`--numeric`" mode with a "`--size`" that was too small - corrects [#26 "Correct "`-n`" behaviour when going past 100% of "`-s`" size"](https://codeberg.org/a-j-wood/pv/issues/26) * i18n: recoded Polish translation file to UTF-8 * i18n: removed inaccurate fuzzy translation matches * docs: moved all open issues into GitHub and updated the TODO list * docs: renamed README to README.md and altered it to Markdown format * docs: moved contributors from the README to docs/ACKNOWLEDGEMENTS.md * docs: moved TODO to TODO.md and altered it to Markdown format * docs: moved NEWS to NEWS.md, converted it to UTF-8, and altered it to Markdown format ### 1.6.20 - 12 September 2021 * fix: add missing `stddef.h` include to `number.c` (Sam James) ### 1.6.19 - 5 September 2021 * fix: starting pv in the background no longer immediately stops unless the transfer is to/from the terminal (Andriy Gapon, Jonathan Elchison) * fix: using "`-B`", "`-A`", or "`-T`" now switches on "`-C`" implicitly (Johannes Gerer, André Stapf) * fix: AIX build fixes (Peter Korsgaard) * i18n: updated German "`--help`" translations (Richard Fonfara) * i18n: switched to UTF-8 encoding, added missing translations (de,fr,pt) * docs: new "common switches" manual section (Jacek Wielemborek) * docs: use placeholder instead of `/dev/sda` in the manual (Pranav Peshwe) * docs: mention MacOS pipes and "`-B 1024`" in the manual (Jan Venekamp) * docs: correct shell in `autoconf/scripts/index.sh` (Juan Picca) * cleanup: various compiler warnings cleaned up Full changelog is below: * (r181) added common switches section to manual (Jacek Wielemborek) * (r184) use placeholder instead of /dev/sda in the manual (Pranav Peshwe) * (r185) replace ash with sh in autoconf/scripts/index.sh (Juan Picca) * (r185) added note to manual about "`-B 1024`" in MacOS pipes (Jan Venekamp) * (r185) fix AIX config check when the CWD contains "yes" (Peter Korsgaard) * (r189) (#1556) updated German "`--help`" translations (Richard Fonfara) * (r189) updated missing German translations and changed to UTF-8 encoding * (r191) updated missing French translations and changed to UTF-8 encoding * (r193) updated missing Portuguese translations, changed to UTF-8 encoding * (r196) (#1563) using "`-B`", "`-A`", or "`-T`" now switches on "`-C`" implicitly (Johannes Gerer, André Stapf) * (r199) fixed numerous compiler warnings in newer GCC versions * (r200,205) fixed bug where "`pv /dev/zero >/dev/null &`" stopped immediately (Jonathan Elchison, Andriy Gapon) * (r203,205) marked unused arguments with GCC unused attribute, started using boolean data type for flags, corrected more compiler warnings ### 1.6.6 - 30 June 2017 * (r161) use `%llu` instead of `%Lu` for better compatibility (Eric A. Borisch) * (r162) (#1532) fix target buffer size ("`-B`") being ignored (AndCycle, Ilya Basin, Antoine Beaupré) * (r164) cap read/write sizes, and check elapsed time during read/write cycles, to avoid display hangs with large buffers or slow media; also remove `select()` call from repeated_write function as it slows the transfer down and the wrapping `alarm()` means it is unnecessary * (r169) (#1477) use alternate form for transfer counter, such that 13GB is shown as 13.0GB so it's the same width as 13.1GB (André Stapf) * (r171) cleanup: units corrections in man page, of the form kb -> KiB * (r175) report error in "`-d`" if process fd directory is unreadable, or if process disappears before we start the main loop (Jacek Wielemborek) ### 1.6.0 - 15 March 2015 * fix lstat64 support when unavailable - separate patches supplied by Ganael Laplanche and Peter Korsgaard * (#1506) new option "`-D`" / "`--delay-start`" to only show bar after N seconds (Damon Harper) * new option "`--fineta`" / "`-I`" to show ETA as time of day rather than time remaining - patch supplied by Erkki Seppälä (r147) * (#1509) change ETA ("`--eta`" / "`-e`") so that days are given if the hours remaining are 24 or more (Jacek Wielemborek) * (#1499) repeat read and write attempts on partial buffer fill/empty to work around post-signal transfer rate drop reported by Ralf Ramsauer * (#1507) do not try to calculate total size in line mode, due to bug reported by Jacek Wielemborek and Michiel Van Herwegen * cleanup: removed defunct RATS comments and unnecessary copyright notices * clean up displayed lines when using "`--watchfd PID`", when PID exits * output errors on a new line to avoid overwriting transfer bar ### 1.5.7 - 26 August 2014 * show KiB instead of incorrect kiB (Debian bug #706175) * (#1284) do not gzip man page, for non-Linux OSes (Bob Friesenhahn) * work around "awk" bug in `tests/016-numeric-timer` in decimal "," locales * fix "`make rpm`" and "`make srpm`", extend "`make release`" to sign releases ### 1.5.3 - 4 May 2014 * remove *SPLICE_F_NONBLOCK* to fix problem with slow `splice()` (Jan Seda) ### 1.5.2 - 10 February 2014 * allow "`--watchfd`" to look at block devices * let "`--watchfd PID:FD`" work with "`--size N`" * moved contributors out of the manual as the list was too long (NB everyone is still listed in the README and always will be) ### 1.5.1 - 23 January 2014 * new option "`--watchfd`" - suggested by Jacek Wielemborek and "fdwatch" * use non-block flag with `splice()` * new display option "`--buffer-percent`", suggested by Kim Krecht * new display option "`--last-written`", suggested by Kim Krecht * new transfer option "`--no-splice`" * fix for minor bug which dropped display elements after one empty one * fix for single fd leak on exit (Cristian Ciupitu) ### 1.4.12 - 5 August 2013 * new option "`--null`" - patch supplied by Zing Shishak * AIX build fix (add "`-lc128`") - with help from Pawel Piatek * AIX "`-c`" fixes - with help from Pawel Piatek * SCO build fix (`po2table.sh`) - reported by Wouter Pronk * test scripts fix for older distributions - patch from Bryan Dongray * fix for `splice()` not using stdin - patch from Zev Weiss ### 1.4.6 - 22 January 2013 * added patch from Pawel Piatek to omit *O_NOFOLLOW* in AIX ### 1.4.5 - 10 January 2013 * updated manual page to show known problem with "`-R`" on Cygwin ### 1.4.4 - 11 December 2012 * added debugging, see "`pv -h`" when `configure` is run with "`--enable-debugging`" * rewrote cursor positioning code used when IPC is unavailable (Cygwin) * fixed cursor positioning cursor read answerback problem (Cygwin/Solaris) * fixed bug causing crash when progress displayed with too-small terminal ### 1.4.0 - 6 December 2012 * new option "`--skip-errors`" commissioned by Jim Salter * if stdout is a block device, and we don't know the total size, use the size of that block device as the total (Peter Samuelson) * new option "`--stop-at-size`" to stop after "`--size`" bytes * report correct filename on read errors * fix use-after-free bug in remote PID cleanup code * refactored large chunks of code to make it more readable and to replace most static variables with a state structure ### 1.3.9 - 5 November 2012 * allow "`--format`" parameters to be sent with "`--remote`" * configure option "`--disable-ipc`" * added tests for "`--numeric`" with "`--timer`" and "`--bytes`" * added tests for "`--remote`" ### 1.3.8 - 29 October 2012 * new "`--pidfile`" option to save process ID to a file * integrated patch for "`--numeric`" with "`--timer`" and "`--bytes`" (Sami Liedes) * removed signalling from "`--remote`" to prevent accidental process kills * new "`--format`" option (originally Vladimir Pal / Vladimir Ermakov) ### 1.3.4 - 27 June 2012 * new "`--disable-splice`" configure script option * fixed line mode size count with multiple files (Moritz Barsnick) * fixes for AIX core dumps (Pawel Piatek) ### 1.3.1 - 9 June 2012 * do not use `splice()` if the write buffer is not empty (Thomas Rachel) * added test 15 (pipe transfers), and new test script ### 1.3.0 - 5 June 2012 * added Tiger build patch from Olle Jonsson * fix 1024-boundary display garble (Debian bug #586763) * use `splice`(2) where available (Debian bug #601683) * added known bugs section of the manual page * fixed average rate test, 12 (Andrew Macheret) * use IEEE1541 units (Thomas Rachel) * bug with rate limit under 10 fixed (Henry Precheur) * speed up PV line mode (patch: Guillaume Marcais) * remove `LD=ld` from `vars.mk` to fix cross-compilation (paintitgray/PV#1291) ### 1.2.0 - 14 December 2010 * integrated improved SI prefixes and "`--average-rate`" (Henry Gebhardt) * return nonzero if exiting due to *SIGTERM* (Martin Baum) * patch from Phil Rutschman to restore terminal properly on exit * fix i18n especially for "`--help`" (Sebastian Kayser) * refactored `pv_display` * we now have a coherent, documented, exit status * modified pipe test and new cksum test from Sebastian Kayser * default *CFLAGS* to just "`-O`" for non-GCC (Kjetil Torgrim Homme) * LFS compile fix for OS X 10.4 (Alexandre de Verteuil) * remove *DESTDIR* `/` suffix (Sam Nelson, Daniel Pape) * fixed potential NULL deref in transfer (Elias Pipping / LLVM/Clang) ### 1.1.4 - 6 March 2008 * patch from Elias Pipping correcting compilation failure on Darwin 9 * patch from Patrick Collison correcting similar problems on OS X * trap *SIGINT* / *SIGHUP* / *SIGTERM* so we clean up IPCs on exit (Laszlo Ersek) * abort if numeric option, eg "`-L`", has non-numeric value (Boris Lohner) ### 1.1.0 - 30 August 2007 * new option "`--remote`" ("`-R`") to control an already-running process * new option "`--line-mode`" ("`-l`") to count lines instead of bytes * fix for "`-L`" to be less resource intensive * fix for input/output equivalence check on Mac OS X * fix for size calculation in pipelines on Mac OS X * fixed "`make uninstall`" * removed "`/debian`" directory at request of new Debian maintainer ### 1.0.1 - 4 August 2007 * licensing change from Artistic to Artistic 2.0 * removed the "`-l`" / "`--license`" option ### 1.0.0 - 2 August 2007 * act more like "`cat`" - just skip unreadable files, don't abort * removed text version of manual page, and obsolete Info file generation * code cleanup and separation of PV internals from CLI front-end ### 0.9.9 - 5 February 2007 * new option "`--buffer-size`" ("`-B`") suggested by Mark Tomich * build fix: HP/UX largefile compile fix from Timo Savinen * maintain better buffer filling during transfers * workaround: "`pv /dev/zero | dd bs=1M count=1k`" bug (reported by Gert Menke) * dropped support for the Texinfo manual ### 0.9.6 - 27 February 2006 * bugfix: `key_t` incompatibility with Cygwin * bugfix: interval ("`-i`") parameter parses numbers after decimal point * build fix: use static NLS if `msgfmt` is unavailable * on the final update, blank out the now-zero ETA ### 0.9.2 - 1 September 2005 * Daniel Roethlisberger patch: use lockfiles if terminal locking fails ### 0.9.1 - 16 June 2005 * minor RPM spec file fix for Fedora Core 4 ### 0.9.0 - 15 November 2004 * minor NLS bugfix ### 0.8.9 - 6 November 2004 * decimal values now accepted for rate and size, eg "`-L 1.23M`" * code cleanup * developers: "`make help`" now lists Makefile targets ### 0.8.6 - 29 June 2004 * use `uu_lock()` for terminal locking on FreeBSD ### 0.8.5 - 2 May 2004 * cursor positioning ("`-c`") reliability improved on systems with IPC * minor fix: made test 005 more reliable * new option "`--height`" ("`-H`") ### 0.8.2 - 24 April 2004 * allow k,m,g,t suffixes on numbers * added "`srpm`" and "`release`" Makefile targets ### 0.8.1 - 19 April 2004 * bugfix in cursor positioning ("`-c`") ### 0.8.0 - 12 February 2004 * replaced GNU getopt with my library code * replaced GNU gettext with my very minimal replacement * use *DESTDIR* instead of *RPM_BUILD_ROOT* for optional installation prefix * looked for flaws using RATS, cleaned up code ### 0.7.0 - 8 February 2004 * display buffer management fixes (thanks Cédric Delfosse) * replaced "`--enable-debug`" with "`--enable-debugging`" and "`--enable-profiling`" ### 0.6.4 - 14 January 2004 * fixed minor bug in RPM installation * bugfix in "`make index`" (only of interest to developers) ### 0.6.3 - 22 December 2003 * fixed transient bug that reported "resource unavailable" occasionally ### 0.6.2 - 6 August 2003 * block devices now have their size read correctly, so "`pv /dev/hda1`" works * minor code cleanups (mainly removal of CVS "Id" tags) ### 0.6.0 - 3 August 2003 * doing *^Z* then "`bg`" then "`fg`" now continues displaying ### 0.5.9 - 23 July 2003 * fix for test 007 when not in C locale * fix for build process to use *CPPFLAGS* * fix for build process to use correct i18n libraries * fix for build process - more portable sed in dependency generator * fix for install process - remember to `mkinstalldirs` before installing * fixes for building on Mac OS X ### 0.5.3 - 4 May 2003 * added Polish translation thanks to Bartosz FeÅ„ski and Krystian Zubel * moved `doc/debian` to `./debian` at insistence of common sense * minor Solaris 8 compatibility fixes * seems to compile and test OK on Mac OS X ### 0.5.0 - 15 April 2003 * added French translation thanks to Stéphane Lacasse * added German translation thanks to Marcos Kreinacke * switched LGPL reference from "Library" to "Lesser" ### 0.4.9 - 18 February 2003 * support for >2GB files added where available (Debian bug #180986) * added `doc/debian` dir (from Cédric Delfosse) * added "`make rpm`" and "`make deb`" targets to build RPM and Debian packages * added a "`make pv-static`" rule to build a statically linked version ### 0.4.5 - 13 December 2002 * added Portuguese (Brazilian) translation thanks to Eduardo Aguiar ### 0.4.4 - 7 December 2002 * pause/resume support - don't count time while stopped * stop output when resumed in the background * terminal size change support * bugfix: "`<=>`" indicator no longer sticks at right hand edge ### 0.4.0 - 27 November 2002 * allow decimal interval values, eg 0.1, 0.5, etc * some simple tests added ("`make check`") * smoother throughput limiting ("`--rate-limit`"), now done in 0.1sec chunks * bounds-check interval values ("`-i`") - max update interval now 10 minutes * more reliable non-blocking output to keep display updated * no longer rely on `atoll()` * don't output final blank line if "`--numeric`" * use `fcntl()` instead of `flock()` for Solaris compatibility ### 0.3.0 - 25 November 2002 * handle broken output pipe gracefully * continue updating display even when output pipe is blocking ### 0.2.6 - 21 October 2002 * we now ignore *EINTR* on `select()` * variable-size buffer (still need to add code to change size) * added (tentative) support for internationalisation * removed superfluous "`--no-progress`", etc options * optimised transfer by using bigger buffers, based on `st_blksize` * added "`--wait`" option to wait until transfer begins before showing progress * added "`--rate-limit`" option to limit rate to a maximum throughput * added "`--quiet`" option (no output at all) to be used with "`--rate-limit`" ### 0.2.5 - 23 July 2002 * added *[FILE]...* arguments, like "`cat`" * function separation in code * some bug fixes related to numeric overflow ### 0.2.3 - 19 July 2002 * Texinfo manual written, man page updated * byte counter added ### 0.2.0 - 18 July 2002 * ETA counter added * screen width estimation added * progress bar added ### 0.1.0 - 17 July 2002 * main loop created * rate counter added * elapsed time counter added * percentage calculation added ### 0.0.1 - 16 July 2002 * package created * first draft of man page written pv-1.8.5/docs/TODO.md000066400000000000000000000067101452655021700142040ustar00rootroot00000000000000Things still to do. (#n) indicates the issue tracker number. * ([#3](https://codeberg.org/a-j-wood/pv/issues/3)) Option ("`-x`"?) to use xterm title line for status (Joachim Haga) * ([#4](https://codeberg.org/a-j-wood/pv/issues/4)) Option for process title (Martin Sarsale) as "`pv - name:FooProcess -xyz - transferred: 1.3GB - 500KB/s - running: 10:15:30s`" * ([#6](https://codeberg.org/a-j-wood/pv/issues/6)) Look at effect of *O_SYNC* or `fsync` on performance; update counters during buffer flush * ([#9](https://codeberg.org/a-j-wood/pv/issues/9)) Option to switch rate to per minute if really slow * ([#10](https://codeberg.org/a-j-wood/pv/issues/10)) Add watchfd tests * ([#11](https://codeberg.org/a-j-wood/pv/issues/11)) Option "`--progress-from FILE`", read last number and use it as bytes read (Jacek Wielemborek) * ([#12](https://codeberg.org/a-j-wood/pv/issues/12)) Allow multiple "`-d`" options (Linus Heckemann for multiple PID:FD; Jacek Wielemborek) * ([#15](https://codeberg.org/a-j-wood/pv/issues/15)) Use Unicode for more granular progress bar (Alexander Petrossian) * ([#17](https://codeberg.org/a-j-wood/pv/issues/17)) Allow "`-r`" with "`-l`" and "`-n`" to output lines/sec (Roland Kletzing) * ([#22](https://codeberg.org/a-j-wood/pv/issues/22)) Options to skip input and seek on output (Jason A. Pfeil, Feb 2022) * ([#25](https://codeberg.org/a-j-wood/pv/issues/25)) Normalise progress to 100% on overrun (Andrej Gantvorg) * ([#34](https://codeberg.org/a-j-wood/pv/issues/34)) Continue timer even if input or output is blocking (Martin Probst - Jun 2017) * ([#35](https://codeberg.org/a-j-wood/pv/issues/35)) Allow decimal values for "`-s`", "`-L`", "`-B`" (Thomas Watson - Aug 2020) * ([#38](https://codeberg.org/a-j-wood/pv/issues/38)) Reset ETA on *SIGUSR1* (Jacek Wielemborek - Jan 2019) * ([#40](https://codeberg.org/a-j-wood/pv/issues/40)) Permit "`-c`" with "`-d PID:FD`", reject "`-N`" with "`-d PID`" (Norman Rasmussen - Nov 2020) * ([#43](https://codeberg.org/a-j-wood/pv/issues/43)) Differentiate between "`--eta`" and "`--fineta`" in display (André Stapf - Apr 2017) * ([#45](https://codeberg.org/a-j-wood/pv/issues/45)) Option "`--sparse`" (with block size option) to write sparse output (Andriy Galetski - Apr 2019) * ([#46](https://codeberg.org/a-j-wood/pv/issues/46)) Option to show speed gauge (% max speed) if progress not known (Ryan Cooley - Jun 2019) * ([#47](https://codeberg.org/a-j-wood/pv/issues/47)) Analyse splice and buffer usage to improve performance * ([#48](https://codeberg.org/a-j-wood/pv/issues/48)) Option to show multiple files with individual sizes and a cumulative total (Zach Riggle - Jul 2021) * ([#49](https://codeberg.org/a-j-wood/pv/issues/49)) Option to provide stats for avg/min/max/stddev throughput (Venky.N.Iyer) * ([#50](https://codeberg.org/a-j-wood/pv/issues/50)) Allow pv to report on a whole pipeline at once (Will Entriken - Feb 2011) * ([#54](https://codeberg.org/a-j-wood/pv/issues/54)) Run command every n percent ([haarp](https://github.com/haarp)) * ([#56](https://codeberg.org/a-j-wood/pv/issues/56)) Support for backgrounding pv, and allowing it to be monitored separately ([jimbobmcgee](https://github.com/jimbobmcgee)) * ([#67](https://codeberg.org/a-j-wood/pv/issues/67)) Wrap another process to monitor its stdin & stdout ([Alex Mason](https://github.com/axman6)) * ([#76](https://codeberg.org/a-j-wood/pv/issues/76)) Provide a way to test translations without installing Any assistance would be appreciated. pv-1.8.5/docs/benchmark.sh000077500000000000000000000020611452655021700154010ustar00rootroot00000000000000#!/bin/bash # # Benchmark the read/write performance of pv by looking at the number of # read() and write() calls and the average amount of data transferred each # time, as suggested by Ville Herva . # test_input=$(mktemp /tmp/pvbench1XXXXXX) strace_output=$(mktemp /tmp/pvbench2XXXXXX) trap 'rm -f ${test_input} ${strace_output}' EXIT pv=${pv:-./pv} test -x "${pv}" || pv="pv" dd if=/dev/zero of="${test_input}" bs=1k count=1k >/dev/null 2>&1 echo -e "Buf(k)\tRate(k)\tReads\tRsize\tWrites\tWsize" for ((buffer=100; buffer<=1000; buffer+=100)); do for ((rate=100; rate<=1000; rate+=100)); do rateparm="-L ${rate}k" test ${rate} -eq 0 && rateparm="" strace -tt -o "${strace_output}" \ "${pv}" "${rateparm}" -B "${buffer}k" \ -f < "${test_input}" > /dev/null 2>&1 rdata=$( awk '$2~/^read\(0,/{c++;t+=$NF}END{print c "\t" t/c}' \ "${strace_output}" ) wdata=$( awk '$2~/^write\(1,/{c++;t+=$NF}END{print c "\t" t/c}' \ "${strace_output}" ) echo -e "${buffer}\t${rate}\t${rdata}\t${wdata}" done done # EOF pv-1.8.5/docs/pv.1000066400000000000000000000432241452655021700136250ustar00rootroot00000000000000.TH PV 1 "November 2023" Linux "User Manuals" .SH NAME pv \- monitor the progress of data through a pipe .SH SYNOPSIS .B pv [\fIOPTION\fR] [\fIFILE\fR]... .br .B pv [\fI\-h\fR|\fI\-V\fR] .SH DESCRIPTION .B pv shows the progress of data through a pipeline by giving information such as time elapsed, percentage completed (with progress bar), current throughput rate, total data transferred, and ETA. To use it, insert it in a pipeline between two processes, with the appropriate options. Its standard input will be passed through to its standard output and progress will be shown on standard error. .B pv will copy each supplied .I FILE in turn to standard output .BR "" "(" - means standard input), or if no .IR FILE s are specified just standard input is copied. This is the same behaviour as .BR cat (1). A simple example to watch how quickly a file is transferred using .BR nc (1): .RS .B pv file | nc -w 1 somewhere.com 3000 .RE A similar example, transferring a file from another process and passing the expected size to .BR pv : .RS .B cat file | pv -s 12345 | nc -w 1 somewhere.com 3000 .RE A more complicated example using numeric output to feed into the .BR dialog (1) program for a full-screen progress display: .RS .B (tar cf - . \e .br .B " | pv -n -s $(du -sb . | awk '{print $1}') \e" .br .B " | gzip -9 > out.tgz) 2>&1 \e" .br .B | dialog --gauge 'Progress' 7 70 .RE Taking an image of a disk, skipping errors: .RS .B pv -EE /dev/your/disk/device > disk-image.img .RE Writing an image back to a disk: .RS .B pv disk-image.img > /dev/your/disk/device .RE Zeroing a disk: .RS .B pv < /dev/zero > /dev/your/disk/device .RE Note that if the input size cannot be calculated, and the output is a block device, then the size of the block device will be used and .B pv will automatically stop at that size as if .B \-S had been given. (Linux only): Watching file descriptor 3 opened by another process 1234: .RS .B pv -d 1234:3 .RE (Linux only): Watching all file descriptors used by process 1234: .RS .B pv -d 1234 .RE .SH OPTIONS .B pv takes many options, which are divided into display switches, output modifiers, and general options. .SH DISPLAY SWITCHES If no display switches are specified, .B pv behaves as if .BR \-p ", " \-t ", " \-e ", " \-r ", and " \-b had been given (i.e. everything except average rate is switched on). Otherwise, only those display types that are explicitly switched on will be shown. .TP .B \-p, \-\-progress Turn the progress bar on. If any inputs are not files, or are unreadable, and no size was explicitly given (with the .B \-s modifier), the progress bar cannot indicate how close to completion the transfer is, so it will just move left and right to indicate that data is moving. .TP .B \-t, \-\-timer Turn the timer on. This will display the total elapsed time that .B pv has been running for. .TP .B \-e, \-\-eta Turn the ETA timer on. This will attempt to guess, based on current transfer rates and the total data size, how long it will be before completion. This option will have no effect if the total data size cannot be determined. .TP .B \-I, \-\-fineta Turn the ETA timer on, but display the estimated local time of arrival instead of time left. When the estimated time is more than 6 hours in the future, the date is shown as well. .TP .B \-r, \-\-rate Turn the rate counter on. This will display the current rate of data transfer. .TP .B \-a, \-\-average\-rate Turn the average rate counter on. This will display the current average rate of data transfer (default: last 30s, see .BR \-m ). .TP .B \-b, \-\-bytes Turn the total byte counter on. This will display the total amount of data transferred so far. .TP .B \-8, \-\-bits Display the total bits instead of the total bytes. The output suffix will be "b" instead of "B". .TP .B \-T, \-\-buffer\-percent Turn on the transfer buffer percentage display. This will show the percentage of the transfer buffer in use - but see the caveat under .B %T in the .B FORMATTING section below. Implies .BR \-C . .TP .BI \-A\ NUM \fR,\ \fB\-\-last\-written\ NUM Show the last .I NUM bytes written - but see the caveat under .B %nA in the .B FORMATTING section below. Implies .BR \-C . .TP .BI \-F\ FORMAT \fR,\ \fB\-\-format\ FORMAT Ignore the options .BR \-p , .BR \-t , .BR \-e , .BR \-r , .BR \-a , .BR \-b , .BR \-T , and .BR \-A , and instead use the format string .I FORMAT to determine the output format. See the .B FORMATTING section below. .TP .B \-n, \-\-numeric Numeric output. Instead of giving a visual indication of progress, .B pv will give an integer percentage, one per line, on standard error, suitable for piping (via convoluted redirection) into .BR dialog (1). Note that .B \-f is not required if .B \-n is being used. .TP .B "" Note that if .B \-\-numeric is in use, then adding .B \-\-bytes will cause the number of bytes processed so far to be output instead of a percentage; if .B \-\-line\-mode is also in use as well as .B \-\-bytes and .BR \-\-numeric , then instead of bytes or a percentage, the number of lines so far is output. And finally, if .B \-\-timer is added to .BR \-\-numeric , then each output line is prefixed with the elapsed time so far, as a decimal number of seconds. .TP .B \-q, \-\-quiet No output. Useful if the .B \-L option is being used on its own to just limit the transfer rate of a pipe. .SH OUTPUT MODIFIERS .TP .B \-W, \-\-wait Wait until the first byte has been transferred before showing any progress information or calculating any ETAs. Useful if the program you are piping to or from requires extra information before it starts, eg piping data into .BR gpg (1) or .BR mcrypt (1) which require a passphrase before data can be processed. .TP .BI \-D\ SEC \fR,\ \fB\-\-delay\-start\ SEC Wait until .I SEC seconds have passed before showing any progress information, for example in a script where you only want to show a progress bar if it starts taking a long time. Note that this can be a decimal such as 0.5. .TP .BI \-s\ SIZE \fR,\ \fB\-\-size\ SIZE Assume the total amount of data to be transferred is .I SIZE bytes when calculating percentages and ETAs. The same suffixes of "k", "m" etc can be used as with .BR -L . .TP .B "" If .I SIZE starts with .BR "@" , the size of file whose name follows the .B @ will be used. .TP .B "" Note that .B \-\-size has no effect if used with .BI \-d\ PID to watch all file descriptors of a process, but will work with .BR "-d PID:FD" . .TP .B \-l, \-\-line\-mode Instead of counting bytes, count lines (newline characters). The progress bar will only move when a new line is found, and the value passed to the .B \-s option will be interpreted as a line count. .TP .B "" If this option is used without .BR \-s , the "total size" (in this case, total line count) is calculated by reading through all input files once before transfer starts. If any inputs are pipes or non-regular files, or are unreadable, the total size will not be calculated. .TP .B \-0, \-\-null Count lines as terminated with a zero byte instead of with a newline. This option implies \-\-line\-mode. .TP .BI \-i\ SEC \fR,\ \fB\-\-interval\ SEC Wait .I SEC seconds between updates. The default is to update every second. Note that this can be a decimal such as 0.1. .TP .BI \-m\ SEC \fR,\ \fB\-\-average-rate-window\ SEC Compute current average rate over a .I SEC seconds window for average rate and ETA calculations (default 30 seconds). .TP .BI \-w\ WIDTH \fR,\ \fB\-\-width\ WIDTH Assume the terminal is .I WIDTH characters wide, instead of trying to work it out (or assuming 80 if it cannot be guessed). If this option is used, the output width will not be adjusted if the width of the terminal changes while the transfer is running. .TP .BI \-H\ HEIGHT \fR,\ \fB\-\-height\ HEIGHT Assume the terminal is .I HEIGHT rows high, instead of trying to work it out (or assuming 25 if it cannot be guessed). If this option is used, the output height will not be adjusted if the height of the terminal changes while the transfer is running. .TP .BI \-N\ NAME \fR,\ \fB\-\-name\ NAME Prefix the output information with .IR NAME . Useful in conjunction with .B \-c if you have a complicated pipeline and you want to be able to tell different parts of it apart. .TP .B \-f, \-\-force Force output. Normally, .B pv will not output any visual display if standard error is not a terminal. This option forces it to do so. .TP .B \-c, \-\-cursor Use cursor positioning escape sequences instead of just using carriage returns. This is useful in conjunction with .B \-N (name) if you are using multiple .B pv invocations in a single, long, pipeline. .SH DATA TRANSFER MODIFIERS .TP .BI \-L\ RATE \fR,\ \fB\-\-rate-limit\ RATE Limit the transfer to a maximum of .I RATE bytes per second. A suffix of "K", "M", "G", or "T" can be added to denote kibibytes (*1024), mebibytes, and so on. .TP .BI \-B\ BYTES \fR,\ \fB\-\-buffer-size\ BYTES Use a transfer buffer size of .I BYTES bytes. A suffix of "K", "M", "G", or "T" can be added to denote kibibytes (*1024), mebibytes, and so on. The default buffer size is the block size of the input file's filesystem multiplied by 32 (512KiB max), or 400KiB if the block size cannot be determined. This can be useful on platforms like MacOS which perform better in pipelines with specific buffer sizes such as 1024. Implies .BR \-C . .TP .B \-C, \-\-no-splice Never use .BR splice (2), even if it would normally be possible. The .BR splice (2) system call is a more efficient way of transferring data from or to a pipe than regular .BR read (2) and .BR write (2), but means that the transfer buffer may not be used. This prevents .B \-A and .B \-T from working, cannot work with .BR \-X , and makes .B \-B redundant, so using .BR \-A , .BR \-T , .BR \-X , or .B \-B automatically switches on .BR \-C . Switching on .B \-C results in a small loss of transfer efficiency. (This option has no effect on systems where .BR splice (2) is unavailable). .TP .B \-E, \-\-skip-errors Ignore read errors by attempting to skip past the offending sections. The corresponding parts of the output will be null bytes. At first only a few bytes will be skipped, but if there are many errors in a row then the skips will move up to chunks of 512. This is intended to be similar to .B dd conv=sync,noerror but has not been as thoroughly tested. .TP .B "" Specify .B \-E twice to only report a read error once per file, instead of reporting each byte range skipped. .TP .BI \-Z\ BYTES \fR,\ \fB\-\-error\-skip\-block\ BYTES When ignoring read errors with .BR \-E , instead of trying to adaptively skip by reading small amounts and skipping progressively larger sections until a read succeeds, move to the next file block of .I BYTES bytes as soon as an error occurs. There may still be some shorter skips where the block being skipped coincides with the end of the transfer buffer. .TP .B "" This option can only be used with .B \-E and is intended for use when reading from a block device, such as .B \-E\ \-Z\ 4K to skip in 4 kibibyte blocks. This will speed up reads from faulty media, at the expense of potentially losing more data. .TP .B \-S, \-\-stop-at-size If a size was specified with .BR \-s , stop transferring data once that many bytes have been written, instead of continuing to the end of input. .TP .B \-Y, \-\-sync After every write operation, synchronise the buffer caches to disk - see .BR fdatasync (2). This has no effect when the output is a pipe. Using .B \-Y may improve the accuracy of the progress bar when writing to a slow disk. .TP .B \-K, \-\-direct-io Set the .B O_DIRECT flag on all inputs and outputs, if it is available. This will minimise the effect of caches, at the cost of performance. Due to memory alignment requirements, it also may cause read or write failures with an error of "Invalid argument", especially if reading and writing files across a variety of filesystems in a single .B pv call. Use this option with caution. .TP .B \-X, \-\-discard Instead of transferring input data to standard output, discard it. This is equivalent to redirecting standard output to .IR /dev/null , except that .BR write (2) is never called. Implies .BR \-C . .TP .BI \-d\ PID\fR[\fB:\fR\fIFD\fR],\ \fB\-\-watchfd\ PID\fR[\fB:\fR\fIFD\fR] Instead of transferring data, watch file descriptor .I FD of process .IR PID , and show its progress. The .B pv process will exit when .I FD either changes to a different file, changes read/write mode, or is closed; other data transfer modifiers - and remote control - may not be used with this option. .TP .B "" If only a .I PID is specified, then that process will be watched, and all regular files and block devices it opens will be shown with a progress bar. The .B pv process will exit when process .I PID exits. .TP .BI \-R\ PID \fR,\ \fB\-\-remote\ PID If .I PID is an instance of .B pv that is already running, .BI \-R\ PID will cause that instance to act as though it had been given this instance's command line instead. For example, if .B pv -L 123K is running with process ID 9876, then running .B pv -R 9876 -L 321K will cause it to start using a rate limit of 321KiB instead of 123KiB. Note that some options cannot be changed while running, such as .BR \-c , .BR \-l , .BR \-f , .BR \-D , .BR \-E , and .BR \-S . .SH GENERAL OPTIONS .TP .BI \-P\ FILE \fR,\ \fB\-\-pidfile\ FILE Save the process ID of .B pv in .IR FILE . The file will be replaced if it already exists, and will be removed when .B pv exits. While .B pv is running, it will contain a single number - the process ID of .B pv - followed by a newline. .TP .B \-h, \-\-help Print a usage message on standard output and exit successfully. .TP .B \-V, \-\-version Print version information on standard output and exit successfully. .SH FORMATTING If the .B \-F option is given, then the output format is determined by the given format string. Within that string, the following sequences can be used: .TP .B %p Progress bar. Expands to fill the remaining space. Should only be specified once. Equivalent to .BR \-p . .TP .B %t Elapsed time. Equivalent to .BR \-t . .TP .B %e ETA as time remaining. Equivalent to .BR \-e . .TP .B %I ETA as local time of completion. Equivalent to .BR \-I . .TP .B %r Current data transfer rate. Equivalent to .BR \-r . .TP .B %a Average data transfer rate. Equivalent to .BR \-a . .TP .B %b Bytes transferred so far (or lines if .B \-l was specified). Equivalent to .BR \-b . If .B \-\-bits was specified, .B %b shows the bits transferred so far, not bytes. .TP .B %T Percentage of the transfer buffer in use. Equivalent to .BR \-T . Shows "{----}" if the transfer is being done with .BR splice (2), since splicing to or from pipes does not use the buffer. .TP .B %nA Show the last .B n bytes written (e.g. .B %16A for the last 16 bytes). Shows only dots if the transfer is being done with .BR splice (2), since splicing to or from pipes does not use the buffer. .TP .B %N Name prefix given by .BR -N . Padded to 9 characters with spaces, and suffixed with :. .TP .B %% A single %. .P The format string equivalent of turning on all display switches is .BR "\`%N %b %T %t %r %a %p %e'" . .SH COMMON SWITCHES Some suggested common switch combinations: .TP .B pv -ptebar Show a progress bar, elapsed time, estimated completion time, byte counter, average rate, and current rate. .TP .B pv -betlap Show a progress bar, elapsed time, estimated completion time, line counter, and average rate, counting lines instead of bytes. .TP .B pv -t Show only the elapsed time - useful as a simple timer, e.g. .BR "sleep 10m | pv -t" . .TP .B pv -pterb The default behaviour: progress bar, elapsed time, estimated completion time, current rate, and byte counter. .P On MacOS, it may be useful to specify .B -B 1024 in a pipeline, as this may improve performance. .SH EXIT STATUS An exit status of 1 indicates a problem with the .B \-R or .B \-P options. Any other exit status is a bitmask of the following: .TP .B 2 One or more files could not be accessed, .BR stat (2)ed, or opened. .TP .B 4 An input file was the same as the output file. .TP .B 8 Internal error with closing a file or moving to the next file. .TP .B 16 There was an error while transferring data from one or more input files. .TP .B 32 A signal was caught that caused an early exit. .TP .B 64 Memory allocation failed. .P A zero exit status indicates no problems. .SH AUTHOR Written by Andrew Wood, with patches submitted by various other people. Please see the package's ACKNOWLEDGEMENTS file for a complete list of contributors. .SH KNOWN PROBLEMS The following problems are known to exist in .BR pv : .IP \(bu 3 In some versions of .BR bash (1) and .BR zsh (1), the construct .B <(pv filename) will not output any progress to the terminal when run from an interactive shell, due to the subprocess being run in a separate process group from the one that owns the terminal. In these cases, use .BR \-\-force . .P .IP \(bu 3 The .B -c option does not work properly on Cygwin without .B cygserver running, if started near the bottom of the screen (IPC is needed to handle the terminal scrolling). To fix this, start .B cygserver before using .BR "pv -c" . .P .IP \(bu 3 The .B -R option requires that either .B /run/user// or .B $HOME/ can be written to, for inter-process communication. .P If you find any other problems, please report them. .SH REPORTING BUGS Please report any bugs to .BR pv@ivarch.com . Alternatively, use the issue tracker linked from the .B pv home page: .SH "SEE ALSO" .BR cat (1), .BR dialog (1), .BR splice (2), .BR open (2) (for .BR O_DIRECT ) .SH COPYRIGHT Copyright \(co 2002-2008, 2010, 2012-2015, 2017, 2021, 2023 Andrew Wood. License GPLv3+: GNU GPL version 3 or later . This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. pv-1.8.5/docs/pv.1.md000066400000000000000000000433751452655021700142330ustar00rootroot00000000000000# NAME pv - monitor the progress of data through a pipe # SYNOPSIS **pv** \[*OPTION*\] \[*FILE*\]\...\ **pv** \[*-h*\|*-V*\] # DESCRIPTION **pv** shows the progress of data through a pipeline by giving information such as time elapsed, percentage completed (with progress bar), current throughput rate, total data transferred, and ETA. To use it, insert it in a pipeline between two processes, with the appropriate options. Its standard input will be passed through to its standard output and progress will be shown on standard error. **pv** will copy each supplied *FILE* in turn to standard output (**-** means standard input), or if no *FILE*s are specified just standard input is copied. This is the same behaviour as **cat**(1). A simple example to watch how quickly a file is transferred using **nc**(1): > **pv file \| nc -w 1 somewhere.com 3000** A similar example, transferring a file from another process and passing the expected size to **pv**: > **cat file \| pv -s 12345 \| nc -w 1 somewhere.com 3000** A more complicated example using numeric output to feed into the **dialog**(1) program for a full-screen progress display: > **(tar cf - . \\**\ > ** \| pv -n -s \$(du -sb . \| awk \'{print \$1}\') \\**\ > ** \| gzip -9 \> out.tgz) 2\>&1 \\**\ > **\| dialog \--gauge \'Progress\' 7 70** Taking an image of a disk, skipping errors: > **pv -EE /dev/your/disk/device \> disk-image.img** Writing an image back to a disk: > **pv disk-image.img \> /dev/your/disk/device** Zeroing a disk: > **pv \< /dev/zero \> /dev/your/disk/device** Note that if the input size cannot be calculated, and the output is a block device, then the size of the block device will be used and **pv** will automatically stop at that size as if **-S** had been given. (Linux only): Watching file descriptor 3 opened by another process 1234: > **pv -d 1234:3** (Linux only): Watching all file descriptors used by process 1234: > **pv -d 1234** # OPTIONS **pv** takes many options, which are divided into display switches, output modifiers, and general options. # DISPLAY SWITCHES If no display switches are specified, **pv** behaves as if **-p**, **-t**, **-e**, **-r**, and **-b** had been given (i.e. everything except average rate is switched on). Otherwise, only those display types that are explicitly switched on will be shown. **-p, \--progress** : Turn the progress bar on. If any inputs are not files, or are unreadable, and no size was explicitly given (with the **-s** modifier), the progress bar cannot indicate how close to completion the transfer is, so it will just move left and right to indicate that data is moving. **-t, \--timer** : Turn the timer on. This will display the total elapsed time that **pv** has been running for. **-e, \--eta** : Turn the ETA timer on. This will attempt to guess, based on current transfer rates and the total data size, how long it will be before completion. This option will have no effect if the total data size cannot be determined. **-I, \--fineta** : Turn the ETA timer on, but display the estimated local time of arrival instead of time left. When the estimated time is more than 6 hours in the future, the date is shown as well. **-r, \--rate** : Turn the rate counter on. This will display the current rate of data transfer. **-a, \--average-rate** : Turn the average rate counter on. This will display the current average rate of data transfer (default: last 30s, see **-m**). **-b, \--bytes** : Turn the total byte counter on. This will display the total amount of data transferred so far. **-8, \--bits** : Display the total bits instead of the total bytes. The output suffix will be \"b\" instead of \"B\". **-T, \--buffer-percent** : Turn on the transfer buffer percentage display. This will show the percentage of the transfer buffer in use - but see the caveat under **%T** in the **FORMATTING** section below. Implies **-C**. **-A NUM, \--last-written NUM** : Show the last *NUM* bytes written - but see the caveat under **%nA** in the **FORMATTING** section below. Implies **-C**. **-F FORMAT, \--format FORMAT** : Ignore the options **-p**, **-t**, **-e**, **-r**, **-a**, **-b**, **-T**, and **-A**, and instead use the format string *FORMAT* to determine the output format. See the **FORMATTING** section below. **-n, \--numeric** : Numeric output. Instead of giving a visual indication of progress, **pv** will give an integer percentage, one per line, on standard error, suitable for piping (via convoluted redirection) into **dialog**(1). Note that **-f** is not required if **-n** is being used. : Note that if **\--numeric** is in use, then adding **\--bytes** will cause the number of bytes processed so far to be output instead of a percentage; if **\--line-mode** is also in use as well as **\--bytes** and **\--numeric**, then instead of bytes or a percentage, the number of lines so far is output. And finally, if **\--timer** is added to **\--numeric**, then each output line is prefixed with the elapsed time so far, as a decimal number of seconds. **-q, \--quiet** : No output. Useful if the **-L** option is being used on its own to just limit the transfer rate of a pipe. # OUTPUT MODIFIERS **-W, \--wait** : Wait until the first byte has been transferred before showing any progress information or calculating any ETAs. Useful if the program you are piping to or from requires extra information before it starts, eg piping data into **gpg**(1) or **mcrypt**(1) which require a passphrase before data can be processed. **-D SEC, \--delay-start SEC** : Wait until *SEC* seconds have passed before showing any progress information, for example in a script where you only want to show a progress bar if it starts taking a long time. Note that this can be a decimal such as 0.5. **-s SIZE, \--size SIZE** : Assume the total amount of data to be transferred is *SIZE* bytes when calculating percentages and ETAs. The same suffixes of \"k\", \"m\" etc can be used as with **-L**. : If *SIZE* starts with **@**, the size of file whose name follows the **@** will be used. : Note that **\--size** has no effect if used with **-d ***PID* to watch all file descriptors of a process, but will work with **-d PID:FD**. **-l, \--line-mode** : Instead of counting bytes, count lines (newline characters). The progress bar will only move when a new line is found, and the value passed to the **-s** option will be interpreted as a line count. : If this option is used without **-s**, the \"total size\" (in this case, total line count) is calculated by reading through all input files once before transfer starts. If any inputs are pipes or non-regular files, or are unreadable, the total size will not be calculated. **-0, \--null** : Count lines as terminated with a zero byte instead of with a newline. This option implies \--line-mode. **-i SEC, \--interval SEC** : Wait *SEC* seconds between updates. The default is to update every second. Note that this can be a decimal such as 0.1. **-m SEC, \--average-rate-window SEC** : Compute current average rate over a *SEC* seconds window for average rate and ETA calculations (default 30 seconds). **-w WIDTH, \--width WIDTH** : Assume the terminal is *WIDTH* characters wide, instead of trying to work it out (or assuming 80 if it cannot be guessed). If this option is used, the output width will not be adjusted if the width of the terminal changes while the transfer is running. **-H HEIGHT, \--height HEIGHT** : Assume the terminal is *HEIGHT* rows high, instead of trying to work it out (or assuming 25 if it cannot be guessed). If this option is used, the output height will not be adjusted if the height of the terminal changes while the transfer is running. **-N NAME, \--name NAME** : Prefix the output information with *NAME*. Useful in conjunction with **-c** if you have a complicated pipeline and you want to be able to tell different parts of it apart. **-f, \--force** : Force output. Normally, **pv** will not output any visual display if standard error is not a terminal. This option forces it to do so. **-c, \--cursor** : Use cursor positioning escape sequences instead of just using carriage returns. This is useful in conjunction with **-N** (name) if you are using multiple **pv** invocations in a single, long, pipeline. # DATA TRANSFER MODIFIERS **-L RATE, \--rate-limit RATE** : Limit the transfer to a maximum of *RATE* bytes per second. A suffix of \"K\", \"M\", \"G\", or \"T\" can be added to denote kibibytes (\*1024), mebibytes, and so on. **-B BYTES, \--buffer-size BYTES** : Use a transfer buffer size of *BYTES* bytes. A suffix of \"K\", \"M\", \"G\", or \"T\" can be added to denote kibibytes (\*1024), mebibytes, and so on. The default buffer size is the block size of the input file\'s filesystem multiplied by 32 (512KiB max), or 400KiB if the block size cannot be determined. This can be useful on platforms like MacOS which perform better in pipelines with specific buffer sizes such as 1024. Implies **-C**. **-C, \--no-splice** : Never use **splice**(2), even if it would normally be possible. The **splice**(2) system call is a more efficient way of transferring data from or to a pipe than regular **read**(2) and **write**(2), but means that the transfer buffer may not be used. This prevents **-A** and **-T** from working, cannot work with **-X**, and makes **-B** redundant, so using **-A**, **-T**, **-X**, or **-B** automatically switches on **-C**. Switching on **-C** results in a small loss of transfer efficiency. (This option has no effect on systems where **splice**(2) is unavailable). **-E, \--skip-errors** : Ignore read errors by attempting to skip past the offending sections. The corresponding parts of the output will be null bytes. At first only a few bytes will be skipped, but if there are many errors in a row then the skips will move up to chunks of 512. This is intended to be similar to **dd conv=sync,noerror** but has not been as thoroughly tested. : Specify **-E** twice to only report a read error once per file, instead of reporting each byte range skipped. **-Z BYTES, \--error-skip-block BYTES** : When ignoring read errors with **-E**, instead of trying to adaptively skip by reading small amounts and skipping progressively larger sections until a read succeeds, move to the next file block of *BYTES* bytes as soon as an error occurs. There may still be some shorter skips where the block being skipped coincides with the end of the transfer buffer. : This option can only be used with **-E** and is intended for use when reading from a block device, such as **-E -Z 4K** to skip in 4 kibibyte blocks. This will speed up reads from faulty media, at the expense of potentially losing more data. **-S, \--stop-at-size** : If a size was specified with **-s**, stop transferring data once that many bytes have been written, instead of continuing to the end of input. **-Y, \--sync** : After every write operation, synchronise the buffer caches to disk - see **fdatasync**(2). This has no effect when the output is a pipe. Using **-Y** may improve the accuracy of the progress bar when writing to a slow disk. **-K, \--direct-io** : Set the **O_DIRECT** flag on all inputs and outputs, if it is available. This will minimise the effect of caches, at the cost of performance. Due to memory alignment requirements, it also may cause read or write failures with an error of \"Invalid argument\", especially if reading and writing files across a variety of filesystems in a single **pv** call. Use this option with caution. **-X, \--discard** : Instead of transferring input data to standard output, discard it. This is equivalent to redirecting standard output to */dev/null*, except that **write**(2) is never called. Implies **-C**. **-d PID\[:FD\], \--watchfd PID\[:FD\]** : Instead of transferring data, watch file descriptor *FD* of process *PID*, and show its progress. The **pv** process will exit when *FD* either changes to a different file, changes read/write mode, or is closed; other data transfer modifiers - and remote control - may not be used with this option. : If only a *PID* is specified, then that process will be watched, and all regular files and block devices it opens will be shown with a progress bar. The **pv** process will exit when process *PID* exits. **-R PID, \--remote PID** : If *PID* is an instance of **pv** that is already running, **-R ***PID* will cause that instance to act as though it had been given this instance\'s command line instead. For example, if **pv -L 123K** is running with process ID 9876, then running **pv -R 9876 -L 321K** will cause it to start using a rate limit of 321KiB instead of 123KiB. Note that some options cannot be changed while running, such as **-c**, **-l**, **-f**, **-D**, **-E**, and **-S**. # GENERAL OPTIONS **-P FILE, \--pidfile FILE** : Save the process ID of **pv** in *FILE*. The file will be replaced if it already exists, and will be removed when **pv** exits. While **pv** is running, it will contain a single number - the process ID of **pv** - followed by a newline. **-h, \--help** : Print a usage message on standard output and exit successfully. **-V, \--version** : Print version information on standard output and exit successfully. # FORMATTING If the **-F** option is given, then the output format is determined by the given format string. Within that string, the following sequences can be used: **%p** : Progress bar. Expands to fill the remaining space. Should only be specified once. Equivalent to **-p**. **%t** : Elapsed time. Equivalent to **-t**. **%e** : ETA as time remaining. Equivalent to **-e**. **%I** : ETA as local time of completion. Equivalent to **-I**. **%r** : Current data transfer rate. Equivalent to **-r**. **%a** : Average data transfer rate. Equivalent to **-a**. **%b** : Bytes transferred so far (or lines if **-l** was specified). Equivalent to **-b**. If **\--bits** was specified, **%b** shows the bits transferred so far, not bytes. **%T** : Percentage of the transfer buffer in use. Equivalent to **-T**. Shows \"{\-\-\--}\" if the transfer is being done with **splice**(2), since splicing to or from pipes does not use the buffer. **%nA** : Show the last **n** bytes written (e.g. **%16A** for the last 16 bytes). Shows only dots if the transfer is being done with **splice**(2), since splicing to or from pipes does not use the buffer. **%N** : Name prefix given by **-N**. Padded to 9 characters with spaces, and suffixed with :. **%%** : A single %. The format string equivalent of turning on all display switches is **\`%N %b %T %t %r %a %p %e\'**. # COMMON SWITCHES Some suggested common switch combinations: **pv -ptebar** : Show a progress bar, elapsed time, estimated completion time, byte counter, average rate, and current rate. **pv -betlap** : Show a progress bar, elapsed time, estimated completion time, line counter, and average rate, counting lines instead of bytes. **pv -t** : Show only the elapsed time - useful as a simple timer, e.g. **sleep 10m \| pv -t**. **pv -pterb** : The default behaviour: progress bar, elapsed time, estimated completion time, current rate, and byte counter. On MacOS, it may be useful to specify **-B 1024** in a pipeline, as this may improve performance. # EXIT STATUS An exit status of 1 indicates a problem with the **-R** or **-P** options. Any other exit status is a bitmask of the following: **2** : One or more files could not be accessed, **stat**(2)ed, or opened. **4** : An input file was the same as the output file. **8** : Internal error with closing a file or moving to the next file. **16** : There was an error while transferring data from one or more input files. **32** : A signal was caught that caused an early exit. **64** : Memory allocation failed. A zero exit status indicates no problems. # AUTHOR Written by Andrew Wood, with patches submitted by various other people. Please see the package\'s ACKNOWLEDGEMENTS file for a complete list of contributors. # KNOWN PROBLEMS The following problems are known to exist in **pv**: - In some versions of **bash**(1) and **zsh**(1), the construct **\<(pv filename)** will not output any progress to the terminal when run from an interactive shell, due to the subprocess being run in a separate process group from the one that owns the terminal. In these cases, use **\--force**. - The **-c** option does not work properly on Cygwin without **cygserver** running, if started near the bottom of the screen (IPC is needed to handle the terminal scrolling). To fix this, start **cygserver** before using **pv -c**. - The **-R** option requires that either **/run/user/\/** or **\$HOME/** can be written to, for inter-process communication. If you find any other problems, please report them. # REPORTING BUGS Please report any bugs to **pv@ivarch.com**. Alternatively, use the issue tracker linked from the **pv** home page: \ # SEE ALSO **cat**(1), **dialog**(1), **splice**(2), **open**(2) (for **O_DIRECT**) # COPYRIGHT Copyright © 2002-2008, 2010, 2012-2015, 2017, 2021, 2023 Andrew Wood. License GPLv3+: GNU GPL version 3 or later \. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. pv-1.8.5/po/000077500000000000000000000000001452655021700125775ustar00rootroot00000000000000pv-1.8.5/po/LINGUAS000066400000000000000000000000141452655021700136170ustar00rootroot00000000000000de fr pl pt pv-1.8.5/po/Makefile.in.in000066400000000000000000000461631452655021700152630ustar00rootroot00000000000000# Makefile for PO directory in any package using GNU gettext. # Copyright (C) 1995-2000 Ulrich Drepper # Copyright (C) 2000-2020 Free Software Foundation, Inc. # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. This file is offered as-is, # without any warranty. # # Origin: gettext-0.21 GETTEXT_MACRO_VERSION = 0.20 PACKAGE = @PACKAGE@ VERSION = @VERSION@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ SED = @SED@ SHELL = /bin/sh @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ datarootdir = @datarootdir@ datadir = @datadir@ localedir = @localedir@ gettextsrcdir = $(datadir)/gettext/po INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ # We use $(mkdir_p). # In automake <= 1.9.x, $(mkdir_p) is defined either as "mkdir -p --" or as # "$(mkinstalldirs)" or as "$(install_sh) -d". For these automake versions, # @install_sh@ does not start with $(SHELL), so we add it. # In automake >= 1.10, @mkdir_p@ is derived from ${MKDIR_P}, which is defined # either as "/path/to/mkdir -p" or ".../install-sh -c -d". For these automake # versions, $(mkinstalldirs) and $(install_sh) are unused. mkinstalldirs = $(SHELL) @install_sh@ -d install_sh = $(SHELL) @install_sh@ MKDIR_P = @MKDIR_P@ mkdir_p = @mkdir_p@ # When building gettext-tools, we prefer to use the built programs # rather than installed programs. However, we can't do that when we # are cross compiling. CROSS_COMPILING = @CROSS_COMPILING@ GMSGFMT_ = @GMSGFMT@ GMSGFMT_no = @GMSGFMT@ GMSGFMT_yes = @GMSGFMT_015@ GMSGFMT = $(GMSGFMT_$(USE_MSGCTXT)) XGETTEXT_ = @XGETTEXT@ XGETTEXT_no = @XGETTEXT@ XGETTEXT_yes = @XGETTEXT_015@ XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT)) MSGMERGE = @MSGMERGE@ MSGMERGE_UPDATE = @MSGMERGE@ --update MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@ MSGINIT = msginit MSGCONV = msgconv MSGFILTER = msgfilter POFILES = @POFILES@ GMOFILES = @GMOFILES@ UPDATEPOFILES = @UPDATEPOFILES@ DUMMYPOFILES = @DUMMYPOFILES@ DISTFILES.common = Makefile.in.in remove-potcdate.sin \ $(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3) DISTFILES = $(DISTFILES.common) Makevars POTFILES.in \ $(POFILES) $(GMOFILES) \ $(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3) POTFILES = \ CATALOGS = @CATALOGS@ POFILESDEPS_ = $(srcdir)/$(DOMAIN).pot POFILESDEPS_yes = $(POFILESDEPS_) POFILESDEPS_no = POFILESDEPS = $(POFILESDEPS_$(PO_DEPENDS_ON_POT)) DISTFILESDEPS_ = update-po DISTFILESDEPS_yes = $(DISTFILESDEPS_) DISTFILESDEPS_no = DISTFILESDEPS = $(DISTFILESDEPS_$(DIST_DEPENDS_ON_UPDATE_PO)) # Makevars gets inserted here. (Don't remove this line!) all: all-@USE_NLS@ .SUFFIXES: .SUFFIXES: .po .gmo .sed .sin .nop .po-create .po-update # The .pot file, stamp-po, .po files, and .gmo files appear in release tarballs. # The GNU Coding Standards say in # : # "GNU distributions usually contain some files which are not source files # ... . Since these files normally appear in the source directory, they # should always appear in the source directory, not in the build directory. # So Makefile rules to update them should put the updated files in the # source directory." # Therefore we put these files in the source directory, not the build directory. # During .po -> .gmo conversion, take into account the most recent changes to # the .pot file. This eliminates the need to update the .po files when the # .pot file has changed, which would be troublesome if the .po files are put # under version control. $(GMOFILES): $(srcdir)/$(DOMAIN).pot .po.gmo: @lang=`echo $* | sed -e 's,.*/,,'`; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}rm -f $${lang}.gmo && $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $${lang}.po $(DOMAIN).pot && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.1po && rm -f $${lang}.1po"; \ cd $(srcdir) && \ rm -f $${lang}.gmo && \ $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $${lang}.po $(DOMAIN).pot && \ $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.1po && \ mv t-$${lang}.gmo $${lang}.gmo && \ rm -f $${lang}.1po .sin.sed: sed -e '/^#/d' $< > t-$@ mv t-$@ $@ all-yes: $(srcdir)/stamp-po all-no: # Ensure that the gettext macros and this Makefile.in.in are in sync. CHECK_MACRO_VERSION = \ test "$(GETTEXT_MACRO_VERSION)" = "@GETTEXT_MACRO_VERSION@" \ || { echo "*** error: gettext infrastructure mismatch: using a Makefile.in.in from gettext version $(GETTEXT_MACRO_VERSION) but the autoconf macros are from gettext version @GETTEXT_MACRO_VERSION@" 1>&2; \ exit 1; \ } # $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no # internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because # we don't want to bother translators with empty POT files). We assume that # LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty. # In this case, $(srcdir)/stamp-po is a nop (i.e. a phony target). # $(srcdir)/stamp-po is a timestamp denoting the last time at which the CATALOGS # have been loosely updated. Its purpose is that when a developer or translator # checks out the package from a version control system, and the $(DOMAIN).pot # file is not under version control, "make" will update the $(DOMAIN).pot and # the $(CATALOGS), but subsequent invocations of "make" will do nothing. This # timestamp would not be necessary if updating the $(CATALOGS) would always # touch them; however, the rule for $(POFILES) has been designed to not touch # files that don't need to be changed. $(srcdir)/stamp-po: $(srcdir)/$(DOMAIN).pot @$(CHECK_MACRO_VERSION) test ! -f $(srcdir)/$(DOMAIN).pot || \ test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES) @test ! -f $(srcdir)/$(DOMAIN).pot || { \ echo "touch $(srcdir)/stamp-po" && \ echo timestamp > $(srcdir)/stamp-poT && \ mv $(srcdir)/stamp-poT $(srcdir)/stamp-po; \ } # Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', # otherwise packages like GCC can not be built if only parts of the source # have been downloaded. # This target rebuilds $(DOMAIN).pot; it is an expensive operation. # Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. # The determination of whether the package xyz is a GNU one is based on the # heuristic whether some file in the top level directory mentions "GNU xyz". # If GNU 'find' is available, we avoid grepping through monster files. $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed package_gnu="$(PACKAGE_GNU)"; \ test -n "$$package_gnu" || { \ if { if (LC_ALL=C find --version) 2>/dev/null | grep GNU >/dev/null; then \ LC_ALL=C find -L $(top_srcdir) -maxdepth 1 -type f -size -10000000c -exec grep -i 'GNU @PACKAGE@' /dev/null '{}' ';' 2>/dev/null; \ else \ LC_ALL=C grep -i 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null; \ fi; \ } | grep -v 'libtool:' >/dev/null; then \ package_gnu=yes; \ else \ package_gnu=no; \ fi; \ }; \ if test "$$package_gnu" = "yes"; then \ package_prefix='GNU '; \ else \ package_prefix=''; \ fi; \ if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \ msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \ else \ msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \ fi; \ case `$(XGETTEXT) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].* | 0.16 | 0.16.[0-1]*) \ $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ --add-comments=TRANSLATORS: \ --files-from=$(srcdir)/POTFILES.in \ --copyright-holder='$(COPYRIGHT_HOLDER)' \ --msgid-bugs-address="$$msgid_bugs_address" \ $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ ;; \ *) \ $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ --add-comments=TRANSLATORS: \ --files-from=$(srcdir)/POTFILES.in \ --copyright-holder='$(COPYRIGHT_HOLDER)' \ --package-name="$${package_prefix}@PACKAGE@" \ --package-version='@VERSION@' \ --msgid-bugs-address="$$msgid_bugs_address" \ $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ ;; \ esac test ! -f $(DOMAIN).po || { \ if test -f $(srcdir)/$(DOMAIN).pot-header; then \ sed -e '1,/^#$$/d' < $(DOMAIN).po > $(DOMAIN).1po && \ cat $(srcdir)/$(DOMAIN).pot-header $(DOMAIN).1po > $(DOMAIN).po && \ rm -f $(DOMAIN).1po \ || exit 1; \ fi; \ if test -f $(srcdir)/$(DOMAIN).pot; then \ sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \ rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \ else \ rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \ mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ fi; \ else \ mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ fi; \ } # This rule has no dependencies: we don't need to update $(DOMAIN).pot at # every "make" invocation, only create it when it is missing. # Only "make $(DOMAIN).pot-update" or "make dist" will force an update. $(srcdir)/$(DOMAIN).pot: $(MAKE) $(DOMAIN).pot-update # This target rebuilds a PO file if $(DOMAIN).pot has changed. # Note that a PO file is not touched if it doesn't need to be changed. $(POFILES): $(POFILESDEPS) @test -f $(srcdir)/$(DOMAIN).pot || $(MAKE) $(srcdir)/$(DOMAIN).pot @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ if test -f "$(srcdir)/$${lang}.po"; then \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} --previous $${lang}.po $(DOMAIN).pot"; \ cd $(srcdir) \ && { case `$(MSGMERGE_UPDATE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].*) \ $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) $${lang}.po $(DOMAIN).pot;; \ 0.1[6-7] | 0.1[6-7].*) \ $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --previous $${lang}.po $(DOMAIN).pot;; \ *) \ $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} --previous $${lang}.po $(DOMAIN).pot;; \ esac; \ }; \ else \ $(MAKE) $${lang}.po-create; \ fi install: install-exec install-data install-exec: install-data: install-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext-tools"; then \ $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \ for file in $(DISTFILES.common) Makevars.template; do \ $(INSTALL_DATA) $(srcdir)/$$file \ $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ for file in Makevars; do \ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ else \ : ; \ fi install-data-no: all install-data-yes: all @catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ dir=$(localedir)/$$lang/LC_MESSAGES; \ $(mkdir_p) $(DESTDIR)$$dir; \ if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \ $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \ echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ if test -n "$$lc"; then \ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ for file in *; do \ if test -f $$file; then \ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ fi; \ done); \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ else \ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ :; \ else \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ fi; \ fi; \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \ fi; \ done; \ done install-strip: install installdirs: installdirs-exec installdirs-data installdirs-exec: installdirs-data: installdirs-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext-tools"; then \ $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \ else \ : ; \ fi installdirs-data-no: installdirs-data-yes: @catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ dir=$(localedir)/$$lang/LC_MESSAGES; \ $(mkdir_p) $(DESTDIR)$$dir; \ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ if test -n "$$lc"; then \ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ for file in *; do \ if test -f $$file; then \ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ fi; \ done); \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ else \ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ :; \ else \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ fi; \ fi; \ fi; \ done; \ done # Define this as empty until I found a useful application. installcheck: uninstall: uninstall-exec uninstall-data uninstall-exec: uninstall-data: uninstall-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext-tools"; then \ for file in $(DISTFILES.common) Makevars.template; do \ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ else \ : ; \ fi uninstall-data-no: uninstall-data-yes: catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ done; \ done check: all info dvi ps pdf html tags TAGS ctags CTAGS ID: install-dvi install-ps install-pdf install-html: mostlyclean: rm -f remove-potcdate.sed rm -f $(srcdir)/stamp-poT rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po rm -fr *.o clean: mostlyclean distclean: clean rm -f Makefile Makefile.in POTFILES maintainer-clean: distclean @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." rm -f $(srcdir)/$(DOMAIN).pot $(srcdir)/stamp-po $(GMOFILES) distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) dist distdir: test -z "$(DISTFILESDEPS)" || $(MAKE) $(DISTFILESDEPS) @$(MAKE) dist2 # This is a separate target because 'update-po' must be executed before. dist2: $(srcdir)/stamp-po $(DISTFILES) @dists="$(DISTFILES)"; \ if test "$(PACKAGE)" = "gettext-tools"; then \ dists="$$dists Makevars.template"; \ fi; \ if test -f $(srcdir)/$(DOMAIN).pot; then \ dists="$$dists $(DOMAIN).pot stamp-po"; \ else \ case $(XGETTEXT) in \ :) echo "Warning: Creating a tarball without '$(DOMAIN).pot', because a suitable 'xgettext' program was not found in PATH." 1>&2;; \ *) echo "Warning: Creating a tarball without '$(DOMAIN).pot', because 'xgettext' found no strings to extract. Check the contents of the POTFILES.in file and the XGETTEXT_OPTIONS in the Makevars file." 1>&2;; \ esac; \ fi; \ if test -f $(srcdir)/ChangeLog; then \ dists="$$dists ChangeLog"; \ fi; \ for i in 0 1 2 3 4 5 6 7 8 9; do \ if test -f $(srcdir)/ChangeLog.$$i; then \ dists="$$dists ChangeLog.$$i"; \ fi; \ done; \ if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \ for file in $$dists; do \ if test -f $$file; then \ cp -p $$file $(distdir) || exit 1; \ else \ cp -p $(srcdir)/$$file $(distdir) || exit 1; \ fi; \ done update-po: Makefile $(MAKE) $(DOMAIN).pot-update test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES) $(MAKE) update-gmo # General rule for creating PO files. .nop.po-create: @lang=`echo $@ | sed -e 's/\.po-create$$//'`; \ echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \ exit 1 # General rule for updating PO files. .nop.po-update: @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ if test "$(PACKAGE)" = "gettext-tools" && test "$(CROSS_COMPILING)" != "yes"; then PATH=`pwd`/../src:$$PATH; fi; \ tmpdir=`pwd`; \ echo "$$lang:"; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}$(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang --previous $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ cd $(srcdir); \ if { case `$(MSGMERGE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].*) \ $(MSGMERGE) $(MSGMERGE_OPTIONS) -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ 0.1[6-7] | 0.1[6-7].*) \ $(MSGMERGE) $(MSGMERGE_OPTIONS) --previous -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ *) \ $(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang --previous -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ esac; \ }; then \ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ :; \ else \ echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ exit 1; \ fi; \ fi; \ else \ echo "msgmerge for $$lang.po failed!" 1>&2; \ rm -f $$tmpdir/$$lang.new.po; \ fi $(DUMMYPOFILES): update-gmo: Makefile $(GMOFILES) @: # Recreate Makefile by invoking config.status. Explicitly invoke the shell, # because execution permission bits may not work on the current file system. # Use @SHELL@, which is the shell determined by autoconf for the use by its # scripts, not $(SHELL) which is hardwired to /bin/sh and may be deficient. Makefile: Makefile.in.in Makevars $(top_builddir)/config.status @POMAKEFILEDEPS@ cd $(top_builddir) \ && @SHELL@ ./config.status $(subdir)/$@.in po-directories force: # Tell versions [3.59,3.63) of GNU make not to export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: pv-1.8.5/po/Makevars000066400000000000000000000067311452655021700143020ustar00rootroot00000000000000# Makefile variables for PO directory in any package using GNU gettext. # # Copyright (C) 2003-2019 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation gives # unlimited permission to use, copy, distribute, and modify it. # Usually the message domain is the same as the package name. DOMAIN = $(PACKAGE) # These two variables depend on the location of this directory. subdir = po top_builddir = .. # These options get passed to xgettext. XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ # This is the copyright holder that gets inserted into the header of the # $(DOMAIN).pot file. Set this to the copyright holder of the surrounding # package. (Note that the msgstr strings, extracted from the package's # sources, belong to the copyright holder of the package.) Translators are # expected to transfer the copyright for their translations to this person # or entity, or to disclaim their copyright. The empty string stands for # the public domain; in this case the translators are expected to disclaim # their copyright. COPYRIGHT_HOLDER = Andrew Wood # This tells whether or not to prepend "GNU " prefix to the package # name that gets inserted into the header of the $(DOMAIN).pot file. # Possible values are "yes", "no", or empty. If it is empty, try to # detect it automatically by scanning the files in $(top_srcdir) for # "GNU packagename" string. PACKAGE_GNU = # This is the email address or URL to which the translators shall report # bugs in the untranslated strings: # - Strings which are not entire sentences, see the maintainer guidelines # in the GNU gettext documentation, section 'Preparing Strings'. # - Strings which use unclear terms or require additional context to be # understood. # - Strings which make invalid assumptions about notation of date, time or # money. # - Pluralisation problems. # - Incorrect English spelling. # - Incorrect formatting. # It can be your email address, or a mailing list address where translators # can write to without being subscribed, or the URL of a web page through # which the translators can contact you. MSGID_BUGS_ADDRESS = # This is the list of locale categories, beyond LC_MESSAGES, for which the # message catalogs shall be used. It is usually empty. EXTRA_LOCALE_CATEGORIES = # This tells whether the $(DOMAIN).pot file contains messages with an 'msgctxt' # context. Possible values are "yes" and "no". Set this to yes if the # package uses functions taking also a message context, like pgettext(), or # if in $(XGETTEXT_OPTIONS) you define keywords with a context argument. USE_MSGCTXT = no # These options get passed to msgmerge. # Useful options are in particular: # --previous to keep previous msgids of translated messages, # --quiet to reduce the verbosity. MSGMERGE_OPTIONS = # These options get passed to msginit. # If you want to disable line wrapping when writing PO files, add # --no-wrap to MSGMERGE_OPTIONS, XGETTEXT_OPTIONS, and # MSGINIT_OPTIONS. MSGINIT_OPTIONS = # This tells whether or not to regenerate a PO file when $(DOMAIN).pot # has changed. Possible values are "yes" and "no". Set this to no if # the POT file is checked in the repository and the version control # program ignores timestamps. PO_DEPENDS_ON_POT = yes # This tells whether or not to forcibly update $(DOMAIN).pot and # regenerate PO files on "make dist". Possible values are "yes" and # "no". Set this to no if the POT file and PO files are maintained # externally. DIST_DEPENDS_ON_UPDATE_PO = yes pv-1.8.5/po/POTFILES.in000066400000000000000000000004111452655021700143500ustar00rootroot00000000000000src/main/debug.c src/main/help.c src/main/main.c src/main/options.c src/main/remote.c src/main/version.c src/pv/cursor.c src/pv/display.c src/pv/file.c src/pv/loop.c src/pv/number.c src/pv/signal.c src/pv/state.c src/pv/string.c src/pv/transfer.c src/pv/watchpid.c pv-1.8.5/po/Rules-quot000066400000000000000000000045331452655021700146070ustar00rootroot00000000000000# Special Makefile rules for English message catalogs with quotation marks. # # Copyright (C) 2001-2017 Free Software Foundation, Inc. # This file, Rules-quot, and its auxiliary files (listed under # DISTFILES.common.extra1) are free software; the Free Software Foundation # gives unlimited permission to use, copy, distribute, and modify them. DISTFILES.common.extra1 = quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot .SUFFIXES: .insert-header .po-update-en en@quot.po-create: $(MAKE) en@quot.po-update en@boldquot.po-create: $(MAKE) en@boldquot.po-update en@quot.po-update: en@quot.po-update-en en@boldquot.po-update: en@boldquot.po-update-en .insert-header.po-update-en: @lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \ if test "$(PACKAGE)" = "gettext-tools" && test "$(CROSS_COMPILING)" != "yes"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \ tmpdir=`pwd`; \ echo "$$lang:"; \ ll=`echo $$lang | sed -e 's/@.*//'`; \ LC_ALL=C; export LC_ALL; \ cd $(srcdir); \ if $(MSGINIT) $(MSGINIT_OPTIONS) -i $(DOMAIN).pot --no-translator -l $$lang -o - 2>/dev/null \ | $(SED) -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | \ { case `$(MSGFILTER) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-8] | 0.1[0-8].*) \ $(MSGFILTER) $(SED) -f `echo $$lang | sed -e 's/.*@//'`.sed \ ;; \ *) \ $(MSGFILTER) `echo $$lang | sed -e 's/.*@//'` \ ;; \ esac } 2>/dev/null > $$tmpdir/$$lang.new.po \ ; then \ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ :; \ else \ echo "creation of $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ exit 1; \ fi; \ fi; \ else \ echo "creation of $$lang.po failed!" 1>&2; \ rm -f $$tmpdir/$$lang.new.po; \ fi en@quot.insert-header: insert-header.sin sed -e '/^#/d' -e 's/HEADER/en@quot.header/g' $(srcdir)/insert-header.sin > en@quot.insert-header en@boldquot.insert-header: insert-header.sin sed -e '/^#/d' -e 's/HEADER/en@boldquot.header/g' $(srcdir)/insert-header.sin > en@boldquot.insert-header mostlyclean: mostlyclean-quot mostlyclean-quot: rm -f *.insert-header pv-1.8.5/po/boldquot.sed000066400000000000000000000003311452655021700151220ustar00rootroot00000000000000s/"\([^"]*\)"/“\1â€/g s/`\([^`']*\)'/‘\1’/g s/ '\([^`']*\)' / ‘\1’ /g s/ '\([^`']*\)'$/ ‘\1’/g s/^'\([^`']*\)' /‘\1’ /g s/“â€/""/g s/“/“/g s/â€/â€/g s/‘/‘/g s/’/’/g pv-1.8.5/po/de.gmo000066400000000000000000000177111452655021700137020ustar00rootroot00000000000000Þ•Ida¬01L3€„'¢%Ê!ð#/(S|4•<ÊP8X‘-®,Ü- 7 L h  ™ ­ !Ç é ý  - G a 't œ ¶ Ê )ß " 2, _ "y 'œ /Ä *ô # "C f r Š % à ß 4û 0 P +b Ž )¯ Ù ë !%?W-o¶Õ'ð#6 Zøg`lbÏ%Ó4ù+.'Z‚'¡'É$ñNve‚ÜK_ «4Ì4.6%e(‹(´&Ý!#&.J/yB©ì )H6^•°Ì/æ$4;p&Ž-µKã7/)g$‘¶Ñî) "5-X:†Áà(ÿ8(Ba¤¹&Ö(ý&& M1n0 %Ñ3÷2+^2z­): @'<G(82 ", B/06;4D -&3?= %1I.7+!# 9E5$*HA>CFBConcatenate FILE(s), or standard input, to standard output, with monitoring.ETAPlease report any bugs to: %sSA_SIGINFO not supported on this systemTry `%s --help' for more information.Try `%s -h' for more information.Usage: %s [OPTION] [FILE]...assume terminal is HEIGHT rows highassume terminal is WIDTH characters widebuffer allocation failedcannot transfer files when watching file descriptorscannot use cursor positioning when watching file descriptorscannot use line mode or transfer modifier options when watching file descriptorscannot use remote control when watching file descriptorscount lines instead of bytesdisplay nothing until SEC seconds have passeddisplay nothing until first byte transferreddo not output any transfer information at allfailed to close filefailed to get terminal namefailed to open lock filefailed to open terminalfailed to read filefailed to seek past errorfailed to seek to start of outputfailed to stat filefailed to stat output filefile is not seekableinput file is output fileinteger argument expectedinvalid process IDlimit transfer to RATE bytes per secondlines are null-terminatedlock attempt failedmessage not receivednever use splice(), always use read/writenot a regular file or block devicenot available on systems without /proc/self/fdinfonumeric argument expectedoption structure allocation failedoption structure argv allocation failedoutput even if standard error is not a terminaloutput percentages, not visual informationprefix visual information with NAMEprocess ID or pid:fd pair expectedread failedsave process ID in FILEselect call failedset estimated data size to SIZE bytesset output format to FORMATshow NUM bytes last writtenshow absolute estimated time of arrival (completion)show data transfer rate countershow elapsed timeshow estimated time of arrival (completion)show number of bytes transferredshow percentage of transfer buffer in useshow progress barshow this help and exitshow version information and exitskip read errors in inputskipped past read errorstate allocation failedstop after --size bytes have been transferredupdate every SEC secondsupdate settings of process PIDuse a buffer size of BYTESuse cursor positioning escape sequenceswarning: read errors detectedwatch file FD opened by process PIDwrite failedReport-Msgid-Bugs-To: pv@ivarch.com Language: de Content-Type: text/plain; charset=UTF-8 Date: 1999-06-01 15:18:29+0100 From: Andrew Wood Xgettext-Options: --default-domain=pkgbuild --directory=./.pkgdir --add-comments --keyword=_ --keyword=N_ Files: src/getopt/getopt.c src/getopt/getopt1.c src/version.c src/main/init.c src/main/help.c src/main/xpmptr.c src/guts/load.c src/guts/stop.c src/guts/configure.c src/guts/make.c src/guts/install.c src/guts/prefs.c src/ui/generate.c src/ui/main.c src/ui/xpm.c src/ui/status.c src/ui/activate.c src/ui/handlers/main.c src/ui/handlers/package.c src/ui/handlers/prefs.c src/ui/handlers/dirsel.c src/ui/handlers/popup.c src/ui/handlers/help.c src/ui/textout.c src/ui/report.c src/ui/callback.c src/nls/intl/bindtextdom.c src/nls/intl/dcgettext.c src/nls/intl/dgettext.c src/nls/intl/finddomain.c src/nls/intl/gettext.c src/nls/intl/loadmsgcat.c src/nls/intl/localealias.c src/nls/intl/textdomain.c src/nls/intl-cat/cat-compat.c src/nls/intl-gett/intl-compat.c BVerbindet DATEI(en) oder den Standard-Eingabe-Kanal mit dem Standard-Ausgabe-Kanal und misst den Datenstrom.ETABitte senden Sie Fehlerberichte an %sSA_SIGINFO wird auf diesem System nicht unterstützt`%s --help' zeigt weitere Informationen an.`%s -h' zeigt weitere Informationen an.Syntax: %s [OPTION] [DATEI]...setze Terminal-Höhe auf HEIGHT Zeichensetze Terminal-Breite auf WIDTH ZeichenPuffer konnte nicht allokiert werdenDateien können beim Betrachten von Dateideskriptoren nicht übertragen werdenBeim Anzeigen von Dateideskriptoren können keine Zeilenmodus- oder Übertragungsmodifikatoroptionen verwendet werden.Beim Anzeigen von Dateideskriptoren können keine Optionen für den Zeilenmodus oder den Übertragungsmodifikator verwendet werdenkann keine Fernbedienung verwenden, wenn Dateideskriptoren angezeigt werdenzähle Zeilen anstelle von BytesSEC nichts anzeigen, bis SEC Sekunden vergangen sindkeine Ausgabe bevor das erste Byte übertragen wurdesämtliche Transferinformationen unterdrückenDatei konnte nicht geschlossen werdenTerminalname konnte nicht gelesen werdenSperrdatei konnte nicht geöffnet werdenTerminal konnte nicht geöffnet werdenDatei konnte nicht gelesen werdenkonnte den Fehler nicht überwindenKonnte nicht versuchen, die Ausgabe zu startenDateiinformationen konnten nicht gelesen werdenDateiinformationen für Ausgabe-Datei konnten nicht gelesen werdendatei ist nicht durchsuchbarEingabe-Datei ist Ausgabe-DateiGanzzahliges Argument erwartetungültige Prozess-IDbeschränke die Transferrate auf RATE Byte pro SekundeZeilen sind nullterminiertSperrversuch fehlgeschlagenNachricht nicht empfangenanstelle von splice() immer read/write benutzenkeine normale Datei oder BlockgerätNicht verfügbar auf Systemen ohne /proc/self/fdinfonumerisches Argument erwartet`option' konnte nicht allokiert werden`option' (argv) konnte nicht allokiert werdenAusgabe auch dann erzwingen, wenn der Fehlerausgabe-Kanal kein Terminal istAusgabe von Prozent-Angaben statt visueller Darstellungsetze den NAMEn für visuelle DarstellungProzess-ID oder PID:FD-Paar erwartetread-Aufruf fehlgeschlagenProzess-ID in FILE speichernselect-Aufruf fehlgeschlagensetze erwartete Datenlänge auf SIZE Bytesetze das Ausgabeformat auf FORMATNUM zeige die zuletzt geschriebenen NUM Byteszeige die absolute geschätzte Zeit bis zur Fertigstellungzeige die Datentransferrate anzeige die verstrichene Zeit anzeige die erwartete Zeit bis zum Ende anzeige die Anzahl von Bytes, die transferiert worden sindzeige, wie viel Prozent des Übertragungsbuffers in Benutzung sindFortschritts-Anzeigezeige diese Hilfe und beendezeige Versionsinformationen und beendeLesefehler in der Eingabe nicht beachtenüber den Lesefehler hinaus verschobenZustandszuweisung fehlgeschlagenanhalten, nachdem --size Bytes übertragen wurdenaktualisiere Ausgabe nach SEC Sekunden IntervallEinstellungen der Prozess-PID updatenBYTES benutze einen Puffer in der Größe von BYTESbenutze Escape-Sequenzen zur Cursor-Positionierungwarnung: lesefehler erkanntdie vom Prozess PID geöffnete Datei FD beobachtenwrite-Aufruf fehlgeschlagenpv-1.8.5/po/de.po000066400000000000000000000310661452655021700135350ustar00rootroot00000000000000msgid "" msgstr "" "Report-Msgid-Bugs-To: pv@ivarch.com\n" "POT-Creation-Date: 2023-11-19 14:19+0000\n" "Language: de\n" "Content-Type: text/plain; charset=UTF-8\n" "Date: 1999-06-01 15:18:29+0100\n" "From: Andrew Wood \n" "Xgettext-Options: --default-domain=pkgbuild --directory=./.pkgdir --add-" "comments --keyword=_ --keyword=N_\n" "Files: src/getopt/getopt.c src/getopt/getopt1.c src/version.c src/main/init." "c src/main/help.c src/main/xpmptr.c src/guts/load.c src/guts/stop.c src/guts/" "configure.c src/guts/make.c src/guts/install.c src/guts/prefs.c src/ui/" "generate.c src/ui/main.c src/ui/xpm.c src/ui/status.c src/ui/activate.c src/" "ui/handlers/main.c src/ui/handlers/package.c src/ui/handlers/prefs.c src/ui/" "handlers/dirsel.c src/ui/handlers/popup.c src/ui/handlers/help.c src/ui/" "textout.c src/ui/report.c src/ui/callback.c src/nls/intl/bindtextdom.c src/" "nls/intl/dcgettext.c src/nls/intl/dgettext.c src/nls/intl/finddomain.c src/" "nls/intl/gettext.c src/nls/intl/loadmsgcat.c src/nls/intl/localealias.c src/" "nls/intl/textdomain.c src/nls/intl-cat/cat-compat.c src/nls/intl-gett/intl-" "compat.c\n" #: src/main/help.c:284 msgid "show progress bar" msgstr "Fortschritts-Anzeige" #: src/main/help.c:287 msgid "show elapsed time" msgstr "zeige die verstrichene Zeit an" #: src/main/help.c:290 msgid "show estimated time of arrival (completion)" msgstr "zeige die erwartete Zeit bis zum Ende an" #: src/main/help.c:293 msgid "show absolute estimated time of arrival (completion)" msgstr "zeige die absolute geschätzte Zeit bis zur Fertigstellung" #: src/main/help.c:296 msgid "show data transfer rate counter" msgstr "zeige die Datentransferrate an" #: src/main/help.c:299 msgid "show data transfer average rate counter" msgstr "" #: src/main/help.c:301 src/main/help.c:329 src/main/help.c:341 msgid "SEC" msgstr "" #: src/main/help.c:302 msgid "compute average rate over past SEC seconds (default 30s)" msgstr "" #: src/main/help.c:305 msgid "show number of bytes transferred" msgstr "zeige die Anzahl von Bytes, die transferiert worden sind" #: src/main/help.c:308 msgid "show number of bits transferred" msgstr "" #: src/main/help.c:311 msgid "show percentage of transfer buffer in use" msgstr "zeige, wie viel Prozent des Übertragungsbuffers in Benutzung sind" #: src/main/help.c:313 msgid "NUM" msgstr "" #: src/main/help.c:314 msgid "show NUM bytes last written" msgstr "NUM zeige die zuletzt geschriebenen NUM Bytes" #: src/main/help.c:316 msgid "FORMAT" msgstr "" #: src/main/help.c:317 msgid "set output format to FORMAT" msgstr "setze das Ausgabeformat auf FORMAT" #: src/main/help.c:320 msgid "output percentages, not visual information" msgstr "Ausgabe von Prozent-Angaben statt visueller Darstellung" #: src/main/help.c:323 msgid "do not output any transfer information at all" msgstr "sämtliche Transferinformationen unterdrücken" #: src/main/help.c:327 msgid "display nothing until first byte transferred" msgstr "keine Ausgabe bevor das erste Byte übertragen wurde" #: src/main/help.c:330 msgid "display nothing until SEC seconds have passed" msgstr "SEC nichts anzeigen, bis SEC Sekunden vergangen sind" #: src/main/help.c:332 msgid "SIZE" msgstr "" #: src/main/help.c:333 msgid "set estimated data size to SIZE bytes" msgstr "setze erwartete Datenlänge auf SIZE Byte" #: src/main/help.c:336 msgid "count lines instead of bytes" msgstr "zähle Zeilen anstelle von Bytes" #: src/main/help.c:339 msgid "lines are null-terminated" msgstr "Zeilen sind nullterminiert" #: src/main/help.c:342 msgid "update every SEC seconds" msgstr "aktualisiere Ausgabe nach SEC Sekunden Intervall" #: src/main/help.c:344 msgid "WIDTH" msgstr "" #: src/main/help.c:345 msgid "assume terminal is WIDTH characters wide" msgstr "setze Terminal-Breite auf WIDTH Zeichen" #: src/main/help.c:347 msgid "HEIGHT" msgstr "" #: src/main/help.c:348 msgid "assume terminal is HEIGHT rows high" msgstr "setze Terminal-Höhe auf HEIGHT Zeichen" #: src/main/help.c:350 msgid "NAME" msgstr "" #: src/main/help.c:351 msgid "prefix visual information with NAME" msgstr "setze den NAMEn für visuelle Darstellung" #: src/main/help.c:354 msgid "output even if standard error is not a terminal" msgstr "" "Ausgabe auch dann erzwingen, wenn der Fehlerausgabe-Kanal kein Terminal ist" #: src/main/help.c:357 msgid "use cursor positioning escape sequences" msgstr "benutze Escape-Sequenzen zur Cursor-Positionierung" #: src/main/help.c:360 msgid "RATE" msgstr "" #: src/main/help.c:361 msgid "limit transfer to RATE bytes per second" msgstr "beschränke die Transferrate auf RATE Byte pro Sekunde" #: src/main/help.c:363 src/main/help.c:372 msgid "BYTES" msgstr "" #: src/main/help.c:364 msgid "use a buffer size of BYTES" msgstr "BYTES benutze einen Puffer in der Größe von BYTES" #: src/main/help.c:367 msgid "never use splice(), always use read/write" msgstr "anstelle von splice() immer read/write benutzen" #: src/main/help.c:370 msgid "skip read errors in input" msgstr "Lesefehler in der Eingabe nicht beachten" #: src/main/help.c:373 msgid "skip errors in BYTES blocks at a time" msgstr "" #: src/main/help.c:376 msgid "stop after --size bytes have been transferred" msgstr "anhalten, nachdem --size Bytes übertragen wurden" #: src/main/help.c:379 msgid "flush cache to disk after every write" msgstr "" #: src/main/help.c:382 msgid "use direct I/O to bypass cache" msgstr "" #: src/main/help.c:385 msgid "discard input instead of writing to output" msgstr "" #: src/main/help.c:388 msgid "PID" msgstr "" #: src/main/help.c:389 msgid "update settings of process PID" msgstr "Einstellungen der Prozess-PID updaten" #: src/main/help.c:393 src/main/help.c:408 msgid "FILE" msgstr "" #: src/main/help.c:394 msgid "save process ID in FILE" msgstr "Prozess-ID in FILE speichern" #: src/main/help.c:397 msgid "PID[:FD]" msgstr "" #: src/main/help.c:398 msgid "watch file FD opened by process PID" msgstr "die vom Prozess PID geöffnete Datei FD beobachten" #: src/main/help.c:402 msgid "show this help and exit" msgstr "zeige diese Hilfe und beende" #: src/main/help.c:405 msgid "show version information and exit" msgstr "zeige Versionsinformationen und beende" #: src/main/help.c:409 msgid "write debug logs to FILE" msgstr "" #: src/main/help.c:434 #, c-format msgid "Usage: %s [OPTION] [FILE]..." msgstr "Syntax: %s [OPTION] [DATEI]..." #: src/main/help.c:445 msgid "" "Concatenate FILE(s), or standard input, to standard output, with monitoring." msgstr "" "Verbindet DATEI(en) oder den Standard-Eingabe-Kanal mit dem Standard-Ausgabe-" "Kanal und misst den Datenstrom." #: src/main/help.c:582 #, c-format msgid "Please report any bugs to: %s" msgstr "Bitte senden Sie Fehlerberichte an %s" #: src/main/main.c:74 msgid "state allocation failed" msgstr "Zustandszuweisung fehlgeschlagen" #: src/main/options.c:173 msgid "option structure allocation failed" msgstr "`option' konnte nicht allokiert werden" #: src/main/options.c:192 msgid "option structure argv allocation failed" msgstr "`option' (argv) konnte nicht allokiert werden" #: src/main/options.c:254 msgid "integer argument expected" msgstr "Ganzzahliges Argument erwartet" #: src/main/options.c:265 msgid "numeric argument expected" msgstr "numerisches Argument erwartet" #: src/main/options.c:276 msgid "process ID or pid:fd pair expected" msgstr "Prozess-ID oder PID:FD-Paar erwartet" #: src/main/options.c:283 msgid "invalid process ID" msgstr "ungültige Prozess-ID" #: src/main/options.c:384 src/pv/file.c:323 msgid "failed to stat file" msgstr "Dateiinformationen konnten nicht gelesen werden" #: src/main/options.c:487 #, c-format msgid "Try `%s --help' for more information." msgstr "`%s --help' zeigt weitere Informationen an." #: src/main/options.c:489 #, c-format msgid "Try `%s -h' for more information." msgstr "`%s -h' zeigt weitere Informationen an." #: src/main/options.c:520 msgid "" "cannot use line mode or transfer modifier options when watching file " "descriptors" msgstr "" "Beim Anzeigen von Dateideskriptoren können keine Optionen für den " "Zeilenmodus oder den Übertragungsmodifikator verwendet werden" #: src/main/options.c:529 msgid "cannot use cursor positioning when watching file descriptors" msgstr "" "Beim Anzeigen von Dateideskriptoren können keine Zeilenmodus- oder " "Übertragungsmodifikatoroptionen verwendet werden." #: src/main/options.c:538 msgid "cannot use remote control when watching file descriptors" msgstr "" "kann keine Fernbedienung verwenden, wenn Dateideskriptoren angezeigt werden" #: src/main/options.c:547 msgid "cannot transfer files when watching file descriptors" msgstr "" "Dateien können beim Betrachten von Dateideskriptoren nicht übertragen werden" #: src/main/options.c:562 msgid "not available on systems without /proc/self/fdinfo" msgstr "Nicht verfügbar auf Systemen ohne /proc/self/fdinfo" #: src/main/remote.c:295 msgid "message not received" msgstr "Nachricht nicht empfangen" #: src/main/remote.c:422 msgid "SA_SIGINFO not supported on this system" msgstr "SA_SIGINFO wird auf diesem System nicht unterstützt" #: src/main/version.c:28 msgid "License: GPLv3+ " msgstr "" #: src/main/version.c:29 msgid "This is free software: you are free to change and redistribute it." msgstr "" #: src/main/version.c:30 msgid "There is NO WARRANTY, to the extent permitted by law." msgstr "" #: src/main/version.c:32 msgid "Project web site" msgstr "" #: src/pv/cursor.c:87 msgid "failed to get terminal name" msgstr "Terminalname konnte nicht gelesen werden" #: src/pv/cursor.c:130 msgid "failed to open lock file" msgstr "Sperrdatei konnte nicht geöffnet werden" #: src/pv/cursor.c:163 msgid "lock attempt failed" msgstr "Sperrversuch fehlgeschlagen" #: src/pv/cursor.c:424 msgid "failed to open terminal" msgstr "Terminal konnte nicht geöffnet werden" #: src/pv/display.c:192 msgid "yzafpnum kMGTPEZY" msgstr "" #: src/pv/display.c:210 msgid "yzafpnum KMGTPEZY" msgstr "" #: src/pv/display.c:746 src/pv/transfer.c:910 msgid "buffer allocation failed" msgstr "Puffer konnte nicht allokiert werden" #: src/pv/display.c:845 msgid "b" msgstr "" #: src/pv/display.c:848 src/pv/transfer.c:595 msgid "B" msgstr "B" #: src/pv/display.c:890 src/pv/display.c:907 msgid "b/s" msgstr "" #: src/pv/display.c:895 src/pv/display.c:912 msgid "/s" msgstr "" #: src/pv/display.c:895 src/pv/display.c:912 msgid "B/s" msgstr "" #: src/pv/display.c:940 src/pv/display.c:944 src/pv/display.c:1010 msgid "ETA" msgstr "ETA" #: src/pv/file.c:148 msgid "failed to seek to start of output" msgstr "Konnte nicht versuchen, die Ausgabe zu starten" #: src/pv/file.c:293 msgid "failed to close file" msgstr "Datei konnte nicht geschlossen werden" #: src/pv/file.c:316 msgid "failed to read file" msgstr "Datei konnte nicht gelesen werden" #: src/pv/file.c:331 msgid "failed to stat output file" msgstr "Dateiinformationen für Ausgabe-Datei konnten nicht gelesen werden" #: src/pv/file.c:353 msgid "input file is output file" msgstr "Eingabe-Datei ist Ausgabe-Datei" #: src/pv/file.c:411 msgid "(none)" msgstr "" #: src/pv/file.c:413 msgid "(stdin)" msgstr "" #: src/pv/loop.c:570 src/pv/loop.c:621 src/pv/loop.c:662 src/pv/watchpid.c:99 #: src/pv/watchpid.c:109 src/pv/watchpid.c:120 src/pv/watchpid.c:128 #: src/pv/watchpid.c:165 src/pv/watchpid.c:184 src/pv/watchpid.c:192 #: src/pv/watchpid.c:202 src/pv/watchpid.c:293 src/pv/watchpid.c:301 #: src/pv/watchpid.c:377 src/pv/watchpid.c:398 msgid "pid" msgstr "" #: src/pv/state.c:36 msgid "history structure allocation failed" msgstr "" #: src/pv/state.c:386 src/pv/state.c:397 msgid "file list allocation failed" msgstr "" #: src/pv/transfer.c:457 msgid "read failed" msgstr "read-Aufruf fehlgeschlagen" #: src/pv/transfer.c:480 msgid "warning: read errors detected" msgstr "warnung: lesefehler erkannt" #: src/pv/transfer.c:496 msgid "file is not seekable" msgstr "datei ist nicht durchsuchbar" #: src/pv/transfer.c:574 msgid "failed to seek past error" msgstr "konnte den Fehler nicht überwinden" #: src/pv/transfer.c:594 msgid "skipped past read error" msgstr "über den Lesefehler hinaus verschoben" #: src/pv/transfer.c:634 msgid "no transfer buffer allocated" msgstr "" #: src/pv/transfer.c:647 msgid "failed to set alarm signal handler" msgstr "" #: src/pv/transfer.c:774 msgid "write failed" msgstr "write-Aufruf fehlgeschlagen" #: src/pv/transfer.c:1007 msgid "select call failed" msgstr "select-Aufruf fehlgeschlagen" #: src/pv/watchpid.c:109 src/pv/watchpid.c:121 src/pv/watchpid.c:130 #: src/pv/watchpid.c:184 src/pv/watchpid.c:193 src/pv/watchpid.c:204 msgid "fd" msgstr "" #: src/pv/watchpid.c:130 src/pv/watchpid.c:204 msgid "not a regular file or block device" msgstr "keine normale Datei oder Blockgerät" pv-1.8.5/po/en@boldquot.header000066400000000000000000000024721452655021700162320ustar00rootroot00000000000000# All this catalog "translates" are quotation characters. # The msgids must be ASCII and therefore cannot contain real quotation # characters, only substitutes like grave accent (0x60), apostrophe (0x27) # and double quote (0x22). These substitutes look strange; see # https://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html # # This catalog translates grave accent (0x60) and apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019). # It also translates pairs of apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019) # and pairs of quotation mark (0x22) to # left double quotation mark (U+201C) and right double quotation mark (U+201D). # # When output to an UTF-8 terminal, the quotation characters appear perfectly. # When output to an ISO-8859-1 terminal, the single quotation marks are # transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to # grave/acute accent (by libiconv), and the double quotation marks are # transliterated to 0x22. # When output to an ASCII terminal, the single quotation marks are # transliterated to apostrophes, and the double quotation marks are # transliterated to 0x22. # # This catalog furthermore displays the text between the quotation marks in # bold face, assuming the VT100/XTerm escape sequences. # pv-1.8.5/po/en@quot.header000066400000000000000000000022641452655021700153700ustar00rootroot00000000000000# All this catalog "translates" are quotation characters. # The msgids must be ASCII and therefore cannot contain real quotation # characters, only substitutes like grave accent (0x60), apostrophe (0x27) # and double quote (0x22). These substitutes look strange; see # https://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html # # This catalog translates grave accent (0x60) and apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019). # It also translates pairs of apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019) # and pairs of quotation mark (0x22) to # left double quotation mark (U+201C) and right double quotation mark (U+201D). # # When output to an UTF-8 terminal, the quotation characters appear perfectly. # When output to an ISO-8859-1 terminal, the single quotation marks are # transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to # grave/acute accent (by libiconv), and the double quotation marks are # transliterated to 0x22. # When output to an ASCII terminal, the single quotation marks are # transliterated to apostrophes, and the double quotation marks are # transliterated to 0x22. # pv-1.8.5/po/fr.gmo000066400000000000000000000210261452655021700137130ustar00rootroot00000000000000Þ•T¼q\ !$&*L0}ˆ‘¯'´Üà%å! -J#P(t4¶<ëP( 8y ² -Ï ,ý -* X m ‰ ¢ º Î !è   9 N h ‚ '• ½ × ë ) "* 2M € "š '½ /å * #@ "d ‡ “ « %¾ ä 4'Qy™+« ×)ø"4!Lnˆ -¸æÿ'9a# £ø°©¬®²U¹ #D-Iw{,‚(¯'Ø27;*sYžgø…`]æ$DAi;«*ç"$50Z"‹ ®%Ï)õ *@(k.”ÃÜ5÷%-"Sv8ˆ5Á7÷/5J9€Aº6ü-3(aŠ' È7ç'1G6y;°(ì;/'k7“Ë ë -- [ /x -¨ #Ö 0ú -+!DY!-ž!2Ì!ÿ!Q S1F  L&,.-* 2H+;=D5/30<"@J '8(>R4INCT$%!#9M?7EP:B6A)K OG/sBB/sBYTESConcatenate FILE(s), or standard input, to standard output, with monitoring.ETAHEIGHTNAMEPIDPlease report any bugs to: %sRATESA_SIGINFO not supported on this systemSECSIZETry `%s --help' for more information.Try `%s -h' for more information.Usage: %s [OPTION] [FILE]...WIDTHassume terminal is HEIGHT rows highassume terminal is WIDTH characters widebuffer allocation failedcannot transfer files when watching file descriptorscannot use cursor positioning when watching file descriptorscannot use line mode or transfer modifier options when watching file descriptorscannot use remote control when watching file descriptorscount lines instead of bytesdisplay nothing until SEC seconds have passeddisplay nothing until first byte transferreddo not output any transfer information at allfailed to close filefailed to get terminal namefailed to open lock filefailed to open terminalfailed to read filefailed to seek past errorfailed to seek to start of outputfailed to stat filefailed to stat output filefile is not seekableinput file is output fileinteger argument expectedinvalid process IDlimit transfer to RATE bytes per secondlines are null-terminatedlock attempt failedmessage not receivednever use splice(), always use read/writenot a regular file or block devicenot available on systems without /proc/self/fdinfonumeric argument expectedoption structure allocation failedoption structure argv allocation failedoutput even if standard error is not a terminaloutput percentages, not visual informationprefix visual information with NAMEprocess ID or pid:fd pair expectedread failedsave process ID in FILEselect call failedset estimated data size to SIZE bytesset output format to FORMATshow NUM bytes last writtenshow absolute estimated time of arrival (completion)show data transfer average rate countershow data transfer rate countershow elapsed timeshow estimated time of arrival (completion)show number of bytes transferredshow percentage of transfer buffer in useshow progress barshow this help and exitshow version information and exitskip read errors in inputskipped past read errorstate allocation failedstop after --size bytes have been transferredupdate every SEC secondsupdate settings of process PIDuse a buffer size of BYTESuse cursor positioning escape sequenceswarning: read errors detectedwatch file FD opened by process PIDwrite failedReport-Msgid-Bugs-To: pv@ivarch.com Language: fr Content-Type: text/plain; charset=UTF-8 Date: 1999-06-01 15:18:29+0100 From: Andrew Wood Xgettext-Options: --default-domain=pkgbuild --directory=./.pkgdir --add-comments --keyword=_ --keyword=N_ Files: src/getopt/getopt.c src/getopt/getopt1.c src/version.c src/main/init.c src/main/help.c src/main/xpmptr.c src/guts/load.c src/guts/stop.c src/guts/configure.c src/guts/make.c src/guts/install.c src/guts/prefs.c src/ui/generate.c src/ui/main.c src/ui/xpm.c src/ui/status.c src/ui/activate.c src/ui/handlers/main.c src/ui/handlers/package.c src/ui/handlers/prefs.c src/ui/handlers/dirsel.c src/ui/handlers/popup.c src/ui/handlers/help.c src/ui/textout.c src/ui/report.c src/ui/callback.c src/nls/intl/bindtextdom.c src/nls/intl/dcgettext.c src/nls/intl/dgettext.c src/nls/intl/finddomain.c src/nls/intl/gettext.c src/nls/intl/loadmsgcat.c src/nls/intl/localealias.c src/nls/intl/textdomain.c src/nls/intl-cat/cat-compat.c src/nls/intl-gett/intl-compat.c /sOO/sOCTETSConcatène FICHIER(s), ou l'entrée standard, sur la sortie standard avec monitorage.ETAHAUTEURNOMPIDSVP rapporter touts bogues à %sTAUXSA_SIGINFO non pris en charge sur ce systèmeSECTAILLEEssayez `%s --help' pour plus d'information.Essayez `%s -h' pour plus d'information.Utilisation : %s [OPTIONS] [FICHIER]...LARGEURprésumer la hauteur du terminal à HAUTEUR lignesprésumer la largeur du terminal à LARGEUR caractèresl'allocation de mémoire tampon a échouéimpossible de transférer des fichiers lorsque vous regardez des descripteurs de fichiersimpossible d'utiliser le positionnement du curseur lors de la visualisation des descripteurs de fichierimpossible d'utiliser le mode ligne ou les options de modificateur de transfert lors de la visualisation des descripteurs de fichiersimpossible d'utiliser la télécommande lors de la visualisation des descripteurs de fichierscompte les lignes au lieu des octetsn'afficher rien jusqu'à ce que SEC secondes se soient écouléesne rien afficher avant qu'au moins un octet soit tranférén'afficher aucune information de transfertla fermeture du fichier a échouééchec de lecture du nom du terminaléchec de l'ouverture du fichier de verrouillagel'ouverture du terminal a échouéla lecture du fichier a échouén'a pas réussi à dépasser l'erreurne peut pas passer au début de la sortieéchec à statuer sur le fichieréchec à statuer sur le fichier de sortiene peut pas se déplacer dans le fichierfichiers d'entré et de sortie sont les mêmesValeur entière attendueID de processus non validelimite le taux de transfer à TAUX octets par secondeles lignes sont terminées par un nultentative de verrouillage échouémessage non reçun'utilisez jamais splice(), utilisez toujours read/writepas un fichier ordinaire ou un périphérique de blocnon disponible sur les systèmes sans /proc/self/fdinfoValeur numérique attenduel'allocation pour la structure d'une option a echouél'allocation pour la structure de l'option argv a echouéimprime vers la sortie d'erreur même si ce n'est pas un terminalimprime en pourcentage, pas les informations visuellespréfixer les informations visuelles avec NOMID de processus ou paire pid:fd attenduela lecture a échouéenregistrer l'ID de processus dans FILEappel de sélection a échouéajuste la taille estimée des données à TAILLE octetsdéfinir le format de sortie sur FORMATaffiche NUM octets pour la dernière fois écritsaffiche l'heure absolute de l'achèvement de la tâcheafficher le compteur de taux moyen de transfert de donnéesaffiche le taux de tranfert des donnéesaffiche le temps écouléaffiche l'heure approximative de l'achèvement de la tâcheaffiche le nombre d'octets transférésafficher le pourcentage de tampon de transfert utiliséaffiche la barre de progressionafficher cette aide puis quitterafficher la version puis quitterignorer les erreurs de lecture dans l'entréeerreur de lecture dépasséeéchec de l'allocation de mémoire de conditionarrêter après le transfert de --size octetsmise-à-jour toute les SEC secondesmettre-à-jour la configuration du processus PIDUtiliser une mémoire tampon de OCTETS octetsutiliser les séquences d'échappements de positionnement de curseuravertissement: erreurs de lecture détectéesregarder le fichier FD ouvert par le processus PIDl'écriture a échouépv-1.8.5/po/fr.po000066400000000000000000000314621452655021700135540ustar00rootroot00000000000000msgid "" msgstr "" "Report-Msgid-Bugs-To: pv@ivarch.com\n" "POT-Creation-Date: 2023-11-19 14:19+0000\n" "Language: fr\n" "Content-Type: text/plain; charset=UTF-8\n" "Date: 1999-06-01 15:18:29+0100\n" "From: Andrew Wood \n" "Xgettext-Options: --default-domain=pkgbuild --directory=./.pkgdir --add-" "comments --keyword=_ --keyword=N_\n" "Files: src/getopt/getopt.c src/getopt/getopt1.c src/version.c src/main/init." "c src/main/help.c src/main/xpmptr.c src/guts/load.c src/guts/stop.c src/guts/" "configure.c src/guts/make.c src/guts/install.c src/guts/prefs.c src/ui/" "generate.c src/ui/main.c src/ui/xpm.c src/ui/status.c src/ui/activate.c src/" "ui/handlers/main.c src/ui/handlers/package.c src/ui/handlers/prefs.c src/ui/" "handlers/dirsel.c src/ui/handlers/popup.c src/ui/handlers/help.c src/ui/" "textout.c src/ui/report.c src/ui/callback.c src/nls/intl/bindtextdom.c src/" "nls/intl/dcgettext.c src/nls/intl/dgettext.c src/nls/intl/finddomain.c src/" "nls/intl/gettext.c src/nls/intl/loadmsgcat.c src/nls/intl/localealias.c src/" "nls/intl/textdomain.c src/nls/intl-cat/cat-compat.c src/nls/intl-gett/intl-" "compat.c\n" #: src/main/help.c:284 msgid "show progress bar" msgstr "affiche la barre de progression" #: src/main/help.c:287 msgid "show elapsed time" msgstr "affiche le temps écoulé" #: src/main/help.c:290 msgid "show estimated time of arrival (completion)" msgstr "affiche l'heure approximative de l'achèvement de la tâche" #: src/main/help.c:293 msgid "show absolute estimated time of arrival (completion)" msgstr "affiche l'heure absolute de l'achèvement de la tâche" #: src/main/help.c:296 msgid "show data transfer rate counter" msgstr "affiche le taux de tranfert des données" #: src/main/help.c:299 msgid "show data transfer average rate counter" msgstr "afficher le compteur de taux moyen de transfert de données" #: src/main/help.c:301 src/main/help.c:329 src/main/help.c:341 msgid "SEC" msgstr "SEC" #: src/main/help.c:302 msgid "compute average rate over past SEC seconds (default 30s)" msgstr "" #: src/main/help.c:305 msgid "show number of bytes transferred" msgstr "affiche le nombre d'octets transférés" #: src/main/help.c:308 msgid "show number of bits transferred" msgstr "" #: src/main/help.c:311 msgid "show percentage of transfer buffer in use" msgstr "afficher le pourcentage de tampon de transfert utilisé" #: src/main/help.c:313 msgid "NUM" msgstr "" #: src/main/help.c:314 msgid "show NUM bytes last written" msgstr "affiche NUM octets pour la dernière fois écrits" #: src/main/help.c:316 msgid "FORMAT" msgstr "" #: src/main/help.c:317 msgid "set output format to FORMAT" msgstr "définir le format de sortie sur FORMAT" #: src/main/help.c:320 msgid "output percentages, not visual information" msgstr "imprime en pourcentage, pas les informations visuelles" #: src/main/help.c:323 msgid "do not output any transfer information at all" msgstr "n'afficher aucune information de transfert" #: src/main/help.c:327 msgid "display nothing until first byte transferred" msgstr "ne rien afficher avant qu'au moins un octet soit tranféré" #: src/main/help.c:330 msgid "display nothing until SEC seconds have passed" msgstr "n'afficher rien jusqu'à ce que SEC secondes se soient écoulées" #: src/main/help.c:332 msgid "SIZE" msgstr "TAILLE" #: src/main/help.c:333 msgid "set estimated data size to SIZE bytes" msgstr "ajuste la taille estimée des données à TAILLE octets" #: src/main/help.c:336 msgid "count lines instead of bytes" msgstr "compte les lignes au lieu des octets" #: src/main/help.c:339 msgid "lines are null-terminated" msgstr "les lignes sont terminées par un nul" #: src/main/help.c:342 msgid "update every SEC seconds" msgstr "mise-à-jour toute les SEC secondes" #: src/main/help.c:344 msgid "WIDTH" msgstr "LARGEUR" #: src/main/help.c:345 msgid "assume terminal is WIDTH characters wide" msgstr "présumer la largeur du terminal à LARGEUR caractères" #: src/main/help.c:347 msgid "HEIGHT" msgstr "HAUTEUR" #: src/main/help.c:348 msgid "assume terminal is HEIGHT rows high" msgstr "présumer la hauteur du terminal à HAUTEUR lignes" #: src/main/help.c:350 msgid "NAME" msgstr "NOM" #: src/main/help.c:351 msgid "prefix visual information with NAME" msgstr "préfixer les informations visuelles avec NOM" #: src/main/help.c:354 msgid "output even if standard error is not a terminal" msgstr "imprime vers la sortie d'erreur même si ce n'est pas un terminal" #: src/main/help.c:357 msgid "use cursor positioning escape sequences" msgstr "utiliser les séquences d'échappements de positionnement de curseur" #: src/main/help.c:360 msgid "RATE" msgstr "TAUX" #: src/main/help.c:361 msgid "limit transfer to RATE bytes per second" msgstr "limite le taux de transfer à TAUX octets par seconde" #: src/main/help.c:363 src/main/help.c:372 msgid "BYTES" msgstr "OCTETS" #: src/main/help.c:364 msgid "use a buffer size of BYTES" msgstr "Utiliser une mémoire tampon de OCTETS octets" #: src/main/help.c:367 msgid "never use splice(), always use read/write" msgstr "n'utilisez jamais splice(), utilisez toujours read/write" #: src/main/help.c:370 msgid "skip read errors in input" msgstr "ignorer les erreurs de lecture dans l'entrée" #: src/main/help.c:373 msgid "skip errors in BYTES blocks at a time" msgstr "" #: src/main/help.c:376 msgid "stop after --size bytes have been transferred" msgstr "arrêter après le transfert de --size octets" #: src/main/help.c:379 msgid "flush cache to disk after every write" msgstr "" #: src/main/help.c:382 msgid "use direct I/O to bypass cache" msgstr "" #: src/main/help.c:385 msgid "discard input instead of writing to output" msgstr "" #: src/main/help.c:388 msgid "PID" msgstr "PID" #: src/main/help.c:389 msgid "update settings of process PID" msgstr "mettre-à-jour la configuration du processus PID" #: src/main/help.c:393 src/main/help.c:408 msgid "FILE" msgstr "" #: src/main/help.c:394 msgid "save process ID in FILE" msgstr "enregistrer l'ID de processus dans FILE" #: src/main/help.c:397 msgid "PID[:FD]" msgstr "" #: src/main/help.c:398 msgid "watch file FD opened by process PID" msgstr "regarder le fichier FD ouvert par le processus PID" #: src/main/help.c:402 msgid "show this help and exit" msgstr "afficher cette aide puis quitter" #: src/main/help.c:405 msgid "show version information and exit" msgstr "afficher la version puis quitter" #: src/main/help.c:409 msgid "write debug logs to FILE" msgstr "" #: src/main/help.c:434 #, c-format msgid "Usage: %s [OPTION] [FILE]..." msgstr "Utilisation : %s [OPTIONS] [FICHIER]..." #: src/main/help.c:445 msgid "" "Concatenate FILE(s), or standard input, to standard output, with monitoring." msgstr "" "Concatène FICHIER(s), ou l'entrée standard, sur la sortie standard avec " "monitorage." #: src/main/help.c:582 #, c-format msgid "Please report any bugs to: %s" msgstr "SVP rapporter touts bogues à %s" #: src/main/main.c:74 msgid "state allocation failed" msgstr "échec de l'allocation de mémoire de condition" #: src/main/options.c:173 msgid "option structure allocation failed" msgstr "l'allocation pour la structure d'une option a echoué" #: src/main/options.c:192 msgid "option structure argv allocation failed" msgstr "l'allocation pour la structure de l'option argv a echoué" #: src/main/options.c:254 msgid "integer argument expected" msgstr "Valeur entière attendue" #: src/main/options.c:265 msgid "numeric argument expected" msgstr "Valeur numérique attendue" #: src/main/options.c:276 msgid "process ID or pid:fd pair expected" msgstr "ID de processus ou paire pid:fd attendue" #: src/main/options.c:283 msgid "invalid process ID" msgstr "ID de processus non valide" #: src/main/options.c:384 src/pv/file.c:323 msgid "failed to stat file" msgstr "échec à statuer sur le fichier" #: src/main/options.c:487 #, c-format msgid "Try `%s --help' for more information." msgstr "Essayez `%s --help' pour plus d'information." #: src/main/options.c:489 #, c-format msgid "Try `%s -h' for more information." msgstr "Essayez `%s -h' pour plus d'information." #: src/main/options.c:520 msgid "" "cannot use line mode or transfer modifier options when watching file " "descriptors" msgstr "" "impossible d'utiliser le mode ligne ou les options de modificateur de " "transfert lors de la visualisation des descripteurs de fichiers" #: src/main/options.c:529 msgid "cannot use cursor positioning when watching file descriptors" msgstr "" "impossible d'utiliser le positionnement du curseur lors de la visualisation " "des descripteurs de fichier" #: src/main/options.c:538 msgid "cannot use remote control when watching file descriptors" msgstr "" "impossible d'utiliser la télécommande lors de la visualisation des " "descripteurs de fichiers" #: src/main/options.c:547 msgid "cannot transfer files when watching file descriptors" msgstr "" "impossible de transférer des fichiers lorsque vous regardez des descripteurs " "de fichiers" #: src/main/options.c:562 msgid "not available on systems without /proc/self/fdinfo" msgstr "non disponible sur les systèmes sans /proc/self/fdinfo" #: src/main/remote.c:295 msgid "message not received" msgstr "message non reçu" #: src/main/remote.c:422 msgid "SA_SIGINFO not supported on this system" msgstr "SA_SIGINFO non pris en charge sur ce système" #: src/main/version.c:28 msgid "License: GPLv3+ " msgstr "" #: src/main/version.c:29 msgid "This is free software: you are free to change and redistribute it." msgstr "" #: src/main/version.c:30 msgid "There is NO WARRANTY, to the extent permitted by law." msgstr "" #: src/main/version.c:32 msgid "Project web site" msgstr "" #: src/pv/cursor.c:87 msgid "failed to get terminal name" msgstr "échec de lecture du nom du terminal" #: src/pv/cursor.c:130 msgid "failed to open lock file" msgstr "échec de l'ouverture du fichier de verrouillage" #: src/pv/cursor.c:163 msgid "lock attempt failed" msgstr "tentative de verrouillage échoué" #: src/pv/cursor.c:424 msgid "failed to open terminal" msgstr "l'ouverture du terminal a échoué" #: src/pv/display.c:192 msgid "yzafpnum kMGTPEZY" msgstr "" #: src/pv/display.c:210 msgid "yzafpnum KMGTPEZY" msgstr "" #: src/pv/display.c:746 src/pv/transfer.c:910 msgid "buffer allocation failed" msgstr "l'allocation de mémoire tampon a échoué" #: src/pv/display.c:845 msgid "b" msgstr "" #: src/pv/display.c:848 src/pv/transfer.c:595 msgid "B" msgstr "O" #: src/pv/display.c:890 src/pv/display.c:907 msgid "b/s" msgstr "" #: src/pv/display.c:895 src/pv/display.c:912 msgid "/s" msgstr "/s" #: src/pv/display.c:895 src/pv/display.c:912 msgid "B/s" msgstr "O/s" #: src/pv/display.c:940 src/pv/display.c:944 src/pv/display.c:1010 msgid "ETA" msgstr "ETA" #: src/pv/file.c:148 msgid "failed to seek to start of output" msgstr "ne peut pas passer au début de la sortie" #: src/pv/file.c:293 msgid "failed to close file" msgstr "la fermeture du fichier a échoué" #: src/pv/file.c:316 msgid "failed to read file" msgstr "la lecture du fichier a échoué" #: src/pv/file.c:331 msgid "failed to stat output file" msgstr "échec à statuer sur le fichier de sortie" #: src/pv/file.c:353 msgid "input file is output file" msgstr "fichiers d'entré et de sortie sont les mêmes" #: src/pv/file.c:411 msgid "(none)" msgstr "" #: src/pv/file.c:413 msgid "(stdin)" msgstr "" #: src/pv/loop.c:570 src/pv/loop.c:621 src/pv/loop.c:662 src/pv/watchpid.c:99 #: src/pv/watchpid.c:109 src/pv/watchpid.c:120 src/pv/watchpid.c:128 #: src/pv/watchpid.c:165 src/pv/watchpid.c:184 src/pv/watchpid.c:192 #: src/pv/watchpid.c:202 src/pv/watchpid.c:293 src/pv/watchpid.c:301 #: src/pv/watchpid.c:377 src/pv/watchpid.c:398 msgid "pid" msgstr "" #: src/pv/state.c:36 msgid "history structure allocation failed" msgstr "" #: src/pv/state.c:386 src/pv/state.c:397 msgid "file list allocation failed" msgstr "" #: src/pv/transfer.c:457 msgid "read failed" msgstr "la lecture a échoué" #: src/pv/transfer.c:480 msgid "warning: read errors detected" msgstr "avertissement: erreurs de lecture détectées" #: src/pv/transfer.c:496 msgid "file is not seekable" msgstr "ne peut pas se déplacer dans le fichier" #: src/pv/transfer.c:574 msgid "failed to seek past error" msgstr "n'a pas réussi à dépasser l'erreur" #: src/pv/transfer.c:594 msgid "skipped past read error" msgstr "erreur de lecture dépassée" #: src/pv/transfer.c:634 msgid "no transfer buffer allocated" msgstr "" #: src/pv/transfer.c:647 msgid "failed to set alarm signal handler" msgstr "" #: src/pv/transfer.c:774 msgid "write failed" msgstr "l'écriture a échoué" #: src/pv/transfer.c:1007 msgid "select call failed" msgstr "appel de sélection a échoué" #: src/pv/watchpid.c:109 src/pv/watchpid.c:121 src/pv/watchpid.c:130 #: src/pv/watchpid.c:184 src/pv/watchpid.c:193 src/pv/watchpid.c:204 msgid "fd" msgstr "" #: src/pv/watchpid.c:130 src/pv/watchpid.c:204 msgid "not a regular file or block device" msgstr "pas un fichier ordinaire ou un périphérique de bloc" pv-1.8.5/po/insert-header.sin000066400000000000000000000016121452655021700160440ustar00rootroot00000000000000# Sed script that inserts the file called HEADER before the header entry. # # Copyright (C) 2001 Free Software Foundation, Inc. # Written by Bruno Haible , 2001. # This file is free software; the Free Software Foundation gives # unlimited permission to use, copy, distribute, and modify it. # # At each occurrence of a line starting with "msgid ", we execute the following # commands. At the first occurrence, insert the file. At the following # occurrences, do nothing. The distinction between the first and the following # occurrences is achieved by looking at the hold space. /^msgid /{ x # Test if the hold space is empty. s/m/m/ ta # Yes it was empty. First occurrence. Read the file. r HEADER # Output the file's contents by reading the next line. But don't lose the # current line while doing this. g N bb :a # The hold space was nonempty. Following occurrences. Do nothing. x :b } pv-1.8.5/po/pl.gmo000066400000000000000000000076451452655021700137320ustar00rootroot00000000000000Þ•,|;ÜÈÉÌÎLÒ#(FJ%O!u—´#º(Þ, -M{¨¼Ðë'"-'P/x*¨#Ó ÷%<\+n š»Í!å'  H&U|   [… á å /ë  % 3/ /c %“ ¹ 7à 7û "3 8V 2  #â  /& ;V 0’ 5à *ù /$ 7T 8Œ $Å ê (ù 4"'W!˜#ºÞ*ô&%F*l —+%&( '* #) $"!,   /sBB/sConcatenate FILE(s), or standard input, to standard output, with monitoring.ETANAMEPlease report any bugs to: %sSECSIZETry `%s --help' for more information.Try `%s -h' for more information.Usage: %s [OPTION] [FILE]...WIDTHassume terminal is HEIGHT rows highassume terminal is WIDTH characters widebuffer allocation faileddisplay nothing until first byte transferreddo not output any transfer information at allfailed to close filefailed to open terminalfailed to read filefailed to stat filefailed to stat output fileinput file is output filelimit transfer to RATE bytes per secondoption structure allocation failedoption structure argv allocation failedoutput even if standard error is not a terminaloutput percentages, not visual informationprefix visual information with NAMEread failedselect call failedset estimated data size to SIZE bytesshow data transfer rate countershow elapsed timeshow estimated time of arrival (completion)show number of bytes transferredshow progress barshow this help and exitshow version information and exitupdate every SEC secondsuse cursor positioning escape sequenceswrite failedProject-Id-Version: PACKAGE VERSION Report-Msgid-Bugs-To: pv@ivarch.com PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE Last-Translator: FULL NAME Language-Team: LANGUAGE Language: pl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit /sBB/sÅÄ…czenie PLIK(ów) lub wejÅ›cia standardowego, do wyjÅ›cia standardowego z monitoringiem.ETANAZWAProszÄ™ przesyÅ‚ać zgÅ‚oszenia błędów do %sWARTOŚĆWARTOŚĆSpróbuj `%s --help' by uzyskać wiÄ™cej informacjiSpróbuj `%s -h' by uzyskać wiÄ™cej informacjiSposób użycia: %s [OPCJA] [PLIK]...WARTOŚĆprzyjmij, że terminal ma szerokość WARTOŚĆ znakówprzyjmij, że terminal ma szerokość WARTOŚĆ znakównie udaÅ‚o siÄ™ zaalokować buforanie wyÅ›wietlaj nic aż do pierwszego przesÅ‚anego bajtunie wyÅ›wietlaj żadnych informacji o przesyÅ‚aniunie udaÅ‚o siÄ™ zamknąć plikunie udaÅ‚o siÄ™ otworzyć terminalanie udaÅ‚o siÄ™ odczytać plikunie udaÅ‚o siÄ™ wykonać operacji stat na plikunie udaÅ‚o siÄ™ wykonać operacji stat na pliku wyjÅ›ciowymplik wejÅ›ciowy jest zarazem plikiem wyjÅ›ciowymogranicz przesyÅ‚ane dane do RATE bajtów na sekundÄ™nie udaÅ‚o siÄ™ zaalokować struktur opcjinie udaÅ‚o siÄ™ zaalokować struktur opcji argvpokaż wyjÅ›cie nawet gdy błędy nie sÄ… typu terminalwÅ›wietl wyjÅ›cie procentowo, bez graficznej prezentacjipoprzedź informacje prefiksem NAZWAbłąd odczytunie udaÅ‚o siÄ™ wywoÅ‚ać funkcji selectustaw oczekiwany rozmiar danych na WARTOŚĆ bajtówpokaż licznik prÄ™dkoÅ›ci przesyÅ‚aniapokaż upÅ‚ywajÄ…cy czaspokaż szacowany czas ukoÅ„czeniapokaż ilość przesÅ‚anych bajtówpokaż pasek postÄ™puwyÅ›wietl te informacje z pomocÄ… i wyjdźwyÅ›wietl informacje o wersji i wyjdźaktualizuj co każde WARTOŚĆ sekundużywaj sekwencji escape do pozycjonowaniabłąd zapisupv-1.8.5/po/pl.po000066400000000000000000000247651452655021700135700ustar00rootroot00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Free Software Foundation, Inc. # FIRST AUTHOR , YEAR. # msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: pv@ivarch.com\n" "POT-Creation-Date: 2023-11-19 14:19+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: pl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: src/main/help.c:284 msgid "show progress bar" msgstr "pokaż pasek postÄ™pu" #: src/main/help.c:287 msgid "show elapsed time" msgstr "pokaż upÅ‚ywajÄ…cy czas" #: src/main/help.c:290 msgid "show estimated time of arrival (completion)" msgstr "pokaż szacowany czas ukoÅ„czenia" #: src/main/help.c:293 msgid "show absolute estimated time of arrival (completion)" msgstr "" #: src/main/help.c:296 msgid "show data transfer rate counter" msgstr "pokaż licznik prÄ™dkoÅ›ci przesyÅ‚ania" #: src/main/help.c:299 msgid "show data transfer average rate counter" msgstr "" #: src/main/help.c:301 src/main/help.c:329 src/main/help.c:341 msgid "SEC" msgstr "WARTOŚĆ" #: src/main/help.c:302 msgid "compute average rate over past SEC seconds (default 30s)" msgstr "" #: src/main/help.c:305 msgid "show number of bytes transferred" msgstr "pokaż ilość przesÅ‚anych bajtów" #: src/main/help.c:308 msgid "show number of bits transferred" msgstr "" #: src/main/help.c:311 msgid "show percentage of transfer buffer in use" msgstr "" #: src/main/help.c:313 msgid "NUM" msgstr "" #: src/main/help.c:314 msgid "show NUM bytes last written" msgstr "" #: src/main/help.c:316 msgid "FORMAT" msgstr "" #: src/main/help.c:317 msgid "set output format to FORMAT" msgstr "" #: src/main/help.c:320 msgid "output percentages, not visual information" msgstr "wÅ›wietl wyjÅ›cie procentowo, bez graficznej prezentacji" #: src/main/help.c:323 msgid "do not output any transfer information at all" msgstr "nie wyÅ›wietlaj żadnych informacji o przesyÅ‚aniu" #: src/main/help.c:327 msgid "display nothing until first byte transferred" msgstr "nie wyÅ›wietlaj nic aż do pierwszego przesÅ‚anego bajtu" #: src/main/help.c:330 msgid "display nothing until SEC seconds have passed" msgstr "" #: src/main/help.c:332 msgid "SIZE" msgstr "WARTOŚĆ" #: src/main/help.c:333 msgid "set estimated data size to SIZE bytes" msgstr "ustaw oczekiwany rozmiar danych na WARTOŚĆ bajtów" #: src/main/help.c:336 msgid "count lines instead of bytes" msgstr "" #: src/main/help.c:339 msgid "lines are null-terminated" msgstr "" #: src/main/help.c:342 msgid "update every SEC seconds" msgstr "aktualizuj co każde WARTOŚĆ sekund" #: src/main/help.c:344 msgid "WIDTH" msgstr "WARTOŚĆ" #: src/main/help.c:345 msgid "assume terminal is WIDTH characters wide" msgstr "przyjmij, że terminal ma szerokość WARTOŚĆ znaków" #: src/main/help.c:347 msgid "HEIGHT" msgstr "" #: src/main/help.c:348 msgid "assume terminal is HEIGHT rows high" msgstr "przyjmij, że terminal ma szerokość WARTOŚĆ znaków" #: src/main/help.c:350 msgid "NAME" msgstr "NAZWA" #: src/main/help.c:351 msgid "prefix visual information with NAME" msgstr "poprzedź informacje prefiksem NAZWA" #: src/main/help.c:354 msgid "output even if standard error is not a terminal" msgstr "pokaż wyjÅ›cie nawet gdy błędy nie sÄ… typu terminal" #: src/main/help.c:357 msgid "use cursor positioning escape sequences" msgstr "używaj sekwencji escape do pozycjonowania" #: src/main/help.c:360 msgid "RATE" msgstr "" #: src/main/help.c:361 msgid "limit transfer to RATE bytes per second" msgstr "ogranicz przesyÅ‚ane dane do RATE bajtów na sekundÄ™" #: src/main/help.c:363 src/main/help.c:372 msgid "BYTES" msgstr "" #: src/main/help.c:364 msgid "use a buffer size of BYTES" msgstr "" #: src/main/help.c:367 msgid "never use splice(), always use read/write" msgstr "" #: src/main/help.c:370 msgid "skip read errors in input" msgstr "" #: src/main/help.c:373 msgid "skip errors in BYTES blocks at a time" msgstr "" #: src/main/help.c:376 msgid "stop after --size bytes have been transferred" msgstr "" #: src/main/help.c:379 msgid "flush cache to disk after every write" msgstr "" #: src/main/help.c:382 msgid "use direct I/O to bypass cache" msgstr "" #: src/main/help.c:385 msgid "discard input instead of writing to output" msgstr "" #: src/main/help.c:388 msgid "PID" msgstr "" #: src/main/help.c:389 msgid "update settings of process PID" msgstr "" #: src/main/help.c:393 src/main/help.c:408 msgid "FILE" msgstr "" #: src/main/help.c:394 msgid "save process ID in FILE" msgstr "" #: src/main/help.c:397 msgid "PID[:FD]" msgstr "" #: src/main/help.c:398 msgid "watch file FD opened by process PID" msgstr "" #: src/main/help.c:402 msgid "show this help and exit" msgstr "wyÅ›wietl te informacje z pomocÄ… i wyjdź" #: src/main/help.c:405 msgid "show version information and exit" msgstr "wyÅ›wietl informacje o wersji i wyjdź" #: src/main/help.c:409 msgid "write debug logs to FILE" msgstr "" #: src/main/help.c:434 #, c-format msgid "Usage: %s [OPTION] [FILE]..." msgstr "Sposób użycia: %s [OPCJA] [PLIK]..." #: src/main/help.c:445 msgid "" "Concatenate FILE(s), or standard input, to standard output, with monitoring." msgstr "" "ÅÄ…czenie PLIK(ów) lub wejÅ›cia standardowego, do wyjÅ›cia standardowego z " "monitoringiem." #: src/main/help.c:582 #, c-format msgid "Please report any bugs to: %s" msgstr "ProszÄ™ przesyÅ‚ać zgÅ‚oszenia błędów do %s" #: src/main/main.c:74 msgid "state allocation failed" msgstr "" #: src/main/options.c:173 msgid "option structure allocation failed" msgstr "nie udaÅ‚o siÄ™ zaalokować struktur opcji" #: src/main/options.c:192 msgid "option structure argv allocation failed" msgstr "nie udaÅ‚o siÄ™ zaalokować struktur opcji argv" #: src/main/options.c:254 msgid "integer argument expected" msgstr "" #: src/main/options.c:265 msgid "numeric argument expected" msgstr "" #: src/main/options.c:276 msgid "process ID or pid:fd pair expected" msgstr "" #: src/main/options.c:283 msgid "invalid process ID" msgstr "" #: src/main/options.c:384 src/pv/file.c:323 msgid "failed to stat file" msgstr "nie udaÅ‚o siÄ™ wykonać operacji stat na pliku" #: src/main/options.c:487 #, c-format msgid "Try `%s --help' for more information." msgstr "Spróbuj `%s --help' by uzyskać wiÄ™cej informacji" #: src/main/options.c:489 #, c-format msgid "Try `%s -h' for more information." msgstr "Spróbuj `%s -h' by uzyskać wiÄ™cej informacji" #: src/main/options.c:520 msgid "" "cannot use line mode or transfer modifier options when watching file " "descriptors" msgstr "" #: src/main/options.c:529 msgid "cannot use cursor positioning when watching file descriptors" msgstr "" #: src/main/options.c:538 msgid "cannot use remote control when watching file descriptors" msgstr "" #: src/main/options.c:547 msgid "cannot transfer files when watching file descriptors" msgstr "" #: src/main/options.c:562 msgid "not available on systems without /proc/self/fdinfo" msgstr "" #: src/main/remote.c:295 msgid "message not received" msgstr "" #: src/main/remote.c:422 msgid "SA_SIGINFO not supported on this system" msgstr "" #: src/main/version.c:28 msgid "License: GPLv3+ " msgstr "" #: src/main/version.c:29 msgid "This is free software: you are free to change and redistribute it." msgstr "" #: src/main/version.c:30 msgid "There is NO WARRANTY, to the extent permitted by law." msgstr "" #: src/main/version.c:32 msgid "Project web site" msgstr "" #: src/pv/cursor.c:87 msgid "failed to get terminal name" msgstr "" # "Przewidywany czas ukoÅ„czenia" for ETA is too long #: src/pv/cursor.c:130 msgid "failed to open lock file" msgstr "" #: src/pv/cursor.c:163 msgid "lock attempt failed" msgstr "" #: src/pv/cursor.c:424 msgid "failed to open terminal" msgstr "nie udaÅ‚o siÄ™ otworzyć terminala" #: src/pv/display.c:192 msgid "yzafpnum kMGTPEZY" msgstr "" #: src/pv/display.c:210 msgid "yzafpnum KMGTPEZY" msgstr "" #: src/pv/display.c:746 src/pv/transfer.c:910 msgid "buffer allocation failed" msgstr "nie udaÅ‚o siÄ™ zaalokować bufora" #: src/pv/display.c:845 msgid "b" msgstr "" #: src/pv/display.c:848 src/pv/transfer.c:595 msgid "B" msgstr "B" #: src/pv/display.c:890 src/pv/display.c:907 msgid "b/s" msgstr "" #: src/pv/display.c:895 src/pv/display.c:912 msgid "/s" msgstr "/s" #: src/pv/display.c:895 src/pv/display.c:912 msgid "B/s" msgstr "B/s" #: src/pv/display.c:940 src/pv/display.c:944 src/pv/display.c:1010 msgid "ETA" msgstr "ETA" #: src/pv/file.c:148 msgid "failed to seek to start of output" msgstr "" # "Przewidywany czas ukoÅ„czenia" for ETA is too long #: src/pv/file.c:293 msgid "failed to close file" msgstr "nie udaÅ‚o siÄ™ zamknąć pliku" #: src/pv/file.c:316 msgid "failed to read file" msgstr "nie udaÅ‚o siÄ™ odczytać pliku" #: src/pv/file.c:331 msgid "failed to stat output file" msgstr "nie udaÅ‚o siÄ™ wykonać operacji stat na pliku wyjÅ›ciowym" #: src/pv/file.c:353 msgid "input file is output file" msgstr "plik wejÅ›ciowy jest zarazem plikiem wyjÅ›ciowym" #: src/pv/file.c:411 msgid "(none)" msgstr "" #: src/pv/file.c:413 msgid "(stdin)" msgstr "" #: src/pv/loop.c:570 src/pv/loop.c:621 src/pv/loop.c:662 src/pv/watchpid.c:99 #: src/pv/watchpid.c:109 src/pv/watchpid.c:120 src/pv/watchpid.c:128 #: src/pv/watchpid.c:165 src/pv/watchpid.c:184 src/pv/watchpid.c:192 #: src/pv/watchpid.c:202 src/pv/watchpid.c:293 src/pv/watchpid.c:301 #: src/pv/watchpid.c:377 src/pv/watchpid.c:398 msgid "pid" msgstr "" #: src/pv/state.c:36 msgid "history structure allocation failed" msgstr "" #: src/pv/state.c:386 src/pv/state.c:397 msgid "file list allocation failed" msgstr "" #: src/pv/transfer.c:457 msgid "read failed" msgstr "błąd odczytu" #: src/pv/transfer.c:480 msgid "warning: read errors detected" msgstr "" #: src/pv/transfer.c:496 msgid "file is not seekable" msgstr "" #: src/pv/transfer.c:574 msgid "failed to seek past error" msgstr "" #: src/pv/transfer.c:594 msgid "skipped past read error" msgstr "" #: src/pv/transfer.c:634 msgid "no transfer buffer allocated" msgstr "" #: src/pv/transfer.c:647 msgid "failed to set alarm signal handler" msgstr "" #: src/pv/transfer.c:774 msgid "write failed" msgstr "błąd zapisu" #: src/pv/transfer.c:1007 msgid "select call failed" msgstr "nie udaÅ‚o siÄ™ wywoÅ‚ać funkcji select" #: src/pv/watchpid.c:109 src/pv/watchpid.c:121 src/pv/watchpid.c:130 #: src/pv/watchpid.c:184 src/pv/watchpid.c:193 src/pv/watchpid.c:204 msgid "fd" msgstr "" #: src/pv/watchpid.c:130 src/pv/watchpid.c:204 msgid "not a regular file or block device" msgstr "" pv-1.8.5/po/pt.gmo000066400000000000000000000161721452655021700137350ustar00rootroot00000000000000Þ•Jle¼PQLU¢¦'Ä%ì!4#Q(už4·<ìP)8z³-Ð,þ-+ Y n Š £ » Ï !é   : O i ƒ '– ¾ Ø ì ) "+ 2N  "› '¾ /æ * #A "e ˆ ” ¬ %¿ å  4 'R z š +¬ Ø )ù #5!Mo‰¡-¹ç':b#€ ¤&±ØWÜ4-8'f-Ž)¼ æ66>u@ŒOÍqFÖ8ô,-3Zަ!Åçÿ,/%\/‚!²,Ô05f…¢)¹5ã2L+i0•8Æ7ÿ)7%a‡—"µ1Ø' )2+\:ˆÃâ"ö(6By"”·#Ñõ'06*g,’!¿5á",:g)3<H(A$/#9=%0 ' B.* D+:>-? !4&@GI7;6E 21,JCF 5"8B/sConcatenate FILE(s), or standard input, to standard output, with monitoring.ETAPlease report any bugs to: %sSA_SIGINFO not supported on this systemTry `%s --help' for more information.Try `%s -h' for more information.Usage: %s [OPTION] [FILE]...assume terminal is HEIGHT rows highassume terminal is WIDTH characters widebuffer allocation failedcannot transfer files when watching file descriptorscannot use cursor positioning when watching file descriptorscannot use line mode or transfer modifier options when watching file descriptorscannot use remote control when watching file descriptorscount lines instead of bytesdisplay nothing until SEC seconds have passeddisplay nothing until first byte transferreddo not output any transfer information at allfailed to close filefailed to get terminal namefailed to open lock filefailed to open terminalfailed to read filefailed to seek past errorfailed to seek to start of outputfailed to stat filefailed to stat output filefile is not seekableinput file is output fileinteger argument expectedinvalid process IDlimit transfer to RATE bytes per secondlines are null-terminatedlock attempt failedmessage not receivednever use splice(), always use read/writenot a regular file or block devicenot available on systems without /proc/self/fdinfonumeric argument expectedoption structure allocation failedoption structure argv allocation failedoutput even if standard error is not a terminaloutput percentages, not visual informationprefix visual information with NAMEprocess ID or pid:fd pair expectedread failedsave process ID in FILEselect call failedset estimated data size to SIZE bytesset output format to FORMATshow NUM bytes last writtenshow absolute estimated time of arrival (completion)show data transfer average rate countershow data transfer rate countershow elapsed timeshow estimated time of arrival (completion)show number of bytes transferredshow percentage of transfer buffer in useshow progress barshow this help and exitshow version information and exitskip read errors in inputskipped past read errorstate allocation failedstop after --size bytes have been transferredupdate every SEC secondsupdate settings of process PIDuse a buffer size of BYTESuse cursor positioning escape sequenceswarning: read errors detectedwatch file FD opened by process PIDwrite failedProject-Id-Version: PACKAGE VERSION Report-Msgid-Bugs-To: pv@ivarch.com PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE Last-Translator: FULL NAME Language-Team: LANGUAGE Language: pt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit B/sConcatena ARQUIVO(s) ou a entrada padrão e grava na saída padrão, com monitoramento.ETAPor favor, reporte quaisquer defeitos para %sSA_SIGINFO não suportado neste sistemaTente `%s --help' para maiores informações.Tente `%s -h' para maiores informações.Uso: %s [OPÇÕES] [ARQUIVOS]...presuma que o terminal tem HEIGHT caracteres de alturapresuma que o terminal tem WIDTH caracteres de larguraerro alocando o buffernão pode transferir arquivos ao assistir descritores de arquivonão pode usar o posicionamento do cursor ao observar os descritores de arquivonão pode usar o modo de linha ou opções de modificador de transferência ao assistir os descritores de arquivonão pode usar o controle remoto ao assistir os descritores de arquivocontar linhas em vez de bytesnão exibir nada até que os segundos SEC tenham passadonão exibe nada até iniciar o processamentoexecuta programa sem exibir quaisquer informaçõeserro fechando o arquivoerro ao ler o nome do terminalerro ao abrir arquivo de bloqueioerro abrindo o terminalerro lendo o arquivonão pode ir além do erronão pode mover para o início da produçãoerro obtendo informações do arquivoerro obtendo informações do arquivo de saídanão pode mover dentro do arquivoos arquivos de entrada e saída são o mesmoargumento inteiro esperadoID de processo inválidolimita a transferência a RATE bytes por segundolinhas são terminadas em nulotentativa de bloqueio falhoumensagem não recebidanunca use splice(), sempre use read/writenão é um arquivo regular ou dispositivo de bloqueionão disponível em sistemas sem /proc/self/fdinfoargumento numérico esperadoerro na alocação da estrutura de opçõeserro na alocação da estrutura de opções argvgera dados mesmo que a saída de erro seja redirecionadaexibe apenas as porcentagens, sem informações visuaisexibe NAME antes das demais informaçõesID do processo ou par pid:fd esperadoerro de leiturasalvar ID do processo em FILEerro na chamada da função selectseta a quantidade estimada de dados em SIZE bytesdefinir o formato de saída para FORMATexibe NUM bytes gravados pela última vezexibe o tempo absoluto estimado de términoexibe o contador da taxa média de transferência de dadosexibe a taxa de transferênciaexibe tempo passadoexibe o tempo estimado de términoexibe a quantidade de bytes transferidosexibe a porcentagem de buffer de transferência em usoexibe barra de progressãoexibe esta tela de ajuda e terminaexibe a versão e terminaignorar erros de leitura em entradaignorado erro de leituraalocação de memória de status falhouparar após --size bytes terem sido transferidosatualiza informações a cada SEC segundosatualizar as configurações do processo PIDuse um tamanho de buffer de BYTESutiliza caracteres de escape para posicionar o cursoraviso: erros de leitura detectadosassistir arquivo FD aberto pelo processo PIDerro de gravaçãopv-1.8.5/po/pt.po000066400000000000000000000273601452655021700135720ustar00rootroot00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Free Software Foundation, Inc. # FIRST AUTHOR , YEAR. # msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: pv@ivarch.com\n" "POT-Creation-Date: 2023-11-19 14:19+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: pt\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: src/main/help.c:284 msgid "show progress bar" msgstr "exibe barra de progressão" #: src/main/help.c:287 msgid "show elapsed time" msgstr "exibe tempo passado" #: src/main/help.c:290 msgid "show estimated time of arrival (completion)" msgstr "exibe o tempo estimado de término" #: src/main/help.c:293 msgid "show absolute estimated time of arrival (completion)" msgstr "exibe o tempo absoluto estimado de término" #: src/main/help.c:296 msgid "show data transfer rate counter" msgstr "exibe a taxa de transferência" #: src/main/help.c:299 msgid "show data transfer average rate counter" msgstr "exibe o contador da taxa média de transferência de dados" #: src/main/help.c:301 src/main/help.c:329 src/main/help.c:341 msgid "SEC" msgstr "" #: src/main/help.c:302 msgid "compute average rate over past SEC seconds (default 30s)" msgstr "" #: src/main/help.c:305 msgid "show number of bytes transferred" msgstr "exibe a quantidade de bytes transferidos" #: src/main/help.c:308 msgid "show number of bits transferred" msgstr "" #: src/main/help.c:311 msgid "show percentage of transfer buffer in use" msgstr "exibe a porcentagem de buffer de transferência em uso" #: src/main/help.c:313 msgid "NUM" msgstr "" #: src/main/help.c:314 msgid "show NUM bytes last written" msgstr "exibe NUM bytes gravados pela última vez" #: src/main/help.c:316 msgid "FORMAT" msgstr "" #: src/main/help.c:317 msgid "set output format to FORMAT" msgstr "definir o formato de saída para FORMAT" #: src/main/help.c:320 msgid "output percentages, not visual information" msgstr "exibe apenas as porcentagens, sem informações visuais" #: src/main/help.c:323 msgid "do not output any transfer information at all" msgstr "executa programa sem exibir quaisquer informações" #: src/main/help.c:327 msgid "display nothing until first byte transferred" msgstr "não exibe nada até iniciar o processamento" #: src/main/help.c:330 msgid "display nothing until SEC seconds have passed" msgstr "não exibir nada até que os segundos SEC tenham passado" #: src/main/help.c:332 msgid "SIZE" msgstr "" #: src/main/help.c:333 msgid "set estimated data size to SIZE bytes" msgstr "seta a quantidade estimada de dados em SIZE bytes" #: src/main/help.c:336 msgid "count lines instead of bytes" msgstr "contar linhas em vez de bytes" #: src/main/help.c:339 msgid "lines are null-terminated" msgstr "linhas são terminadas em nulo" #: src/main/help.c:342 msgid "update every SEC seconds" msgstr "atualiza informações a cada SEC segundos" #: src/main/help.c:344 msgid "WIDTH" msgstr "" #: src/main/help.c:345 msgid "assume terminal is WIDTH characters wide" msgstr "presuma que o terminal tem WIDTH caracteres de largura" #: src/main/help.c:347 msgid "HEIGHT" msgstr "" #: src/main/help.c:348 msgid "assume terminal is HEIGHT rows high" msgstr "presuma que o terminal tem HEIGHT caracteres de altura" #: src/main/help.c:350 msgid "NAME" msgstr "" #: src/main/help.c:351 msgid "prefix visual information with NAME" msgstr "exibe NAME antes das demais informações" #: src/main/help.c:354 msgid "output even if standard error is not a terminal" msgstr "gera dados mesmo que a saída de erro seja redirecionada" #: src/main/help.c:357 msgid "use cursor positioning escape sequences" msgstr "utiliza caracteres de escape para posicionar o cursor" #: src/main/help.c:360 msgid "RATE" msgstr "" #: src/main/help.c:361 msgid "limit transfer to RATE bytes per second" msgstr "limita a transferência a RATE bytes por segundo" #: src/main/help.c:363 src/main/help.c:372 msgid "BYTES" msgstr "" #: src/main/help.c:364 msgid "use a buffer size of BYTES" msgstr "use um tamanho de buffer de BYTES" #: src/main/help.c:367 msgid "never use splice(), always use read/write" msgstr "nunca use splice(), sempre use read/write" #: src/main/help.c:370 msgid "skip read errors in input" msgstr "ignorar erros de leitura em entrada" #: src/main/help.c:373 msgid "skip errors in BYTES blocks at a time" msgstr "" #: src/main/help.c:376 msgid "stop after --size bytes have been transferred" msgstr "parar após --size bytes terem sido transferidos" #: src/main/help.c:379 msgid "flush cache to disk after every write" msgstr "" #: src/main/help.c:382 msgid "use direct I/O to bypass cache" msgstr "" #: src/main/help.c:385 msgid "discard input instead of writing to output" msgstr "" #: src/main/help.c:388 msgid "PID" msgstr "" #: src/main/help.c:389 msgid "update settings of process PID" msgstr "atualizar as configurações do processo PID" #: src/main/help.c:393 src/main/help.c:408 msgid "FILE" msgstr "" #: src/main/help.c:394 msgid "save process ID in FILE" msgstr "salvar ID do processo em FILE" #: src/main/help.c:397 msgid "PID[:FD]" msgstr "" #: src/main/help.c:398 msgid "watch file FD opened by process PID" msgstr "assistir arquivo FD aberto pelo processo PID" #: src/main/help.c:402 msgid "show this help and exit" msgstr "exibe esta tela de ajuda e termina" #: src/main/help.c:405 msgid "show version information and exit" msgstr "exibe a versão e termina" #: src/main/help.c:409 msgid "write debug logs to FILE" msgstr "" #: src/main/help.c:434 #, c-format msgid "Usage: %s [OPTION] [FILE]..." msgstr "Uso: %s [OPÇÕES] [ARQUIVOS]..." #: src/main/help.c:445 msgid "" "Concatenate FILE(s), or standard input, to standard output, with monitoring." msgstr "" "Concatena ARQUIVO(s) ou a entrada padrão e grava na saída padrão, com " "monitoramento." #: src/main/help.c:582 #, c-format msgid "Please report any bugs to: %s" msgstr "Por favor, reporte quaisquer defeitos para %s" #: src/main/main.c:74 msgid "state allocation failed" msgstr "alocação de memória de status falhou" #: src/main/options.c:173 msgid "option structure allocation failed" msgstr "erro na alocação da estrutura de opções" #: src/main/options.c:192 msgid "option structure argv allocation failed" msgstr "erro na alocação da estrutura de opções argv" #: src/main/options.c:254 msgid "integer argument expected" msgstr "argumento inteiro esperado" #: src/main/options.c:265 msgid "numeric argument expected" msgstr "argumento numérico esperado" #: src/main/options.c:276 msgid "process ID or pid:fd pair expected" msgstr "ID do processo ou par pid:fd esperado" #: src/main/options.c:283 msgid "invalid process ID" msgstr "ID de processo inválido" #: src/main/options.c:384 src/pv/file.c:323 msgid "failed to stat file" msgstr "erro obtendo informações do arquivo" #: src/main/options.c:487 #, c-format msgid "Try `%s --help' for more information." msgstr "Tente `%s --help' para maiores informações." #: src/main/options.c:489 #, c-format msgid "Try `%s -h' for more information." msgstr "Tente `%s -h' para maiores informações." #: src/main/options.c:520 msgid "" "cannot use line mode or transfer modifier options when watching file " "descriptors" msgstr "" "não pode usar o modo de linha ou opções de modificador de transferência ao " "assistir os descritores de arquivo" #: src/main/options.c:529 msgid "cannot use cursor positioning when watching file descriptors" msgstr "" "não pode usar o posicionamento do cursor ao observar os descritores de " "arquivo" #: src/main/options.c:538 msgid "cannot use remote control when watching file descriptors" msgstr "não pode usar o controle remoto ao assistir os descritores de arquivo" #: src/main/options.c:547 msgid "cannot transfer files when watching file descriptors" msgstr "não pode transferir arquivos ao assistir descritores de arquivo" #: src/main/options.c:562 msgid "not available on systems without /proc/self/fdinfo" msgstr "não disponível em sistemas sem /proc/self/fdinfo" #: src/main/remote.c:295 msgid "message not received" msgstr "mensagem não recebida" #: src/main/remote.c:422 msgid "SA_SIGINFO not supported on this system" msgstr "SA_SIGINFO não suportado neste sistema" #: src/main/version.c:28 msgid "License: GPLv3+ " msgstr "" #: src/main/version.c:29 msgid "This is free software: you are free to change and redistribute it." msgstr "" #: src/main/version.c:30 msgid "There is NO WARRANTY, to the extent permitted by law." msgstr "" #: src/main/version.c:32 msgid "Project web site" msgstr "" #: src/pv/cursor.c:87 msgid "failed to get terminal name" msgstr "erro ao ler o nome do terminal" #: src/pv/cursor.c:130 msgid "failed to open lock file" msgstr "erro ao abrir arquivo de bloqueio" #: src/pv/cursor.c:163 msgid "lock attempt failed" msgstr "tentativa de bloqueio falhou" #: src/pv/cursor.c:424 msgid "failed to open terminal" msgstr "erro abrindo o terminal" #: src/pv/display.c:192 msgid "yzafpnum kMGTPEZY" msgstr "" #: src/pv/display.c:210 msgid "yzafpnum KMGTPEZY" msgstr "" #: src/pv/display.c:746 src/pv/transfer.c:910 msgid "buffer allocation failed" msgstr "erro alocando o buffer" #: src/pv/display.c:845 msgid "b" msgstr "" #: src/pv/display.c:848 src/pv/transfer.c:595 msgid "B" msgstr "" #: src/pv/display.c:890 src/pv/display.c:907 msgid "b/s" msgstr "" #: src/pv/display.c:895 src/pv/display.c:912 msgid "/s" msgstr "" #: src/pv/display.c:895 src/pv/display.c:912 msgid "B/s" msgstr "B/s" #: src/pv/display.c:940 src/pv/display.c:944 src/pv/display.c:1010 msgid "ETA" msgstr "ETA" #: src/pv/file.c:148 msgid "failed to seek to start of output" msgstr "não pode mover para o início da produção" #: src/pv/file.c:293 msgid "failed to close file" msgstr "erro fechando o arquivo" #: src/pv/file.c:316 msgid "failed to read file" msgstr "erro lendo o arquivo" #: src/pv/file.c:331 msgid "failed to stat output file" msgstr "erro obtendo informações do arquivo de saída" #: src/pv/file.c:353 msgid "input file is output file" msgstr "os arquivos de entrada e saída são o mesmo" #: src/pv/file.c:411 msgid "(none)" msgstr "" #: src/pv/file.c:413 msgid "(stdin)" msgstr "" #: src/pv/loop.c:570 src/pv/loop.c:621 src/pv/loop.c:662 src/pv/watchpid.c:99 #: src/pv/watchpid.c:109 src/pv/watchpid.c:120 src/pv/watchpid.c:128 #: src/pv/watchpid.c:165 src/pv/watchpid.c:184 src/pv/watchpid.c:192 #: src/pv/watchpid.c:202 src/pv/watchpid.c:293 src/pv/watchpid.c:301 #: src/pv/watchpid.c:377 src/pv/watchpid.c:398 msgid "pid" msgstr "" #: src/pv/state.c:36 msgid "history structure allocation failed" msgstr "" #: src/pv/state.c:386 src/pv/state.c:397 msgid "file list allocation failed" msgstr "" #: src/pv/transfer.c:457 msgid "read failed" msgstr "erro de leitura" #: src/pv/transfer.c:480 msgid "warning: read errors detected" msgstr "aviso: erros de leitura detectados" #: src/pv/transfer.c:496 msgid "file is not seekable" msgstr "não pode mover dentro do arquivo" #: src/pv/transfer.c:574 msgid "failed to seek past error" msgstr "não pode ir além do erro" #: src/pv/transfer.c:594 msgid "skipped past read error" msgstr "ignorado erro de leitura" #: src/pv/transfer.c:634 msgid "no transfer buffer allocated" msgstr "" #: src/pv/transfer.c:647 msgid "failed to set alarm signal handler" msgstr "" #: src/pv/transfer.c:774 msgid "write failed" msgstr "erro de gravação" #: src/pv/transfer.c:1007 msgid "select call failed" msgstr "erro na chamada da função select" #: src/pv/watchpid.c:109 src/pv/watchpid.c:121 src/pv/watchpid.c:130 #: src/pv/watchpid.c:184 src/pv/watchpid.c:193 src/pv/watchpid.c:204 msgid "fd" msgstr "" #: src/pv/watchpid.c:130 src/pv/watchpid.c:204 msgid "not a regular file or block device" msgstr "não é um arquivo regular ou dispositivo de bloqueio" pv-1.8.5/po/pv.pot000066400000000000000000000216711452655021700137570ustar00rootroot00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Andrew Wood # This file is distributed under the same license as the pv package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: pv 1.8.5\n" "Report-Msgid-Bugs-To: pv@ivarch.com\n" "POT-Creation-Date: 2023-11-19 14:19+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" #: src/main/help.c:284 msgid "show progress bar" msgstr "" #: src/main/help.c:287 msgid "show elapsed time" msgstr "" #: src/main/help.c:290 msgid "show estimated time of arrival (completion)" msgstr "" #: src/main/help.c:293 msgid "show absolute estimated time of arrival (completion)" msgstr "" #: src/main/help.c:296 msgid "show data transfer rate counter" msgstr "" #: src/main/help.c:299 msgid "show data transfer average rate counter" msgstr "" #: src/main/help.c:301 src/main/help.c:329 src/main/help.c:341 msgid "SEC" msgstr "" #: src/main/help.c:302 msgid "compute average rate over past SEC seconds (default 30s)" msgstr "" #: src/main/help.c:305 msgid "show number of bytes transferred" msgstr "" #: src/main/help.c:308 msgid "show number of bits transferred" msgstr "" #: src/main/help.c:311 msgid "show percentage of transfer buffer in use" msgstr "" #: src/main/help.c:313 msgid "NUM" msgstr "" #: src/main/help.c:314 msgid "show NUM bytes last written" msgstr "" #: src/main/help.c:316 msgid "FORMAT" msgstr "" #: src/main/help.c:317 msgid "set output format to FORMAT" msgstr "" #: src/main/help.c:320 msgid "output percentages, not visual information" msgstr "" #: src/main/help.c:323 msgid "do not output any transfer information at all" msgstr "" #: src/main/help.c:327 msgid "display nothing until first byte transferred" msgstr "" #: src/main/help.c:330 msgid "display nothing until SEC seconds have passed" msgstr "" #: src/main/help.c:332 msgid "SIZE" msgstr "" #: src/main/help.c:333 msgid "set estimated data size to SIZE bytes" msgstr "" #: src/main/help.c:336 msgid "count lines instead of bytes" msgstr "" #: src/main/help.c:339 msgid "lines are null-terminated" msgstr "" #: src/main/help.c:342 msgid "update every SEC seconds" msgstr "" #: src/main/help.c:344 msgid "WIDTH" msgstr "" #: src/main/help.c:345 msgid "assume terminal is WIDTH characters wide" msgstr "" #: src/main/help.c:347 msgid "HEIGHT" msgstr "" #: src/main/help.c:348 msgid "assume terminal is HEIGHT rows high" msgstr "" #: src/main/help.c:350 msgid "NAME" msgstr "" #: src/main/help.c:351 msgid "prefix visual information with NAME" msgstr "" #: src/main/help.c:354 msgid "output even if standard error is not a terminal" msgstr "" #: src/main/help.c:357 msgid "use cursor positioning escape sequences" msgstr "" #: src/main/help.c:360 msgid "RATE" msgstr "" #: src/main/help.c:361 msgid "limit transfer to RATE bytes per second" msgstr "" #: src/main/help.c:363 src/main/help.c:372 msgid "BYTES" msgstr "" #: src/main/help.c:364 msgid "use a buffer size of BYTES" msgstr "" #: src/main/help.c:367 msgid "never use splice(), always use read/write" msgstr "" #: src/main/help.c:370 msgid "skip read errors in input" msgstr "" #: src/main/help.c:373 msgid "skip errors in BYTES blocks at a time" msgstr "" #: src/main/help.c:376 msgid "stop after --size bytes have been transferred" msgstr "" #: src/main/help.c:379 msgid "flush cache to disk after every write" msgstr "" #: src/main/help.c:382 msgid "use direct I/O to bypass cache" msgstr "" #: src/main/help.c:385 msgid "discard input instead of writing to output" msgstr "" #: src/main/help.c:388 msgid "PID" msgstr "" #: src/main/help.c:389 msgid "update settings of process PID" msgstr "" #: src/main/help.c:393 src/main/help.c:408 msgid "FILE" msgstr "" #: src/main/help.c:394 msgid "save process ID in FILE" msgstr "" #: src/main/help.c:397 msgid "PID[:FD]" msgstr "" #: src/main/help.c:398 msgid "watch file FD opened by process PID" msgstr "" #: src/main/help.c:402 msgid "show this help and exit" msgstr "" #: src/main/help.c:405 msgid "show version information and exit" msgstr "" #: src/main/help.c:409 msgid "write debug logs to FILE" msgstr "" #: src/main/help.c:434 #, c-format msgid "Usage: %s [OPTION] [FILE]..." msgstr "" #: src/main/help.c:445 msgid "" "Concatenate FILE(s), or standard input, to standard output, with monitoring." msgstr "" #: src/main/help.c:582 #, c-format msgid "Please report any bugs to: %s" msgstr "" #: src/main/main.c:74 msgid "state allocation failed" msgstr "" #: src/main/options.c:173 msgid "option structure allocation failed" msgstr "" #: src/main/options.c:192 msgid "option structure argv allocation failed" msgstr "" #: src/main/options.c:254 msgid "integer argument expected" msgstr "" #: src/main/options.c:265 msgid "numeric argument expected" msgstr "" #: src/main/options.c:276 msgid "process ID or pid:fd pair expected" msgstr "" #: src/main/options.c:283 msgid "invalid process ID" msgstr "" #: src/main/options.c:384 src/pv/file.c:323 msgid "failed to stat file" msgstr "" #: src/main/options.c:487 #, c-format msgid "Try `%s --help' for more information." msgstr "" #: src/main/options.c:489 #, c-format msgid "Try `%s -h' for more information." msgstr "" #: src/main/options.c:520 msgid "" "cannot use line mode or transfer modifier options when watching file " "descriptors" msgstr "" #: src/main/options.c:529 msgid "cannot use cursor positioning when watching file descriptors" msgstr "" #: src/main/options.c:538 msgid "cannot use remote control when watching file descriptors" msgstr "" #: src/main/options.c:547 msgid "cannot transfer files when watching file descriptors" msgstr "" #: src/main/options.c:562 msgid "not available on systems without /proc/self/fdinfo" msgstr "" #: src/main/remote.c:295 msgid "message not received" msgstr "" #: src/main/remote.c:422 msgid "SA_SIGINFO not supported on this system" msgstr "" #: src/main/version.c:28 msgid "License: GPLv3+ " msgstr "" #: src/main/version.c:29 msgid "This is free software: you are free to change and redistribute it." msgstr "" #: src/main/version.c:30 msgid "There is NO WARRANTY, to the extent permitted by law." msgstr "" #: src/main/version.c:32 msgid "Project web site" msgstr "" #: src/pv/cursor.c:87 msgid "failed to get terminal name" msgstr "" #: src/pv/cursor.c:130 msgid "failed to open lock file" msgstr "" #: src/pv/cursor.c:163 msgid "lock attempt failed" msgstr "" #: src/pv/cursor.c:424 msgid "failed to open terminal" msgstr "" #: src/pv/display.c:192 msgid "yzafpnum kMGTPEZY" msgstr "" #: src/pv/display.c:210 msgid "yzafpnum KMGTPEZY" msgstr "" #: src/pv/display.c:746 src/pv/transfer.c:910 msgid "buffer allocation failed" msgstr "" #: src/pv/display.c:845 msgid "b" msgstr "" #: src/pv/display.c:848 src/pv/transfer.c:595 msgid "B" msgstr "" #: src/pv/display.c:890 src/pv/display.c:907 msgid "b/s" msgstr "" #: src/pv/display.c:895 src/pv/display.c:912 msgid "/s" msgstr "" #: src/pv/display.c:895 src/pv/display.c:912 msgid "B/s" msgstr "" #: src/pv/display.c:940 src/pv/display.c:944 src/pv/display.c:1010 msgid "ETA" msgstr "" #: src/pv/file.c:148 msgid "failed to seek to start of output" msgstr "" #: src/pv/file.c:293 msgid "failed to close file" msgstr "" #: src/pv/file.c:316 msgid "failed to read file" msgstr "" #: src/pv/file.c:331 msgid "failed to stat output file" msgstr "" #: src/pv/file.c:353 msgid "input file is output file" msgstr "" #: src/pv/file.c:411 msgid "(none)" msgstr "" #: src/pv/file.c:413 msgid "(stdin)" msgstr "" #: src/pv/loop.c:570 src/pv/loop.c:621 src/pv/loop.c:662 src/pv/watchpid.c:99 #: src/pv/watchpid.c:109 src/pv/watchpid.c:120 src/pv/watchpid.c:128 #: src/pv/watchpid.c:165 src/pv/watchpid.c:184 src/pv/watchpid.c:192 #: src/pv/watchpid.c:202 src/pv/watchpid.c:293 src/pv/watchpid.c:301 #: src/pv/watchpid.c:377 src/pv/watchpid.c:398 msgid "pid" msgstr "" #: src/pv/state.c:36 msgid "history structure allocation failed" msgstr "" #: src/pv/state.c:386 src/pv/state.c:397 msgid "file list allocation failed" msgstr "" #: src/pv/transfer.c:457 msgid "read failed" msgstr "" #: src/pv/transfer.c:480 msgid "warning: read errors detected" msgstr "" #: src/pv/transfer.c:496 msgid "file is not seekable" msgstr "" #: src/pv/transfer.c:574 msgid "failed to seek past error" msgstr "" #: src/pv/transfer.c:594 msgid "skipped past read error" msgstr "" #: src/pv/transfer.c:634 msgid "no transfer buffer allocated" msgstr "" #: src/pv/transfer.c:647 msgid "failed to set alarm signal handler" msgstr "" #: src/pv/transfer.c:774 msgid "write failed" msgstr "" #: src/pv/transfer.c:1007 msgid "select call failed" msgstr "" #: src/pv/watchpid.c:109 src/pv/watchpid.c:121 src/pv/watchpid.c:130 #: src/pv/watchpid.c:184 src/pv/watchpid.c:193 src/pv/watchpid.c:204 msgid "fd" msgstr "" #: src/pv/watchpid.c:130 src/pv/watchpid.c:204 msgid "not a regular file or block device" msgstr "" pv-1.8.5/po/quot.sed000066400000000000000000000002311452655021700142600ustar00rootroot00000000000000s/"\([^"]*\)"/“\1â€/g s/`\([^`']*\)'/‘\1’/g s/ '\([^`']*\)' / ‘\1’ /g s/ '\([^`']*\)'$/ ‘\1’/g s/^'\([^`']*\)' /‘\1’ /g s/“â€/""/g pv-1.8.5/po/remove-potcdate.sin000066400000000000000000000013201452655021700164040ustar00rootroot00000000000000# Sed script that removes the POT-Creation-Date line in the header entry # from a POT file. # # Copyright (C) 2002 Free Software Foundation, Inc. # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. This file is offered as-is, # without any warranty. # # The distinction between the first and the following occurrences of the # pattern is achieved by looking at the hold space. /^"POT-Creation-Date: .*"$/{ x # Test if the hold space is empty. s/P/P/ ta # Yes it was empty. First occurrence. Remove the line. g d bb :a # The hold space was nonempty. Following occurrences. Do nothing. x :b } pv-1.8.5/po/stamp-po000066400000000000000000000000121452655021700142530ustar00rootroot00000000000000timestamp pv-1.8.5/src/000077500000000000000000000000001452655021700127505ustar00rootroot00000000000000pv-1.8.5/src/include/000077500000000000000000000000001452655021700143735ustar00rootroot00000000000000pv-1.8.5/src/include/config-aux.h000066400000000000000000000017041452655021700166060ustar00rootroot00000000000000/* * Standard definitions to make use of the config.h values set by the * `configure' script. Include this after config.h and before anything * else. * * Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023 Andrew Wood * * License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'. */ #if ENABLE_NLS # ifdef HAVE_LIBINTL_H # include # endif # ifdef HAVE_LOCALE_H # include # endif # define _(String) gettext (String) # define N_(String) (String) #else # define _(String) (String) # define N_(String) (String) #endif #undef CURSOR_ANSWERBACK_BYTE_BY_BYTE #ifndef _AIX #define CURSOR_ANSWERBACK_BYTE_BY_BYTE 1 #endif /* Boolean type support */ #ifdef HAVE_STDBOOL_H # include #else # ifndef HAVE__BOOL # ifdef __cplusplus typedef bool _Bool; # else # define _Bool signed char # endif # endif # define bool _Bool # define false 0 # define true 1 # define __bool_true_false_are_defined 1 #endif /* EOF */ pv-1.8.5/src/include/config.h.in000066400000000000000000000226631452655021700164270ustar00rootroot00000000000000/* src/include/config.h.in. Generated from configure.ac by autoheader. */ /* Debugging support enabled */ #undef ENABLE_DEBUGGING /* Define to 1 if translation of program messages to the user's native language is requested. */ #undef ENABLE_NLS /* Define to 1 if you have the `alarm' function. */ #undef HAVE_ALARM /* Define to 1 if you have the `basename' function. */ #undef HAVE_BASENAME /* Define to 1 if you have the Mac OS X function CFLocaleCopyPreferredLanguages in the CoreFoundation framework. */ #undef HAVE_CFLOCALECOPYPREFERREDLANGUAGES /* Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in the CoreFoundation framework. */ #undef HAVE_CFPREFERENCESCOPYAPPVALUE /* Define to 1 if you have the `clock_gettime' function. */ #undef HAVE_CLOCK_GETTIME /* Define if the GNU dcgettext() function is already present or preinstalled. */ #undef HAVE_DCGETTEXT /* Define to 1 if you have the `dup2' function. */ #undef HAVE_DUP2 /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the `fdatasync' function. */ #undef HAVE_FDATASYNC /* Define to 1 if you have the `fpathconf' function. */ #undef HAVE_FPATHCONF /* Define to 1 if you have the `getcwd' function. */ #undef HAVE_GETCWD /* Define to 1 if you have the header file. */ #undef HAVE_GETOPT_H /* Define to 1 if you have the `getopt_long' function. */ #undef HAVE_GETOPT_LONG /* Define if the GNU gettext() function is already present or preinstalled. */ #undef HAVE_GETTEXT /* Define if you have the iconv() function and it works. */ #undef HAVE_ICONV /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* IPC support enabled */ #undef HAVE_IPC /* Define to 1 if you have the header file. */ #undef HAVE_LIBGEN_H /* Define to 1 if you have the header file. */ #undef HAVE_LIBINTL_H /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H /* Define to 1 if you have the header file. */ #undef HAVE_LOCALE_H /* Define to 1 if you have the `memcpy' function. */ #undef HAVE_MEMCPY /* Define to 1 if you have the `memmove' function. */ #undef HAVE_MEMMOVE /* Define to 1 if you have the `memrchr' function. */ #undef HAVE_MEMRCHR /* Define to 1 if you have the `memset' function. */ #undef HAVE_MEMSET /* Define to 1 if you have the header file. */ #undef HAVE_MINIX_CONFIG_H /* Define to 1 if you have the `nanosleep' function. */ #undef HAVE_NANOSLEEP /* Define to 1 if you have the `posix_fadvise' function. */ #undef HAVE_POSIX_FADVISE /* Define to 1 if you have the `posix_memalign' function. */ #undef HAVE_POSIX_MEMALIGN /* Define to 1 if you have the `select' function. */ #undef HAVE_SELECT /* Define to 1 if you have the `setlocale' function. */ #undef HAVE_SETLOCALE /* Define to 1 if you have the `shmget' function. */ #undef HAVE_SHMGET /* Define to 1 if you have the `splice' function. */ #undef HAVE_SPLICE /* Define to 1 if stdbool.h conforms to C99. */ #undef HAVE_STDBOOL_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDIO_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strchr' function. */ #undef HAVE_STRCHR /* Define to 1 if you have the `strerror' function. */ #undef HAVE_STRERROR /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strlcat' function. */ #undef HAVE_STRLCAT /* Define to 1 if you have the `strrchr' function. */ #undef HAVE_STRRCHR /* Define to 1 if you have the `strstr' function. */ #undef HAVE_STRSTR /* Define to 1 if you have the `strtoul' function. */ #undef HAVE_STRTOUL /* Define to 1 if `st_blksize' is a member of `struct stat'. */ #undef HAVE_STRUCT_STAT_ST_BLKSIZE /* Define to 1 if you have the `sysconf' function. */ #undef HAVE_SYSCONF /* Define to 1 if you have the header file. */ #undef HAVE_SYS_FILE_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_IOCTL_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_IPC_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_PARAM_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_TERMIOS_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the `vsnprintf' function. */ #undef HAVE_VSNPRINTF /* Define to 1 if you have the header file. */ #undef HAVE_WCHAR_H /* Define to 1 if you have the header file. */ #undef HAVE_WCTYPE_H /* Define to 1 if the system has the type `_Bool'. */ #undef HAVE__BOOL /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if all of the C90 standard headers exist (not just the ones required in a freestanding environment). This macro is provided for backward compatibility; new code need not use it. */ #undef STDC_HEADERS /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif /* Enable general extensions on macOS. */ #ifndef _DARWIN_C_SOURCE # undef _DARWIN_C_SOURCE #endif /* Enable general extensions on Solaris. */ #ifndef __EXTENSIONS__ # undef __EXTENSIONS__ #endif /* Enable GNU extensions on systems that have them. */ #ifndef _GNU_SOURCE # undef _GNU_SOURCE #endif /* Enable X/Open compliant socket functions that do not require linking with -lxnet on HP-UX 11.11. */ #ifndef _HPUX_ALT_XOPEN_SOCKET_API # undef _HPUX_ALT_XOPEN_SOCKET_API #endif /* Identify the host operating system as Minix. This macro does not affect the system headers' behavior. A future release of Autoconf may stop defining this macro. */ #ifndef _MINIX # undef _MINIX #endif /* Enable general extensions on NetBSD. Enable NetBSD compatibility extensions on Minix. */ #ifndef _NETBSD_SOURCE # undef _NETBSD_SOURCE #endif /* Enable OpenBSD compatibility extensions on NetBSD. Oddly enough, this does nothing on OpenBSD. */ #ifndef _OPENBSD_SOURCE # undef _OPENBSD_SOURCE #endif /* Define to 1 if needed for POSIX-compatible behavior. */ #ifndef _POSIX_SOURCE # undef _POSIX_SOURCE #endif /* Define to 2 if needed for POSIX-compatible behavior. */ #ifndef _POSIX_1_SOURCE # undef _POSIX_1_SOURCE #endif /* Enable POSIX-compatible threading on Solaris. */ #ifndef _POSIX_PTHREAD_SEMANTICS # undef _POSIX_PTHREAD_SEMANTICS #endif /* Enable extensions specified by ISO/IEC TS 18661-5:2014. */ #ifndef __STDC_WANT_IEC_60559_ATTRIBS_EXT__ # undef __STDC_WANT_IEC_60559_ATTRIBS_EXT__ #endif /* Enable extensions specified by ISO/IEC TS 18661-1:2014. */ #ifndef __STDC_WANT_IEC_60559_BFP_EXT__ # undef __STDC_WANT_IEC_60559_BFP_EXT__ #endif /* Enable extensions specified by ISO/IEC TS 18661-2:2015. */ #ifndef __STDC_WANT_IEC_60559_DFP_EXT__ # undef __STDC_WANT_IEC_60559_DFP_EXT__ #endif /* Enable extensions specified by ISO/IEC TS 18661-4:2015. */ #ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__ # undef __STDC_WANT_IEC_60559_FUNCS_EXT__ #endif /* Enable extensions specified by ISO/IEC TS 18661-3:2015. */ #ifndef __STDC_WANT_IEC_60559_TYPES_EXT__ # undef __STDC_WANT_IEC_60559_TYPES_EXT__ #endif /* Enable extensions specified by ISO/IEC TR 24731-2:2010. */ #ifndef __STDC_WANT_LIB_EXT2__ # undef __STDC_WANT_LIB_EXT2__ #endif /* Enable extensions specified by ISO/IEC 24747:2009. */ #ifndef __STDC_WANT_MATH_SPEC_FUNCS__ # undef __STDC_WANT_MATH_SPEC_FUNCS__ #endif /* Enable extensions on HP NonStop. */ #ifndef _TANDEM_SOURCE # undef _TANDEM_SOURCE #endif /* Enable X/Open extensions. Define to 500 only if necessary to make mbstate_t available. */ #ifndef _XOPEN_SOURCE # undef _XOPEN_SOURCE #endif /* Version number of package */ #undef VERSION /* Number of bits in a file offset, on hosts where this is settable. */ #undef _FILE_OFFSET_BITS /* Define for large files, on AIX-style hosts. */ #undef _LARGE_FILES /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `int' if doesn't define. */ #undef gid_t /* Define to the type of a signed integer type of width exactly 32 bits if such a type exists and the standard includes do not define it. */ #undef int32_t /* Define to `int' if does not define. */ #undef mode_t /* Define to `long int' if does not define. */ #undef off_t /* Define as a signed integer type capable of holding a process identifier. */ #undef pid_t /* Define to `unsigned int' if does not define. */ #undef size_t /* Define to `int' if does not define. */ #undef ssize_t /* Define to `int' if doesn't define. */ #undef uid_t #include "config-aux.h" pv-1.8.5/src/include/options.h000066400000000000000000000072521452655021700162450ustar00rootroot00000000000000/* * Global program option structure and the parsing function prototype. * * Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023 Andrew Wood * * License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'. */ #ifndef _OPTIONS_H #define _OPTIONS_H 1 #if HAVE_CONFIG_H #include "config.h" #endif #include #include #ifdef __cplusplus extern "C" { #endif struct opts_s; typedef struct opts_s *opts_t; struct opts_s { /* structure describing run-time options */ /*@keep@*/ const char *program_name; /* name the program is running as */ bool do_nothing; /* exit-without-doing-anything flag */ bool progress; /* progress bar flag */ bool timer; /* timer flag */ bool eta; /* ETA flag */ bool fineta; /* absolute ETA flag */ bool rate; /* rate counter flag */ bool average_rate; /* average rate counter flag */ bool bytes; /* bytes transferred flag */ bool bits; /* report transfer size in bits */ bool bufpercent; /* transfer buffer percentage flag */ size_t lastwritten; /* show N bytes last written */ bool force; /* force-if-not-terminal flag */ bool cursor; /* whether to use cursor positioning */ bool numeric; /* numeric output only */ bool wait; /* wait for transfer before display */ bool linemode; /* count lines instead of bytes */ bool null_terminated_lines; /* lines are null-terminated */ bool no_display; /* do nothing other than pipe data */ off_t rate_limit; /* rate limit, in bytes per second */ size_t buffer_size; /* buffer size, in bytes (0=default) */ unsigned int remote; /* PID of pv to update settings of */ off_t size; /* total size of data */ bool no_splice; /* flag set if never to use splice */ unsigned int skip_errors; /* skip read errors counter */ off_t error_skip_block; /* skip block size, 0 for adaptive */ bool stop_at_size; /* set if we stop at "size" bytes */ bool sync_after_write; /* set if we sync after every write */ bool direct_io; /* set if O_DIRECT is to be used */ bool discard_input; /* set to write nothing to stdout */ double interval; /* interval between updates */ double delay_start; /* delay before first display */ pid_t watch_pid; /* process to watch fds of */ int watch_fd; /* fd to watch */ unsigned int average_rate_window; /* time window in seconds for average rate calculations */ unsigned int width; /* screen width */ unsigned int height; /* screen height */ bool width_set_manually; /* width was set manually, not detected */ bool height_set_manually; /* height was set manually, not detected */ /*@keep@*/ /*@null@*/ char *name; /* display name, if any */ /*@keep@*/ /*@null@*/ char *format; /* output format, if any */ /*@keep@*/ /*@null@*/ char *pidfile; /* PID file, if any */ unsigned int argc; /* number of non-option arguments */ /*@keep@*/ /*@null@*/ const char **argv; /* array of non-option arguments */ unsigned int argv_length; /* allocated array size */ }; /*@-exportlocal@*/ /* splint thinks opts_free is exported but not used - it is used. */ extern /*@null@*/ /*@only@*/ opts_t opts_parse(unsigned int, char **); extern void opts_free(/*@only@*/ opts_t); extern bool opts_add_file(opts_t, const char *); #ifdef __cplusplus } #endif #endif /* _OPTIONS_H */ /* EOF */ pv-1.8.5/src/include/pv-internal.h000066400000000000000000000321721452655021700170100ustar00rootroot00000000000000/* * Functions internal to the PV library. Include "config.h" first. * * Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023 Andrew Wood * * License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'. */ #ifndef _PV_INTERNAL_H #define _PV_INTERNAL_H 1 #include #include #include #include #include #include #ifdef __cplusplus extern "C" { #endif /* * Types of display component that make up an output string. */ typedef enum { PV_COMPONENT_STRING, /* fixed string */ PV_COMPONENT_PROGRESS, /* progress bar, with percentage if known */ PV_COMPONENT_BYTES, /* number of bytes transferred */ PV_COMPONENT_TIMER, /* elapsed time */ PV_COMPONENT_RATE, /* current transfer rate */ PV_COMPONENT_AVERAGERATE, /* average transfer rate */ PV_COMPONENT_ETA, /* estimated time remaining until completion */ PV_COMPONENT_FINETA, /* estimated time of completion */ PV_COMPONENT_NAME, /* name prefix */ PV_COMPONENT_BUFPERCENT, /* percentage of buffer used */ PV_COMPONENT_OUTPUTBUF, /* recent bytes in output buffer */ PV_COMPONENT__MAX } pv_display_component; #define PV_SIZEOF_COMPONENT_STR 1024 /* size of buffer for each component */ #define RATE_GRANULARITY 100000000 /* nsec between -L rate chunks */ #define RATE_BURST_WINDOW 5 /* rate burst window (multiples of rate) */ #define REMOTE_INTERVAL 100000000 /* nsec between checks for -R */ #define BUFFER_SIZE (size_t) 409600 /* default transfer buffer size */ #define BUFFER_SIZE_MAX (size_t) 524288 /* max auto transfer buffer size */ #define MAX_READ_AT_ONCE (size_t) 524288 /* max to read() in one go */ #define MAX_WRITE_AT_ONCE (size_t) 524288 /* max to write() in one go */ #define TRANSFER_READ_TIMEOUT 0.09L /* seconds to time reads out at */ #define TRANSFER_WRITE_TIMEOUT 0.9L /* seconds to time writes out at */ #define MAXIMISE_BUFFER_FILL 1 #define PV_SIZEOF_DEFAULT_FORMAT 512 #define PV_SIZEOF_CWD 4096 #define PV_SIZEOF_LASTOUTPUT_BUFFER 256 #define PV_FORMAT_ARRAY_MAX 100 #define PV_SIZEOF_CRS_LOCK_FILE 1024 #define PV_SIZEOF_FILE_FDINFO 4096 #define PV_SIZEOF_FILE_FD 4096 #define PV_SIZEOF_FILE_FDPATH 4096 #define PV_SIZEOF_DISPLAY_NAME 512 /* * Structure for data shared between multiple "pv -c" instances. */ struct pvcursorstate_s { int y_topmost; /* terminal row of topmost "pv" instance */ bool tty_tostop_added; /* whether any instance had to set TOSTOP on the terminal */ }; /* * Structure for holding PV internal state. Opaque outside the PV library. */ struct pvstate_s { /****************** * Program status * ******************/ struct { /*@only@*/ char *program_name; /* program name for error reporting */ char cwd[PV_SIZEOF_CWD]; /* current working directory for relative path */ int current_input_file; /* index of current file being read */ int exit_status; /* exit status to give (0=OK) */ } status; /*************** * Input files * ***************/ struct { unsigned int file_count; /* number of input files */ /*@only@*/ /*@null@*/ char **filename; /* input filenames */ } files; /******************* * Program control * *******************/ struct { bool force; /* display even if not on terminal */ bool cursor; /* use cursor positioning */ bool numeric; /* numeric output only */ bool wait; /* wait for data before display */ bool linemode; /* count lines instead of bytes */ bool bits; /* report bits instead of bytes */ bool null_terminated_lines; /* lines are null-terminated */ bool no_display; /* do nothing other than pipe data */ unsigned int skip_errors; /* skip read errors counter */ off_t error_skip_block; /* skip block size, 0 for adaptive */ bool stop_at_size; /* set if we stop at "size" bytes */ bool sync_after_write; /* set if we sync after every write */ bool direct_io; /* set if O_DIRECT is to be used */ bool direct_io_changed; /* set when direct_io is changed */ bool no_splice; /* never use splice() */ bool discard_input; /* write nothing to stdout */ off_t rate_limit; /* rate limit, in bytes per second */ size_t target_buffer_size; /* buffer size (0=default) */ off_t size; /* total size of data */ double interval; /* interval between updates */ double delay_start; /* delay before first display */ pid_t watch_pid; /* process to watch fds of */ int watch_fd; /* fd to watch */ unsigned int average_rate_window; /* time window in seconds for average rate calculations */ unsigned int width; /* screen width */ unsigned int height; /* screen height */ bool width_set_manually; /* width was set manually, not detected */ bool height_set_manually; /* height was set manually, not detected */ /*@only@*/ /*@null@*/ char *name; /* display name */ char default_format[PV_SIZEOF_DEFAULT_FORMAT]; /* default format string */ /*@only@*/ /*@null@*/ char *format_string; /* output format string */ } control; /******************* * Signal handling * *******************/ struct { int old_stderr; /* see pv_sig_ttou() */ bool pv_tty_tostop_added; /* whether we had to set TOSTOP on the terminal */ struct timespec tstp_time; /* see pv_sig_tstp() / __cont() */ struct timespec toffset; /* total time spent stopped */ #ifdef SA_SIGINFO volatile sig_atomic_t rxusr2; /* whether SIGUSR2 was received */ volatile pid_t sender; /* PID of sending process for SIGUSR2 */ #endif /* old signal handlers to restore in pv_sig_fini(). */ struct sigaction old_sigpipe; struct sigaction old_sigttou; struct sigaction old_sigtstp; struct sigaction old_sigcont; struct sigaction old_sigwinch; struct sigaction old_sigint; struct sigaction old_sighup; struct sigaction old_sigterm; #ifdef SA_SIGINFO struct sigaction old_sigusr2; #endif } signal; /******************* * Transient flags * *******************/ struct { volatile sig_atomic_t reparse_display; /* whether to re-check format string */ volatile sig_atomic_t terminal_resized; /* whether we need to get term size again */ volatile sig_atomic_t trigger_exit; /* whether we need to abort right now */ } flag; /***************** * Display state * *****************/ struct { /*@only@*/ /*@null@*/ char *display_buffer; /* buffer for display string */ size_t display_buffer_size; /* size allocated to display buffer */ size_t display_string_len; /* length of string in display buffer */ unsigned int prev_screen_width; /* screen width last time we were called */ bool display_visible; /* set once anything written to terminal */ int percentage; /* transfer percentage completion */ long double prev_elapsed_sec; /* elapsed sec at which rate last calculated */ long double prev_rate; /* last calculated instantaneous transfer rate */ long double prev_trans; /* bytes transferred since last rate calculation */ /* Keep track of progress over last intervals to compute current average rate. */ /*@null@*/ struct { /* state at previous intervals (circular buffer) */ long double elapsed_sec; /* time since start of transfer */ off_t total_bytes; /* amount transferred by that time */ } *history; size_t history_len; /* total size of history array */ int history_interval; /* seconds between each history entry */ size_t history_first; /* index of oldest entry */ size_t history_last; /* index of newest entry */ long double current_avg_rate; /* current average rate over last history intervals */ off_t initial_offset; /* offset when first opened (when watching fds) */ size_t lastoutput_length; /* number of last-output bytes to show */ char lastoutput_buffer[PV_SIZEOF_LASTOUTPUT_BUFFER]; size_t format_segment_count; /* number of format string segments */ struct { /* format string broken into display components */ pv_display_component type; /* type of display component */ size_t str_start; /* for strings: start offset */ size_t str_length; /* for strings: length */ } format[PV_FORMAT_ARRAY_MAX]; struct { /* display components */ bool required; /* true if included in format */ char content[PV_SIZEOF_COMPONENT_STR]; /* string to display */ size_t length; /* number of bytes in string */ } component[PV_COMPONENT__MAX]; } display; /******************** * Cursor/IPC state * ********************/ struct { #ifdef HAVE_IPC int shmid; /* ID of our shared memory segment */ int pvcount; /* number of `pv' processes in total */ int pvmax; /* highest number of `pv's seen */ /*@keep@*/ /*@null@*/ struct pvcursorstate_s *shared; /* data shared between instances */ int y_lastread; /* last value of _y_top seen */ int y_offset; /* our Y offset from this top position */ int needreinit; /* counter if we need to reinit cursor pos */ bool noipc; /* set if we can't use IPC */ #endif /* HAVE_IPC */ int lock_fd; /* fd of lockfile, -1 if none open */ char lock_file[PV_SIZEOF_CRS_LOCK_FILE]; int y_start; /* our initial Y coordinate */ } cursor; /******************* * Transfer state * *******************/ /* * The transfer buffer is used for moving data from the input files * to the output when splice() is not available. * * If buffer_size is smaller than pv__target_bufsize, then * pv_transfer() will try to reallocate transfer_buffer to make * buffer_size equal to pv__target_bufsize. * * Data from the input files is read into the buffer; read_position * is the offset in the buffer that we've read data up to. * * Data is written to the output from the buffer, and write_position * is the offset in the buffer that we've written data up to. It * will always be less than or equal to read_position. */ struct { /*@only@*/ /*@null@*/ char *transfer_buffer; /* data transfer buffer */ size_t buffer_size; /* size of buffer */ size_t read_position; /* amount of data in buffer */ size_t write_position; /* buffered data written */ /* * While reading from a file descriptor we keep track of how * many times in a row we've seen errors * (read_errors_in_a_row), and whether or not we have put a * warning on stderr about read errors on this fd * (read_error_warning_shown). * * Whenever the active file descriptor changes from * last_read_skip_fd, we reset read_errors_in_a_row to 0 and * read_error_warning_shown to false for the new file * descriptor and set last_read_skip_fd to the new fd * number. * * This way, we're treating each input file separately. */ int last_read_skip_fd; off_t read_errors_in_a_row; bool read_error_warning_shown; #ifdef HAVE_SPLICE /* * These variables are used to keep track of whether * splice() was used; splice_failed_fd is the file * descriptor that splice() last failed on, so that we don't * keep trying to use it on an fd that doesn't support it, * and splice_used is set to true if splice() was used this * time within pv_transfer(). */ int splice_failed_fd; bool splice_used; #endif ssize_t to_write; /* max to write this time around */ ssize_t written; /* bytes sent to stdout this time */ } transfer; }; struct pvwatchfd_s { pid_t watch_pid; /* PID to watch */ int watch_fd; /* fd to watch, -1 = not displayed */ #ifdef __APPLE__ #else char file_fdinfo[PV_SIZEOF_FILE_FDINFO]; /* path to /proc fdinfo file */ char file_fd[PV_SIZEOF_FILE_FD]; /* path to /proc fd symlink */ #endif char file_fdpath[PV_SIZEOF_FILE_FDPATH]; /* path to file that was opened */ char display_name[PV_SIZEOF_DISPLAY_NAME]; /* name to show on progress bar */ struct stat sb_fd; /* stat of fd symlink */ struct stat sb_fd_link; /* lstat of fd symlink */ off_t size; /* size of whole file, 0 if unknown */ off_t position; /* position last seen at */ struct timespec start_time; /* time we started watching the fd */ /*@null@*/ pvstate_t state; /* state object for flags and display */ }; typedef struct pvwatchfd_s *pvwatchfd_t; void pv_error(pvstate_t, char *, ...); int pv_main_loop(pvstate_t); void pv_display(pvstate_t, long double, off_t, off_t); ssize_t pv_transfer(pvstate_t, int, bool *, bool *, off_t, long *); int pv_next_file(pvstate_t, unsigned int, int); /*@out@*/ const char *pv_current_file_name(pvstate_t); void pv_write_retry(int, const char *, size_t); void pv_crs_fini(pvstate_t); void pv_crs_init(pvstate_t); void pv_crs_update(pvstate_t, const char *); #ifdef HAVE_IPC void pv_crs_needreinit(pvstate_t); #endif void pv_sig_allowpause(void); void pv_sig_checkbg(void); void pv_sig_nopause(void); void pv_remote_init(pvstate_t); void pv_remote_check(pvstate_t); void pv_remote_fini(pvstate_t); int pv_remote_set(pvstate_t); int pv_watchfd_info(pvstate_t, pvwatchfd_t, bool); bool pv_watchfd_changed(pvwatchfd_t); off_t pv_watchfd_position(pvwatchfd_t); int pv_watchpid_scanfds(pvstate_t, pid_t, int *, pvwatchfd_t *, int *); void pv_watchpid_setname(pvstate_t, pvwatchfd_t); #ifdef __cplusplus } #endif #endif /* _PV_INTERNAL_H */ /* EOF */ pv-1.8.5/src/include/pv.h000066400000000000000000000164751452655021700152060ustar00rootroot00000000000000/* * Functions used across the program. * * Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023 Andrew Wood * * License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'. */ #ifndef _PV_H #define _PV_H 1 #if HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #ifdef __cplusplus extern "C" { #endif /* * Opaque structure for PV internal state. */ struct pvstate_s; typedef struct pvstate_s *pvstate_t; /* * Valid number types for pv_getnum_check(). */ typedef enum { PV_NUMTYPE_INTEGER, PV_NUMTYPE_DOUBLE } pv_numtype; /* * Simple string functions for processing numbers. */ /* * Return the given string converted to a double, for use as a time * interval. */ extern double pv_getnum_interval(const char *); /* * Return the given string converted to an off_t, for use as a size. */ extern off_t pv_getnum_size(const char *); /* * Return the given string converted to an unsigned integer, for use as a * count such as screen width. */ extern unsigned int pv_getnum_count(const char *); /* * Return true if the given string is a number of the given type. NB an * integer is both a valid integer and a valid double. */ extern bool pv_getnum_check(const char *, pv_numtype); /* * String handling wrappers. */ /* * Wrapper for sprintf(), falling back to sprintf() on systems without that * function. */ extern int pv_snprintf(char *, size_t, const char *, ...); /* * Implementation of strlcat() where it is unavailable: append a string to a * buffer, constraining the buffer to a particular size and ensuring * termination with '\0'. */ extern size_t pv_strlcat(char *, const char *, size_t); /* * Allocate and return a duplicate of a \0-terminated string, ensuring that * the duplicate is also \0-terminated. Returns NULL on error. */ /*@null@ */ /*@only@ */ extern char *pv_strdup(const char *); /* * Return a pointer to the last matching character in the buffer, or NULL if * not found. */ /*@null@ */ /*@temp@ */ extern void *pv_memrchr(const void *, int, size_t); /* * Functions relating to elapsed time. */ /* * Read the current elapsed time, relative to an unspecified point in the * past, and store it in the given timespec buffer. The time is guaranteed * to not go backwards and does not count time when the system was * suspended. See clock_gettime(2) with CLOCK_MONOTONIC. */ void pv_elapsedtime_read(struct timespec *); /* Set the time in the given timespec to zero. */ void pv_elapsedtime_zero(struct timespec *); /* Copy the second timespec into the first. Analogous to strcpy(3). */ void pv_elapsedtime_copy(struct timespec *, const struct timespec *); /* * Return -1, 0, or 1 depending on whether the first time is earlier than, * equal to, or later than the second time. Analogous to strcmp(3). */ int pv_elapsedtime_compare(const struct timespec *, const struct timespec *); /* Add the latter two timespecs and store them in the first timespec. */ void pv_elapsedtime_add(struct timespec *, const struct timespec *, const struct timespec *); /* Add a number of nanoseconds to the given timespec. */ void pv_elapsedtime_add_nsec(struct timespec *, long long); /* Set the first timespec to the second minus the third. */ void pv_elapsedtime_subtract(struct timespec *, const struct timespec *, const struct timespec *); /* Convert a timespec to seconds. */ long double pv_elapsedtime_seconds(const struct timespec *); /* Sleep for a number of nanoseconds. */ void pv_nanosleep(long long); /* * Main PV functions. */ /* * Create a new state structure, and return it, or 0 (NULL) on error. */ extern /*@null@*/ /*@only@*/ pvstate_t pv_state_alloc(const char *); /* * Set the formatting string, given a set of old-style formatting options. */ extern void pv_state_set_format(pvstate_t state, bool progress, bool timer, bool eta, bool fineta, bool rate, bool average_rate, bool bytes, bool bufpercent, size_t lastwritten, /*@null@*/ const char *name); /* * Set the various options. */ extern void pv_state_force_set(pvstate_t, bool); extern void pv_state_cursor_set(pvstate_t, bool); extern void pv_state_numeric_set(pvstate_t, bool); extern void pv_state_wait_set(pvstate_t, bool); extern void pv_state_delay_start_set(pvstate_t, double); extern void pv_state_linemode_set(pvstate_t, bool); extern void pv_state_bits_set(pvstate_t, bool); extern void pv_state_null_terminated_lines_set(pvstate_t, bool); extern void pv_state_no_display_set(pvstate_t, bool); extern void pv_state_skip_errors_set(pvstate_t, unsigned int); extern void pv_state_error_skip_block_set(pvstate_t, off_t); extern void pv_state_stop_at_size_set(pvstate_t, bool); extern void pv_state_sync_after_write_set(pvstate_t, bool); extern void pv_state_direct_io_set(pvstate_t, bool); extern void pv_state_rate_limit_set(pvstate_t, off_t); extern void pv_state_target_buffer_size_set(pvstate_t, size_t); extern void pv_state_no_splice_set(pvstate_t, bool); extern void pv_state_discard_input_set(pvstate_t, bool); extern void pv_state_size_set(pvstate_t, off_t); extern void pv_state_interval_set(pvstate_t, double); extern void pv_state_width_set(pvstate_t, unsigned int, bool); extern void pv_state_height_set(pvstate_t, unsigned int, bool); extern void pv_state_name_set(pvstate_t, /*@null@*/ const char *); extern void pv_state_format_string_set(pvstate_t, /*@null@*/ const char *); extern void pv_state_watch_pid_set(pvstate_t, pid_t); extern void pv_state_watch_fd_set(pvstate_t, int); extern void pv_state_average_rate_window_set(pvstate_t, unsigned int); extern void pv_state_inputfiles(pvstate_t, unsigned int, const char **); /* * Work out whether we are in the foreground. */ extern bool pv_in_foreground(void); /* * Work out the terminal size. */ extern void pv_screensize(unsigned int *width, unsigned int *height); /* * Calculate the total size of all input files. */ extern off_t pv_calc_total_size(pvstate_t); /* * Set up signal handlers ready for running the main loop. */ extern void pv_sig_init(pvstate_t); #ifdef SA_SIGINFO /* * Return true if SIGUSR2 has been received, and indicate the sender. */ extern bool pv_sigusr2_received(pvstate_t, pid_t *); #endif /* * Enter the main transfer loop, transferring all input files to the output. */ extern int pv_main_loop(pvstate_t); /* * Watch the selected file descriptor of the selected process. */ extern int pv_watchfd_loop(pvstate_t); /* * Watch the selected process. */ extern int pv_watchpid_loop(pvstate_t); /* * Shut down signal handlers after running the main loop. */ extern void pv_sig_fini(pvstate_t); /* * Free a state structure, after which it can no longer be used. */ extern void pv_state_free(/*@only@*/ pvstate_t); #ifdef ENABLE_DEBUGGING # if __STDC_VERSION__ < 199901L && !defined(__func__) # if __GNUC__ >= 2 # define __func__ __FUNCTION__ # else # define __func__ "" # endif # endif # define debug(x,...) debugging_output(__func__, __FILE__, __LINE__, x, __VA_ARGS__) #else # define debug(x,...) do { } while (0) #endif /* * Set the debugging destination file, if debugging is enabled. */ void debugging_output_destination(const char *); /* * Output debugging information, if debugging is enabled. */ void debugging_output(const char *, const char *, int, const char *, ...); #ifdef __cplusplus } #endif #endif /* _PV_H */ /* EOF */ pv-1.8.5/src/main/000077500000000000000000000000001452655021700136745ustar00rootroot00000000000000pv-1.8.5/src/main/debug.c000066400000000000000000000047111452655021700151310ustar00rootroot00000000000000/* * Output debugging information. * * Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023 Andrew Wood * * License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'. */ #include "config.h" #include "pv.h" #include #include #include #include #include #include #ifdef ENABLE_DEBUGGING /*@null@*/ static const char *debug_filename = NULL; /* * Set the destination for debugging information. */ void debugging_output_destination(const char *filename) { debug_filename = filename; } /* * Output debugging information to the file specified earlier by a call to * debugging_output_destination(), if any. */ void debugging_output(const char *function, const char *file, int line, const char *format, ...) { static bool tried_open = false; static FILE *debugfptr = NULL; va_list ap; time_t t; struct tm *tm; char tbuf[128]; /* flawfinder: ignore */ /* * flawfinder note: tbuf is only written to by strftime() which * takes its size, and we enforce string termination. */ if (false == tried_open) { if (NULL != debug_filename) { debugfptr = fopen(debug_filename, "a"); /* flawfinder: ignore */ /* * flawfinder note: caller directly controls * filename, the safest we can manage is to use * append mode. */ } tried_open = true; } if (NULL == debugfptr) { return; } (void) time(&t); tm = localtime(&t); tbuf[0] = '\0'; if (0 == strftime(tbuf, sizeof(tbuf), "%Y-%m-%d %H:%M:%S", tm)) { tbuf[0] = '\0'; } tbuf[sizeof(tbuf) - 1] = '\0'; /* enforce termination */ (void) fprintf(debugfptr, "[%s] (%d) %s (%s:%d): ", tbuf, getpid(), function, file, line); va_start(ap, format); (void) vfprintf(debugfptr, format, ap); /* flawfinder: ignore */ va_end(ap); /* * flawfinder note: vfprintf format is explicitly controlled by the * caller of this function - no mitigation possible or desirable. */ (void) fprintf(debugfptr, "\n"); (void) fflush(debugfptr); } #else /* ! ENABLE_DEBUGGING */ /* * Stub debugging destination function. */ void debugging_output_destination( __attribute__((unused)) const char *filename) { } /* * Stub debugging output function. */ void debugging_output( __attribute__((unused)) const char *function, __attribute__((unused)) const char *file, __attribute__((unused)) int line, __attribute__((unused)) const char *format, ...) { } #endif /* ENABLE_DEBUGGING */ /* EOF */ pv-1.8.5/src/main/help.c000066400000000000000000000432511452655021700147750ustar00rootroot00000000000000/* * Output command-line help to stdout. * * Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023 Andrew Wood * * License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'. */ #include "config.h" #include "pv.h" #include #include #include #include #include #if defined(ENABLE_NLS) && defined(HAVE_WCHAR_H) #include #if defined(HAVE_WCTYPE_H) #include #endif #endif /* * Return the number of display columns needed to show the given string. * * To do this, we convert it to a wide character string, and use the wide * character display width function "wcswidth()" on it. * * If NLS is disabled, or the string cannot be converted, this is just the * same as "strlen()". */ static size_t display_width(const char *string) { size_t width; #if defined(ENABLE_NLS) && defined(HAVE_WCHAR_H) size_t wide_char_count; size_t wide_string_buffer_size; wchar_t *wide_string; if (NULL == string) return 0; /*@-nullpass@ */ /* * splint note: mbstowcs() manual page on Linux explicitly says it * takes NULL. */ wide_char_count = mbstowcs(NULL, string, 0); /*@+nullpass@ */ if (wide_char_count == (size_t) -1) { debug("%s: %s: %s", "mbstowcs", string, strerror(errno)); return strlen(string); /* flawfinder: ignore */ /* * flawfinder rationale: we have already checked for NULL, * and we don't know the size of the originating buffer so * can't use strnlen(); it is up to the caller to provide a * terminated string. */ } wide_string_buffer_size = sizeof(*wide_string) * (1 + wide_char_count); wide_string = malloc(wide_string_buffer_size); if (NULL == wide_string) { perror("malloc"); return strlen(string); /* flawfinder: ignore */ /* flawfinder rationale: see above. */ } memset(wide_string, 0, wide_string_buffer_size); if (mbstowcs(wide_string, string, 1 + wide_char_count) == (size_t) -1) { debug("%s: %s: %s", "mbstowcs", string, strerror(errno)); width = strlen(string); /* flawfinder: ignore */ /* flawfinder rationale: see above. */ } else if (NULL != wide_string) { /*@-unrecog @ */ /* splint seems unable to see the prototype. */ width = wcswidth(wide_string, wide_char_count); /*@+unrecog @ */ } else { width = 0; } free(wide_string); #else /* ! defined(ENABLE_NLS) && defined(HAVE_WCHAR_H) */ if (NULL == string) return 0; width = strlen(string); /* flawfinder: ignore */ /* flawfinder rationale: see above. */ #endif /* defined(ENABLE_NLS) && defined(HAVE_WCHAR_H) */ return width; } /* * The 7-bit ASCII version of display_word_wrap() below - does not * understand multi-byte characters. */ static void display_word_wrap_7bit(const char *string, size_t display_width, size_t left_margin) { const char *start; const char *end; if (NULL == string) return; start = string; while (strlen(start) > display_width) { /* flawfinder: ignore */ /* flawfinder rationale: see above. */ end = start + display_width; while ((end > start) && (end[0] != ' ')) end--; if (end == start) { end = start + display_width; } else { end++; } printf("%.*s", (int) (end - start), start); if (end == start) end++; start = end; if (start[0] != '\0') printf("\n%*s", (int) left_margin, ""); } printf("%s", start); } /* * Output a string to standard output, word wrapping to "display_width" * display character positions, and left-padding any new lines after the * first one with "left_margin" spaces. * * Wide characters are handled if NLS is enabled, but if they can't be, this * falls back to a version which just counts bytes as characters. */ static void display_word_wrap(const char *string, size_t display_width, size_t left_margin) { #if defined(ENABLE_NLS) && defined(HAVE_WCHAR_H) size_t wide_char_count; size_t wide_string_buffer_size; wchar_t *wide_string; size_t start_idx, end_idx, chars_remaining; if (NULL == string) return; /*@-nullpass@ */ /* splint note: see earlier mbstowcs() call. */ wide_char_count = mbstowcs(NULL, string, 0); /*@+nullpass@ */ if (wide_char_count == (size_t) -1) { debug("%s: %s: %s", "mbstowcs", string, strerror(errno)); display_word_wrap_7bit(string, display_width, left_margin); return; } wide_string_buffer_size = sizeof(*wide_string) * (1 + wide_char_count); wide_string = malloc(wide_string_buffer_size); if (NULL == wide_string) { perror("malloc"); display_word_wrap_7bit(string, display_width, left_margin); return; } memset(wide_string, 0, wide_string_buffer_size); if (mbstowcs(wide_string, string, 1 + wide_char_count) == (size_t) -1) { debug("%s: %s: %s", "mbstowcs", string, strerror(errno)); free(wide_string); display_word_wrap_7bit(string, display_width, left_margin); return; } start_idx = 0; chars_remaining = wide_char_count; while (chars_remaining > 0 && wcswidth(&(wide_string[start_idx]), chars_remaining) > display_width) { size_t next_idx; end_idx = start_idx + display_width; while ((end_idx > start_idx) && (!iswspace(wide_string[end_idx]))) end_idx--; if (end_idx == start_idx) { end_idx = start_idx + display_width; } else { end_idx++; } next_idx = end_idx; if (end_idx == start_idx) next_idx++; while (start_idx < end_idx && start_idx < wide_char_count) { char multi_byte_string[MB_CUR_MAX + 1]; /* flawfinder: ignore */ /* * flawfinder rationale: array is explicitly * cleared, large enough according to the wctomb() * manual, and we explicitly terminate the string. */ memset(multi_byte_string, 0, MB_CUR_MAX + 1); if (wctomb(multi_byte_string, wide_string[start_idx]) >= 0) { multi_byte_string[MB_CUR_MAX] = '\0'; printf("%s", multi_byte_string); } start_idx++; } start_idx = next_idx; if (start_idx < wide_char_count) printf("\n%*s", (int) left_margin, ""); chars_remaining = wide_char_count - start_idx; } while (start_idx < wide_char_count) { char multi_byte_string[MB_CUR_MAX + 1]; /* flawfinder: ignore */ /* flawfinder rationale as above. */ memset(multi_byte_string, 0, MB_CUR_MAX + 1); if (wctomb(multi_byte_string, wide_string[start_idx]) >= 0) { multi_byte_string[MB_CUR_MAX] = '\0'; printf("%s", multi_byte_string); } start_idx++; } free(wide_string); #else /* ! defined(ENABLE_NLS) && defined(HAVE_WCHAR_H) */ display_word_wrap_7bit(string, display_width, left_margin); #endif /* defined(ENABLE_NLS) && defined(HAVE_WCHAR_H) */ } /* * Structure holding the displayed descriptions of each option - the short * option such as "-s", its long counterpart such as "--size", the name of * its argument such as "SIZE", and the description of what the option does. * Any of them may be NULL. * * In the initialiser for this structure, translatable strings are wrapped * with N_() to indicate that they are to be translated into the operator's * language by this function at run-time. * * Note that "opt_short" and "opt_long" should never be marked as * translatable, as they must remain consistent across all locales. * * The list is terminated with a NULL opt_short value - to leave a gap, set * opt_short to an empty string instead. */ struct option_definition_s { /*@null@ */ const char *opt_short; /*@null@ */ const char *opt_long; /*@null@ *//*@observer@ */ const char *opt_argument; /*@null@ *//*@observer@ */ const char *opt_description; struct { /* * Structure holding the width, in display character * positions, of the individual parts of the description of * each option - calculated after initialisation, so that * translation can be performed. */ size_t opt_short; size_t opt_long; size_t opt_argument; size_t opt_description; } width; }; /* * Display command-line help. */ void display_help(void) { struct option_definition_s option_definitions[] = { { "-p", "--progress", NULL, N_("show progress bar"), { 0, 0, 0, 0} }, { "-t", "--timer", NULL, N_("show elapsed time"), { 0, 0, 0, 0} }, { "-e", "--eta", NULL, N_("show estimated time of arrival (completion)"), { 0, 0, 0, 0} }, { "-I", "--fineta", NULL, N_("show absolute estimated time of arrival (completion)"), { 0, 0, 0, 0} }, { "-r", "--rate", NULL, N_("show data transfer rate counter"), { 0, 0, 0, 0} }, { "-a", "--average-rate", NULL, N_("show data transfer average rate counter"), { 0, 0, 0, 0} }, { "-m", "--average-rate-window", N_("SEC"), N_("compute average rate over past SEC seconds (default 30s)"), { 0, 0, 0, 0} }, { "-b", "--bytes", NULL, N_("show number of bytes transferred"), { 0, 0, 0, 0} }, { "-8", "--bits", NULL, N_("show number of bits transferred"), { 0, 0, 0, 0} }, { "-T", "--buffer-percent", NULL, N_("show percentage of transfer buffer in use"), { 0, 0, 0, 0} }, { "-A", "--last-written", _("NUM"), N_("show NUM bytes last written"), { 0, 0, 0, 0} }, { "-F", "--format", N_("FORMAT"), N_("set output format to FORMAT"), { 0, 0, 0, 0} }, { "-n", "--numeric", NULL, N_("output percentages, not visual information"), { 0, 0, 0, 0} }, { "-q", "--quiet", NULL, N_("do not output any transfer information at all"), { 0, 0, 0, 0} }, { "", NULL, NULL, NULL, { 0, 0, 0, 0} }, { "-W", "--wait", NULL, N_("display nothing until first byte transferred"), { 0, 0, 0, 0} }, { "-D", "--delay-start", N_("SEC"), N_("display nothing until SEC seconds have passed"), { 0, 0, 0, 0} }, { "-s", "--size", N_("SIZE"), N_("set estimated data size to SIZE bytes"), { 0, 0, 0, 0} }, { "-l", "--line-mode", NULL, N_("count lines instead of bytes"), { 0, 0, 0, 0} }, { "-0", "--null", NULL, N_("lines are null-terminated"), { 0, 0, 0, 0} }, { "-i", "--interval", N_("SEC"), N_("update every SEC seconds"), { 0, 0, 0, 0} }, { "-w", "--width", N_("WIDTH"), N_("assume terminal is WIDTH characters wide"), { 0, 0, 0, 0} }, { "-H", "--height", N_("HEIGHT"), N_("assume terminal is HEIGHT rows high"), { 0, 0, 0, 0} }, { "-N", "--name", N_("NAME"), N_("prefix visual information with NAME"), { 0, 0, 0, 0} }, { "-f", "--force", NULL, N_("output even if standard error is not a terminal"), { 0, 0, 0, 0} }, { "-c", "--cursor", NULL, N_("use cursor positioning escape sequences"), { 0, 0, 0, 0} }, { "", NULL, NULL, NULL, { 0, 0, 0, 0} }, { "-L", "--rate-limit", N_("RATE"), N_("limit transfer to RATE bytes per second"), { 0, 0, 0, 0} }, { "-B", "--buffer-size", N_("BYTES"), N_("use a buffer size of BYTES"), { 0, 0, 0, 0} }, { "-C", "--no-splice", NULL, N_("never use splice(), always use read/write"), { 0, 0, 0, 0} }, { "-E", "--skip-errors", NULL, N_("skip read errors in input"), { 0, 0, 0, 0} }, { "-Z", "--error-skip-block", N_("BYTES"), N_("skip errors in BYTES blocks at a time"), { 0, 0, 0, 0} }, { "-S", "--stop-at-size", NULL, N_("stop after --size bytes have been transferred"), { 0, 0, 0, 0} }, { "-Y", "--sync", NULL, N_("flush cache to disk after every write"), { 0, 0, 0, 0} }, { "-K", "--direct-io", NULL, N_("use direct I/O to bypass cache"), { 0, 0, 0, 0} }, { "-X", "--discard", NULL, N_("discard input instead of writing to output"), { 0, 0, 0, 0} }, #ifdef SA_SIGINFO { "-R", "--remote", N_("PID"), N_("update settings of process PID"), { 0, 0, 0, 0} }, #endif /* SA_SIGINFO */ { "", NULL, NULL, NULL, { 0, 0, 0, 0} }, { "-P", "--pidfile", N_("FILE"), N_("save process ID in FILE"), { 0, 0, 0, 0} }, { "", NULL, NULL, NULL, { 0, 0, 0, 0} }, { "-d", "--watchfd", N_("PID[:FD]"), N_("watch file FD opened by process PID"), { 0, 0, 0, 0} }, { "", NULL, NULL, NULL, { 0, 0, 0, 0} }, { "-h", "--help", NULL, N_("show this help and exit"), { 0, 0, 0, 0} }, { "-V", "--version", NULL, N_("show version information and exit"), { 0, 0, 0, 0} }, #ifdef ENABLE_DEBUGGING { "-!", "--debug", N_("FILE"), N_("write debug logs to FILE"), { 0, 0, 0, 0} }, #endif { NULL, NULL, NULL, NULL, { 0, 0, 0, 0} } }; unsigned int option_index; size_t widest_option_width = 0; size_t description_left_margin = 0; size_t min_description_width = 50; size_t right_margin = 77; const char *program_description; const char *bug_report_note; unsigned int terminal_width = 0, terminal_height = 0; pv_screensize(&terminal_width, &terminal_height); if (terminal_width > 5) { right_margin = (size_t) (terminal_width - 3); } /*@-formatconst@ */ /* * splint note: unavoidable use of %s in translated string. Should * be hard to exploit - the message catalogue would have to be * replaced or forced to load from another location. */ printf(_("Usage: %s [OPTION] [FILE]..."), PACKAGE_NAME); /*@+formatconst@ */ printf("\n"); /*@-mustfreefresh@ */ /* * splint note: the gettext calls made by _() cause memory leak * warnings, but in this case it's unavoidable, and mitigated by the * fact we only translate each string once. */ program_description = _("Concatenate FILE(s), or standard input, to standard output, with monitoring."); if (NULL != program_description) { display_word_wrap(program_description, right_margin, 0); printf("\n"); } printf("\n"); /* * Translate the help text, and calculate the displayed width of * each part of each option definition. The total display width of * the short option, long option, and option argument together form * the "option" width - we look for the widest one to calculate the * left margin for all of the descriptions to start at. */ for (option_index = 0; NULL != option_definitions[option_index].opt_short; option_index++) { struct option_definition_s *definition; size_t option_width; definition = &(option_definitions[option_index]); option_width = 0; definition->width.opt_short = display_width(definition->opt_short); definition->width.opt_long = 0; definition->width.opt_argument = 0; definition->width.opt_description = 0; if (NULL != definition->opt_long) { definition->width.opt_long = display_width(definition->opt_long); } if (NULL != definition->opt_argument) { /*@observer@ */ const char *translated; translated = _(definition->opt_argument); if (NULL != translated) { definition->opt_argument = translated; } definition->width.opt_argument = display_width(definition->opt_argument); } if (NULL != definition->opt_description) { /*@observer@ */ const char *translated; translated = _(definition->opt_description); if (NULL != translated) { definition->opt_description = translated; } definition->width.opt_description = display_width(definition->opt_description); } /* * The option_width is padded with a left margin of 2 * spaces, a ", " between the short and long options, a * space between the long option and the argument, and two * spaces after the argument: * * " , " * * If we don't have getopt_long() then ", " is omitted. */ option_width += 2 + definition->width.opt_short; /* " short" */ #ifdef HAVE_GETOPT_LONG option_width += 2 + definition->width.opt_long; /* ", " */ #endif option_width += 1 + definition->width.opt_argument; /* " ARG" */ option_width += 2; /* final 2 spaces */ if (option_width > widest_option_width) { widest_option_width = option_width; } } /* * Set the left margin for the option descriptions, based on the * widest option width, or (right margin - min_description_width), * whichever is less, so that there is always room for * "min_description_width" characters of description. */ description_left_margin = right_margin - min_description_width; if (widest_option_width < description_left_margin) { description_left_margin = widest_option_width; } debug("%s: description_left_margin=%d, widest_option_width=%d, right_margin=%d", "help display", (int) description_left_margin, (int) widest_option_width, (int) right_margin); /* * Display each of the option definitions, word wrapping the * descriptions. */ for (option_index = 0; NULL != option_definitions[option_index].opt_short; option_index++) { struct option_definition_s *definition; size_t option_width; definition = &(option_definitions[option_index]); option_width = 0; if (definition->width.opt_short > 0 && NULL != definition->opt_short) { printf(" %s", definition->opt_short); option_width += 2 + definition->width.opt_short; } #ifdef HAVE_GETOPT_LONG if (definition->width.opt_long > 0 && NULL != definition->opt_long) { printf(", %s", definition->opt_long); option_width += 2 + definition->width.opt_long; } #endif if (definition->width.opt_argument > 0 && NULL != definition->opt_argument) { printf(" %s", definition->opt_argument); option_width += 1 + definition->width.opt_argument; } /* Just start a new line if there's no description. */ if ((0 == definition->width.opt_description) || (NULL == definition->opt_description)) { printf("\n"); continue; } /* * If the option is too wide, start a new line for the * description. In both cases, pad with spaces up to the * description left margin. */ if (option_width > description_left_margin) { printf("\n%*s", (int) description_left_margin, ""); } else if (option_width < description_left_margin) { printf("%*s", (int) (description_left_margin - option_width), ""); } /* Output the description, word wrapped. */ display_word_wrap(definition->opt_description, right_margin - description_left_margin, description_left_margin); printf("\n"); } printf("\n"); bug_report_note = _("Please report any bugs to: %s"); if (NULL != bug_report_note) { /*@-formatconst@ */ /* * splint note: see earlier "formatconst" note. * flawfinder: same reason. */ printf(bug_report_note, PACKAGE_BUGREPORT); /* flawfinder: ignore */ /*@+formatconst@ */ } printf("\n"); } /* EOF */ pv-1.8.5/src/main/main.c000066400000000000000000000236111452655021700147670ustar00rootroot00000000000000/* * Main program entry point - read the command line options, then perform * the appropriate actions. * * Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023 Andrew Wood * * License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'. */ #include "config.h" #include "options.h" #include "pv.h" /* We do not set this because it breaks "dd" - see below. */ /* #undef MAKE_STDOUT_NONBLOCKING */ #include #include #include #include #include #include #include #include int pv_remote_set(opts_t, pvstate_t); void pv_remote_init(void); void pv_remote_fini(void); /* * Process command-line arguments and set option flags, then call functions * to initialise, and finally enter the main loop. */ int main(int argc, char **argv) { /*@only@ */ opts_t opts = NULL; /*@only@ */ pvstate_t state = NULL; int retcode = 0; #ifdef ENABLE_NLS /* Initialise language translation. */ (void) setlocale(LC_ALL, ""); (void) bindtextdomain(PACKAGE, LOCALEDIR); (void) textdomain(PACKAGE); #endif /* Parse the command line arguments. */ opts = opts_parse(argc >= 0 ? (unsigned int) argc : 0, argv); if (NULL == opts) { debug("%s: %d", "exiting with status", 64); return 64; } /* Early exit if necessary, such as with "-h". */ if (opts->do_nothing) { debug("%s", "nothing to do - exiting with status 0"); opts_free(opts); return 0; } /* * Allocate our internal state buffer. */ state = pv_state_alloc(opts->program_name); if (NULL == state) { /*@-mustfreefresh@ */ /* * splint note: the gettext calls made by _() cause memory * leak warnings, but in this case it's unavoidable, and * mitigated by the fact we only translate each string once. */ fprintf(stderr, "%s: %s: %s\n", opts->program_name, _("state allocation failed"), strerror(errno)); opts_free(opts); debug("%s: %d", "exiting with status", 64); return 64; /*@+mustfreefresh@ */ } /* * -R specified - send the message, then exit. */ if (opts->remote > 0) { /* Initialise signal handling. */ pv_sig_init(state); /* Send the message. */ retcode = pv_remote_set(opts, state); /* Close down the signal handling. */ pv_sig_fini(state); /* Free resources. */ pv_state_free(state); opts_free(opts); /* Early exit. */ return retcode; } /* * Write a PID file if -P was specified. */ if (opts->pidfile != NULL) { char *pidfile_tmp_name; size_t pidfile_tmp_bufsize; int pidfile_tmp_fd; FILE *pidfile_tmp_fptr; mode_t prev_umask; pidfile_tmp_bufsize = 16 + strlen(opts->pidfile); /* flawfinder: ignore */ /* * flawfinder rationale: pidfile was supplied as an argument * so we have to assume it is \0 terminated. */ pidfile_tmp_name = malloc(pidfile_tmp_bufsize); if (NULL == pidfile_tmp_name) { fprintf(stderr, "%s: %s\n", opts->program_name, strerror(errno)); pv_state_free(state); opts_free(opts); return 1; } memset(pidfile_tmp_name, 0, pidfile_tmp_bufsize); (void) pv_snprintf(pidfile_tmp_name, pidfile_tmp_bufsize, "%s.XXXXXX", opts->pidfile); /*@-type@ *//* splint doesn't like mode_t */ prev_umask = umask(0000); /* flawfinder: ignore */ (void) umask(prev_umask | 0133); /* flawfinder: ignore */ /*@-unrecog@ *//* splint doesn't know mkstemp() */ pidfile_tmp_fd = mkstemp(pidfile_tmp_name); /* flawfinder: ignore */ /*@+unrecog@ */ if (pidfile_tmp_fd < 0) { fprintf(stderr, "%s: %s: %s\n", opts->program_name, pidfile_tmp_name, strerror(errno)); (void) umask(prev_umask); /* flawfinder: ignore */ free(pidfile_tmp_name); pv_state_free(state); opts_free(opts); return 1; } (void) umask(prev_umask); /* flawfinder: ignore */ /* * flawfinder rationale (umask, mkstemp) - flawfinder * recommends setting the most restrictive umask possible * when calling mkstemp(), so this is what we have done. * * We get the original umask and OR it with 0133 to make * sure new files will be at least chmod 644. Then we put * the umask back to what it was, after creating the * temporary file. */ /*@+type@ */ pidfile_tmp_fptr = fdopen(pidfile_tmp_fd, "w"); if (NULL == pidfile_tmp_fptr) { fprintf(stderr, "%s: %s: %s\n", opts->program_name, pidfile_tmp_name, strerror(errno)); (void) close(pidfile_tmp_fd); (void) remove(pidfile_tmp_name); free(pidfile_tmp_name); pv_state_free(state); opts_free(opts); return 1; } fprintf(pidfile_tmp_fptr, "%d\n", getpid()); if (0 != fclose(pidfile_tmp_fptr)) { fprintf(stderr, "%s: %s: %s\n", opts->program_name, opts->pidfile, strerror(errno)); } if (rename(pidfile_tmp_name, opts->pidfile) < 0) { fprintf(stderr, "%s: %s: %s\n", opts->program_name, opts->pidfile, strerror(errno)); (void) remove(pidfile_tmp_name); } free(pidfile_tmp_name); } /* * If no files were given, pretend "-" was given (stdin). */ if (0 == opts->argc) { debug("%s", "no files given - adding fake argument `-'"); if (!opts_add_file(opts, "-")) { pv_state_free(state); opts_free(opts); return 64; } } /* * Put our list of input files into the PV internal state. */ if (NULL != opts->argv) { pv_state_inputfiles(state, opts->argc, (const char **) (opts->argv)); } /* Total size calculation, in normal transfer mode. */ if (0 == opts->watch_pid) { /* * If no size was given, try to calculate the total size. */ if (0 == opts->size) { pv_state_linemode_set(state, opts->linemode); pv_state_null_terminated_lines_set(state, opts->null_terminated_lines); opts->size = pv_calc_total_size(state); debug("%s: %llu", "no size given - calculated", opts->size); } /* * If the size is unknown, we cannot have an ETA. */ if (opts->size < 1) { opts->eta = false; debug("%s", "size unknown - ETA disabled"); } } /* * If stderr is not a terminal and we're neither forcing output nor * outputting numerically, we will have nothing to display at all. */ if ((0 == isatty(STDERR_FILENO)) && (false == opts->force) && (false == opts->numeric)) { opts->no_display = true; debug("%s", "nothing to display - setting no_display"); } /* * Auto-detect width or height if either are unspecified. */ if ((0 == opts->width) || (0 == opts->height)) { unsigned int width, height; width = 0; height = 0; pv_screensize(&width, &height); if (0 == opts->width) { opts->width = width; debug("%s: %u", "auto-detected terminal width", width); } if (0 == opts->height) { opts->height = height; debug("%s: %u", "auto-detected terminal height", height); } } /* * Width and height bounds checking (and defaults). */ if (opts->width < 1) opts->width = 80; if (opts->height < 1) opts->height = 25; if (opts->width > 999999) opts->width = 999999; if (opts->height > 999999) opts->height = 999999; /* * Interval must be at least 0.1 second, and at most 10 minutes. */ if (opts->interval < 0.1) opts->interval = 0.1; if (opts->interval > 600) opts->interval = 600; /* * Copy parameters from options into main state. */ pv_state_interval_set(state, opts->interval); pv_state_width_set(state, opts->width, opts->width_set_manually); pv_state_height_set(state, opts->height, opts->height_set_manually); pv_state_no_display_set(state, opts->no_display); pv_state_force_set(state, opts->force); pv_state_cursor_set(state, opts->cursor); pv_state_numeric_set(state, opts->numeric); pv_state_wait_set(state, opts->wait); pv_state_delay_start_set(state, opts->delay_start); pv_state_linemode_set(state, opts->linemode); pv_state_bits_set(state, opts->bits); pv_state_null_terminated_lines_set(state, opts->null_terminated_lines); pv_state_skip_errors_set(state, opts->skip_errors); pv_state_error_skip_block_set(state, opts->error_skip_block); pv_state_stop_at_size_set(state, opts->stop_at_size); pv_state_sync_after_write_set(state, opts->sync_after_write); pv_state_direct_io_set(state, opts->direct_io); pv_state_discard_input_set(state, opts->discard_input); pv_state_rate_limit_set(state, opts->rate_limit); pv_state_target_buffer_size_set(state, opts->buffer_size); pv_state_no_splice_set(state, opts->no_splice); pv_state_size_set(state, opts->size); pv_state_name_set(state, opts->name); pv_state_format_string_set(state, opts->format); pv_state_watch_pid_set(state, opts->watch_pid); pv_state_watch_fd_set(state, opts->watch_fd); pv_state_average_rate_window_set(state, opts->average_rate_window); pv_state_set_format(state, opts->progress, opts->timer, opts->eta, opts->fineta, opts->rate, opts->average_rate, opts->bytes, opts->bufpercent, opts->lastwritten, opts->name); #ifdef MAKE_STDOUT_NONBLOCKING /* * Try and make standard output use non-blocking I/O. * * Note that this can cause problems with (broken) applications * such as dd. */ fcntl(STDOUT_FILENO, F_SETFL, O_NONBLOCK | fcntl(STDOUT_FILENO, F_GETFL)); #endif /* MAKE_STDOUT_NONBLOCKING */ /* Initialise the signal handling. */ pv_sig_init(state); /* Run the appropriate main loop. */ if (0 == opts->watch_pid) { /* Normal "transfer data" mode. */ pv_remote_init(); retcode = pv_main_loop(state); pv_remote_fini(); } else if (0 != opts->watch_pid && -1 == opts->watch_fd) { /* "Watch all file descriptors of another process" mode. */ retcode = pv_watchpid_loop(state); } else if (0 != opts->watch_pid && -1 != opts->watch_fd) { /* "Watch a specific file descriptor of another process" mode. */ retcode = pv_watchfd_loop(state); } /* Clear up the PID file, if one was written. */ if (opts->pidfile != NULL) { if (0 != remove(opts->pidfile)) { fprintf(stderr, "%s: %s: %s\n", opts->program_name, opts->pidfile, strerror(errno)); } } /* Close down the signal handling. */ pv_sig_fini(state); /* Free the internal PV state. */ pv_state_free(state); /* Free the data from parsing the command-line arguments. */ opts_free(opts); debug("%s: %d", "exiting with status", retcode); return retcode; } /* EOF */ pv-1.8.5/src/main/options.c000066400000000000000000000353671452655021700155510ustar00rootroot00000000000000/* * Parse command-line options. * * Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023 Andrew Wood * * License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'. */ #include "config.h" #include "options.h" #include "pv.h" #include #include #include #include #include #include #ifdef HAVE_GETOPT_H #include #endif void display_help(void); void display_version(void); /* * Free an opts_t object. */ void opts_free( /*@only@ */ opts_t opts) { if (!opts) return; /*@-keeptrans@ */ /* * splint note: we're explicitly being handed the "opts" object to * free it, so the previously "kept" internally allocated buffers * are now ours to free. */ if (NULL != opts->name) free(opts->name); if (NULL != opts->format) free(opts->format); if (NULL != opts->pidfile) free(opts->pidfile); if (NULL != opts->argv) free(opts->argv); /*@+keeptrans@ */ free(opts); } /* * Add a filename to the list of non-option arguments, returning false on * error. The filename is not copied - the pointer is stored. */ bool opts_add_file(opts_t opts, const char *filename) { /*@-branchstate@ */ if ((opts->argc >= opts->argv_length) || (NULL == opts->argv)) { opts->argv_length = opts->argc + 10; /*@-keeptrans@ */ opts->argv = realloc(opts->argv, opts->argv_length * sizeof(char *)); /*@+keeptrans@ */ if (NULL == opts->argv) { fprintf(stderr, "%s: %s\n", opts->program_name, strerror(errno)); opts->argv_length = 0; opts->argc = 0; return false; } } /*@+branchstate@ */ /* * splint notes: we turned off "branchstate" above because depending * on whether we have to extend the array, we change argv from * "keep" to "only", which is also why we turned off "keeptrans"; * there doesn't seem to be a clean way to tell splint that everyone * else should not touch argv but we're allowed to reallocate it and * so is opts_parse. */ opts->argv[opts->argc++] = filename; return true; } /* * Parse the given command-line arguments into an opts_t object, handling * "help" and "version" options internally. * * Returns an opts_t, or NULL on error. * * Note that the contents of *argv[] (i.e. the command line parameters) * aren't copied anywhere, just the pointers are copied, so make sure the * command line data isn't overwritten or argv[1] free()d or whatever. */ /*@null@ */ /*@only@ */ opts_t opts_parse(unsigned int argc, char **argv) { #ifdef HAVE_GETOPT_LONG /*@-nullassign@ */ /* splint rationale: NULL is allowed for "flags" in long options. */ struct option long_options[] = { { "help", 0, NULL, (int) 'h' }, { "version", 0, NULL, (int) 'V' }, { "progress", 0, NULL, (int) 'p' }, { "timer", 0, NULL, (int) 't' }, { "eta", 0, NULL, (int) 'e' }, { "fineta", 0, NULL, (int) 'I' }, { "rate", 0, NULL, (int) 'r' }, { "average-rate", 0, NULL, (int) 'a' }, { "bytes", 0, NULL, (int) 'b' }, { "bits", 0, NULL, (int) '8' }, { "buffer-percent", 0, NULL, (int) 'T' }, { "last-written", 1, NULL, (int) 'A' }, { "force", 0, NULL, (int) 'f' }, { "numeric", 0, NULL, (int) 'n' }, { "quiet", 0, NULL, (int) 'q' }, { "cursor", 0, NULL, (int) 'c' }, { "wait", 0, NULL, (int) 'W' }, { "delay-start", 1, NULL, (int) 'D' }, { "size", 1, NULL, (int) 's' }, { "line-mode", 0, NULL, (int) 'l' }, { "null", 0, NULL, (int) '0' }, { "interval", 1, NULL, (int) 'i' }, { "width", 1, NULL, (int) 'w' }, { "height", 1, NULL, (int) 'H' }, { "name", 1, NULL, (int) 'N' }, { "format", 1, NULL, (int) 'F' }, { "rate-limit", 1, NULL, (int) 'L' }, { "buffer-size", 1, NULL, (int) 'B' }, { "no-splice", 0, NULL, (int) 'C' }, { "skip-errors", 0, NULL, (int) 'E' }, { "error-skip-block", 1, NULL, (int) 'Z' }, { "stop-at-size", 0, NULL, (int) 'S' }, { "sync", 0, NULL, (int) 'Y' }, { "direct-io", 0, NULL, (int) 'K' }, { "discard", 0, NULL, (int) 'X' }, { "remote", 1, NULL, (int) 'R' }, { "pidfile", 1, NULL, (int) 'P' }, { "watchfd", 1, NULL, (int) 'd' }, { "average-rate-window", 1, NULL, (int) 'm' }, #ifdef ENABLE_DEBUGGING { "debug", 1, NULL, (int) '!' }, #endif /* ENABLE_DEBUGGING */ { NULL, 0, NULL, 0 } }; /*@+nullassign@ */ int option_index = 0; #endif /* HAVE_GETOPT_LONG */ char *short_options = "hVpteIrab8TA:fnqcWD:s:l0i:w:H:N:F:L:B:CEZ:SYKXR:P:d:m:" #ifdef ENABLE_DEBUGGING "!:" #endif ; int c, numopts; unsigned int check_pid, parse_pid; int check_fd, parse_fd; opts_t opts; char *leafptr; opts = calloc(1, sizeof(*opts)); if (!opts) { /*@-mustfreefresh@ */ /* * splint note: the gettext calls made by _() cause memory * leak warnings, but in this case it's unavoidable, and * mitigated by the fact we only translate each string once. */ fprintf(stderr, "%s: %s: %s\n", argv[0], _("option structure allocation failed"), strerror(errno)); return NULL; /*@+mustfreefresh@ */ } leafptr = strrchr(argv[0], '/'); if (NULL != leafptr) { opts->program_name = 1 + leafptr; } else { leafptr = argv[0]; /* avoid splint "keep" warnings */ opts->program_name = leafptr; } opts->argc = 0; opts->argv = calloc((size_t) (argc + 1), sizeof(char *)); if (NULL == opts->argv) { /*@-mustfreefresh@ */ /* splint note: as above. */ fprintf(stderr, "%s: %s: %s\n", opts->program_name, _("option structure argv allocation failed"), strerror(errno)); free(opts); /* can't call opts_free as argv is not set */ return NULL; /*@+mustfreefresh@ */ } opts->argv_length = 1 + argc; numopts = 0; opts->interval = 1; opts->delay_start = 0; opts->watch_pid = 0; opts->watch_fd = -1; opts->average_rate_window = 30; opts->width_set_manually = false; opts->height_set_manually = false; do { #ifdef HAVE_GETOPT_LONG c = getopt_long((int) argc, argv, short_options, long_options, &option_index); /* flawfinder: ignore */ #else c = getopt((int) argc, argv, short_options); /* flawfinder: ignore */ #endif /* * flawfinder rationale: we have to pass argv to getopt, and * limiting the argument sizes would be impractical and * cumbersome (and likely lead to more bugs); so we have to * trust the system getopt to not have internal buffer * overflows. */ if (c < 0) continue; /* * Check that any numeric arguments are of the right type. */ switch (c) { case 's': /* "-s @" is valid, so allow it. */ if ('@' == *optarg) break; /* falls through */ /*@fallthrough@ */ case 'A': /*@fallthrough@ */ case 'w': /*@fallthrough@ */ case 'H': /*@fallthrough@ */ case 'L': /*@fallthrough@ */ case 'B': /*@fallthrough@ */ case 'R': /*@fallthrough@ */ case 'm': /*@fallthrough@ */ case 'Z': if (!pv_getnum_check(optarg, PV_NUMTYPE_INTEGER)) { /*@-mustfreefresh@ *//* see above */ fprintf(stderr, "%s: -%c: %s\n", opts->program_name, c, _("integer argument expected")); opts_free(opts); return NULL; /*@+mustfreefresh@ */ } break; case 'i': /*@fallthrough@ */ case 'D': if (!pv_getnum_check(optarg, PV_NUMTYPE_DOUBLE)) { /*@-mustfreefresh@ *//* see above */ fprintf(stderr, "%s: -%c: %s\n", opts->program_name, c, _("numeric argument expected")); opts_free(opts); return NULL; /*@+mustfreefresh@ */ } break; case 'd': if (sscanf(optarg, "%u:%d", &check_pid, &check_fd) < 1) { /*@-mustfreefresh@ *//* see above */ fprintf(stderr, "%s: -%c: %s\n", opts->program_name, c, _("process ID or pid:fd pair expected")); opts_free(opts); return NULL; /*@+mustfreefresh@ */ } if (check_pid < 1) { /*@-mustfreefresh@ *//* see above */ fprintf(stderr, "%s: -%c: %s\n", opts->program_name, c, _("invalid process ID")); opts_free(opts); return NULL; /*@+mustfreefresh@ */ } break; default: break; } /* * Parse each command line option. */ switch (c) { case 'h': display_help(); opts->do_nothing = true; return opts; /* early return */ case 'V': display_version(); opts->do_nothing = true; return opts; /* early return */ case 'p': opts->progress = true; numopts++; break; case 't': opts->timer = true; numopts++; break; case 'I': opts->fineta = true; numopts++; break; case 'e': opts->eta = true; numopts++; break; case 'r': opts->rate = true; numopts++; break; case 'a': opts->average_rate = true; numopts++; break; case 'b': opts->bytes = true; numopts++; break; case '8': opts->bytes = true; opts->bits = true; numopts++; break; case 'T': opts->bufpercent = true; numopts++; opts->no_splice = true; break; case 'A': opts->lastwritten = (size_t) pv_getnum_count(optarg); numopts++; opts->no_splice = true; break; case 'f': opts->force = true; break; case 'n': opts->numeric = true; numopts++; break; case 'q': opts->no_display = true; numopts++; break; case 'c': opts->cursor = true; break; case 'W': opts->wait = true; break; case 'D': opts->delay_start = pv_getnum_interval(optarg); break; case 's': /* Permit "@" as well as just a number. */ if ('@' == *optarg) { const char *size_file = 1 + optarg; struct stat sb; int rc; rc = 0; memset(&sb, 0, sizeof(sb)); rc = stat(size_file, &sb); if (0 == rc) { opts->size = (off_t) (sb.st_size); } else { /*@-mustfreefresh@ *//* see above */ fprintf(stderr, "%s: %s %s: %s\n", opts->program_name, _("failed to stat file"), size_file, strerror(errno)); opts_free(opts); return NULL; /*@+mustfreefresh@ */ } } else { opts->size = pv_getnum_size(optarg); } break; case 'l': opts->linemode = true; break; case '0': opts->null_terminated_lines = true; opts->linemode = true; break; case 'i': opts->interval = pv_getnum_interval(optarg); break; case 'w': opts->width = pv_getnum_count(optarg); opts->width_set_manually = opts->width == 0 ? false : true; break; case 'H': opts->height = pv_getnum_count(optarg); opts->height_set_manually = opts->height == 0 ? false : true; break; case 'N': opts->name = pv_strdup(optarg); if (NULL == opts->name) { fprintf(stderr, "%s: -N: %s\n", opts->program_name, strerror(errno)); opts_free(opts); return NULL; } break; case 'L': opts->rate_limit = pv_getnum_size(optarg); break; case 'B': opts->buffer_size = (size_t) pv_getnum_size(optarg); opts->no_splice = true; break; case 'C': opts->no_splice = true; break; case 'E': opts->skip_errors++; break; case 'Z': opts->error_skip_block = pv_getnum_size(optarg); break; case 'S': opts->stop_at_size = true; break; case 'Y': opts->sync_after_write = true; break; case 'K': opts->direct_io = true; break; case 'X': opts->discard_input = true; opts->no_splice = true; break; case 'R': opts->remote = pv_getnum_count(optarg); break; case 'P': opts->pidfile = pv_strdup(optarg); if (NULL == opts->pidfile) { fprintf(stderr, "%s: -P: %s\n", opts->program_name, strerror(errno)); opts_free(opts); return NULL; } break; case 'F': opts->format = pv_strdup(optarg); if (NULL == opts->format) { fprintf(stderr, "%s: -F: %s\n", opts->program_name, strerror(errno)); opts_free(opts); return NULL; } break; case 'd': parse_pid = 0; parse_fd = -1; /* No syntax check here, already done earlier */ (void) sscanf(optarg, "%u:%d", &parse_pid, &parse_fd); opts->watch_pid = (pid_t) parse_pid; opts->watch_fd = parse_fd; break; case 'm': opts->average_rate_window = pv_getnum_count(optarg); break; #ifdef ENABLE_DEBUGGING case '!': debugging_output_destination(optarg); break; #endif /* ENABLE_DEBUGGING */ default: /*@-mustfreefresh@ *//* see above */ /*@-formatconst@ */ #ifdef HAVE_GETOPT_LONG fprintf(stderr, _("Try `%s --help' for more information."), opts->program_name); #else fprintf(stderr, _("Try `%s -h' for more information."), opts->program_name); #endif /*@+formatconst@ */ /* * splint note: formatconst is warning about the use * of a non constant (translatable) format string; * this is unavoidable here and the only attack * vector is through the message catalogue. */ fprintf(stderr, "\n"); opts_free(opts); opts = NULL; return NULL; /* early return */ /*@+mustfreefresh@ */ } } while (c != -1); /* * splint thinks we can reach here after opts_free() and opts=NULL * above, so explicitly return here if opts was set to NULL. */ if (NULL == opts) return NULL; if (0 != opts->watch_pid) { if (opts->linemode || opts->null_terminated_lines || opts->stop_at_size || (opts->skip_errors > 0) || (opts->buffer_size > 0) || (opts->rate_limit > 0)) { /*@-mustfreefresh@ *//* see above */ fprintf(stderr, "%s: %s\n", opts->program_name, _("cannot use line mode or transfer modifier options when watching file descriptors")); opts_free(opts); return NULL; /*@+mustfreefresh@ */ } if (opts->cursor) { /*@-mustfreefresh@ *//* see above */ fprintf(stderr, "%s: %s\n", opts->program_name, _("cannot use cursor positioning when watching file descriptors")); opts_free(opts); return NULL; /*@+mustfreefresh@ */ } if (0 != opts->remote) { /*@-mustfreefresh@ *//* see above */ fprintf(stderr, "%s: %s\n", opts->program_name, _("cannot use remote control when watching file descriptors")); opts_free(opts); return NULL; /*@+mustfreefresh@ */ } if (optind < (int) argc) { /*@-mustfreefresh@ *//* see above */ fprintf(stderr, "%s: %s\n", opts->program_name, _("cannot transfer files when watching file descriptors")); opts_free(opts); return NULL; /*@+mustfreefresh@ */ } #ifndef __APPLE__ if (0 != access("/proc/self/fdinfo", X_OK)) { /* flawfinder: ignore */ /* * flawfinder rationale: access() is used here as a * low cost stat() to see whether the path exists at * all, under a path only modifiable by root, so is * unlikely to be exploitable. */ /*@-mustfreefresh@ *//* see above */ fprintf(stderr, "%s: -d: %s\n", opts->program_name, _("not available on systems without /proc/self/fdinfo")); opts_free(opts); return NULL; /*@+mustfreefresh@ */ } #endif } /* * Default options: -pterb */ if (0 == numopts) { opts->progress = true; opts->timer = true; opts->eta = true; opts->rate = true; opts->bytes = true; } /* If -Z was given but not -E, pretend one -E was given too. */ if (opts->error_skip_block > 0 && 0 == opts->skip_errors) opts->skip_errors = 1; /* * Store remaining command-line arguments. */ while (optind < (int) argc) { if (!opts_add_file(opts, argv[optind++])) { opts_free(opts); return NULL; } } return opts; } /* EOF */ pv-1.8.5/src/main/remote.c000066400000000000000000000265051452655021700153430ustar00rootroot00000000000000/* * Remote-control functions. * * Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023 Andrew Wood * * License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'. */ #include "config.h" #include "options.h" #include "pv.h" #include #include #include #include #include #include #include #include #include #include #ifdef SA_SIGINFO void pv_error(pvstate_t, char *, ...); struct remote_msg { bool progress; /* progress bar flag */ bool timer; /* timer flag */ bool eta; /* ETA flag */ bool fineta; /* absolute ETA flag */ bool rate; /* rate counter flag */ bool average_rate; /* average rate counter flag */ bool bytes; /* bytes transferred flag */ bool bufpercent; /* transfer buffer percentage flag */ size_t lastwritten; /* last-written bytes count */ off_t rate_limit; /* rate limit, in bytes per second */ size_t buffer_size; /* buffer size, in bytes (0=default) */ off_t size; /* total size of data */ double interval; /* interval between updates */ unsigned int width; /* screen width */ unsigned int height; /* screen height */ bool width_set_manually; /* width was set manually, not detected */ bool height_set_manually; /* height was set manually, not detected */ char name[256]; /* flawfinder: ignore */ char format[256]; /* flawfinder: ignore */ }; /* * flawfinder rationale: name and format are always explicitly zeroed and * bounded to one less than their size so they are always \0 terminated. */ /* * Return a stream pointer, and populate the filename buffer, for a control * file associated with a particular process ID; it will be opened for * writing if "sender" is true. Returns NULL on error. */ static FILE *pv__control_file(char *filename, size_t bufsize, pid_t control_pid, bool sender) { int open_flags, open_mode, control_fd; FILE *control_fptr; open_flags = O_RDONLY; #ifdef O_NOFOLLOW open_flags += O_NOFOLLOW; #endif if (sender) open_flags = O_WRONLY | O_CREAT | O_EXCL; open_mode = 0644; (void) pv_snprintf(filename, bufsize, "/run/user/%lu/pv.remote.%lu", (unsigned long) geteuid(), (unsigned long) control_pid); control_fd = open(filename, open_flags, open_mode); /* flawfinder: ignore */ /* * If /run/user/ wasn't usable, try $HOME/.pv instead. */ if (control_fd < 0) { char *home_dir; home_dir = getenv("HOME"); /* flawfinder: ignore */ if (NULL == home_dir) return NULL; (void) pv_snprintf(filename, bufsize, "%s/.pv/remote.%lu", home_dir, (unsigned long) control_pid); control_fd = open(filename, open_flags, open_mode); /* flawfinder: ignore */ /* * If the open failed, try creating the $HOME/.pv directory * first. */ if (control_fd < 0) { (void) pv_snprintf(filename, bufsize, "%s/.pv", home_dir); (void) mkdir(filename, 0700); /* In case of weird umask, explicitly chmod the dir. */ (void) chmod(filename, 0700); /* flawfinder: ignore */ (void) pv_snprintf(filename, bufsize, "%s/.pv/remote.%lu", home_dir, (unsigned long) control_pid); control_fd = open(filename, open_flags, open_mode); /* flawfinder: ignore */ } } /* * flawfinder rationale: the files are in a directory whose parents * cannot be manipulated, and we are not allowing the final * component to be a symbolic link. We are checking that $HOME is * not NULL, and it's bounded by pv_snprintf() so it can't overshoot * the filename buffer. When we chmod $HOME/.pv, we assume that an * attacker is unlikely to be able to manipulate $HOME's contents to * make use of us setting $HOME/.pv to mode 700. */ if (control_fd < 0) return NULL; debug("%s: %s", "control filename", filename); control_fptr = fdopen(control_fd, sender ? "wb" : "rb"); return control_fptr; } /* * Set the options of a remote process by writing them to a file, sending a * signal to the receiving process, and waiting for the message to be * consumed by the remote process. * * Returns nonzero on error. */ int pv_remote_set(opts_t opts, pvstate_t state) { char control_filename[4096]; /* flawfinder: ignore */ FILE *control_fptr; struct remote_msg msgbuf; pid_t signal_sender; long timeout; bool received; /* * flawfinder rationale: buffer is large enough, explicitly zeroed, * and always bounded properly as we are only writing to it with * pv_snprintf(). */ /* * Check that the remote process exists. */ if (kill((pid_t) (opts->remote), 0) != 0) { pv_error(state, "%u: %s", opts->remote, strerror(errno)); return 1; } /* * Make sure parameters are within sensible bounds. */ if (opts->width < 1) opts->width = 80; if (opts->height < 1) opts->height = 25; if (opts->width > 999999) opts->width = 999999; if (opts->height > 999999) opts->height = 999999; if ((opts->interval > 0) && (opts->interval < 0.1)) opts->interval = 0.1; if (opts->interval > 600) opts->interval = 600; /* * Copy parameters into message buffer. */ memset(&msgbuf, 0, sizeof(msgbuf)); msgbuf.progress = opts->progress; msgbuf.timer = opts->timer; msgbuf.eta = opts->eta; msgbuf.fineta = opts->fineta; msgbuf.rate = opts->rate; msgbuf.average_rate = opts->average_rate; msgbuf.bytes = opts->bytes; msgbuf.bufpercent = opts->bufpercent; msgbuf.lastwritten = opts->lastwritten; msgbuf.rate_limit = opts->rate_limit; msgbuf.buffer_size = opts->buffer_size; msgbuf.size = opts->size; msgbuf.interval = opts->interval; msgbuf.width = opts->width; msgbuf.height = opts->height; msgbuf.width_set_manually = opts->width_set_manually; msgbuf.height_set_manually = opts->height_set_manually; if (opts->name != NULL) { strncpy(msgbuf.name, opts->name, sizeof(msgbuf.name) - 1); /* flawfinder: ignore */ } if (opts->format != NULL) { strncpy(msgbuf.format, opts->format, sizeof(msgbuf.format) - 1); /* flawfinder: ignore */ } /* * flawfinder rationale: both name and format are explicitly bounded * to 1 less than the size of their buffer and the buffer is \0 * terminated by memset() earlier. */ /* * Get the filename and file stream to use for remote control. */ memset(control_filename, 0, sizeof(control_filename)); control_fptr = pv__control_file(control_filename, sizeof(control_filename), getpid(), true); if (NULL == control_fptr) { pv_error(state, "%s", strerror(errno)); return 1; } /* * Write the message buffer to the remote control file, and close * it. */ if (1 != fwrite(&msgbuf, sizeof(msgbuf), 1, control_fptr)) { pv_error(state, "%s", strerror(errno)); (void) fclose(control_fptr); (void) remove(control_filename); return 1; } if (0 != fclose(control_fptr)) { pv_error(state, "%s", strerror(errno)); (void) remove(control_filename); return 1; } /* * Send a SIGUSR2 signal to the remote process, to tell it a message * is ready to read, after clearing our own "SIGUSR2 received" flag. */ signal_sender = 0; (void) pv_sigusr2_received(state, &signal_sender); if (kill((pid_t) (opts->remote), SIGUSR2) != 0) { pv_error(state, "%u: %s", opts->remote, strerror(errno)); (void) remove(control_filename); return 1; } debug("%s", "message sent"); /* * Wait for a signal from the remote process to say it has received * the message. */ timeout = 1100000; received = false; while (timeout > 10000 && !received) { struct timeval tv; memset(&tv, 0, sizeof(tv)); tv.tv_sec = 0; tv.tv_usec = 10000; /*@-nullpass@ *//* splint: NULL is OK with select() */ (void) select(0, NULL, NULL, NULL, &tv); /*@+nullpass@ */ timeout -= 10000; if (pv_sigusr2_received(state, &signal_sender)) { if (signal_sender == opts->remote) { debug("%s", "message received"); received = true; } } } /* * Remove the remote control file. */ if (0 != remove(control_filename)) { pv_error(state, "%s", strerror(errno)); } /* * Return 0 if the message was received. */ if (received) return 0; /*@-mustfreefresh@ */ /* * splint note: the gettext calls made by _() cause memory leak * warnings, but in this case it's unavoidable, and mitigated by the * fact we only translate each string once. */ pv_error(state, "%u: %s", opts->remote, _("message not received")); return 1; /*@+mustfreefresh @ */ } /* * Check for a remote control message and, if there is one, replace the * current process's options with those being passed in. * * NB relies on pv_state_set_format() causing the output format to be * reparsed. */ void pv_remote_check(pvstate_t state) { pid_t signal_sender; char control_filename[4096]; /* flawfinder: ignore */ FILE *control_fptr; struct remote_msg msgbuf; /* flawfinder rationale: as above. */ /* * Return early if a SIGUSR2 signal has not been received. */ signal_sender = 0; if (!pv_sigusr2_received(state, &signal_sender)) return; memset(control_filename, 0, sizeof(control_filename)); control_fptr = pv__control_file(control_filename, sizeof(control_filename), signal_sender, false); if (NULL == control_fptr) { pv_error(state, "%s", strerror(errno)); return; } /* * Read the message buffer from the remote control file, and close * it. */ if (1 != fread(&msgbuf, sizeof(msgbuf), 1, control_fptr)) { pv_error(state, "%s", strerror(errno)); (void) fclose(control_fptr); return; } if (0 != fclose(control_fptr)) { pv_error(state, "%s", strerror(errno)); return; } /* * Send a SIGUSR2 signal to the sending process, to tell it the * message has been received. */ if (kill(signal_sender, SIGUSR2) != 0) { debug("%u: %s", signal_sender, strerror(errno)); } debug("%s", "received remote message"); pv_state_format_string_set(state, NULL); pv_state_name_set(state, NULL); msgbuf.name[sizeof(msgbuf.name) - 1] = '\0'; msgbuf.format[sizeof(msgbuf.format) - 1] = '\0'; pv_state_set_format(state, msgbuf.progress, msgbuf.timer, msgbuf.eta, msgbuf.fineta, msgbuf.rate, msgbuf.average_rate, msgbuf.bytes, msgbuf.bufpercent, msgbuf.lastwritten, '\0' == msgbuf.name[0] ? NULL : msgbuf.name); if (msgbuf.rate_limit > 0) pv_state_rate_limit_set(state, msgbuf.rate_limit); if (msgbuf.buffer_size > 0) { pv_state_target_buffer_size_set(state, msgbuf.buffer_size); } if (msgbuf.size > 0) pv_state_size_set(state, msgbuf.size); if (msgbuf.interval > 0) pv_state_interval_set(state, msgbuf.interval); if (msgbuf.width > 0 && msgbuf.width_set_manually) pv_state_width_set(state, msgbuf.width, msgbuf.width_set_manually); if (msgbuf.height > 0 && msgbuf.height_set_manually) pv_state_height_set(state, msgbuf.height, msgbuf.height_set_manually); if (msgbuf.format[0] != '\0') pv_state_format_string_set(state, msgbuf.format); } /* * Initialise remote message reception handling. */ void pv_remote_init(void) { } /* * Clean up after remote message reception handling. */ void pv_remote_fini(void) { } #else /* !SA_SIGINFO */ /* * Dummy stubs for remote control when we don't have SA_SIGINFO. */ void pv_remote_init(void) { } void pv_remote_check( /*@unused@ */ __attribute__((unused)) pvstate_t state) { } void pv_remote_fini(void) { } int pv_remote_set( /*@unused@ */ __attribute__((unused)) opts_t opts, /*@unused@ */ __attribute__((unused)) pvstate_t state) { /*@-mustfreefresh@ *//* splint - see above */ fprintf(stderr, "%s\n", _("SA_SIGINFO not supported on this system")); /*@+mustfreefresh@ */ return 1; } #endif /* SA_SIGINFO */ /* EOF */ pv-1.8.5/src/main/version.c000066400000000000000000000022431452655021700155260ustar00rootroot00000000000000/* * Output version information to stdout. * * Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023 Andrew Wood * * License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'. */ #include "config.h" #include /* * Display current package version as per GNU standards. */ void display_version(void) { /*@-mustfreefresh@ */ /* * splint note: the gettext calls made by _() cause memory leak * warnings, but in this case it's unavoidable, and mitigated by the * fact we only translate each string once. */ /* GNU standard first line format: program and version only */ printf("%s %s\n", PACKAGE_NAME, PACKAGE_VERSION); /* GNU standard second line format - "Copyright" always in English */ printf("Copyright %s %s\n", "2023", "Andrew Wood"); /* GNU standard license line and free software notice */ printf("%s\n", _("License: GPLv3+ ")); printf("%s\n", _("This is free software: you are free to change and redistribute it.")); printf("%s\n", _("There is NO WARRANTY, to the extent permitted by law.")); /* Project web site link */ printf("\n%s: <%s>\n", _("Project web site"), PACKAGE_URL); } /* EOF */ pv-1.8.5/src/pv/000077500000000000000000000000001452655021700133755ustar00rootroot00000000000000pv-1.8.5/src/pv/cursor.c000066400000000000000000000455271452655021700150730ustar00rootroot00000000000000/* * Cursor positioning functions. * * If IPC is available, then a shared memory segment is used to co-ordinate * cursor positioning across multiple instances of `pv'. The shared memory * segment contains an integer which is the original "y" co-ordinate of the * first `pv' process. * * However, some OSes (FreeBSD and MacOS X so far) don't allow locking of a * terminal, so we try to use a lockfile if terminal locking doesn't work, * and finally abort if even that is unavailable. * * Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023 Andrew Wood * * License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'. */ #include "config.h" #include "pv.h" #include "pv-internal.h" #include #include #include #include #include #include #include #include #include #ifdef HAVE_IPC #include #include #ifdef HAVE_SYS_PARAM_H #include #endif #endif /* HAVE_IPC */ /* for basename() */ #ifdef HAVE_LIBGEN_H #include #endif /* * Write the given buffer to the given file descriptor, retrying until all * bytes have been written or an error has occurred. */ void pv_write_retry(int fd, const char *buf, size_t count) { while (count > 0) { ssize_t nwritten; nwritten = write(fd, buf, count); if (nwritten < 0) { if ((EINTR == errno) || (EAGAIN == errno)) { continue; } return; } if (nwritten < 1) return; count -= nwritten; buf += nwritten; } } /* * Create a per-euid, per-tty, lockfile in ${TMPDIR:-${TMP:-/tmp}} for the * tty on the given file descriptor. */ static void pv_crs_open_lockfile(pvstate_t state, int fd) { char *ttydev; char *tmpdir; int openflags; state->cursor.lock_fd = -1; ttydev = ttyname(fd); if (!ttydev) { if (!state->control.force) { pv_error(state, "%s: %s", _("failed to get terminal name"), strerror(errno)); } /* * If we don't know our terminal name, we can neither do IPC * nor make a lock file, so turn off cursor positioning. */ state->control.cursor = 0; debug("%s", "ttyname failed - cursor positioning disabled"); return; } /* * We used to look at the TMPDIR or TMP environment variables to * override the temporary directory, but this leads to less * predictable behaviour, and flawfinder points out that relying on * environment variables in this way is not safe. So the lock * directory is hard-coded to "/tmp" now (Sep 2023). */ tmpdir = "/tmp"; memset(state->cursor.lock_file, 0, PV_SIZEOF_CRS_LOCK_FILE); (void) pv_snprintf(state->cursor.lock_file, PV_SIZEOF_CRS_LOCK_FILE, "%s/pv-%s-%i.lock", tmpdir, basename(ttydev), (int) geteuid()); /* * Pawel Piatek - not everyone has O_NOFOLLOW, e.g. AIX doesn't. */ #ifdef O_NOFOLLOW openflags = O_RDWR | O_CREAT | O_NOFOLLOW; #else openflags = O_RDWR | O_CREAT; #endif state->cursor.lock_fd = open(state->cursor.lock_file, openflags, 0600); /* flawfinder: ignore */ /* * flawfinder rationale: we aren't truncating the lock file, we * don't change its contents, and we are attempting to use * O_NOFOLLOW where possible to avoid symlink attacks, so this * open() is as safe as we can make it. */ if (state->cursor.lock_fd < 0) { pv_error(state, "%s: %s: %s", state->cursor.lock_file, _("failed to open lock file"), strerror(errno)); state->control.cursor = 0; return; } } /* * Lock the terminal on the given file descriptor, falling back to using a * lockfile if the terminal itself cannot be locked. */ static void pv_crs_lock(pvstate_t state, int fd) { struct flock lock; int lock_fd; lock_fd = fd; if (state->cursor.lock_fd >= 0) lock_fd = state->cursor.lock_fd; memset(&lock, 0, sizeof(lock)); lock.l_type = (short) F_WRLCK; lock.l_whence = (short) SEEK_SET; lock.l_start = 0; lock.l_len = 1; while (fcntl(lock_fd, F_SETLKW, &lock) < 0) { if (errno != EINTR) { if (state->cursor.lock_fd == -2) { pv_crs_open_lockfile(state, fd); if (state->cursor.lock_fd >= 0) { lock_fd = state->cursor.lock_fd; } } else { pv_error(state, "%s: %s", _("lock attempt failed"), strerror(errno)); return; } } } if (state->cursor.lock_fd >= 0) { debug("%s: %s", state->cursor.lock_file, "terminal lockfile acquired"); } else { debug("%s", "terminal lock acquired"); } } /* * Unlock the terminal on the given file descriptor. If pv_crs_lock used * lockfile locking, unlock the lockfile. */ static void pv_crs_unlock(pvstate_t state, int fd) { struct flock lock; int lock_fd; lock_fd = fd; if (state->cursor.lock_fd >= 0) lock_fd = state->cursor.lock_fd; memset(&lock, 0, sizeof(lock)); lock.l_type = (short) F_UNLCK; lock.l_whence = (short) SEEK_SET; lock.l_start = 0; lock.l_len = 1; (void) fcntl(lock_fd, F_SETLK, &lock); if (state->cursor.lock_fd >= 0) { debug("%s: %s", state->cursor.lock_file, "terminal lockfile released"); } else { debug("%s", "terminal lock released"); } } #ifdef HAVE_IPC /* * Get the current number of processes attached to our shared memory * segment, i.e. find out how many `pv' processes in total are running in * cursor mode (including us), and store it in pv_crs_pvcount. If this is * larger than pv_crs_pvmax, update pv_crs_pvmax. */ static void pv_crs_ipccount(pvstate_t state) { struct shmid_ds buf; memset(&buf, 0, sizeof(buf)); buf.shm_nattch = 0; (void) shmctl(state->cursor.shmid, IPC_STAT, &buf); state->cursor.pvcount = (int) (buf.shm_nattch); if (state->cursor.pvcount > state->cursor.pvmax) state->cursor.pvmax = state->cursor.pvcount; debug("%s: %d", "pvcount", state->cursor.pvcount); } #endif /* HAVE_IPC */ /* * Get the current cursor Y co-ordinate by sending the ECMA-48 CPR code to * the terminal connected to the given file descriptor. * * This should only be called while the terminal is locked, to avoid * confusing other "pv -c" instances about the current terminal attributes, * since this function temporarily changes the terminal attributes and then * puts them back. */ static int pv_crs_get_ypos(int terminalfd) { struct termios tty; struct termios old_tty; char cpr[32]; /* flawfinder: ignore - bounded, zeroed */ int ypos; ssize_t r; #ifdef CURSOR_ANSWERBACK_BYTE_BY_BYTE int got; #endif /* CURSOR_ANSWERBACK_BYTE_BY_BYTE */ if (0 != tcgetattr(terminalfd, &tty)) { debug("%s: %s", "tcgetattr (1) failed", strerror(errno)); } if (0 != tcgetattr(terminalfd, &old_tty)) { debug("%s: %s", "tcgetattr (2) failed", strerror(errno)); } tty.c_lflag &= ~(ICANON | ECHO); if (0 != tcsetattr(terminalfd, TCSANOW | TCSAFLUSH, &tty)) { debug("%s: %s", "tcsetattr (1) failed", strerror(errno)); } pv_write_retry(terminalfd, "\033[6n", 4); memset(cpr, 0, sizeof(cpr)); #ifdef CURSOR_ANSWERBACK_BYTE_BY_BYTE /* Read answerback byte by byte - fails on AIX */ for (got = 0, r = 0; got < (int) (sizeof(cpr) - 2); got += r) { r = read(terminalfd, cpr + got, 1); /* flawfinder: ignore */ /* flawfinder rationale: bounded to buffer size by "for" */ if (r <= 0) { debug("got=%d, r=%d: %s", got, r, strerror(errno)); break; } if (cpr[got] == 'R') break; } debug ("read answerback message from fd %d, length %d - buf = %02X %02X %02X %02X %02X %02X", terminalfd, got, cpr[0], cpr[1], cpr[2], cpr[3], cpr[4], cpr[5]); #else /* !CURSOR_ANSWERBACK_BYTE_BY_BYTE */ /* Read answerback in one big lump - may fail on Solaris */ r = read(terminalfd, cpr, sizeof(cpr) - 2); /* flawfinder: ignore */ /* flawfinder rationale: bounded to buffer size */ if (r <= 0) { debug("r=%d: %s", r, strerror(errno)); } else { debug ("read answerback message from fd %d, length %d - buf = %02X %02X %02X %02X %02X %02X", terminalfd, r, cpr[0], cpr[1], cpr[2], cpr[3], cpr[4], cpr[5]); } #endif /* !CURSOR_ANSWERBACK_BYTE_BY_BYTE */ ypos = (int) pv_getnum_count(cpr + 2); if (0 != tcsetattr(terminalfd, TCSANOW | TCSAFLUSH, &old_tty)) { debug("%s: %s", "tcsetattr (2) failed", strerror(errno)); } debug("%s: %d", "ypos", ypos); return ypos; } #ifdef HAVE_IPC /* * Initialise the IPC data, returning nonzero on error. * * To do this, we attach to the shared memory segment (creating it if it * does not exist). If we are the only process attached to it, then we * initialise it with the current cursor position. * * There is a race condition here: another process could attach before we've * had a chance to check, such that no process ends up getting an "attach * count" of one, and so no initialisation occurs. So, we lock the terminal * with pv_crs_lock() while we are attaching and checking. */ static int pv_crs_ipcinit(pvstate_t state, char *ttyfile, int terminalfd) { key_t key; /* * Base the key for the shared memory segment on our current tty, so * we don't end up interfering in any way with instances of `pv' * running on another terminal. */ key = ftok(ttyfile, (int) 'p'); if (-1 == key) { debug("%s: %s\n", "ftok failed", strerror(errno)); return 1; } pv_crs_lock(state, terminalfd); if (!state->control.cursor) { debug("%s", "early return - cursor has been disabled"); return 1; } state->cursor.shmid = shmget(key, sizeof(struct pvcursorstate_s), 0600 | IPC_CREAT); if (state->cursor.shmid < 0) { debug("%s: %s", "shmget failed", strerror(errno)); pv_crs_unlock(state, terminalfd); return 1; } /*@-nullpass@ */ /* splint doesn't know shmaddr can be NULL */ state->cursor.shared = shmat(state->cursor.shmid, NULL, 0); /*@+nullpass@ */ pv_crs_ipccount(state); /* * If nobody else is attached to the shared memory segment, we're * the first, so we need to initialise the shared memory with our * current Y cursor co-ordinate and with an initial false value for * the TOSTOP-added flag. */ if (state->cursor.pvcount < 2) { state->cursor.y_start = pv_crs_get_ypos(terminalfd); state->cursor.shared->y_topmost = state->cursor.y_start; state->cursor.shared->tty_tostop_added = false; state->cursor.y_lastread = state->cursor.y_start; debug("%s", "we are the first to attach"); } state->cursor.y_offset = state->cursor.pvcount - 1; if (state->cursor.y_offset < 0) state->cursor.y_offset = 0; /* * If anyone else had attached to the shared memory segment, we need * to read the top Y co-ordinate from it. */ if (state->cursor.pvcount > 1) { state->cursor.y_start = state->cursor.shared->y_topmost; state->cursor.y_lastread = state->cursor.y_start; debug("%s: %d", "not the first to attach - got top y", state->cursor.y_start); } pv_crs_unlock(state, terminalfd); return 0; } #endif /* HAVE_IPC */ /* * Initialise the terminal for cursor positioning. */ void pv_crs_init(pvstate_t state) { char *ttyfile; int terminalfd; state->cursor.lock_fd = -2; state->cursor.lock_file[0] = '\0'; if (!state->control.cursor) return; debug("%s", "init"); ttyfile = ttyname(STDERR_FILENO); if (NULL == ttyfile) { debug("%s: %s", "disabling cursor positioning because ttyname failed", strerror(errno)); state->control.cursor = false; return; } terminalfd = open(ttyfile, O_RDWR); /* flawfinder: ignore */ /* * flawfinder rationale: the file we open won't be truncated but * could be corrupted by writes attempting to get the current Y * position; but we get the filename from ttyname() and it could be * a symbolic link, so we can't do much more than trust it. */ if (terminalfd < 0) { pv_error(state, "%s: %s: %s", _("failed to open terminal"), ttyfile, strerror(errno)); state->control.cursor = false; return; } #ifdef HAVE_IPC if (pv_crs_ipcinit(state, ttyfile, terminalfd) != 0) { debug("%s", "ipcinit failed, setting noipc flag"); state->cursor.noipc = true; } /* * If we have already set the terminal TOSTOP attribute, set the * flag in shared memory to let the other instances know. */ if ((!state->cursor.noipc) && state->signal.pv_tty_tostop_added && (NULL != state->cursor.shared)) { debug("%s", "propagating local pv_tty_tostop_added true value to shared flag"); state->cursor.shared->tty_tostop_added = true; } /* * If we are not using IPC, then we need to get the current Y * co-ordinate. If we are using IPC, then the pv_crs_ipcinit() * function takes care of this in a more multi-process-friendly way. */ if (state->cursor.noipc) { #else /* ! HAVE_IPC */ if (1) { #endif /* HAVE_IPC */ /* * Get current cursor position + 1. */ pv_crs_lock(state, terminalfd); state->cursor.y_start = pv_crs_get_ypos(terminalfd); /* * Move down a line while the terminal is locked, so that * other processes in the pipeline will get a different * initial ypos. */ if (state->cursor.y_start > 0) pv_write_retry(STDERR_FILENO, "\n", 1); pv_crs_unlock(state, terminalfd); if (state->cursor.y_start < 1) state->control.cursor = 0; } (void) close(terminalfd); } #ifdef HAVE_IPC /* * Set the "we need to reinitialise cursor positioning" flag. */ void pv_crs_needreinit(pvstate_t state) { state->cursor.needreinit += 2; if (state->cursor.needreinit > 3) state->cursor.needreinit = 3; } #endif #ifdef HAVE_IPC /* * Reinitialise the cursor positioning code (called if we are backgrounded * then foregrounded again). */ static void pv_crs_reinit(pvstate_t state) { debug("%s", "reinit"); pv_crs_lock(state, STDERR_FILENO); state->cursor.needreinit--; if (state->cursor.y_offset < 1) state->cursor.needreinit = 0; if (state->cursor.needreinit > 0) { pv_crs_unlock(state, STDERR_FILENO); return; } debug("%s", "reinit full"); state->cursor.y_start = pv_crs_get_ypos(STDERR_FILENO); if ((state->cursor.y_offset < 1) && (NULL != state->cursor.shared)) { state->cursor.shared->y_topmost = state->cursor.y_start; } state->cursor.y_lastread = state->cursor.y_start; pv_crs_unlock(state, STDERR_FILENO); } #endif /* * Output a single-line update (\0-terminated), using the ECMA-48 CSI "CUP" * sequence to move the cursor to the correct position to do so. */ void pv_crs_update(pvstate_t state, const char *output_line) { char cup_cmd[32]; /* flawfinder: ignore */ size_t cup_cmd_length, output_line_length; int y; /* * flawfinder rationale: the "cup_cmd" buffer is always zeroed * before each use, and is only written to by pv_snprintf() bounded * by its size; also, that function explictly zero-terminates the * string it writes. The write() call is also bounded. */ output_line_length = strlen(output_line); /* flawfinder: ignore */ /* flawfinder - output_line is explictly expected to be \0-terminated. */ #ifdef HAVE_IPC if (!state->cursor.noipc) { if (state->cursor.needreinit > 0) pv_crs_reinit(state); pv_crs_ipccount(state); if (NULL != state->cursor.shared) { if (state->cursor.y_lastread != state->cursor.shared->y_topmost) { state->cursor.y_start = state->cursor.shared->y_topmost; state->cursor.y_lastread = state->cursor.y_start; } } if (state->cursor.needreinit > 0) return; } #endif /* HAVE_IPC */ y = state->cursor.y_start; #ifdef HAVE_IPC /* * If the screen has scrolled, or is about to scroll, due to * multiple `pv' instances taking us near the bottom of the screen, * scroll the screen (only if we're the first `pv'), and then move * our initial Y co-ordinate up. */ if (((state->cursor.y_start + state->cursor.pvmax) > (int) (state->control.height)) && (!state->cursor.noipc) ) { int offs; offs = ((state->cursor.y_start + state->cursor.pvmax) - state->control.height); state->cursor.y_start -= offs; if (state->cursor.y_start < 1) state->cursor.y_start = 1; debug("%s: %d", "scroll offset", offs); /* * Scroll the screen if we're the first `pv'. */ if (0 == state->cursor.y_offset) { pv_crs_lock(state, STDERR_FILENO); memset(cup_cmd, 0, sizeof(cup_cmd)); (void) pv_snprintf(cup_cmd, sizeof(cup_cmd), "\033[%u;1H", state->control.height); cup_cmd_length = strlen(cup_cmd); /* flawfinder: ignore */ pv_write_retry(STDERR_FILENO, cup_cmd, cup_cmd_length); for (; offs > 0; offs--) { pv_write_retry(STDERR_FILENO, "\n", 1); } pv_crs_unlock(state, STDERR_FILENO); debug("%s", "we are the first - scrolled screen"); } } if (!state->cursor.noipc) y = state->cursor.y_start + state->cursor.y_offset; #endif /* HAVE_IPC */ /* * Keep the Y co-ordinate within sensible bounds, so we can never * overflow the "cup_cmd" buffer. */ if ((y < 1) || (y > 999999)) y = 1; memset(cup_cmd, 0, sizeof(cup_cmd)); (void) pv_snprintf(cup_cmd, sizeof(cup_cmd), "\033[%d;1H", y); cup_cmd_length = strlen(cup_cmd); /* flawfinder: ignore */ /* * flawfinder rationale: "cup_cmd" is only written to by * pv_snprintf(), which explicitly ensures that the string will be * \0-terminated, and the buffer is zeroed beforehand so if * pv_snprintf() fails to run the string will be of zero length. */ pv_crs_lock(state, STDERR_FILENO); pv_write_retry(STDERR_FILENO, cup_cmd, cup_cmd_length); pv_write_retry(STDERR_FILENO, output_line, output_line_length); pv_crs_unlock(state, STDERR_FILENO); } /* * Reposition the cursor to a final position. */ void pv_crs_fini(pvstate_t state) { char cup_cmd[32]; /* flawfinder: ignore */ unsigned int y; /* flawfinder - "cup_cmd" is zeroed, and only written by pv_snprintf() */ debug("%s", "fini"); y = (unsigned int) (state->cursor.y_start); #ifdef HAVE_IPC if ((state->cursor.pvmax > 0) && (!state->cursor.noipc)) y += state->cursor.pvmax - 1; #endif /* HAVE_IPC */ if (y > state->control.height) y = state->control.height; /* * Absolute bounds check. */ if ((y < 1) || (y > 999999)) y = 1; memset(cup_cmd, 0, sizeof(cup_cmd)); (void) pv_snprintf(cup_cmd, sizeof(cup_cmd), "\033[%u;1H\n", y); pv_crs_lock(state, STDERR_FILENO); pv_write_retry(STDERR_FILENO, cup_cmd, strlen(cup_cmd)); /* flawfinder: ignore */ /* flawfinder - pv_snprintf() always \0-terminates (see above). */ #ifdef HAVE_IPC /* * If any other "pv -c" instances have set the terminal TOSTOP * attribute, set our local flag so pv_sig_fini() will know about * it. */ if ((!state->cursor.noipc) && (NULL != state->cursor.shared) && state->cursor.shared->tty_tostop_added) { if (!state->signal.pv_tty_tostop_added) { debug("%s", "propagating shared tty_tostop_added true value to local flag"); state->signal.pv_tty_tostop_added = true; } } pv_crs_ipccount(state); if (NULL != state->cursor.shared) { (void) shmdt(state->cursor.shared); } state->cursor.shared = NULL; /* * If we are the last instance detaching from the shared memory, * delete it so it's not left lying around. */ if (state->cursor.pvcount < 2) { struct shmid_ds shm_buf; memset(&shm_buf, 0, sizeof(shm_buf)); (void) shmctl(state->cursor.shmid, IPC_RMID, &shm_buf); } #endif /* HAVE_IPC */ pv_crs_unlock(state, STDERR_FILENO); if (state->cursor.lock_fd >= 0) { (void) close(state->cursor.lock_fd); /* * We can get away with removing this on exit because all * the other PVs will be finishing at the same sort of time. */ (void) remove(state->cursor.lock_file); } } /* EOF */ pv-1.8.5/src/pv/display.c000066400000000000000000001204701452655021700152120ustar00rootroot00000000000000/* * Display functions. * * Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023 Andrew Wood * * License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'. */ #include "config.h" #include "pv.h" #include "pv-internal.h" #include #include #include #include #include #include #include #include #ifdef HAVE_TERMIOS_H #include #endif /* * We need sys/ioctl.h for ioctl() regardless of whether TIOCGWINSZ is * defined in termios.h, so we no longer use AC_HEADER_TIOCGWINSZ in * configure.in, and just include both header files if they are available. * (GH#74, 2023-08-06) */ #ifdef HAVE_SYS_IOCTL_H #include #endif /* * Output an error message. If we've displayed anything to the terminal * already, then put a newline before our error so we don't write over what * we've written. */ void pv_error(pvstate_t state, char *format, ...) { va_list ap; if (state->display.display_visible) fprintf(stderr, "\n"); fprintf(stderr, "%s: ", state->status.program_name); va_start(ap, format); (void) vfprintf(stderr, format, ap); /* flawfinder: ignore */ va_end(ap); fprintf(stderr, "\n"); /* * flawfinder: this function relies on callers always having a * static format string, not directly subject to outside influences. */ } /* * Return true if we are the foreground process on the terminal, or if we * aren't outputting to a terminal; false otherwise. */ bool pv_in_foreground(void) { pid_t our_process_group; pid_t tty_process_group; if (0 == isatty(STDERR_FILENO)) { debug("%s: true: %s", "pv_in_foreground", "not a tty"); return true; } /*@-type@ *//* __pid_t vs pid_t, not significant */ our_process_group = getpgrp(); tty_process_group = tcgetpgrp(STDERR_FILENO); /*@+type@ */ if (tty_process_group == -1 && errno == ENOTTY) { debug("%s: true: %s", "pv_in_foreground", "tty_process_group is -1, errno is ENOTTY"); return true; } if (our_process_group == tty_process_group) { debug("%s: true: %s", "pv_in_foreground", "our_process_group == tty_process_group"); return true; } debug("%s: false: our_process_group=%d, tty_process_group=%d", "pv_in_foreground", our_process_group, tty_process_group); return false; } /* * Fill in *width and *height with the current terminal size, * if possible. */ void pv_screensize(unsigned int *width, unsigned int *height) { #ifdef TIOCGWINSZ struct winsize wsz; memset(&wsz, 0, sizeof(wsz)); if (0 != isatty(STDERR_FILENO)) { if (0 == ioctl(STDERR_FILENO, TIOCGWINSZ, &wsz)) { *width = wsz.ws_col; *height = wsz.ws_row; } } #endif } /* * Calculate the percentage transferred so far and return it. */ static int pv__calc_percentage(off_t so_far, const off_t total) { if (total < 1) return 0; so_far *= 100; so_far /= total; return (int) so_far; } /* * Given how many bytes have been transferred, the total byte count to * transfer, and the current average transfer rate, return the estimated * number of seconds until completion. */ static long pv__seconds_remaining(const off_t so_far, const off_t total, const long double rate) { long double amount_left; if ((so_far < 1) || (rate < 0.001)) return 0; amount_left = (long double) (total - so_far) / rate; return (long) amount_left; } /* * Types of transfer count - bytes or lines. */ typedef enum { PV_TRANSFERCOUNT_BYTES, PV_TRANSFERCOUNT_LINES } pv__transfercount_t; /* * Given a long double value, it is divided or multiplied by the ratio until * a value in the range 1.0 to 999.999... is found. The string "prefix" to * is updated to the corresponding SI prefix. * * If the count type is PV_TRANSFERCOUNT_BYTES, then the second byte of * "prefix" is set to "i" to denote MiB etc (IEEE1541). Thus "prefix" * should be at least 3 bytes long (to include the terminating null). */ static void pv__si_prefix(long double *value, char *prefix, const long double ratio, pv__transfercount_t count_type) { static char *pfx_000 = NULL; /* kilo, mega, etc */ static char *pfx_024 = NULL; /* kibi, mibi, etc */ static char const *pfx_middle_000 = NULL; static char const *pfx_middle_024 = NULL; char *pfx; char const *pfx_middle; char const *pfx_ptr; long double cutoff; prefix[0] = ' '; /* Make the prefix start blank. */ prefix[1] = '\0'; /* * The prefix list strings have a space (no prefix) in the middle; * moving right from the space gives the prefix letter for each * increasing multiple of 1000 or 1024 - such as kilo, mega, giga - * and moving left from the space gives the prefix letter for each * decreasing multiple - such as milli, micro, nano. */ /* * Prefix list for multiples of 1000. */ if (NULL == pfx_000) { /*@-onlytrans@ */ pfx_000 = _("yzafpnum kMGTPEZY"); /* * splint: this is only looked up once in the program's run, * so the memory leak is negligible. */ /*@+onlytrans@ */ if (NULL == pfx_000) { debug("%s", "prefix list was NULL"); return; } pfx_middle_000 = strchr(pfx_000, ' '); } /* * Prefix list for multiples of 1024. */ if (NULL == pfx_024) { /*@-onlytrans@ */ pfx_024 = _("yzafpnum KMGTPEZY"); /*@+onlytrans@ *//* splint: see above. */ if (NULL == pfx_024) { debug("%s", "prefix list was NULL"); return; } pfx_middle_024 = strchr(pfx_024, ' '); } pfx = pfx_000; pfx_middle = pfx_middle_000; if (count_type == PV_TRANSFERCOUNT_BYTES) { /* bytes - multiples of 1024 */ pfx = pfx_024; pfx_middle = pfx_middle_024; } pfx_ptr = pfx_middle; if (NULL == pfx_ptr) { debug("%s", "prefix middle was NULL"); return; } /* * Force an empty prefix if the value is almost zero, to avoid * "0yB". NB we don't compare directly with zero because of * potential floating-point inaccuracies. * * See the "count_type" check below for the reason we add another * space in bytes mode. */ if ((*value > -0.00000001) && (*value < 0.00000001)) { if (count_type == PV_TRANSFERCOUNT_BYTES) { prefix[1] = ' '; prefix[2] = '\0'; } return; } /* * Cut-off for moving to the next prefix - a little less than the * ratio (970 for ratio=1000, 993 for ratio=1024). */ cutoff = ratio * 0.97; /* * Divide by the ratio until the value is a little below the ratio, * moving along the prefix list with each division to get the * associated prefix letter, so that for example 20000 becomes 20 * with a "k" (kilo) prefix. */ if (*value > 0) { /* Positive values */ while ((*value > cutoff) && (*(pfx_ptr += 1) != '\0')) { *value /= ratio; prefix[0] = *pfx_ptr; } } else { /* Negative values */ cutoff = 0 - cutoff; while ((*value < cutoff) && (*(pfx_ptr += 1) != '\0')) { *value /= ratio; prefix[0] = *pfx_ptr; } } /* * Multiply by the ratio until the value is at least 1, moving in * the other direction along the prefix list to get the associated * prefix letter - so for example a value of 0.5 becomes 500 with a * "m" (milli) prefix. */ if (*value > 0) { /* Positive values */ while ((*value < 1.0) && ((pfx_ptr -= 1) != (pfx - 1))) { *value *= ratio; prefix[0] = *pfx_ptr; } } else { /* Negative values */ while ((*value > -1.0) && ((pfx_ptr -= 1) != (pfx - 1))) { *value *= ratio; prefix[0] = *pfx_ptr; } } /* * Byte prefixes (kibi, mebi, etc) are of the form "KiB" rather than * "KB", so that's two characters, not one - meaning that for just * "B", the prefix is two spaces, not one. */ if (count_type == PV_TRANSFERCOUNT_BYTES) { prefix[1] = (prefix[0] == ' ' ? ' ' : 'i'); prefix[2] = '\0'; } } /* * Put a string in "buffer" (max length "bufsize") containing "amount" * formatted such that it's 3 or 4 digits followed by an SI suffix and then * whichever of "suffix_basic" or "suffix_bytes" is appropriate (whether * "count_type" is PV_TRANSFERTYPE_LINES for non-byte amounts or * PV_TRANSFERTYPE_BYTES for byte amounts). If "count_type" is * PV_TRANSFERTYPE_BYTES then the SI units are KiB, MiB etc and the divisor * is 1024 instead of 1000. * * The "format" string is in sprintf format and must contain exactly one % * parameter (a %s) which will expand to the string described above. */ static void pv__sizestr(char *buffer, size_t bufsize, char *format, long double amount, char *suffix_basic, char *suffix_bytes, pv__transfercount_t count_type) { char sizestr_buffer[256]; /* flawfinder: ignore */ char si_prefix[8]; /* flawfinder: ignore */ long double divider; long double display_amount; char *suffix; /* * flawfinder: sizestr_buffer and si_prefix are explicitly zeroed; * sizestr_buffer is only ever used with pv_snprintf() along with * its buffer size; si_prefix is only populated by pv_snprintf() * along with its size, and by pv__si_prefix() which explicitly only * needs 3 bytes. */ memset(sizestr_buffer, 0, sizeof(sizestr_buffer)); memset(si_prefix, 0, sizeof(si_prefix)); (void) pv_snprintf(si_prefix, sizeof(si_prefix), "%s", " "); if (count_type == PV_TRANSFERCOUNT_BYTES) { suffix = suffix_bytes; divider = 1024.0; } else { suffix = suffix_basic; divider = 1000.0; } display_amount = amount; pv__si_prefix(&display_amount, si_prefix, divider, count_type); /* Make sure we don't overrun our buffer. */ if (display_amount > 100000) display_amount = 100000; if (display_amount < -100000) display_amount = -100000; /* Fix for display of "1.01e+03" instead of "1010" */ if ((display_amount > 99.9) || (display_amount < -99.9)) { (void) pv_snprintf(sizestr_buffer, sizeof(sizestr_buffer), "%4ld%.2s%.16s", (long) display_amount, si_prefix, suffix); } else { /* * AIX blows up with %4.3Lg%.2s%.16s for some reason, so we * write display_amount separately first. */ char str_disp[64]; /* flawfinder: ignore - only used with pv_snprintf(). */ memset(str_disp, 0, sizeof(str_disp)); /* # to get 13.0GB instead of 13GB (#1477) */ (void) pv_snprintf(str_disp, sizeof(str_disp), "%#4.3Lg", display_amount); (void) pv_snprintf(sizestr_buffer, sizeof(sizestr_buffer), "%s%.2s%.16s", str_disp, si_prefix, suffix); } (void) pv_snprintf(buffer, bufsize, format, sizestr_buffer); } /* * Initialise the output format structure, based on the current options. */ static void pv__format_init(pvstate_t state) { const char *formatstr; size_t strpos; size_t segment; if (NULL == state) return; state->display.format_segment_count = 0; memset(state->display.format, 0, PV_FORMAT_ARRAY_MAX * sizeof(state->display.format[0])); memset(state->display.component, 0, PV_COMPONENT__MAX * sizeof(state->display.component[0])); if (state->control.name) { (void) pv_snprintf(state->display.component[PV_COMPONENT_NAME].content, PV_SIZEOF_COMPONENT_STR, "%9.500s:", state->control.name); state->display.component[PV_COMPONENT_NAME].length = strlen(state->display.component[PV_COMPONENT_NAME].content); /* flawfinder: ignore */ /* flawfinder: content always bounded thanks to pv_snprintf(). */ } formatstr = state->control.format_string ? state->control.format_string : state->control.default_format; if (NULL == formatstr) return; /* * Split the format string into segments. Each segment consists * of a type and some string information. * * A type of PV_COMPONENT_STRING indicates that the segment is a * constant string starting at a position in the format string and * with a particular length. * * A type other than PV_COMPONENT_STRING indicates that the segment * is a string updated by pv__format(), whose contents will be in * component[type]. * * In pv__format(), the content of a PV_COMPONENT_PROGRESS component * is calculated after first populating all the other components * referenced by the format segments. * * Then, pv_format() generates the output string by sticking all of * these segments together. */ segment = 0; for (strpos = 0; formatstr[strpos] != '\0' && segment < PV_FORMAT_ARRAY_MAX; strpos++, segment++) { pv_display_component seg_type; size_t str_start, str_length; if ('%' == formatstr[strpos]) { unsigned long number_prefix; #if HAVE_STRTOUL char *number_end_ptr; #endif strpos++; /* * Check for a numeric prefix between the % and the * format character - currently only used with "%A". */ #if HAVE_STRTOUL number_end_ptr = NULL; number_prefix = strtoul(&(formatstr[strpos]), &number_end_ptr, 10); if ((NULL == number_end_ptr) || (number_end_ptr[0] == '\0')) break; if (number_end_ptr > &(formatstr[strpos])) strpos += (number_end_ptr - &(formatstr[strpos])); #else /* !HAVE_STRTOUL */ while (isdigit((int) (formatstr[strpos]))) { number_prefix = number_prefix * 10; number_prefix += formatstr[strpos] - '0'; strpos++; } #endif /* !HAVE_STRTOUL */ seg_type = PV_COMPONENT_STRING; str_start = 0; str_length = 0; switch (formatstr[strpos]) { case 'p': seg_type = PV_COMPONENT_PROGRESS; break; case 't': seg_type = PV_COMPONENT_TIMER; break; case 'e': seg_type = PV_COMPONENT_ETA; break; case 'I': seg_type = PV_COMPONENT_FINETA; break; case 'A': seg_type = PV_COMPONENT_OUTPUTBUF; if (number_prefix > PV_SIZEOF_LASTOUTPUT_BUFFER) number_prefix = PV_SIZEOF_LASTOUTPUT_BUFFER; if (number_prefix < 1) number_prefix = 1; state->display.lastoutput_length = (size_t) number_prefix; break; case 'r': seg_type = PV_COMPONENT_RATE; break; case 'a': seg_type = PV_COMPONENT_AVERAGERATE; break; case 'b': seg_type = PV_COMPONENT_BYTES; break; case 'T': seg_type = PV_COMPONENT_BUFPERCENT; break; case 'N': seg_type = PV_COMPONENT_NAME; break; case '%': /* %% => % */ seg_type = PV_COMPONENT_STRING; str_start = strpos; str_length = 1; break; case '\0': /* % at end => just % */ seg_type = PV_COMPONENT_STRING; str_start = strpos - 1; str_length = 1; break; default: /* %z (unknown) => %z */ seg_type = PV_COMPONENT_STRING; str_start = strpos - 1; str_length = 2; break; } } else { const char *searchptr; int foundlength; searchptr = strchr(&(formatstr[strpos]), '%'); if (NULL == searchptr) { foundlength = (int) strlen(&(formatstr[strpos])); /* flawfinder: ignore */ /* flawfinder: formatstr is explicitly \0-terminated. */ } else { foundlength = searchptr - &(formatstr[strpos]); } seg_type = PV_COMPONENT_STRING; str_start = strpos; str_length = (size_t) foundlength; strpos += foundlength - 1; } if (seg_type != PV_COMPONENT_STRING) state->display.component[seg_type].required = true; state->display.format[segment].type = seg_type; state->display.format[segment].str_start = str_start; state->display.format[segment].str_length = str_length; state->display.format_segment_count++; } } /* * Return the original value x so that it has been clamped between * [min..max] */ static long bound_long(long x, long min, long max) { return x < min ? min : x > max ? max : x; } /* * Update the current average rate, using a ring buffer of past transfer * positions - if this is the first entry, use the provided instantaneous * rate, otherwise calulate the average rate from the difference between the * current position + elapsed time pair, and the oldest pair in the buffer. */ static void pv__update_average_rate_history(pvstate_t state, off_t total_bytes, long double elapsed_sec, long double rate) { size_t first = state->display.history_first; size_t last = state->display.history_last; long double last_elapsed; if (NULL == state->display.history) return; last_elapsed = state->display.history[last].elapsed_sec; /* * Do nothing if this is not the first call but not enough time has * elapsed since the previous call yet. */ if ((last_elapsed > 0.0) && (elapsed_sec < (last_elapsed + state->display.history_interval))) return; /* * If this is not the first call, add a new entry to the circular * buffer. */ if (last_elapsed > 0.0) { size_t len = state->display.history_len; last = (last + 1) % len; state->display.history_last = last; if (last == first) { first = (first + 1) % len; state->display.history_first = first; } } state->display.history[last].elapsed_sec = elapsed_sec; state->display.history[last].total_bytes = total_bytes; if (first == last) { state->display.current_avg_rate = rate; } else { off_t bytes = (state->display.history[last].total_bytes - state->display.history[first].total_bytes); long double sec = (state->display.history[last].elapsed_sec - state->display.history[first].elapsed_sec); state->display.current_avg_rate = (long double) bytes / sec; } } /* * Update state->display.display_buffer with status information formatted * according to the state held within the given structure, where * "elapsed_sec" is the seconds elapsed since the transfer started, * "bytes_since_last" is the number of bytes transferred since the last * update, and "total_bytes" is the total number of bytes transferred so * far. * * If "bytes_since_last" is negative, this is the final update so the rate * is given as an an average over the whole transfer; otherwise the current * rate is shown. * * In line mode, "bytes_since_last" and "total_bytes" are in lines, not bytes. * * Returns true if the display buffer can be used, false if not. * * When returning true, this function will have also set * state->display.display_string_len to the length of the string in * state->display.display_buffer, in bytes. * * If "total_bytes" is negative, then free the display buffer and return * false. */ static bool pv__format(pvstate_t state, long double elapsed_sec, off_t bytes_since_last, off_t total_bytes) { long double time_since_last, rate, average_rate; long eta; int static_portion_size; pv_display_component component_type; size_t segment; size_t new_display_string_len; const char *formatstr; /* Quick sanity check - state must exist. */ if (NULL == state) return false; /* Negative total transfer - free memory and return false. */ if (total_bytes < 0) { if (NULL != state->display.display_buffer) free(state->display.display_buffer); state->display.display_buffer = NULL; state->display.display_buffer_size = 0; return false; } /* The format string is needed for the static segments. */ formatstr = state->control.format_string ? state->control.format_string : state->control.default_format; if (NULL == formatstr) return false; /* * In case the time since the last update is very small, we keep * track of amount transferred since the last update, and just keep * adding to that until a reasonable amount of time has passed to * avoid rate spikes or division by zero. */ time_since_last = elapsed_sec - state->display.prev_elapsed_sec; if (time_since_last <= 0.01) { rate = state->display.prev_rate; state->display.prev_trans += bytes_since_last; } else { rate = ((long double) bytes_since_last + state->display.prev_trans) / time_since_last; state->display.prev_elapsed_sec = elapsed_sec; state->display.prev_trans = 0; } state->display.prev_rate = rate; /* Update history and current average rate for ETA. */ pv__update_average_rate_history(state, total_bytes, elapsed_sec, rate); average_rate = state->display.current_avg_rate; /* * If this is the final update at the end of the transfer, we * recalculate the rate - and the average rate - across the whole * period of the transfer. */ if (bytes_since_last < 0) { /* Sanity check to avoid division by zero */ if (elapsed_sec < 0.000001) elapsed_sec = 0.000001; average_rate = (((long double) total_bytes) - ((long double) state->display.initial_offset)) / (long double) elapsed_sec; rate = average_rate; } if (state->control.size <= 0) { /* * If we don't know the total size of the incoming data, * then for a percentage, we gradually increase the * percentage completion as data arrives, to a maximum of * 200, then reset it - we use this if we can't calculate * it, so that the numeric percentage output will go * 0%-100%, 100%-0%, 0%-100%, and so on. */ if (rate > 0) state->display.percentage += 2; if (state->display.percentage > 199) state->display.percentage = 0; } else if (state->control.numeric || state->display.component[PV_COMPONENT_PROGRESS].required) { /* * If we do know the total size, and we're going to show * the percentage (numeric mode or a progress bar), * calculate the percentage completion. */ state->display.percentage = pv__calc_percentage(total_bytes, state->control.size); } /* * Reallocate output buffer if width changes. */ if (state->display.display_buffer != NULL && state->display.display_buffer_size < (size_t) ((state->control.width * 2))) { free(state->display.display_buffer); state->display.display_buffer = NULL; state->display.display_buffer_size = 0; } /* * Allocate output buffer if there isn't one. */ if (NULL == state->display.display_buffer) { char *new_buffer; size_t new_size; new_size = (size_t) ((2 * state->control.width) + 80); if (NULL != state->control.name) new_size += strlen(state->control.name); /* flawfinder: ignore */ /* flawfinder: name is always set by pv_strdup(), which bounds with a \0. */ new_buffer = malloc(new_size + 16); if (NULL == new_buffer) { pv_error(state, "%s: %s", _("buffer allocation failed"), strerror(errno)); state->status.exit_status |= 64; state->display.display_buffer = NULL; return false; } state->display.display_buffer = new_buffer; state->display.display_buffer_size = new_size; state->display.display_buffer[0] = '\0'; } /* * In numeric output mode, our output is just a number. * * Patch from Sami Liedes: * With --timer we prefix the output with the elapsed time. * With --bytes we output the bytes transferred so far instead * of the percentage. (Or lines, if --lines was given with --bytes). */ if (state->control.numeric) { char numericprefix[128]; /* flawfinder: ignore - only populated by pv_snprintf(). */ numericprefix[0] = '\0'; if (state->display.component[PV_COMPONENT_TIMER].required) (void) pv_snprintf(numericprefix, sizeof(numericprefix), "%.4Lf ", elapsed_sec); if (state->display.component[PV_COMPONENT_BYTES].required) { if (state->control.bits) { (void) pv_snprintf(state->display.display_buffer, state->display.display_buffer_size, "%.99s%lld\n", numericprefix, (long long) (8 * total_bytes)); } else { (void) pv_snprintf(state->display.display_buffer, state->display.display_buffer_size, "%.99s%lld\n", numericprefix, (long long) total_bytes); } } else { (void) pv_snprintf(state->display.display_buffer, state->display.display_buffer_size, "%.99s%ld\n", numericprefix, (long) (state->display.percentage)); } state->display.display_string_len = strlen(state->display.display_buffer); /* flawfinder: ignore */ /* flawfinder: always \0 terminated by pv_snprintf(). */ return true; } /* * First, work out what components we will be putting in the output * buffer, and for those that don't depend on the total width * available (i.e. all but the progress bar), prepare their strings * to be placed in the output buffer. */ for (component_type = 0; component_type < PV_COMPONENT__MAX; component_type++) { char *component_content; size_t component_buf_size; size_t buf_idx; bool show_eta; time_t now; time_t then; struct tm *time_ptr; char *time_format; if (!state->display.component[component_type].required) continue; /* * Don't try to calculate ETA if the size is not known. We * check here to avoid big indented blocks if we check * later. */ if (state->control.size < 1 && ((component_type == PV_COMPONENT_ETA) || (component_type == PV_COMPONENT_FINETA))) { state->display.component[component_type].content[0] = '\0'; state->display.component[component_type].length = 0; continue; } component_content = state->display.component[component_type].content; component_content[0] = '\0'; component_buf_size = PV_SIZEOF_COMPONENT_STR; switch (component_type) { case PV_COMPONENT_STRING: break; case PV_COMPONENT_PROGRESS: /* Progress bar - variable width, so do this later. */ break; case PV_COMPONENT_BYTES: /* Bytes / bits / lines transferred. */ /*@-mustfreefresh @ */ if (state->control.bits && !state->control.linemode) { pv__sizestr(component_content, component_buf_size, "%s", (long double) total_bytes * 8, "", _("b"), PV_TRANSFERCOUNT_BYTES); } else { pv__sizestr(component_content, component_buf_size, "%s", (long double) total_bytes, "", _("B"), state->control.linemode ? PV_TRANSFERCOUNT_LINES : PV_TRANSFERCOUNT_BYTES); } /*@+mustfreefresh @ */ /* splint: we trust gettext() not to really leak memory. */ break; case PV_COMPONENT_TIMER: /* Elapsed time. */ /* * Bounds check, so we don't overrun the prefix buffer. This * does mean that the timer will stop at a 100,000 hours, * but since that's 11 years, it shouldn't be a problem. */ if (elapsed_sec > (long double) 360000000.0L) elapsed_sec = (long double) 360000000.0L; /* * If the elapsed time is more than a day, include a day count as * well as hours, minutes, and seconds. */ if (elapsed_sec > (long double) 86400.0L) { (void) pv_snprintf(component_content, component_buf_size, "%ld:%02ld:%02ld:%02ld", ((long) elapsed_sec) / 86400, (((long) elapsed_sec) / 3600) % 24, (((long) elapsed_sec) / 60) % 60, ((long) elapsed_sec) % 60); } else { (void) pv_snprintf(component_content, component_buf_size, "%ld:%02ld:%02ld", ((long) elapsed_sec) / 3600, (((long) elapsed_sec) / 60) % 60, ((long) elapsed_sec) % 60); } break; case PV_COMPONENT_RATE: /* Current transfer rate. */ /*@-mustfreefresh @ */ if (state->control.bits && !state->control.linemode) { /* bits per second */ pv__sizestr(component_content, component_buf_size, "[%s]", 8 * rate, "", _("b/s"), PV_TRANSFERCOUNT_BYTES); } else { /* bytes or lines per second */ pv__sizestr(component_content, component_buf_size, "[%s]", rate, _("/s"), _("B/s"), state->control.linemode ? PV_TRANSFERCOUNT_LINES : PV_TRANSFERCOUNT_BYTES); } /*@+mustfreefresh @ *//* splint: see above. */ break; case PV_COMPONENT_AVERAGERATE: /* Average transfer rate. */ /*@-mustfreefresh @ */ if (state->control.bits && !state->control.linemode) { /* bits per second */ pv__sizestr(component_content, component_buf_size, "[%s]", 8 * average_rate, "", _("b/s"), PV_TRANSFERCOUNT_BYTES); } else { /* bytes or lines per second */ pv__sizestr(component_content, component_buf_size, "[%s]", average_rate, _("/s"), _("B/s"), state->control.linemode ? PV_TRANSFERCOUNT_LINES : PV_TRANSFERCOUNT_BYTES); } /*@+mustfreefresh @ *//* splint: see above. */ break; case PV_COMPONENT_ETA: /* Estimated time remaining until completion - if size is known. */ eta = pv__seconds_remaining(((off_t) total_bytes - state->display.initial_offset), state->control.size - state->display.initial_offset, state->display.current_avg_rate); /* * Bounds check, so we don't overrun the suffix buffer. This * means the ETA will always be less than 100,000 hours. */ eta = bound_long(eta, 0, (long) 360000000L); /* * If the ETA is more than a day, include a day count as * well as hours, minutes, and seconds. */ /*@-mustfreefresh @ */ if (eta > 86400L) { (void) pv_snprintf(component_content, component_buf_size, "%.16s %ld:%02ld:%02ld:%02ld", _("ETA"), eta / 86400, (eta / 3600) % 24, (eta / 60) % 60, eta % 60); } else { (void) pv_snprintf(component_content, component_buf_size, "%.16s %ld:%02ld:%02ld", _("ETA"), eta / 3600, (eta / 60) % 60, eta % 60); } /*@+mustfreefresh @ *//* splint: see above. */ /* * If this is the final update, show a blank space where the * ETA used to be. */ if (bytes_since_last < 0) { size_t erase_idx; for (erase_idx = 0; erase_idx < component_buf_size && component_content[erase_idx] != '\0'; erase_idx++) { component_content[erase_idx] = ' '; } } break; case PV_COMPONENT_FINETA: /* Estimated time of completion - if size is known. */ now = time(NULL); show_eta = true; time_format = NULL; /* * The ETA may be hidden by a failed ETA string * generation. */ eta = pv__seconds_remaining((off_t) (total_bytes - state->display.initial_offset), state->control.size - state->display.initial_offset, state->display.current_avg_rate); /* * Bounds check, so we don't overrun the suffix buffer. This * means the ETA will always be less than 100,000 hours. */ eta = bound_long(eta, 0, (long) 360000000L); /* * Only include the date if the ETA is more than 6 hours * away. */ if (eta > (long) (6 * 3600)) { time_format = "%Y-%m-%d %H:%M:%S"; } else { time_format = "%H:%M:%S"; } then = now + eta; time_ptr = localtime(&then); if (NULL == time_ptr) { show_eta = false; } else { /* Localtime keeps data stored in a static * buffer that gets overwritten by time * functions. */ struct tm time = *time_ptr; size_t component_content_length; /*@-mustfreefresh @ */ (void) pv_snprintf(component_content, component_buf_size, "%.16s ", _("ETA")); /*@+mustfreefresh @ *//* splint: see above. */ component_content_length = strlen(component_content); /* flawfinder: ignore */ /* flawfinder: always bounded with \0 by pv_snprintf(). */ (void) strftime(component_content + component_content_length, component_buf_size - 1 - component_content_length, time_format, &time); } if (!show_eta) { size_t erase_idx; for (erase_idx = 0; erase_idx < component_buf_size && component_content[erase_idx] != '\0'; erase_idx++) { component_content[erase_idx] = ' '; } } break; case PV_COMPONENT_NAME: /* Name prefix. */ if (state->control.name) { (void) pv_snprintf(component_content, component_buf_size, "%9.500s:", state->control.name); } break; case PV_COMPONENT_BUFPERCENT: /* Transfer buffer percentage utilisation. */ if (state->transfer.buffer_size > 0) { int pct_used = pv__calc_percentage((off_t) (state->transfer.read_position - state->transfer.write_position), (off_t) (state->transfer.buffer_size)); (void) pv_snprintf(component_content, component_buf_size, "{%3d%%}", pct_used); } #ifdef HAVE_SPLICE if (state->transfer.splice_used) (void) pv_snprintf(component_content, component_buf_size, "{%s}", "----"); #endif break; case PV_COMPONENT_OUTPUTBUF: /* Recently transferred bytes. */ for (buf_idx = 0; buf_idx < state->display.lastoutput_length; buf_idx++) { int display_char; display_char = (int) (state->display.lastoutput_buffer[buf_idx]); component_content[buf_idx] = isprint(display_char) ? (char) display_char : '.'; } component_content[buf_idx] = '\0'; break; default: break; } /* Record the string length for this component. */ state->display.component[component_type].length = strlen(component_content); /* flawfinder: ignore */ /* flawfinder: always bounded by \0 either explicitly or by pv_snprintf(). */ } /* * Now go through all the static portions of the format to work * out how much space will be left for any dynamic portions * (i.e. the progress bar). */ static_portion_size = 0; for (segment = 0; segment < state->display.format_segment_count; segment++) { if (state->display.format[segment].type == PV_COMPONENT_STRING) { static_portion_size += state->display.format[segment].str_length; } else if (state->display.format[segment].type != PV_COMPONENT_PROGRESS) { static_portion_size += state->display.component[state->display.format[segment].type].length; } } debug("static_portion_size: %d", static_portion_size); /* * Assemble the progress bar now we know how big it should be. */ if (state->display.component[PV_COMPONENT_PROGRESS].required) { char *component_content; size_t component_buf_size; char pct[16]; /* flawfinder: ignore - only populated by pv_snprintf(). */ int available_width, bar_length, pad_count; component_content = state->display.component[PV_COMPONENT_PROGRESS].content; component_content[0] = '\0'; component_buf_size = PV_SIZEOF_COMPONENT_STR; memset(pct, 0, sizeof(pct)); /* The opening of the bar area. */ (void) pv_snprintf(component_content, component_buf_size, "["); if (state->control.size > 0) { /* Known size; show a bar and a percentage. */ size_t pct_width; if (state->display.percentage < 0) state->display.percentage = 0; if (state->display.percentage > 100000) state->display.percentage = 100000; (void) pv_snprintf(pct, sizeof(pct), "%3ld%%", state->display.percentage); pct_width = strlen(pct); /* flawfinder: ignore */ /* flawfinder: always \0-terminated by pv_snprintf() and the earlier memset(). */ available_width = (int) (state->control.width) - static_portion_size - (int) (pct_width) - 3; if (available_width < 0) available_width = 0; if (available_width > (int) (component_buf_size) - 16) available_width = (int) (component_buf_size - 16); /* The bar portion. */ bar_length = (int) ((available_width * state->display.percentage) / 100 - 1); for (pad_count = 0; pad_count < bar_length; pad_count++) { if (pad_count < available_width) (void) pv_strlcat(component_content, "=", component_buf_size); } /* The tip of the bar, if not at 100%. */ if (pad_count < available_width) { (void) pv_strlcat(component_content, ">", component_buf_size); pad_count++; } /* The spaces after the bar. */ for (; pad_count < available_width; pad_count++) { (void) pv_strlcat(component_content, " ", component_buf_size); } /* The closure of the bar area, and the percentage. */ (void) pv_strlcat(component_content, "] ", component_buf_size); (void) pv_strlcat(component_content, pct, component_buf_size); } else { /* Unknown size; show a moving indicator. */ int indicator_position = state->display.percentage; available_width = (int) (state->control.width) - static_portion_size - 5; if (available_width < 0) available_width = 0; if (available_width > (int) (component_buf_size) - 16) available_width = (int) (component_buf_size) - 16; debug("available_width: %d", available_width); /* * Earlier code in this function sets the percentage * when the size is unknown to a value that goes 0 - * 200 and resets, so here we make values above 100 * send the indicator back down again, so it moves * back and forth. */ if (indicator_position > 100) indicator_position = 200 - indicator_position; /* The spaces before the indicator. */ for (pad_count = 0; pad_count < (available_width * indicator_position) / 100; pad_count++) { if (pad_count < available_width) (void) pv_strlcat(component_content, " ", component_buf_size); } /* The indicator. */ (void) pv_strlcat(component_content, "<=>", component_buf_size); /* The spaces after the indicator. */ for (; pad_count < available_width; pad_count++) { (void) pv_strlcat(component_content, " ", component_buf_size); } /* The closure of the bar area. */ (void) pv_strlcat(component_content, "]", component_buf_size); } /* Record the string length for this component. */ state->display.component[PV_COMPONENT_PROGRESS].length = strlen(component_content); /* flawfinder: ignore */ /* flawfinder: always bounded with \0 by pv_strlcat(). */ /* * If the progress bar won't fit, drop it. */ if ((unsigned int) (state->display.component[PV_COMPONENT_PROGRESS].length + static_portion_size) > state->control.width) { component_content[0] = '\0'; state->display.component[PV_COMPONENT_PROGRESS].length = 0; } } /* * We can now build the output string using the format structure. */ memset(state->display.display_buffer, 0, state->display.display_buffer_size); new_display_string_len = 0; for (segment = 0; segment < state->display.format_segment_count; segment++) { const char *segment_content; size_t segment_length; if (state->display.format[segment].type == PV_COMPONENT_STRING) { segment_content = &(formatstr[state->display.format[segment].str_start]); segment_length = state->display.format[segment].str_length; } else { segment_content = state->display.component[state->display.format[segment].type].content; segment_length = state->display.component[state->display.format[segment].type].length; } /* Skip empty segments. */ if (segment_length == 0) continue; /* * Truncate the segment if it would make the display string * overflow the buffer. */ if (segment_length + new_display_string_len > state->display.display_buffer_size - 2) segment_length = state->display.display_buffer_size - new_display_string_len - 2; if (segment_length < 1) break; /* Skip the segment if it would make the display too wide. */ if ((unsigned int) (segment_length + new_display_string_len) > state->control.width) break; /* Append the segment to the output string. */ strncat(state->display.display_buffer, segment_content, segment_length); /* flawfinder: ignore */ /* flawfinder: length is checked above, and buffer is \0 terminated already. */ new_display_string_len += segment_length; } debug("%s: %d", "display string length counted by format segments", (int) new_display_string_len); /* Recalculate display string length with strlen() in case of miscounting. */ new_display_string_len = strlen(state->display.display_buffer); /* flawfinder: ignore */ /* flawfinder: \0 terminated by memset() above and then by segment bounds checking. */ debug("%s: %d", "display string length from strlen()", (int) new_display_string_len); /* * If the size of our output shrinks, we need to keep appending * spaces at the end, so that we don't leave dangling bits behind. */ if ((new_display_string_len < state->display.display_string_len) && (state->control.width >= state->display.prev_screen_width)) { char spaces[32]; /* flawfinder: ignore - terminated, bounded */ int spaces_to_add; spaces_to_add = (int) (state->display.display_string_len - new_display_string_len); /* Upper boundary on number of spaces */ if (spaces_to_add > 15) { spaces_to_add = 15; } new_display_string_len += spaces_to_add; spaces[spaces_to_add] = '\0'; while (--spaces_to_add >= 0) { spaces[spaces_to_add] = ' '; } (void) pv_strlcat(state->display.display_buffer, spaces, state->display.display_buffer_size); } state->display.display_string_len = new_display_string_len; state->display.prev_screen_width = state->control.width; return true; } /* * Output status information on standard error, where "esec" is the seconds * elapsed since the transfer started, "sl" is the number of bytes transferred * since the last update, and "tot" is the total number of bytes transferred * so far. * * If "sl" is negative, this is the final update so the rate is given as an * an average over the whole transfer; otherwise the current rate is shown. * * In line mode, "sl" and "tot" are in lines, not bytes. */ void pv_display(pvstate_t state, long double esec, off_t sl, off_t tot) { if (NULL == state) return; /* * If the display options need reparsing, do so to generate new * formatting parameters. */ if (0 != state->flag.reparse_display) { pv__format_init(state); state->flag.reparse_display = 0; } pv_sig_checkbg(); if (!pv__format(state, esec, sl, tot)) return; if (NULL == state->display.display_buffer) return; if (state->control.numeric) { pv_write_retry(STDERR_FILENO, state->display.display_buffer, state->display.display_string_len); } else if (state->control.cursor) { if (state->control.force || pv_in_foreground()) { pv_crs_update(state, state->display.display_buffer); state->display.display_visible = true; } } else { if (state->control.force || pv_in_foreground()) { pv_write_retry(STDERR_FILENO, state->display.display_buffer, state->display.display_string_len); pv_write_retry(STDERR_FILENO, "\r", 1); state->display.display_visible = true; } } debug("%s: [%s]", "display", state->display.display_buffer); } /* EOF */ pv-1.8.5/src/pv/elapsedtime.c000066400000000000000000000135711452655021700160440ustar00rootroot00000000000000/* * Functions relating to elapsed time. * * Copyright 2023 Andrew Wood * * License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'. */ #include "config.h" #include "pv.h" #include "pv-internal.h" #include #include #include /* * Read the current elapsed time, relative to an unspecified point in the * past, and store it in the given timespec buffer. The time is guaranteed * to not go backwards and does not count time when the system was * suspended. See clock_gettime(2) with CLOCK_MONOTONIC. * * The read should not fail; if it does, the program is aborted with exit * status 16. */ void pv_elapsedtime_read(struct timespec *return_time) { /*@-unrecog@ *//* splint doesn't know clock_gettime */ if (0 != clock_gettime(CLOCK_MONOTONIC, return_time)) { fprintf(stderr, "%s: %s: %s\n", PACKAGE_NAME, "clock_gettime", strerror(errno)); /*@-exitarg@ *//* we explicitly want a special exit status */ exit(16); /*@+exitarg@ */ } /*@+unrecog@ */ } /* * Set the time in the given timespec to zero. */ void pv_elapsedtime_zero(struct timespec *zero_time) { if (NULL == zero_time) return; zero_time->tv_sec = 0; zero_time->tv_nsec = 0; } /* * Copy source_time into dest_time. Analogous to strcpy(3). */ void pv_elapsedtime_copy(struct timespec *dest_time, const struct timespec *source_time) { if (NULL == dest_time) return; if (NULL == source_time) return; dest_time->tv_sec = source_time->tv_sec; dest_time->tv_nsec = source_time->tv_nsec; } /* * Return -1, 0, or 1 depending on whether the first time is earlier than, * equal to, or later than the second time. Analogous to strcmp(3). */ int pv_elapsedtime_compare(const struct timespec *first_time, const struct timespec *second_time) { /* Treat NULL as a zero time. */ if ((NULL == first_time) && (NULL == second_time)) return 0; if ((NULL == first_time) && (NULL != second_time)) return -1; if ((NULL != first_time) && (NULL == second_time)) return 1; /* These should never happen, but check just in case. */ if (NULL == first_time) return 0; if (NULL == second_time) return 0; /* Check the seconds part, first */ if (first_time->tv_sec < second_time->tv_sec) return -1; if (first_time->tv_sec > second_time->tv_sec) return 1; /* Seconds are equal - compare nanoseconds. */ if (first_time->tv_nsec < second_time->tv_nsec) return -1; if (first_time->tv_nsec > second_time->tv_nsec) return 1; /* Nanoseconds are also equal - times are equal. */ return 0; } /* * Add first_time and second_time, writing the result to return_time. */ void pv_elapsedtime_add(struct timespec *return_time, const struct timespec *first_time, const struct timespec *second_time) { long long seconds, nanoseconds; if (NULL == return_time) return; seconds = 0; nanoseconds = 0; if (NULL != first_time) { seconds += first_time->tv_sec; nanoseconds += first_time->tv_nsec; } if (NULL != second_time) { seconds += second_time->tv_sec; nanoseconds += second_time->tv_nsec; } seconds += nanoseconds / 1000000000; nanoseconds = nanoseconds % 1000000000; /*@-type@ */ return_time->tv_sec = seconds; return_time->tv_nsec = nanoseconds; /*@+type@ */ /* * splint rationale: we know the types are different but should be * large enough and are relying on the compiler to do the casting * correctly, since the manual for timespec(3) states the types are * implementation-defined. * * TODO: review this to make sure that this isn't just an elaborate * excuse for "it's hard to fix and I don't know how". */ } /* * Add a number of nanoseconds to the given timespec. */ void pv_elapsedtime_add_nsec(struct timespec *return_time, long long add_nanoseconds) { long long seconds, nanoseconds; if (NULL == return_time) return; seconds = return_time->tv_sec; nanoseconds = return_time->tv_nsec + add_nanoseconds; seconds += nanoseconds / 1000000000; nanoseconds = nanoseconds % 1000000000; /*@-type@ *//* see above */ return_time->tv_sec = seconds; return_time->tv_nsec = nanoseconds; /*@+type@ */ } /* * Set the return timespec to the first time minus the second time. */ void pv_elapsedtime_subtract(struct timespec *return_time, const struct timespec *first_time, const struct timespec *second_time) { long long seconds, nanoseconds; if (NULL == return_time) return; seconds = 0; nanoseconds = 0; if (NULL != first_time) { seconds += first_time->tv_sec; nanoseconds += first_time->tv_nsec; } if (NULL != second_time) { seconds -= second_time->tv_sec; nanoseconds -= second_time->tv_nsec; } seconds += nanoseconds / 1000000000; nanoseconds = nanoseconds % 1000000000; if (nanoseconds < 0) { seconds--; nanoseconds = 1000000000 + nanoseconds; } /*@-type@ *//* see above */ return_time->tv_sec = seconds; return_time->tv_nsec = nanoseconds; /*@+type@ */ } /* * Convert a timespec to seconds. */ long double pv_elapsedtime_seconds(const struct timespec *elapsed_time) { long double seconds; if (NULL == elapsed_time) return 0.0; seconds = (long double) elapsed_time->tv_sec; seconds += (long double) (elapsed_time->tv_nsec) / 1000000000.0L; return seconds; } /* * Sleep for a number of nanoseconds. */ void pv_nanosleep(long long nanoseconds) { #if HAVE_NANOSLEEP struct timespec sleep_for, time_remaining; memset(&sleep_for, 0, sizeof(sleep_for)); memset(&time_remaining, 0, sizeof(time_remaining)); sleep_for.tv_sec = 0; /*@-type@ */ sleep_for.tv_nsec = nanoseconds; /*@+type@ *//* splint rationale - best effort */ /*@-unrecog@ */ (void) nanosleep(&sleep_for, &time_remaining); /*@+unrecog@ *//* splint rationale - doesn't know of nanosleep() */ #else struct timeval tv; tv.tv_sec = 0; /*@-type@ */ tv.tv_usec = nanoseconds / 1000; /*@+type@ *//* splint rationale - best effort */ /*@-null@ */ (void) select(0, NULL, NULL, NULL, &tv); /*@+null@ *//* splint doesn't know about select() */ #endif } /* EOF */ pv-1.8.5/src/pv/file.c000066400000000000000000000277121452655021700144710ustar00rootroot00000000000000/* * Functions for opening and closing files, and calculating their size. * * Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023 Andrew Wood * * License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'. */ #include "config.h" #include "pv.h" #include "pv-internal.h" #include #include #include #include #include #include #include #include /*@-type@*/ /* splint has trouble with off_t and mode_t throughout this file. */ /* * Calculate the total number of bytes to be transferred by adding up the * sizes of all input files. If any of the input files are of indeterminate * size (such as if they are a pipe), the total size is set to zero. * * Any files that cannot be stat()ed or that access() says we can't read * will be skipped, and the total size will be set to zero. * * Returns the total size, or 0 if it is unknown. */ static off_t pv_calc_total_bytes(pvstate_t state) { off_t total; struct stat sb; unsigned int file_idx; total = 0; memset(&sb, 0, sizeof(sb)); /* * No files specified - check stdin. */ if ((state->files.file_count < 1) || (NULL == state->files.filename)) { if (0 == fstat(STDIN_FILENO, &sb)) total = sb.st_size; return total; } for (file_idx = 0; file_idx < state->files.file_count; file_idx++) { int rc; if (0 == strcmp(state->files.filename[file_idx], "-")) { rc = fstat(STDIN_FILENO, &sb); if (rc != 0) { total = 0; return total; } } else { rc = stat(state->files.filename[file_idx], &sb); if (0 == rc) { rc = access(state->files.filename[file_idx], R_OK); /* flawfinder: ignore */ /* * flawfinder rationale: we're not really * using access() to do permissions checks, * but to zero the total if we might be * unable to read the file later, so if an * attacker redirected one of the input * files in between this part and the actual * reading, the outcome would be that the * total byte count would be wrong or * missing, nothing useful. */ } } if (rc != 0) { debug("%s: %s", state->files.filename[file_idx], strerror(errno)); total = 0; return total; } if (S_ISBLK(sb.st_mode)) { int fd; /* * Get the size of block devices by opening * them and seeking to the end. */ if (0 == strcmp(state->files.filename[file_idx], "-")) { fd = open("/dev/stdin", O_RDONLY); /* flawfinder: ignore */ /* * flawfinder rationale: "/dev/stdin" may be * a symlink, so can't use O_NOFOLLOW, and * so we have to assume that it being under * "/dev" means the path is less likely to * be under the control of someone else. */ } else { fd = open(state->files.filename[file_idx], O_RDONLY); /* flawfinder: ignore */ /* flawfinder - see last open() below. */ } if (fd >= 0) { off_t end_position; end_position = lseek(fd, 0, SEEK_END); if (end_position > 0) { total += end_position; } (void) close(fd); } else { total = 0; return total; } } else if (S_ISREG(sb.st_mode)) { total += sb.st_size; } else { total = 0; } } /* * Patch from Peter Samuelson: if we cannot work out the size of the * input, but we are writing to a block device, then use the size of * the output block device. * * Further modified to check that stdout is not in append-only mode * and that we can seek back to the start after getting the size. */ if (total < 1) { int rc; rc = fstat(STDOUT_FILENO, &sb); if ((0 == rc) && S_ISBLK(sb.st_mode) && (0 == (fcntl(STDOUT_FILENO, F_GETFL) & O_APPEND))) { off_t end_position; end_position = lseek(STDOUT_FILENO, 0, SEEK_END); total = 0; if (end_position > 0) { total = end_position; } if (lseek(STDOUT_FILENO, 0, SEEK_SET) != 0) { pv_error(state, "%s: %s: %s", "(stdout)", _("failed to seek to start of output"), strerror(errno)); state->status.exit_status |= 2; } /* * If we worked out a size, then set the * stop-at-size flag to prevent a "no space left on * device" error when we reach the end of the output * device. */ if (total > 0) { state->control.stop_at_size = true; } } } return total; } /* * Count the total number of lines to be transferred by reading through all * input files. If any of the inputs are not regular files (such as if they * are a pipe or a block device), the total size is set to zero. * * Any files that cannot be stat()ed or that access() says we can't read * will be skipped, and the total size will be set to zero. * * Returns the total size, or 0 if it is unknown. */ static off_t pv_calc_total_lines(pvstate_t state) { off_t total; struct stat sb; unsigned int file_idx; total = 0; for (file_idx = 0; file_idx < state->files.file_count && NULL != state->files.filename; file_idx++) { int fd = -1; int rc = 0; if (0 == strcmp(state->files.filename[file_idx], "-")) { rc = fstat(STDIN_FILENO, &sb); if ((rc != 0) || (!S_ISREG(sb.st_mode))) { total = 0; return total; } fd = dup(STDIN_FILENO); } else { rc = stat(state->files.filename[file_idx], &sb); if ((rc != 0) || (!S_ISREG(sb.st_mode))) { total = 0; return total; } fd = open(state->files.filename[file_idx], O_RDONLY); /* flawfinder: ignore */ /* flawfinder - see last open() below. */ } if (fd < 0) { debug("%s: %s", state->files.filename[file_idx], strerror(errno)); total = 0; return total; } #if HAVE_POSIX_FADVISE /* Advise the OS that we will only be reading sequentially. */ (void) posix_fadvise(fd, 0, 0, POSIX_FADV_SEQUENTIAL); #endif while (true) { char scanbuf[1024]; /* flawfinder: ignore */ ssize_t numread, buf_idx; /* flawfinder - always bounded, below. */ numread = read(fd, scanbuf, sizeof(scanbuf)); /* flawfinder: ignore */ /* * flawfinder rationale: each time around the loop * we are always reading into the start of the * buffer, not moving along it, so the bounding is * OK. */ if (numread < 0) { pv_error(state, "%s: %s", state->files.filename[file_idx], strerror(errno)); state->status.exit_status |= 2; break; } else if (0 == numread) { break; } for (buf_idx = 0; buf_idx < numread; buf_idx++) { if (state->control.null_terminated_lines) { if ('\0' == scanbuf[buf_idx]) total++; } else { if ('\n' == scanbuf[buf_idx]) total++; } } } if (0 != lseek(fd, 0, SEEK_SET)) { pv_error(state, "%s: %s", state->files.filename[file_idx], strerror(errno)); state->status.exit_status |= 2; } (void) close(fd); } return total; } /* * Work out the total size of all data by adding up the sizes of all input * files, using either pv_calc_total_bytes() or pv_calc_total_lines() * depending on whether state->control.linemode is true. * * Returns the total size, or 0 if it is unknown. */ off_t pv_calc_total_size(pvstate_t state) { if (state->control.linemode) { return pv_calc_total_lines(state); } else { return pv_calc_total_bytes(state); } } /* * Close the given file descriptor and open the next one, whose number in * the list is "filenum", returning the new file descriptor (or negative on * error). It is an error if the next input file is the same as the file * stdout is pointing to. * * Updates state->status.current_input_file in the process. */ int pv_next_file(pvstate_t state, unsigned int filenum, int oldfd) { struct stat isb; struct stat osb; int fd; bool input_file_is_stdout; if (oldfd >= 0) { if (0 != close(oldfd)) { pv_error(state, "%s: %s", _("failed to close file"), strerror(errno)); state->status.exit_status |= 8; return -1; } } if (filenum >= state->files.file_count) { debug("%s: %d >= %d", "filenum too large", filenum, state->files.file_count); state->status.exit_status |= 8; return -1; } if ((NULL == state->files.filename) || (0 == strcmp(state->files.filename[filenum], "-"))) { fd = STDIN_FILENO; } else { fd = open(state->files.filename[filenum], O_RDONLY); /* flawfinder: ignore */ /* * flawfinder rationale: the input file list is under the * control of the operator by its nature, so we can't refuse * to open symlinks etc as that would be counterintuitive. */ if (fd < 0) { pv_error(state, "%s: %s: %s", _("failed to read file"), state->files.filename[filenum], strerror(errno)); state->status.exit_status |= 2; return -1; } } if (0 != fstat(fd, &isb)) { pv_error(state, "%s: %s: %s", _("failed to stat file"), NULL == state->files.filename ? "-" : state->files.filename[filenum], strerror(errno)); (void) close(fd); state->status.exit_status |= 2; return -1; } if (0 != fstat(STDOUT_FILENO, &osb)) { pv_error(state, "%s: %s", _("failed to stat output file"), strerror(errno)); (void) close(fd); state->status.exit_status |= 2; return -1; } /* * Check that this new input file is not the same as stdout's * destination. This restriction is ignored for anything other * than a regular file or block device. */ input_file_is_stdout = true; if (isb.st_dev != osb.st_dev) input_file_is_stdout = false; if (isb.st_ino != osb.st_ino) input_file_is_stdout = false; if (0 != isatty(fd)) input_file_is_stdout = false; if ((!S_ISREG(isb.st_mode)) && (!S_ISBLK(isb.st_mode))) input_file_is_stdout = false; if (input_file_is_stdout) { pv_error(state, "%s: %s", _("input file is output file"), NULL == state->files.filename ? "-" : state->files.filename[filenum]); (void) close(fd); state->status.exit_status |= 4; return -1; } state->status.current_input_file = filenum; #ifdef O_DIRECT /* * Set or clear O_DIRECT on the file descriptor. */ if (0 != fcntl(fd, F_SETFL, (state->control.direct_io ? O_DIRECT : 0) | fcntl(fd, F_GETFL))) { /*@-compdef@ */ /* * splint - passed or returned storage is undefined - but at * this point we know the input file list is been populated, * so that's OK. */ debug("%s: %s: %s", pv_current_file_name(state), "fcntl", strerror(errno)); /*@+compdef@ */ } /* * We don't clear direct_io_changed here, to avoid race conditions * that could cause the input and output settings to differ. */ #endif /* O_DIRECT */ debug("%s: %d: %s: fd=%d", "next file opened", filenum, pv_current_file_name(state), fd); return fd; } /* * Return the name of the current file. The returned buffer may point to * internal state and must not be passed to free() or used after "state" is * freed. */ /*@out@*/ const char *pv_current_file_name(pvstate_t state) { static char *str_none = NULL; static char *str_stdin = NULL; const char *input_file_name = NULL; /*@-observertrans@ */ /*@-onlytrans@ */ /*@-statictrans@ */ /* * Here we are doing bad things with regards to whether the returned * string is an allocated string from the state->files.filename array, * a constant string, or a returned string from gettext(), but it * has no impact. We explicitly document, above, that the returned * string expires with the state, and hence switch off the * associated splint warnings. */ if (NULL == str_none) str_none = _("(none)"); if (NULL == str_stdin) str_stdin = _("(stdin)"); /* Fallback in case of translation failure. */ if (NULL == str_none) str_none = "(none)"; if (NULL == str_stdin) str_stdin = "(stdin)"; if (state->status.current_input_file < 0) return str_none; if ((unsigned int) (state->status.current_input_file) >= state->files.file_count) return str_none; if (NULL == state->files.filename) { input_file_name = NULL; } else { input_file_name = state->files.filename[state->status.current_input_file]; } if (NULL == input_file_name) return str_none; if (0 == strcmp(input_file_name, "-")) return str_stdin; /*@-compdef@ */ return input_file_name; /*@+compdef@ */ /* * splint warns about state->files.filename being undefined, but we * know it's been populated fully by the time this function is * called. */ /*@+statictrans@ */ /*@+onlytrans@ */ /*@+observertrans@ */ } /* EOF */ pv-1.8.5/src/pv/loop.c000066400000000000000000000540201452655021700145130ustar00rootroot00000000000000/* * Functions providing the main transfer or file descriptor watching loop. * * Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023 Andrew Wood * * License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'. */ #include "config.h" #include "pv.h" #include "pv-internal.h" #include #include #include #include #define _GNU_SOURCE 1 #include #include #include #include #include #include /* * Pipe data from a list of files to standard output, giving information * about the transfer on standard error according to the given options. * * Returns nonzero on error. */ int pv_main_loop(pvstate_t state) { long lineswritten; off_t total_written, transferred_since_last, cansend; ssize_t written; long double target; bool eof_in, eof_out, final_update; struct timespec start_time, next_update, next_ratecheck, cur_time; struct timespec init_time, next_remotecheck, transfer_elapsed; long double elapsed_seconds; int fd; unsigned int file_idx; /* * "written" is ALWAYS bytes written by the last transfer. * * "lineswritten" is the lines written by the last transfer, * but is only updated in line mode. * * "total_written" is the total bytes written since the start, * or in line mode, the total lines written since the start. * * "transferred_since_last" is the bytes written since the last * display, or in line mode, the lines written since the last * display. * * The remaining variables are all unchanged by linemode. */ fd = -1; pv_crs_init(state); eof_in = false; eof_out = false; total_written = 0; lineswritten = 0; transferred_since_last = 0; state->display.initial_offset = 0; memset(&cur_time, 0, sizeof(cur_time)); memset(&start_time, 0, sizeof(start_time)); pv_elapsedtime_read(&cur_time); pv_elapsedtime_copy(&start_time, &cur_time); memset(&next_ratecheck, 0, sizeof(next_ratecheck)); memset(&next_remotecheck, 0, sizeof(next_remotecheck)); memset(&next_update, 0, sizeof(next_update)); pv_elapsedtime_copy(&next_ratecheck, &cur_time); pv_elapsedtime_copy(&next_remotecheck, &cur_time); pv_elapsedtime_copy(&next_update, &cur_time); if ((state->control.delay_start > 0) && (state->control.delay_start > state->control.interval)) { pv_elapsedtime_add_nsec(&next_update, (long long) (1000000000.0 * state->control.delay_start)); } else { pv_elapsedtime_add_nsec(&next_update, (long long) (1000000000.0 * state->control.interval)); } target = 0; final_update = false; file_idx = 0; /* * Open the first readable input file. */ fd = -1; while (fd < 0 && file_idx < state->files.file_count) { fd = pv_next_file(state, file_idx, -1); if (fd < 0) file_idx++; } /* * Exit early if there was no readable input file. */ if (fd < 0) { if (state->control.cursor) pv_crs_fini(state); return state->status.exit_status; } #if HAVE_POSIX_FADVISE /* Advise the OS that we will only be reading sequentially. */ (void) posix_fadvise(fd, 0, 0, POSIX_FADV_SEQUENTIAL); #endif #ifdef O_DIRECT /* * Set or clear O_DIRECT on the output. */ if (0 != fcntl(STDOUT_FILENO, F_SETFL, (state->control.direct_io ? O_DIRECT : 0) | fcntl(STDOUT_FILENO, F_GETFL))) { debug("%s: %s", "fcntl", strerror(errno)); } state->control.direct_io_changed = false; #endif /* O_DIRECT */ #if HAVE_STRUCT_STAT_ST_BLKSIZE /* * Set target buffer size if the initial file's block size can be * read and we weren't given a target buffer size. */ if (0 == state->control.target_buffer_size) { struct stat sb; memset(&sb, 0, sizeof(sb)); if (0 == fstat(fd, &sb)) { size_t sz; sz = (size_t) (sb.st_blksize * 32); if (sz > BUFFER_SIZE_MAX) { sz = BUFFER_SIZE_MAX; } state->control.target_buffer_size = sz; } } #endif if (0 == state->control.target_buffer_size) state->control.target_buffer_size = BUFFER_SIZE; while ((!(eof_in && eof_out)) || (!final_update)) { cansend = 0; /* * Check for remote messages from -R every short while. */ if (pv_elapsedtime_compare(&cur_time, &next_remotecheck) > 0) { pv_remote_check(state); pv_elapsedtime_add_nsec(&next_remotecheck, REMOTE_INTERVAL); } if (1 == state->flag.trigger_exit) break; if (state->control.rate_limit > 0) { pv_elapsedtime_read(&cur_time); if (pv_elapsedtime_compare(&cur_time, &next_ratecheck) > 0) { target += ((long double) (state->control.rate_limit)) / (long double) (1000000000.0 / (long double) (RATE_GRANULARITY)); long double burst_max = ((long double) (state->control.rate_limit * RATE_BURST_WINDOW)); if (target > burst_max) { target = burst_max; } pv_elapsedtime_add_nsec(&next_ratecheck, RATE_GRANULARITY); } cansend = (off_t) target; } /* * If we have to stop at "size" bytes, make sure we don't * try to write more than we're allowed to. */ if ((0 < state->control.size) && (state->control.stop_at_size)) { if ((state->control.size < (total_written + cansend)) || ((0 == cansend) && (0 == state->control.rate_limit))) { cansend = state->control.size - total_written; if (0 >= cansend) { eof_in = true; eof_out = true; } } } if ((0 < state->control.size) && (state->control.stop_at_size) && (0 >= cansend) && eof_in && eof_out) { written = 0; } else { written = pv_transfer(state, fd, &eof_in, &eof_out, cansend, &lineswritten); } /* End on write error. */ if (written < 0) { if (state->control.cursor) pv_crs_fini(state); return state->status.exit_status; } if (state->control.linemode) { transferred_since_last += lineswritten; total_written += lineswritten; if (state->control.rate_limit > 0) target -= lineswritten; } else { transferred_since_last += written; total_written += written; if (state->control.rate_limit > 0) target -= written; } /* * EOF, and files remain - advance to the next file. */ while (eof_in && eof_out && file_idx < (state->files.file_count - 1)) { file_idx++; fd = pv_next_file(state, file_idx, fd); if (fd >= 0) { eof_in = false; eof_out = false; } } /* Now check the current time. */ pv_elapsedtime_read(&cur_time); /* If full EOF, final update, and force a display updaate. */ if (eof_in && eof_out) { final_update = true; if ((state->display.display_visible) || (state->control.delay_start < 0.001)) { pv_elapsedtime_copy(&next_update, &cur_time); } } /* Just go round the loop again if there's no display. */ if (state->control.no_display) continue; /* * If -W was given, we don't output anything until we have * written a byte (or line, in line mode), at which point * we then count time as if we started when the first byte * was received. */ if (state->control.wait) { /* Restart the loop if nothing written yet. */ if (state->control.linemode) { if (lineswritten < 1) continue; } else { if (written < 1) continue; } state->control.wait = 0; /* * Reset the timer offset counter now that data * transfer has begun, otherwise if we had been * stopped and started (with ^Z / SIGTSTOP) * previously (while waiting for data), the timers * will be wrongly offset. * * While we reset the offset counter we must disable * SIGTSTOP so things don't mess up. */ pv_sig_nopause(); pv_elapsedtime_read(&start_time); pv_elapsedtime_zero(&(state->signal.toffset)); pv_sig_allowpause(); /* * Start the display, but only at the next interval, * not immediately. */ pv_elapsedtime_copy(&next_update, &start_time); pv_elapsedtime_add_nsec(&next_update, (long long) (1000000000.0 * state->control.interval)); } /* Restart the loop if it's not time to update the display. */ if (pv_elapsedtime_compare(&cur_time, &next_update) < 0) { continue; } pv_elapsedtime_add_nsec(&next_update, (long long) (1000000000.0 * state->control.interval)); /* Set the "next update" time to now, if it's in the past. */ if (pv_elapsedtime_compare(&next_update, &cur_time) < 0) pv_elapsedtime_copy(&next_update, &cur_time); /* * Calculate the effective start time: the time we actually * started, plus the total time we spent stopped. */ memset(&init_time, 0, sizeof(init_time)); pv_elapsedtime_add(&init_time, &start_time, &(state->signal.toffset)); /* * Now get the effective elapsed transfer time - current * time minus effective start time. */ memset(&transfer_elapsed, 0, sizeof(transfer_elapsed)); pv_elapsedtime_subtract(&transfer_elapsed, &cur_time, &init_time); elapsed_seconds = pv_elapsedtime_seconds(&transfer_elapsed); if (final_update) transferred_since_last = -1; /* Resize the display, if a resize signal was received. */ if (1 == state->flag.terminal_resized) { unsigned int new_width, new_height; state->flag.terminal_resized = 0; new_width = state->control.width; new_height = state->control.height; pv_screensize(&new_width, &new_height); if (!state->control.width_set_manually) state->control.width = new_width; if (!state->control.height_set_manually) state->control.height = new_height; } pv_display(state, elapsed_seconds, transferred_since_last, total_written); transferred_since_last = 0; } if (state->control.cursor) { pv_crs_fini(state); } else { if ((!state->control.numeric) && (!state->control.no_display) && (state->display.display_visible)) pv_write_retry(STDERR_FILENO, "\n", 1); } if (1 == state->flag.trigger_exit) state->status.exit_status |= 32; if (fd >= 0) (void) close(fd); return state->status.exit_status; } /* * Watch the progress of file descriptor state->control.watch_fd in process * state->control.watch_pid and show details about the transfer on standard error * according to the given options. * * Returns nonzero on error. */ int pv_watchfd_loop(pvstate_t state) { struct pvwatchfd_s info; off_t position_now, total_written, transferred_since_last; struct timespec next_update, cur_time; struct timespec init_time, next_remotecheck, transfer_elapsed; long double elapsed_seconds; bool ended, first_check; int rc; memset(&info, 0, sizeof(info)); info.watch_pid = state->control.watch_pid; info.watch_fd = state->control.watch_fd; rc = pv_watchfd_info(state, &info, false); if (0 != rc) { state->status.exit_status |= 2; /*@-compdestroy@ */ return state->status.exit_status; /*@+compdestroy@ */ /* splint: no leak of info.state as it is unused so far. */ } /* * Use a size if one was passed, otherwise use the total size * calculated. */ if (0 >= state->control.size) state->control.size = info.size; if (state->control.size < 1) { char *fmt; while (NULL != (fmt = strstr(state->control.default_format, "%e"))) { debug("%s", "zero size - removing ETA"); /* strlen-1 here to include trailing \0 */ memmove(fmt, fmt + 2, strlen(fmt) - 1); /* flawfinder: ignore */ /* flawfinder: default_format is always \0 terminated */ state->flag.reparse_display = 1; } } memset(&cur_time, 0, sizeof(cur_time)); memset(&next_remotecheck, 0, sizeof(next_remotecheck)); memset(&next_update, 0, sizeof(next_update)); memset(&init_time, 0, sizeof(init_time)); memset(&transfer_elapsed, 0, sizeof(transfer_elapsed)); pv_elapsedtime_read(&cur_time); pv_elapsedtime_copy(&(info.start_time), &cur_time); pv_elapsedtime_copy(&next_remotecheck, &cur_time); pv_elapsedtime_copy(&next_update, &cur_time); pv_elapsedtime_add_nsec(&next_update, (long long) (1000000000.0 * state->control.interval)); ended = false; total_written = 0; transferred_since_last = 0; first_check = true; while (!ended) { /* * Check for remote messages from -R every short while. */ if (pv_elapsedtime_compare(&cur_time, &next_remotecheck) > 0) { pv_remote_check(state); pv_elapsedtime_add_nsec(&next_remotecheck, REMOTE_INTERVAL); } if (1 == state->flag.trigger_exit) break; position_now = pv_watchfd_position(&info); if (position_now < 0) { ended = true; } else { transferred_since_last += position_now - total_written; total_written = position_now; if (first_check) { state->display.initial_offset = position_now; first_check = false; } } pv_elapsedtime_read(&cur_time); /* Ended - force a display update. */ if (ended) { pv_elapsedtime_copy(&next_update, &cur_time); } /* * Restart the loop after a brief delay, if it's not time to * update the display. */ if (pv_elapsedtime_compare(&cur_time, &next_update) < 0) { pv_nanosleep(50000000); continue; } pv_elapsedtime_add_nsec(&next_update, (long long) (1000000000.0 * state->control.interval)); /* Set the "next update" time to now, if it's in the past. */ if (pv_elapsedtime_compare(&next_update, &cur_time) < 0) pv_elapsedtime_copy(&next_update, &cur_time); /* * Calculate the effective start time: the time we actually * started, plus the total time we spent stopped. */ pv_elapsedtime_add(&init_time, &(info.start_time), &(state->signal.toffset)); /* * Now get the effective elapsed transfer time - current * time minus effective start time. */ pv_elapsedtime_subtract(&transfer_elapsed, &cur_time, &init_time); elapsed_seconds = pv_elapsedtime_seconds(&transfer_elapsed); if (ended) transferred_since_last = -1; /* Resize the display, if a resize signal was received. */ if (1 == state->flag.terminal_resized) { unsigned int new_width, new_height; state->flag.terminal_resized = 0; new_width = state->control.width; new_height = state->control.height; pv_screensize(&new_width, &new_height); if (!state->control.width_set_manually) state->control.width = new_width; if (!state->control.height_set_manually) state->control.height = new_height; } pv_display(state, elapsed_seconds, transferred_since_last, total_written); transferred_since_last = 0; } if (!state->control.numeric) pv_write_retry(STDERR_FILENO, "\n", 1); if (1 == state->flag.trigger_exit) state->status.exit_status |= 32; /* * Free the state structure specific to this file descriptor. * Uunused so far - this is so that in future we could watch * multiple file descriptors similar to pv_watchpid_loop(). */ if (NULL != info.state) { pv_state_free(info.state); info.state = NULL; } /*@-compdestroy@ */ return state->status.exit_status; /*@+compdestroy@ */ /* splint: no leak of info.state as we just freed it above. */ } /* * Watch the progress of all file descriptors in process state->control.watch_pid * and show details about the transfers on standard error according to the * given options. * * Replaces format_string in "state" so that starts with "%N " if it doesn't * already do so. * * Returns nonzero on error. */ int pv_watchpid_loop(pvstate_t state) { const char *original_format_string; char new_format_string[512]; /* flawfinder: ignore */ struct pvwatchfd_s *info_array = NULL; int array_length = 0; int fd_to_idx[FD_SETSIZE]; struct timespec next_update, cur_time; int idx; int prev_displayed_lines, blank_lines; bool first_pass = true; /* * flawfinder rationale (new_format_string): zeroed with memset(), * only written to with pv_snprintf() which checks boundaries, and * explicitly terminated with \0. */ /* * Make sure the process exists first, so we can give an error if * it's not there at the start. */ if (kill(state->control.watch_pid, 0) != 0) { pv_error(state, "%s %u: %s", _("pid"), state->control.watch_pid, strerror(errno)); state->status.exit_status |= 2; return 2; } /* * Make sure there's a format string, and then insert %N into it if * it's not present. */ original_format_string = NULL != state->control.format_string ? state->control.format_string : state->control.default_format; memset(new_format_string, 0, sizeof(new_format_string)); if (NULL == original_format_string) { (void) pv_snprintf(new_format_string, sizeof(new_format_string), "%%N"); } else if (NULL == strstr(original_format_string, "%N")) { (void) pv_snprintf(new_format_string, sizeof(new_format_string), "%%N %s", original_format_string); } else { (void) pv_snprintf(new_format_string, sizeof(new_format_string), "%s", original_format_string); } new_format_string[sizeof(new_format_string) - 1] = '\0'; if (NULL != state->control.format_string) free(state->control.format_string); state->control.format_string = pv_strdup(new_format_string); /* * Get things ready for the main loop. */ memset(&cur_time, 0, sizeof(cur_time)); memset(&next_update, 0, sizeof(next_update)); pv_elapsedtime_read(&cur_time); pv_elapsedtime_copy(&next_update, &cur_time); pv_elapsedtime_add_nsec(&next_update, (long long) (1000000000.0 * state->control.interval)); for (idx = 0; idx < FD_SETSIZE; idx++) { fd_to_idx[idx] = -1; } prev_displayed_lines = 0; while (true) { int rc, fd, displayed_lines; if (1 == state->flag.trigger_exit) break; pv_elapsedtime_read(&cur_time); if (kill(state->control.watch_pid, 0) != 0) { if (first_pass) { pv_error(state, "%s %u: %s", _("pid"), state->control.watch_pid, strerror(errno)); state->status.exit_status |= 2; if (NULL != info_array) free(info_array); return 2; } break; } /* * Restart the loop after a brief delay, if it's not time to * update the display. */ if (pv_elapsedtime_compare(&cur_time, &next_update) < 0) { pv_nanosleep(50000000); continue; } pv_elapsedtime_add_nsec(&next_update, (long long) (1000000000.0 * state->control.interval)); /* Set the "next update" time to now, if it's in the past. */ if (pv_elapsedtime_compare(&next_update, &cur_time) < 0) pv_elapsedtime_copy(&next_update, &cur_time); /* Resize the display, if a resize signal was received. */ if (1 == state->flag.terminal_resized) { state->flag.terminal_resized = 0; pv_screensize(&(state->control.width), &(state->control.height)); for (idx = 0; NULL != info_array && idx < array_length; idx++) { if (NULL == info_array[idx].state) continue; info_array[idx].state->control.width = state->control.width; info_array[idx].state->control.height = state->control.height; pv_watchpid_setname(state, &(info_array[idx])); info_array[idx].state->flag.reparse_display = 1; } } rc = pv_watchpid_scanfds(state, state->control.watch_pid, &array_length, &info_array, fd_to_idx); if (rc != 0) { if (first_pass) { pv_error(state, "%s %u: %s", _("pid"), state->control.watch_pid, strerror(errno)); state->status.exit_status |= 2; if (NULL != info_array) free(info_array); return 2; } break; } first_pass = false; displayed_lines = 0; for (fd = 0; fd < FD_SETSIZE && NULL != info_array; fd++) { off_t position_now, transferred_since_last; struct timespec init_time, transfer_elapsed; long double elapsed_seconds; if (displayed_lines >= (int) (state->control.height)) break; idx = fd_to_idx[fd]; if (idx < 0) continue; if (info_array[idx].watch_fd < 0) { /* * Non-displayable fd - just remove if * changed */ if (pv_watchfd_changed(&(info_array[idx]))) { fd_to_idx[fd] = -1; info_array[idx].watch_pid = 0; debug("%s %d: %s", "fd", fd, "removing"); } continue; } if (NULL == info_array[idx].state) { debug("%s %d: %s", "fd", fd, "null state - skipping"); continue; } /* * Displayable fd - display, or remove if changed */ position_now = pv_watchfd_position(&(info_array[idx])); if (position_now < 0) { fd_to_idx[fd] = -1; info_array[idx].watch_pid = 0; debug("%s %d: %s", "fd", fd, "removing"); continue; } transferred_since_last = position_now - info_array[idx].position; info_array[idx].position = position_now; memset(&init_time, 0, sizeof(init_time)); memset(&transfer_elapsed, 0, sizeof(transfer_elapsed)); /* * Calculate the effective start time: the time we actually * started, plus the total time we spent stopped. */ pv_elapsedtime_add(&init_time, &(info_array[idx].start_time), &(state->signal.toffset)); /* * Now get the effective elapsed transfer time - current * time minus effective start time. */ pv_elapsedtime_subtract(&transfer_elapsed, &cur_time, &init_time); elapsed_seconds = pv_elapsedtime_seconds(&transfer_elapsed); if (displayed_lines > 0) { debug("%s", "adding newline"); pv_write_retry(STDERR_FILENO, "\n", 1); } debug("%s %d [%d]: %Lf / %Ld / %Ld", "fd", fd, idx, elapsed_seconds, transferred_since_last, position_now); pv_display(info_array[idx].state, elapsed_seconds, transferred_since_last, position_now); displayed_lines++; } /* * Write blank lines if we're writing fewer lines than last * time. */ blank_lines = prev_displayed_lines - displayed_lines; prev_displayed_lines = displayed_lines; if (blank_lines > 0) debug("%s: %d", "adding blank lines", blank_lines); while (blank_lines > 0) { unsigned int x; if (displayed_lines > 0) pv_write_retry(STDERR_FILENO, "\n", 1); for (x = 0; x < state->control.width; x++) pv_write_retry(STDERR_FILENO, " ", 1); pv_write_retry(STDERR_FILENO, "\r", 1); blank_lines--; displayed_lines++; } debug("%s: %d", "displayed lines", displayed_lines); while (displayed_lines > 1) { pv_write_retry(STDERR_FILENO, "\033[A", 3); displayed_lines--; } } /* * Clean up our displayed lines on exit. */ blank_lines = prev_displayed_lines; while (blank_lines > 0) { unsigned int x; for (x = 0; x < state->control.width; x++) pv_write_retry(STDERR_FILENO, " ", 1); pv_write_retry(STDERR_FILENO, "\r", 1); blank_lines--; if (blank_lines > 0) pv_write_retry(STDERR_FILENO, "\n", 1); } while (prev_displayed_lines > 1) { pv_write_retry(STDERR_FILENO, "\033[A", 3); prev_displayed_lines--; } /* * Free the per-fd state. */ for (idx = 0; NULL != info_array && idx < array_length; idx++) { if (NULL == info_array[idx].state) continue; pv_state_free(info_array[idx].state); info_array[idx].state = NULL; } if (NULL != info_array) free(info_array); return 0; } /* EOF */ pv-1.8.5/src/pv/number.c000066400000000000000000000135441452655021700150400ustar00rootroot00000000000000/* * Functions for converting strings to numbers. * * Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023 Andrew Wood * * License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'. */ #include "config.h" #include "pv.h" #include /* * This function is used instead of the macro from because * including causes weird versioned glibc dependencies on certain * Red Hat systems, complicating package management. */ static bool pv__isdigit(char c) { return ((c >= '0') && (c <= '9')) ? true : false; } /* * Return the numeric value of "str", as an off_t, where "str" is expected * to be a sequence of digits (without a thousands separator), possibly with * a fractional part, optionally followed by a units suffix such as "K" for * kibibytes. */ off_t pv_getnum_size(const char *str) { off_t integral_part = 0; off_t fractional_part = 0; unsigned int fractional_divisor = 1; unsigned int shift = 0; if (NULL == str) return (off_t) 0; /* Skip any non-numeric leading characters. */ while (str[0] != '\0' && (!pv__isdigit(str[0]))) str++; /* * Parse the integral part of the number - the digits before the * decimal mark or units. */ for (; pv__isdigit(str[0]); str++) { integral_part = integral_part * 10; integral_part += (off_t) (str[0] - '0'); } /* * If the next character is a decimal mark, skip over it and parse * the following digits as the fractional part of the number. * * Note that we hard-code the decimal mark as '.' or ',' so this * will fail if there are any locales whose decimal mark is not one * of those two characters. */ if (('.' == str[0]) || (',' == str[0])) { str++; for (; pv__isdigit(str[0]); str++) { /* Stop counting below 0.0001. */ if (fractional_divisor < 10000) { fractional_part = fractional_part * 10; fractional_part += (off_t) (str[0] - '0'); fractional_divisor = fractional_divisor * 10; } } } /* * Parse any units given (K=KiB=*1024, M=MiB=1024KiB, G=GiB=1024MiB, * T=TiB=1024GiB). */ if (str[0] != '\0') { /* Skip any spaces or tabs after the digits. */ while ((' ' == str[0]) || ('\t' == str[0])) str++; switch (str[0]) { case 'k': case 'K': shift = 10; break; case 'm': case 'M': shift = 20; break; case 'g': case 'G': shift = 30; break; case 't': case 'T': shift = 40; break; default: break; } } /* * Binary left-shift the supplied number by "shift" times, i.e. * apply the given units (KiB, MiB, etc) to it, but never shift left * more than 30 at a time to avoid overflows. */ while (shift > 0) { unsigned int shiftby; shiftby = shift; if (shiftby > 30) shiftby = 30; /*@-shiftimplementation@ */ /* * splint note: ignore the fact that the types we are * shifting are signed, because we know they are definitely * not negative. */ integral_part = (off_t) (integral_part << shiftby); fractional_part = (off_t) (fractional_part << shiftby); /*@+shiftimplementation@ */ shift -= shiftby; } /* * Add the fractional part, divided by its divisor, to the integral * part, now that we've multiplied everything by the appropriate * units. */ fractional_part = fractional_part / fractional_divisor; integral_part += fractional_part; return integral_part; } /* * Return the numeric value of "str", as a double, where "str" is expected * to be a positive decimal number expressing a time interval. */ double pv_getnum_interval(const char *str) { double result = 0.0; double step = 1; if (NULL == str) return 0.0; /* Skip any non-digit characters at the start. */ while (str[0] != '\0' && (!pv__isdigit(str[0]))) str++; /* Parse the digits before the decimal mark. */ for (; pv__isdigit(str[0]); str++) { result = result * 10; result += (double) (str[0] - '0'); } /* If there is no decimal mark, return the value as-is. */ if ((str[0] != '.') && (str[0] != ',')) return result; /* Move past the decimal mark. */ str++; /* Parse the digits after the decimal mark, up to 0.0000001. */ for (; pv__isdigit(str[0]) && step < 1000000; str++) { step = step * 10; result += ((double) (str[0] - '0')) / step; } return result; } /* * Return the numeric value of "str", as an unsigned int, following the same * rules as pv_getnum_size(), expecting "str" to express a value to be used * as a count (such as number of screen columns, or size of a buffer). */ unsigned int pv_getnum_count(const char *str) { return (unsigned int) pv_getnum_size(str); } /* * Return true if the given string is a valid number of the given type. */ bool pv_getnum_check(const char *str, pv_numtype type) { if (NULL == str) return false; /* Skip leading spaces and tabs. */ while ((' ' == str[0]) || ('\t' == str[0])) str++; /* If the next character isn't a digit, this isn't a number. */ if (!pv__isdigit(str[0])) return false; /* Skip over the digits. */ for (; pv__isdigit(str[0]); str++); /* * If there's a decimal mark (see note in pv_getnum_size() above), * check that too. */ if (('.' == str[0]) || (',' == str[0])) { /* Integers should have no decimal mark. */ if (type == PV_NUMTYPE_INTEGER) return false; /* Skip the decimal mark, then all digits. */ str++; for (; pv__isdigit(str[0]); str++); } /* If the string ends here, this is a valid number. */ if ('\0' == str[0]) return true; /* A units suffix is not allowed for doubles, only for integers. */ if (type == PV_NUMTYPE_DOUBLE) return false; /* Skip trailing spaces or tabs. */ while ((' ' == str[0]) || ('\t' == str[0])) str++; /* Check the units suffix is one we know about. */ switch (str[0]) { case 'k': case 'K': case 'm': case 'M': case 'g': case 'G': case 't': case 'T': str++; break; default: return false; } /* If the string has trailing text, it's not a valid number. */ if (str[0] != '\0') return false; return true; } /* EOF */ pv-1.8.5/src/pv/signal.c000066400000000000000000000331341452655021700150220ustar00rootroot00000000000000/* * Signal handling functions. * * Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023 Andrew Wood * * License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'. */ #include "config.h" #include "pv.h" #include "pv-internal.h" #include #include #include #include #include #include #include #ifdef HAVE_IPC void pv_crs_needreinit(pvstate_t); #endif /*@null@*/ static pvstate_t pv_sig_state = NULL; /* * Ensure that terminal attribute TOSTOP is set. If we have to set it, * record that fact by setting the state boolean "pv_tty_tostop_added" to * true, so that in pv_sig_fini() we can turn it back off again. */ static void pv_sig_ensure_tty_tostop() { struct termios terminal_attributes; if (NULL == pv_sig_state) return; if (0 != tcgetattr(STDERR_FILENO, &terminal_attributes)) { debug("%s: %s", "failed to read terminal attributes", strerror(errno)); return; } if (0 == (terminal_attributes.c_lflag & TOSTOP)) { terminal_attributes.c_lflag |= TOSTOP; if (0 == tcsetattr(STDERR_FILENO, TCSANOW, &terminal_attributes)) { pv_sig_state->signal.pv_tty_tostop_added = true; debug("%s", "set terminal TOSTOP attribute"); } else { debug("%s: %s", "failed to set terminal TOSTOP attribute", strerror(errno)); } #if HAVE_IPC /* * In "-c" mode with IPC, make all "pv -c" instances aware * that we set TOSTOP, so the last one can clear it on exit. */ if (pv_sig_state->control.cursor && (NULL != pv_sig_state->cursor.shared) && (!pv_sig_state->cursor.noipc)) { pv_sig_state->cursor.shared->tty_tostop_added = true; } #endif } } /* * Handle SIGTTOU (tty output for background process) by redirecting stderr * to /dev/null, so that we can be stopped and backgrounded without messing * up the terminal. We store the old stderr file descriptor so that on a * subsequent SIGCONT we can try writing to the terminal again, in case we * get backgrounded and later get foregrounded again. */ static void pv_sig_ttou( /*@unused@ */ __attribute__((unused)) int s) { int fd; if (NULL == pv_sig_state) return; fd = open("/dev/null", O_RDWR); /* flawfinder: ignore */ if (fd < 0) { debug("%s: %s", "failed to open /dev/null", strerror(errno)); return; } /* * flawfinder rationale: not checking for symlinks because this is * explicitly a device file under /dev so we assume it is safe to * open. * * TODO: look at just preventing stderr output instead of writing to * stderr while backgrounded. */ if (-1 == pv_sig_state->signal.old_stderr) pv_sig_state->signal.old_stderr = dup(STDERR_FILENO); if (dup2(fd, STDERR_FILENO) < 0) { debug("%s: %s", "failed to replace stderr", strerror(errno)); } if (0 != close(fd)) { debug("%s: %s", "failed to close /dev/null", strerror(errno)); } } /* * Handle SIGTSTP (stop typed at tty) by storing the time the signal * happened for later use by pv_sig_cont(), and then stopping the process. */ static void pv_sig_tstp( /*@unused@ */ __attribute__((unused)) int s) { if (NULL == pv_sig_state) return; pv_elapsedtime_read(&(pv_sig_state->signal.tstp_time)); if (0 != raise(SIGSTOP)) { debug("%s: %s", "raise", strerror(errno)); } } /* * Handle SIGCONT (continue if stopped) by adding the elapsed time since the * last SIGTSTP to the elapsed time offset, and by trying to write to the * terminal again (by replacing the /dev/null stderr with the old stderr). */ static void pv_sig_cont( /*@unused@ */ __attribute__((unused)) int s) { struct timespec current_time; struct timespec time_spent_stopped; if (NULL == pv_sig_state) return; pv_sig_state->flag.terminal_resized = 1; /* * We can only make the time adjustments if this SIGCONT followed a * SIGTSTP such that we have a stop time. */ if (0 != pv_sig_state->signal.tstp_time.tv_sec) { memset(¤t_time, 0, sizeof(current_time)); memset(&time_spent_stopped, 0, sizeof(time_spent_stopped)); pv_elapsedtime_read(¤t_time); /* time spent stopped = current time - time SIGTSTP received */ pv_elapsedtime_subtract(&time_spent_stopped, ¤t_time, &(pv_sig_state->signal.tstp_time)); /* add time spent stopped the total stopped-time count */ pv_elapsedtime_add(&(pv_sig_state->signal.toffset), &(pv_sig_state->signal.toffset), &time_spent_stopped); /* reset the SIGTSTP receipt time */ pv_elapsedtime_zero(&(pv_sig_state->signal.tstp_time)); } /* * Restore the old stderr, if we had replaced it. */ if (pv_sig_state->signal.old_stderr != -1) { if (dup2(pv_sig_state->signal.old_stderr, STDERR_FILENO) < 0) { debug("%s: %s", "failed to restore old stderr", strerror(errno)); } if (0 != close(pv_sig_state->signal.old_stderr)) { debug("%s: %s", "failed to close duplicate old stderr", strerror(errno)); } pv_sig_state->signal.old_stderr = -1; } pv_sig_ensure_tty_tostop(); #ifdef HAVE_IPC pv_crs_needreinit(pv_sig_state); #endif } #ifdef SIGWINCH /* * Handle SIGWINCH (window size changed) by setting a flag. */ static void pv_sig_winch( /*@unused@ */ __attribute__((unused)) int s) { if (NULL == pv_sig_state) return; pv_sig_state->flag.terminal_resized = 1; } #endif /* * Handle termination signals by setting the abort flag. */ static void pv_sig_term( /*@unused@ */ __attribute__((unused)) int s) { if (NULL == pv_sig_state) return; pv_sig_state->flag.trigger_exit = 1; } #ifdef SA_SIGINFO /* * Handle a SIGUSR2 by setting a flag to say we received it, after recording * the sending PID. */ static void pv_sig_usr2( /*@unused@ */ __attribute__((unused)) int sig, siginfo_t * info, /*@unused@ */ __attribute__((unused)) void *ucontext) { if (NULL == pv_sig_state) return; if (NULL == info) return; pv_sig_state->signal.rxusr2 = 1; pv_sig_state->signal.sender = info->si_pid; } /* * Return true if a SIGUSR2 signal has been received since the last time * this function was called, populating *pid with the sending PID if so. */ bool pv_sigusr2_received(pvstate_t state, pid_t * pid) { if (NULL == state) return false; if (0 == state->signal.rxusr2) return false; if (NULL != pid) *pid = state->signal.sender; state->signal.rxusr2 = 0; return true; } #endif /* * Initialise signal handling. */ void pv_sig_init(pvstate_t state) { static struct sigaction sa; memset(&sa, 0, sizeof(sa)); /* * Note that wherever we use a "struct sigaction", we declare it * static and explicitly zero it before use, because it may contain * deeper structures (e.g. "sigset_t") which trigger splint * warnings about potential memory leaks. */ pv_sig_state = state; pv_sig_state->signal.old_stderr = -1; pv_elapsedtime_zero(&(pv_sig_state->signal.tstp_time)); pv_elapsedtime_zero(&(pv_sig_state->signal.toffset)); /* * Note that we cast all sigemptyset() and sigaction() return values * to void, because there's nothing we can reasonably do about any * conceivable error they may return. */ /* * Ignore SIGPIPE, so we don't die if stdout is a pipe and the other * end closes unexpectedly. */ sa.sa_handler = SIG_IGN; (void) sigemptyset(&(sa.sa_mask)); sa.sa_flags = 0; (void) sigaction(SIGPIPE, &sa, &(pv_sig_state->signal.old_sigpipe)); /* * Handle SIGTTOU by continuing with output switched off, so that we * can be stopped and backgrounded without messing up the terminal. */ sa.sa_handler = pv_sig_ttou; (void) sigemptyset(&(sa.sa_mask)); sa.sa_flags = 0; (void) sigaction(SIGTTOU, &sa, &(pv_sig_state->signal.old_sigttou)); /* * Handle SIGTSTP by storing the time the signal happened for later * use by pv_sig_cont(), and then stopping the process. */ sa.sa_handler = pv_sig_tstp; (void) sigemptyset(&(sa.sa_mask)); sa.sa_flags = 0; (void) sigaction(SIGTSTP, &sa, &(pv_sig_state->signal.old_sigtstp)); /* * Handle SIGCONT by adding the elapsed time since the last SIGTSTP * to the elapsed time offset, and by trying to write to the * terminal again. */ sa.sa_handler = pv_sig_cont; (void) sigemptyset(&(sa.sa_mask)); sa.sa_flags = 0; (void) sigaction(SIGCONT, &sa, &(pv_sig_state->signal.old_sigcont)); /* * Handle SIGWINCH by setting a flag to let the main loop know it * has to reread the terminal size. */ #ifdef SIGWINCH sa.sa_handler = pv_sig_winch; (void) sigemptyset(&(sa.sa_mask)); sa.sa_flags = 0; (void) sigaction(SIGWINCH, &sa, &(pv_sig_state->signal.old_sigwinch)); #endif /* * Handle SIGINT, SIGHUP, SIGTERM by setting a flag to let the * main loop know it should quit now. */ sa.sa_handler = pv_sig_term; (void) sigemptyset(&(sa.sa_mask)); sa.sa_flags = 0; (void) sigaction(SIGINT, &sa, &(pv_sig_state->signal.old_sigint)); sa.sa_handler = pv_sig_term; (void) sigemptyset(&(sa.sa_mask)); sa.sa_flags = 0; (void) sigaction(SIGHUP, &sa, &(pv_sig_state->signal.old_sighup)); sa.sa_handler = pv_sig_term; (void) sigemptyset(&(sa.sa_mask)); sa.sa_flags = 0; (void) sigaction(SIGTERM, &sa, &(pv_sig_state->signal.old_sigterm)); #ifdef SA_SIGINFO /* * Handle SIGUSR2 by setting a flag to say the signal has been * received, and storing the sending process's PID. */ memset(&sa, 0, sizeof(sa)); sa.sa_sigaction = pv_sig_usr2; (void) sigemptyset(&(sa.sa_mask)); /*@-unrecog@ *//* splint doesn't know about SA_SIGINFO */ sa.sa_flags = SA_SIGINFO; /*@+unrecog@ */ (void) sigaction(SIGUSR2, &sa, &(pv_sig_state->signal.old_sigusr2)); memset(&sa, 0, sizeof(sa)); #endif /* * Ensure that the TOSTOP terminal attribute is set, so that a * SIGTTOU signal will be raised if we try to write to the terminal * while backgrounded (see the SIGTTOU handler above). */ pv_sig_ensure_tty_tostop(); } /* * Shut down signal handling. If we had set the TOSTOP terminal attribute, * and we're in the foreground, also turn that off (though if we're in * cursor "-c" mode, only do that if we're the last PV instance, otherwise * leave the terminal alone). */ void pv_sig_fini( /*@unused@ */ __attribute__((unused)) pvstate_t state) { bool need_to_clear_tostop = false; if (NULL == pv_sig_state) return; (void) sigaction(SIGPIPE, &(pv_sig_state->signal.old_sigpipe), NULL); (void) sigaction(SIGTTOU, &(pv_sig_state->signal.old_sigttou), NULL); (void) sigaction(SIGTSTP, &(pv_sig_state->signal.old_sigtstp), NULL); (void) sigaction(SIGCONT, &(pv_sig_state->signal.old_sigcont), NULL); #ifdef SIGWINCH (void) sigaction(SIGWINCH, &(pv_sig_state->signal.old_sigwinch), NULL); #endif (void) sigaction(SIGINT, &(pv_sig_state->signal.old_sigint), NULL); (void) sigaction(SIGHUP, &(pv_sig_state->signal.old_sighup), NULL); (void) sigaction(SIGTERM, &(pv_sig_state->signal.old_sigterm), NULL); #ifdef SA_SIGINFO (void) sigaction(SIGUSR2, &(pv_sig_state->signal.old_sigusr2), NULL); #endif need_to_clear_tostop = pv_sig_state->signal.pv_tty_tostop_added; if (pv_sig_state->control.cursor) { #ifdef HAVE_IPC /* * We won't clear TOSTOP if other "pv -c" instances * were still running when pv_crs_fini() ran. * * TODO: we need a better way to determine if we're the last * "pv" left. */ if (pv_sig_state->control.cursor && pv_sig_state->cursor.pvcount > 1) { need_to_clear_tostop = false; } #else /* !HAVE_IPC */ /* * Without IPC we can't tell whether the other "pv -c" * instances in the pipeline have finished so we will just * have to clear TOSTOP anyway. */ #endif /* !HAVE_IPC */ } debug("%s=%s", "need_to_clear_tostop", need_to_clear_tostop ? "true" : "false"); if (need_to_clear_tostop && pv_in_foreground()) { struct termios terminal_attributes; debug("%s", "about to to clear TOSTOP terminal attribute if it is set"); if (0 != tcgetattr(STDERR_FILENO, &terminal_attributes)) { debug("%s: %s", "tcgetattr", strerror(errno)); } else if (0 != (terminal_attributes.c_lflag & TOSTOP)) { terminal_attributes.c_lflag -= TOSTOP; if (0 == tcsetattr(STDERR_FILENO, TCSANOW, &terminal_attributes)) { debug("%s", "cleared TOSTOP terminal attribute"); } else { debug("%s: %s", "failed to clear TOSTOP terminal attribute", strerror(errno)); } } pv_sig_state->signal.pv_tty_tostop_added = false; } } /* * Stop reacting to SIGTSTP and SIGCONT. */ void pv_sig_nopause(void) { static struct sigaction sa; memset(&sa, 0, sizeof(sa)); sa.sa_handler = SIG_IGN; (void) sigemptyset(&(sa.sa_mask)); sa.sa_flags = 0; (void) sigaction(SIGTSTP, &sa, NULL); sa.sa_handler = SIG_DFL; (void) sigemptyset(&(sa.sa_mask)); sa.sa_flags = 0; (void) sigaction(SIGCONT, &sa, NULL); } /* * Start catching SIGTSTP and SIGCONT again. */ void pv_sig_allowpause(void) { static struct sigaction sa; memset(&sa, 0, sizeof(sa)); sa.sa_handler = pv_sig_tstp; (void) sigemptyset(&(sa.sa_mask)); sa.sa_flags = 0; (void) sigaction(SIGTSTP, &sa, NULL); sa.sa_handler = pv_sig_cont; (void) sigemptyset(&(sa.sa_mask)); sa.sa_flags = 0; (void) sigaction(SIGCONT, &sa, NULL); } /* * If we have redirected stderr to /dev/null, check every second or so to * see whether we can write to the terminal again - this is so that if we * get backgrounded, then foregrounded again, we start writing to the * terminal again. */ void pv_sig_checkbg(void) { static time_t next_check = 0; if (NULL == pv_sig_state) return; if (time(NULL) < next_check) return; next_check = time(NULL) + 1; if (-1 == pv_sig_state->signal.old_stderr) return; if (dup2(pv_sig_state->signal.old_stderr, STDERR_FILENO) < 0) { debug("%s: %s", "failed to restore old stderr", strerror(errno)); } if (0 != close(pv_sig_state->signal.old_stderr)) { debug("%s: %s", "failed to close duplicate old stderr", strerror(errno)); } pv_sig_state->signal.old_stderr = -1; pv_sig_ensure_tty_tostop(); #ifdef HAVE_IPC pv_crs_needreinit(pv_sig_state); #endif } /* EOF */ pv-1.8.5/src/pv/state.c000066400000000000000000000240101452655021700146560ustar00rootroot00000000000000/* * State management functions. * * Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023 Andrew Wood * * License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'. */ #include "config.h" #include "pv.h" #include "pv-internal.h" #include #include #include #include #include /* alloc / realloc history buffer */ static void pv_alloc_history(pvstate_t state) { if (NULL != state->display.history) free(state->display.history); state->display.history = NULL; state->display.history = calloc((size_t) (state->display.history_len), sizeof(state->display.history[0])); if (NULL == state->display.history) { /*@-mustfreefresh@ */ /* * splint note: the gettext calls made by _() cause memory * leak warnings, but in this case it's unavoidable, and * mitigated by the fact we only translate each string once. */ fprintf(stderr, "%s: %s: %s\n", state->status.program_name, _("history structure allocation failed"), strerror(errno)); /*@+mustfreefresh@ */ return; } state->display.history_first = state->display.history_last = 0; state->display.history[0].elapsed_sec = 0.0; /* to be safe, memset() not recommended for doubles */ } /* * Create a new state structure, and return it, or 0 (NULL) on error. */ pvstate_t pv_state_alloc(const char *program_name) { pvstate_t state; state = calloc(1, sizeof(*state)); if (NULL == state) return NULL; memset(state, 0, sizeof(*state)); /* splint 3.1.2 thinks this is required for some reason. */ if (NULL != state->status.program_name) { free(state->status.program_name); } state->status.program_name = pv_strdup(program_name); if (NULL == state->status.program_name) { free(state); return NULL; } state->control.watch_pid = 0; state->control.watch_fd = -1; #ifdef HAVE_IPC state->cursor.shmid = -1; state->cursor.pvcount = 1; #endif /* HAVE_IPC */ state->cursor.lock_fd = -1; state->flag.reparse_display = 1; state->status.current_input_file = -1; #ifdef HAVE_SPLICE state->transfer.splice_failed_fd = -1; #endif /* HAVE_SPLICE */ state->display.display_visible = false; /* * Get the current working directory, if possible, as a base for * showing relative filenames with --watchfd. */ if (NULL == getcwd(state->status.cwd, PV_SIZEOF_CWD - 1)) { /* failed - will always show full path */ state->status.cwd[0] = '\0'; } if ('\0' == state->status.cwd[1]) { /* CWD is root directory - always show full path */ state->status.cwd[0] = '\0'; } state->status.cwd[PV_SIZEOF_CWD - 1] = '\0'; return state; } /* * Free a state structure, after which it can no longer be used. */ void pv_state_free(pvstate_t state) { if (0 == state) return; if (NULL != state->status.program_name) free(state->status.program_name); state->status.program_name = NULL; if (NULL != state->display.display_buffer) free(state->display.display_buffer); state->display.display_buffer = NULL; if (NULL != state->control.name) { free(state->control.name); state->control.name = NULL; } if (NULL != state->control.format_string) { free(state->control.format_string); state->control.format_string = NULL; } /*@-keeptrans@ */ if (NULL != state->transfer.transfer_buffer) free(state->transfer.transfer_buffer); state->transfer.transfer_buffer = NULL; /*@+keeptrans@ */ /* splint - explicitly freeing this structure, so free() here is OK. */ if (NULL != state->display.history) free(state->display.history); state->display.history = NULL; if (NULL != state->files.filename) { unsigned int file_idx; for (file_idx = 0; file_idx < state->files.file_count; file_idx++) { /*@-unqualifiedtrans@ */ free(state->files.filename[file_idx]); /*@+unqualifiedtrans@ */ /* splint: see similar code below. */ } free(state->files.filename); state->files.filename = NULL; } free(state); return; } /* * Set the formatting string, given a set of old-style formatting options. */ void pv_state_set_format(pvstate_t state, bool progress, bool timer, bool eta, bool fineta, bool rate, bool average_rate, bool bytes, bool bufpercent, size_t lastwritten, /*@null@ */ const char *name) { #define PV_ADDFORMAT(x,y) if (x) { \ if (state->control.default_format[0] != '\0') \ (void) pv_strlcat(state->control.default_format, " ", sizeof(state->control.default_format)); \ (void) pv_strlcat(state->control.default_format, y, sizeof(state->control.default_format)); \ } state->control.default_format[0] = '\0'; PV_ADDFORMAT(name, "%N"); PV_ADDFORMAT(bytes, "%b"); PV_ADDFORMAT(bufpercent, "%T"); PV_ADDFORMAT(timer, "%t"); PV_ADDFORMAT(rate, "%r"); PV_ADDFORMAT(average_rate, "%a"); PV_ADDFORMAT(progress, "%p"); PV_ADDFORMAT(eta, "%e"); PV_ADDFORMAT(fineta, "%I"); if (lastwritten > 0) { char buf[16]; /* flawfinder: ignore */ memset(buf, 0, sizeof(buf)); (void) pv_snprintf(buf, sizeof(buf), "%%%uA", (unsigned int) lastwritten); PV_ADDFORMAT(lastwritten > 0, buf); /* * flawfinder rationale: large enough for string, zeroed * before use, only written to by pv_snprintf() with the * right buffer length. */ } if (NULL != state->control.name) { free(state->control.name); state->control.name = NULL; } if (NULL != name) state->control.name = pv_strdup(name); state->flag.reparse_display = 1; } void pv_state_force_set(pvstate_t state, bool val) { state->control.force = val; } void pv_state_cursor_set(pvstate_t state, bool val) { state->control.cursor = val; } void pv_state_numeric_set(pvstate_t state, bool val) { state->control.numeric = val; } void pv_state_wait_set(pvstate_t state, bool val) { state->control.wait = val; } void pv_state_delay_start_set(pvstate_t state, double val) { state->control.delay_start = val; } void pv_state_linemode_set(pvstate_t state, bool val) { state->control.linemode = val; } void pv_state_bits_set(pvstate_t state, bool bits) { state->control.bits = bits; } void pv_state_null_terminated_lines_set(pvstate_t state, bool val) { state->control.null_terminated_lines = val; } void pv_state_no_display_set(pvstate_t state, bool val) { state->control.no_display = val; } void pv_state_skip_errors_set(pvstate_t state, unsigned int val) { state->control.skip_errors = val; } void pv_state_error_skip_block_set(pvstate_t state, off_t val) { state->control.error_skip_block = val; } void pv_state_stop_at_size_set(pvstate_t state, bool val) { state->control.stop_at_size = val; } void pv_state_sync_after_write_set(pvstate_t state, bool val) { state->control.sync_after_write = val; } void pv_state_direct_io_set(pvstate_t state, bool val) { state->control.direct_io = val; state->control.direct_io_changed = true; } void pv_state_discard_input_set(pvstate_t state, bool val) { state->control.discard_input = val; } void pv_state_rate_limit_set(pvstate_t state, off_t val) { state->control.rate_limit = val; } void pv_state_target_buffer_size_set(pvstate_t state, size_t val) { state->control.target_buffer_size = val; } void pv_state_no_splice_set(pvstate_t state, bool val) { state->control.no_splice = val; } void pv_state_size_set(pvstate_t state, off_t val) { state->control.size = val; } void pv_state_interval_set(pvstate_t state, double val) { state->control.interval = val; } void pv_state_width_set(pvstate_t state, unsigned int val, bool was_set_manually) { state->control.width = val; state->control.width_set_manually = was_set_manually; } void pv_state_height_set(pvstate_t state, unsigned int val, bool was_set_manually) { state->control.height = val; state->control.height_set_manually = was_set_manually; } void pv_state_name_set(pvstate_t state, /*@null@ */ const char *val) { if (NULL != state->control.name) { free(state->control.name); state->control.name = NULL; } if (NULL != val) state->control.name = pv_strdup(val); } void pv_state_format_string_set(pvstate_t state, /*@null@ */ const char *val) { if (NULL != state->control.format_string) { free(state->control.format_string); state->control.format_string = NULL; } if (NULL != val) state->control.format_string = pv_strdup(val); } void pv_state_watch_pid_set(pvstate_t state, pid_t val) { state->control.watch_pid = val; } void pv_state_watch_fd_set(pvstate_t state, int val) { state->control.watch_fd = val; } void pv_state_average_rate_window_set(pvstate_t state, unsigned int val) { if (val < 1) val = 1; state->control.average_rate_window = val; if (val >= 20) { state->display.history_len = (size_t) (val / 5 + 1); state->display.history_interval = 5; } else { state->display.history_len = (size_t) (val + 1); state->display.history_interval = 1; } pv_alloc_history(state); } /* * Set the array of input files. */ void pv_state_inputfiles(pvstate_t state, unsigned int input_file_count, const char **input_files) { unsigned int file_idx; if (NULL != state->files.filename) { for (file_idx = 0; file_idx < state->files.file_count; file_idx++) { /*@-unqualifiedtrans@ */ free(state->files.filename[file_idx]); /*@+unqualifiedtrans@ */ /* * TODO: find a way to tell splint the array * contents are "only" and "null" as well as the * array itself. */ } free(state->files.filename); state->files.filename = NULL; state->files.file_count = 0; } state->files.filename = calloc((size_t) (input_file_count + 1), sizeof(char *)); if (NULL == state->files.filename) { /*@-mustfreefresh@ *//* see similar _() issue above */ fprintf(stderr, "%s: %s: %s\n", state->status.program_name, _("file list allocation failed"), strerror(errno)); /*@+mustfreefresh@ */ return; } for (file_idx = 0; file_idx < input_file_count; file_idx++) { /*@-nullstate@ */ state->files.filename[file_idx] = pv_strdup(input_files[file_idx]); if (NULL == state->files.filename[file_idx]) { /*@-mustfreefresh@ *//* see similar _() issue above */ fprintf(stderr, "%s: %s: %s\n", state->status.program_name, _("file list allocation failed"), strerror(errno)); /*@+mustfreefresh@ */ return; } } state->files.file_count = input_file_count; } /*@+nullstate@*/ /* splint: see unqualifiedtrans note by free() above. */ /* EOF */ pv-1.8.5/src/pv/string.c000066400000000000000000000100341452655021700150450ustar00rootroot00000000000000/* * Functions for portably managing strings. * * Copyright 2023 Andrew Wood * * License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'. */ #include "config.h" #include "pv.h" #include #include #include #include /* * Wrapper for sprintf(), falling back to sprintf() on systems without that * function. * * Returns -1 if "str" or "format" are NULL or if "size" is 0. * * Otherwise, ensures that the buffer "str" is always terminated with a '\0' * byte, before returning whatever the system's vsnprintf() or vsprintf() * returned. */ int pv_snprintf(char *str, size_t size, const char *format, ...) { va_list ap; int ret; if (NULL == str) return -1; if (0 == size) return -1; if (NULL == format) return -1; str[0] = '\0'; va_start(ap, format); #ifdef HAVE_VSNPRINTF ret = vsnprintf(str, size, format, ap); /* flawfinder: ignore */ #else /* ! HAVE_VSNPRINTF */ ret = vsprintf(str, format, ap); /* flawfinder: ignore */ #endif /* HAVE_VSNPRINTF */ va_end(ap); str[size - 1] = '\0'; /* * flawfinder rationale: this function replaces snprintf so * explicitly takes a non-constant format; also it explicitly * \0-terminates the output buffer, as flawfinder warns that some * sprintf() variants do not. */ return ret; } /* * Implementation of strlcat() where it is unavailable: append a string to a * buffer, constraining the buffer to a particular size and ensuring * termination with '\0'. * * Appends the string "src" to the buffer "dst", assuming "dst" is "dstsize" * bytes long, and ensuring that "dst" is always terminated with a '\0' * byte. * * Returns the intended length of the string, not including the terminating * '\0', i.e. strlen(src)+strlen(dst), regardless of whether truncation * occurred. * * Note that this implementation has the side effect that "dst" will always * be terminated with a '\0' even if "src" was zero bytes long. */ size_t pv_strlcat(char *dst, const char *src, size_t dstsize) { #ifdef HAVE_STRLCAT size_t result; result = strlcat(dst, src, dstsize); if ((NULL != dst) && (dstsize > 0)) dst[dstsize - 1] = '\0'; return result; #else size_t dstlen, srclen, available; if (NULL == dst) return 0; if (NULL == src) return 0; if (0 == dstsize) return 0; dst[dstsize - 1] = '\0'; dstlen = strlen(dst); /* flawfinder: ignore */ srclen = strlen(src); /* flawfinder: ignore */ /* * flawfinder rationale: src must explicitly be \0 terminated, so * this is up to the caller; with dst, we enforce \0 termination * before calling strlen(). */ available = dstsize - dstlen; if (available > 1) (void) pv_snprintf(dst + dstlen, available, "%.*s", available - 1, src); return dstlen + srclen; #endif } /* * Allocate and return a duplicate of a \0-terminated string, ensuring that * the duplicate is also \0-terminated. Returns NULL on error. */ /*@null@ */ /*@only@ */ char *pv_strdup(const char *original) { size_t length; char *duplicate; if (NULL == original) { errno = EINVAL; return NULL; } length = strlen(original); /* flawfinder: ignore */ /* * flawfinder rationale: the original string is explicitly required * to be \0 terminated. */ duplicate = calloc(1, 1 + length); if (NULL == duplicate) return NULL; memcpy(duplicate, original, length); /* flawfinder: ignore */ /* * flawfinder rationale: the buffer is explicitly allocated to be * large enough. */ duplicate[length] = '\0'; return duplicate; } /* * Return a pointer to the last matching character in the buffer, or NULL if * not found. */ /*@null@ */ /*@temp@ */ void *pv_memrchr(const void *buffer, int match, size_t length) { #ifdef HAVE_MEMRCHR /*@-unrecog @ *//* splint doesn't know of memrchr() */ return memrchr(buffer, match, length); /*@+unrecog @ */ #else unsigned char *ptr; if (length < 1) return NULL; ptr = ((unsigned char *) buffer) + length - 1; while (ptr >= (unsigned char *) buffer) { if ((int) (ptr[0]) == match) return (void *) ptr; ptr--; } return NULL; #endif } /* EOF */ pv-1.8.5/src/pv/transfer.c000066400000000000000000000773711452655021700154040ustar00rootroot00000000000000/* * Functions for transferring data between file descriptors. * * Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023 Andrew Wood * * License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'. */ #include "config.h" #include "pv.h" #include "pv-internal.h" #include #include #include #include #include #include #include #include #include #include #include /* * splint note: In a few places we use "#if SPLINT" to substitute other code * while analysing with splint, to work around the issues it has with * FD_ZERO, FD_SET, FD_ISSET - these macros expand to code it does not like, * such as using << with an fd which may be negative, or comparing an * unsigned integer with a size_t, and it doesn't seem to work to turn off * those specific warnings where these macros are used. */ /* * Return >0 if data is ready to read on fd_in, or write on fd_out, before * "usec" microseconds have elapsed, 0 if not, or negative on error. Either * or both of "fd_in" and "fd_out" may be negative to ignore that side. If * fd_in_ready and/or fd_out_ready are not NULL, they will be populated with * true or false depending on whether data is ready on those sides. */ static int is_data_ready(int fd_in, /*@null@ */ bool *fd_in_ready, int fd_out, /*@null@ */ bool *fd_out_ready, long usec) { struct timeval tv; fd_set readfds; fd_set writefds; fd_set exceptfds; int max_fd; int result; max_fd = -1; if (fd_in > max_fd) max_fd = fd_in; if (fd_out > max_fd) max_fd = fd_out; memset(&tv, 0, sizeof(tv)); #if SPLINT /* splint doesn't like FD_ZERO and FD_SET. */ memset(&readfds, 0, sizeof(readfds)); memset(&writefds, 0, sizeof(writefds)); memset(&exceptfds, 0, sizeof(exceptfds)); #else /* !SPLINT */ FD_ZERO(&readfds); FD_ZERO(&writefds); FD_ZERO(&exceptfds); if (fd_in >= 0) FD_SET(fd_in, &readfds); if (fd_out >= 0) FD_SET(fd_out, &writefds); #endif /* !SPLINT */ tv.tv_sec = usec / 1000000; tv.tv_usec = usec % 1000000; if (NULL != fd_in_ready) *fd_in_ready = false; if (NULL != fd_out_ready) *fd_out_ready = false; result = select(max_fd + 1, &readfds, &writefds, &exceptfds, &tv); if (result > 0) { if ((fd_in >= 0) && (NULL != fd_in_ready) #ifndef SPLINT && (FD_ISSET(fd_in, &readfds)) #endif ) { *fd_in_ready = true; } if ((fd_out >= 0) && (NULL != fd_out_ready) #ifndef SPLINT && (FD_ISSET(fd_out, &writefds)) #endif ) { *fd_out_ready = true; } } return result; } /* * Read up to "count" bytes from file descriptor "fd" into the buffer "buf", * and return the number of bytes read, like read(). * * Unlike read(), if we have read less than "count" bytes, we check to see * if there's any more to read, and keep trying, to make sure we fill the * buffer as full as we can. * * We stop retrying if the time elapsed since this function was entered * reaches TRANSFER_READ_TIMEOUT seconds. */ static ssize_t pv__transfer_read_repeated(int fd, void *buf, size_t count) { struct timespec start_time; ssize_t total_read; memset(&start_time, 0, sizeof(start_time)); pv_elapsedtime_read(&start_time); total_read = 0; while (count > 0) { ssize_t nread; struct timespec cur_time, transfer_elapsed; long double elapsed_seconds; nread = read(fd, buf, (size_t) (count > MAX_READ_AT_ONCE ? MAX_READ_AT_ONCE : count)); /* flawfinder: ignore */ /* * flawfinder rationale: reads stop after "count" bytes, and * we handle negative and zero results from read(), so it is * bounded to the buffer size the caller told us to use. */ if (nread < 0) return nread; total_read += nread; buf += nread; count -= nread; if (0 == nread) return total_read; memset(&cur_time, 0, sizeof(cur_time)); memset(&transfer_elapsed, 0, sizeof(transfer_elapsed)); elapsed_seconds = 0.0; pv_elapsedtime_read(&cur_time); pv_elapsedtime_subtract(&transfer_elapsed, &cur_time, &start_time); elapsed_seconds = pv_elapsedtime_seconds(&transfer_elapsed); if (elapsed_seconds > TRANSFER_READ_TIMEOUT) { debug("%s %d: %s (%lf %s)", "fd", fd, "stopping read - timer expired", elapsed_seconds, "sec elapsed"); return total_read; } if (count > 0) { debug("%s %d: %s (%ld %s, %ld %s)", "fd", fd, "trying another read after partial buffer fill", nread, "read", count, "remaining"); if (is_data_ready(fd, NULL, -1, NULL, 0) < 1) break; } } return total_read; } /* * Write up to "count" bytes to file descriptor "fd" from the buffer "buf", * and return the number of bytes written, like write(). * * Unlike write(), if we have written less than "count" bytes, we check to * see if we can write any more, and keep trying, to make sure we empty the * buffer as much as we can. * * If "sync_after_write" is true, we call fdatasync() after each write() (or * fsync() if _POSIX_SYNCHRONIZED_IO is not > 0). * * We stop retrying if the time elapsed since this function was entered * reaches TRANSFER_WRITE_TIMEOUT seconds. */ static ssize_t pv__transfer_write_repeated(int fd, void *buf, size_t count, bool sync_after_write) { struct timespec start_time; ssize_t total_written; memset(&start_time, 0, sizeof(start_time)); pv_elapsedtime_read(&start_time); total_written = 0; while (count > 0) { ssize_t nwritten; struct timespec cur_time, transfer_elapsed; long double elapsed_seconds; size_t asked_to_write; asked_to_write = count > MAX_WRITE_AT_ONCE ? MAX_WRITE_AT_ONCE : count; nwritten = write(fd, buf, asked_to_write); #ifdef HAVE_FDATASYNC if (sync_after_write && nwritten >= 0) { /* * Ignore non IO errors, such as EBADFD (bad file * descriptor), EINVAL (non syncable fd, such as a * pipe), etc - only return an error on EIO. */ #if defined(_POSIX_SYNCHRONIZED_IO) && _POSIX_SYNCHRONIZED_IO > 0 if ((fdatasync(fd) < 0) && (EIO == errno)) { return -1; } #else if ((fsync(fd) < 0) && (EIO == errno)) { return -1; } #endif } #endif /* HAVE_FDATASYNC */ if (nwritten < 0) { if ((EINTR == errno) || (EAGAIN == errno)) { /* * Interrupted by a signal - probably our * alarm() - so just return what we've * written so far. */ return total_written; } else { /* * Legitimate error - return negative. */ return nwritten; } } total_written += nwritten; buf += nwritten; count -= nwritten; if (0 == nwritten) return total_written; memset(&cur_time, 0, sizeof(cur_time)); memset(&transfer_elapsed, 0, sizeof(transfer_elapsed)); elapsed_seconds = 0.0; pv_elapsedtime_read(&cur_time); pv_elapsedtime_subtract(&transfer_elapsed, &cur_time, &start_time); elapsed_seconds = pv_elapsedtime_seconds(&transfer_elapsed); if (elapsed_seconds > TRANSFER_WRITE_TIMEOUT) { debug("%s %d: %s (%lf %s)", "fd", fd, "stopping write - timer expired", elapsed_seconds, "sec elapsed"); return total_written; } /* * Running the select() here seems to make PV eat a lot of * CPU in some cases, so instead we just go round the loop * again and rely on our alarm() to interrupt us if we run * out of time - also on our elapsed time check. */ if (count > 0) { debug("%s %d: %s (%ld %s, %ld %s)", "fd", fd, "trying another write after partial buffer flush", nwritten, "written", count, "remaining"); #if 0 /* removed after 1.6.0 - see comment above */ if (is_data_ready(-1, NULL, fd, NULL, 0) < 1) { break; } #endif /* end of removed section */ } } return total_written; } /* * Read some data from the given file descriptor. Returns zero if there was * a transient error and we need to return 0 from pv_transfer, otherwise * returns 1. * * At most, the number of bytes read will be the number of bytes remaining * in the input buffer. If state->control.rate_limit is >0, and/or "allowed" is >0, * then the maximum number of bytes read will be the number remaining unused * in the input buffer or the value of "allowed", whichever is smaller. * * If splice() was successfully used, sets state->transfer.splice_used to true; if it * failed, then state->transfer.splice_failed_fd is updated to the current fd so * splice() won't be tried again until the next input file. * * Updates state->transfer.read_position by the number of bytes read, unless splice() * was used, in which case it does not since there's nothing in the buffer * (and it also adds the bytes to state->transfer.written since they've been written * to the output). * * On read error, updates state->status.exit_status, and if allowed by * state->control.skip_errors, tries to skip past the problem. * * If the end of the input file is reached or the error is unrecoverable, * sets *eof_in to true. If all data in the buffer has been written at this * point, then also sets *eof_out to true. */ static int pv__transfer_read(pvstate_t state, int fd, bool *eof_in, bool *eof_out, off_t allowed) { bool do_not_skip_errors; size_t bytes_can_read; off_t amount_to_skip, amount_skipped, orig_offset, skip_offset; ssize_t nread; #ifdef HAVE_SPLICE size_t bytes_to_splice; #endif /* HAVE_SPLICE */ do_not_skip_errors = false; if (0 == state->control.skip_errors) do_not_skip_errors = true; bytes_can_read = state->transfer.buffer_size - state->transfer.read_position; nread = 0; #ifdef HAVE_SPLICE state->transfer.splice_used = false; if ((!state->control.linemode) && (!state->control.no_splice) && (fd != state->transfer.splice_failed_fd) && (0 == state->transfer.to_write)) { if (state->control.rate_limit > 0 || allowed != 0) { bytes_to_splice = (size_t) allowed; } else { bytes_to_splice = bytes_can_read; } /*@-nullpass@ */ /*@-type@ */ /* splint doesn't know about splice */ nread = splice(fd, NULL, STDOUT_FILENO, NULL, bytes_to_splice, SPLICE_F_MORE); /*@+type@ */ /*@+nullpass@ */ state->transfer.splice_used = true; if ((nread < 0) && (EINVAL == errno)) { debug("%s %d: %s", "fd", fd, "splice failed with EINVAL - disabling"); state->transfer.splice_failed_fd = fd; state->transfer.splice_used = false; /* * Fall through to read() below. */ } else if (nread > 0) { state->transfer.written = nread; #ifdef HAVE_FDATASYNC if (state->control.sync_after_write) { /* * Ignore non IO errors, such as EBADFD (bad file * descriptor), EINVAL (non syncable fd, such as a * pipe), etc - only treat EIO as a failure. * Since this is a write error, not a read * error, we cannot skip it, so set * "do_not_skip_errors". */ if ((fdatasync(STDOUT_FILENO) < 0) && (EIO == errno)) { nread = -1; do_not_skip_errors = true; } } #endif /* HAVE_FDATASYNC */ } else if ((-1 == nread) && (EAGAIN == errno)) { /* nothing read yet - do nothing */ } else { /* EOF might not really be EOF, it seems */ state->transfer.splice_used = false; } } if (!state->transfer.splice_used) { nread = pv__transfer_read_repeated(fd, state->transfer.transfer_buffer + state->transfer.read_position, bytes_can_read); } #else nread = pv__transfer_read_repeated(fd, state->transfer.transfer_buffer + state->transfer.read_position, bytes_can_read); #endif /* HAVE_SPLICE */ if (0 == nread) { /* * If read returned 0, we've reached the end of this input * file. If we've also written all the data in the transfer * buffer, we set eof_out as well, so that the main loop can * move on to the next input file. */ *eof_in = true; if (state->transfer.write_position >= state->transfer.read_position) *eof_out = true; return 1; } else if (nread > 0) { /* * Read returned >0, so we successfully read data - clear * the error counter and update our record of how much data * we've got in the buffer. */ state->transfer.read_errors_in_a_row = 0; #ifdef HAVE_SPLICE /* * If we used splice(), there isn't any more data in the * buffer than there was before. */ if (!state->transfer.splice_used) state->transfer.read_position += nread; #else state->transfer.read_position += nread; #endif /* HAVE_SPLICE */ return 1; } /* * If we reach this point, nread<0, so there was an error. */ /* * If a read error occurred but it was EINTR or EAGAIN, just wait a * bit and then return zero, since this was a transient error. */ if ((EINTR == errno) || (EAGAIN == errno)) { debug("%s %d: %s: %s", "fd", fd, "transient error - waiting briefly", strerror(errno)); (void) is_data_ready(-1, NULL, -1, NULL, 10000); return 0; } /* * The read error is not transient, so update the program's final * exit status, regardless of whether we're skipping errors, and * increment the error counter. */ state->status.exit_status |= 16; state->transfer.read_errors_in_a_row++; /* * If we aren't skipping errors, show the error and pretend we * reached the end of this file. */ if (do_not_skip_errors) { /*@-compdef@ */ pv_error(state, "%s: %s: %s", pv_current_file_name(state), _("read failed"), strerror(errno)); /*@+compdef@ */ /* * splint says the storage pointed to by the result of * pv_current_file_name() is not fully defined. * * TODO: investigate and fix the reason for this. */ *eof_in = true; if (state->transfer.write_position >= state->transfer.read_position) { *eof_out = true; } return 1; } /* * Try to skip past the error. */ amount_skipped = -1; if (!state->transfer.read_error_warning_shown) { /*@-compdef@ */ pv_error(state, "%s: %s: %s", pv_current_file_name(state), _("warning: read errors detected"), strerror(errno)); /*@+compdef@ */ /* splint - see previous pv_current_file_name() call. */ state->transfer.read_error_warning_shown = true; } orig_offset = (off_t) lseek(fd, 0, SEEK_CUR); /* * If the file is not seekable, we can't skip past the error, so we * will have to abandon the attempt and pretend we reached the end * of the file. */ if (0 > orig_offset) { /*@-compdef@ */ pv_error(state, "%s: %s: %s", pv_current_file_name(state), _("file is not seekable"), strerror(errno)); /*@+compdef@ */ /* splint - see previous pv_current_file_name() calls. */ *eof_in = true; if (state->transfer.write_position >= state->transfer.read_position) { *eof_out = true; } return 1; } /* * If a non-zero error skip block size was given, just use that, * otherwise start small and ramp up based on the number of errors * in a row. */ if (state->control.error_skip_block > 0) { amount_to_skip = state->control.error_skip_block; } else { if (state->transfer.read_errors_in_a_row < 10) { amount_to_skip = (off_t) (state->transfer.read_errors_in_a_row < 5 ? 1 : 2); } else if (state->transfer.read_errors_in_a_row < 20) { unsigned int shift_by = (unsigned int) (state->transfer.read_errors_in_a_row - 10); amount_to_skip = (off_t) (1 << shift_by); } else { amount_to_skip = 512; } } /* * Round the skip amount down to the start of the next block of the * skip amount size. For instance if the skip amount is 512, but * our file offset is 257, we'll jump to 512 instead of 769. */ if (amount_to_skip > 1) { skip_offset = orig_offset + amount_to_skip; skip_offset -= (skip_offset % amount_to_skip); if (skip_offset > orig_offset) { amount_to_skip = skip_offset - orig_offset; } } /* * Trim the skip amount so we wouldn't read too much. */ if (amount_to_skip > (off_t) bytes_can_read) amount_to_skip = (off_t) bytes_can_read; /*@+longintegral@ */ /* splint complains about __off_t vs off_t */ skip_offset = (off_t) lseek(fd, (off_t) (orig_offset + amount_to_skip), SEEK_SET); /*@-longintegral@ */ /* * If the skip we just tried didn't work, try only skipping 1 byte * in case we were trying to go past the end of the input file. */ if (skip_offset < 0) { amount_to_skip = 1; /*@+longintegral@ */ /* see above */ skip_offset = (off_t) lseek(fd, (off_t) (orig_offset + amount_to_skip), SEEK_SET); /*@-longintegral@ */ } if (skip_offset < 0) { /* * Failed to skip - lseek() returned an error, so mark the * file as having ended. */ *eof_in = true; /* * EINVAL means the file has ended since we've tried to go * past the end of it, so we don't bother with a warning * since it just means we've reached the end anyway. */ if (EINVAL != errno) { /*@-compdef@ */ pv_error(state, "%s: %s: %s", pv_current_file_name(state), _("failed to seek past error"), strerror(errno)); /*@+compdef@ */ /* splint - see previous pv_current_file_name() calls. */ } } else { amount_skipped = skip_offset - orig_offset; } /* * If we succeeded in skipping some bytes, zero the equivalent part * of the transfer buffer, and update the buffer position. */ if (amount_skipped > 0) { memset(state->transfer.transfer_buffer + state->transfer.read_position, 0, (size_t) amount_skipped); state->transfer.read_position += amount_skipped; if (state->control.skip_errors < 2) { /*@-compdef@ */ pv_error(state, "%s: %s: %ld - %ld (%ld %s)", pv_current_file_name(state), _("skipped past read error"), (long) orig_offset, (long) skip_offset, (long) amount_skipped, _("B")); /*@+compdef@ */ /* splint - see previous pv_current_file_name() calls. */ } } else { /* * Failed to skip - mark file as ended. */ *eof_in = true; if (state->transfer.write_position >= state->transfer.read_position) { *eof_out = true; } } return 1; } /* * Write state->transfer.to_write bytes of data from the transfer buffer to stdout. * Returns zero if there was a transient error and we need to return 0 from * pv_transfer, otherwise returns 1. * * Updates state->transfer.write_position by moving it on by the number of bytes * written; adds the number of bytes written to state->transfer.written; sets * *eof_out to true, on stdout EOF, or when the write position catches up * with the read position AND *eof_in is true (meaning we've reached the end * of data). * * On error, sets *eof_out to true, sets state->transfer.written to -1, and updates * state->status.exit_status. * * If state->control.discard_input is true, does not actually write anything. */ static int pv__transfer_write(pvstate_t state, bool *eof_in, bool *eof_out, long *lineswritten) { ssize_t nwritten; if (NULL == state->transfer.transfer_buffer) { pv_error(state, "%s", _("no transfer buffer allocated")); state->status.exit_status |= 64; *eof_out = true; state->transfer.written = -1; return 1; } nwritten = 0; if (state->control.discard_input) { nwritten = state->transfer.to_write; } else if (state->transfer.to_write > 0) { if (signal(SIGALRM, SIG_IGN) == SIG_ERR) { pv_error(state, "%s: %s", _("failed to set alarm signal handler"), strerror(errno)); } else { (void) alarm(1); } nwritten = pv__transfer_write_repeated(STDOUT_FILENO, state->transfer.transfer_buffer + state->transfer.write_position, (size_t) (state->transfer.to_write), state->control.sync_after_write); (void) alarm(0); } if (0 == nwritten) { /* * Write returned 0 - EOF on stdout. */ *eof_out = true; return 1; } else if (nwritten > 0) { /* * Write returned >0 - data successfully written. */ if ((state->control.linemode) && (lineswritten != NULL)) { char separator; char *ptr; long lines = 0; if (state->control.null_terminated_lines) { separator = '\0'; } else { separator = '\n'; } ptr = (char *) (state->transfer.transfer_buffer + state->transfer.write_position - 1); for (ptr++; ptr - (char *) state->transfer.transfer_buffer - state->transfer.write_position < (size_t) nwritten; ptr++) { if (*ptr == separator) ++lines; } *lineswritten += lines; } state->transfer.write_position += nwritten; state->transfer.written += nwritten; /* * If we're monitoring the output, update our copy of the * last few bytes we've written. */ if (state->display.component[PV_COMPONENT_OUTPUTBUF].required && (nwritten > 0)) { size_t new_portion_length, old_portion_length; new_portion_length = (size_t) nwritten; if (new_portion_length > state->display.lastoutput_length) new_portion_length = state->display.lastoutput_length; old_portion_length = state->display.lastoutput_length - new_portion_length; /* * Make room for the new portion. */ if (old_portion_length > 0) { memmove(state->display.lastoutput_buffer, state->display.lastoutput_buffer + new_portion_length, old_portion_length); } /* * Copy the new data in. */ memcpy(state->display.lastoutput_buffer + /* flawfinder: ignore */ old_portion_length, state->transfer.transfer_buffer + state->transfer.write_position - new_portion_length, new_portion_length); /* * flawfinder rationale: calculations above ensure * that old_portion_length + new_portion_length is * always <= lastoutput_length, and * lastoutput_length is guaranteed by * pv__format_init() to be no more than * PV_SIZEOF_LASTOUTPUT_BUFFER, which is the size of * lastoutput_buffer, so the memcpy() will always * fit into the buffer. */ } /* * If we've written all the data in the buffer, reset the * read pointer to the start, and if the input file is at * EOF, set eof_out as well to indicate that we've written * everything for this input file. */ if (state->transfer.write_position >= state->transfer.read_position) { state->transfer.write_position = 0; state->transfer.read_position = 0; if (*eof_in) *eof_out = true; } return 1; } /* * If we reach this point, nwritten<0, so there was an error. */ /* * If a write error occurred but it was EINTR or EAGAIN, just wait a * bit and then return zero, since this was a transient error. */ if ((EINTR == errno) || (EAGAIN == errno)) { debug("%s: %s", "transient write error - waiting briefly", strerror(errno)); (void) is_data_ready(-1, NULL, -1, NULL, 10000); return 0; } /* * SIGPIPE means we've finished. Don't output an error because it's * not really our error to report. */ if (EPIPE == errno) { *eof_in = true; *eof_out = true; return 0; } pv_error(state, "%s: %s", _("write failed"), strerror(errno)); state->status.exit_status |= 16; *eof_out = true; state->transfer.written = -1; return 1; } /* * Return a pointer to a newly allocated buffer of the given size, aligned * appropriately for the current input and output file descriptors * (important if using O_DIRECT). * * Falls back to unaligned allocation if it was not possible to get an * aligned buffer, or if the relevant operating system features were not * available. With O_DIRECT, this means that transfers could fail with an * "Invalid argument" error (EINVAL). * * Returns NULL on complete allocation failure. */ /*@null@*/ /*@only@*/ static char *pv__allocate_aligned_buffer(int fd, size_t target_size) { char *newptr; #if defined(HAVE_FPATHCONF) && defined(HAVE_POSIX_MEMALIGN) && defined(_PC_REC_XFER_ALIGN) long input_alignment, output_alignment, min_alignment; long required_alignment; input_alignment = fd >= 0 ? fpathconf(fd, _PC_REC_XFER_ALIGN) : -1; output_alignment = fpathconf(STDOUT_FILENO, _PC_REC_XFER_ALIGN); #if defined(HAVE_SYSCONF) && defined(_SC_PAGESIZE) min_alignment = sysconf(_SC_PAGESIZE); #else /* ! defined(HAVE_SYSCONF) && defined(_SC_PAGESIZE) */ min_alignment = 8192; #endif /* defined(HAVE_SYSCONF) && defined(_SC_PAGESIZE) */ if (input_alignment > output_alignment) { required_alignment = input_alignment; } else if (output_alignment > input_alignment) { required_alignment = output_alignment; } else if (input_alignment < min_alignment) { required_alignment = min_alignment; } else { required_alignment = input_alignment; } /* Ensure the alignment is at least the page size. */ if (required_alignment < min_alignment) { required_alignment = min_alignment; } newptr = NULL; /*@-unrecog@ */ /* splice doesn't know of posix_memalign(). */ if (0 != posix_memalign((void **) (&newptr), (size_t) required_alignment, target_size)) { newptr = malloc(target_size); } /*@+unrecog@ */ #else /* ! defined(HAVE_FPATHCONF) && defined(HAVE_POSIX_MEMALIGN) && defined(_PC_REC_XFER_ALIGN) */ newptr = malloc(target_size); #endif /* defined(HAVE_FPATHCONF) && defined(HAVE_POSIX_MEMALIGN) && defined(_PC_REC_XFER_ALIGN) */ /* Initialise the buffer with zeroes. */ if (NULL != newptr) memset(newptr, 0, target_size); return newptr; } /* * Transfer some data from "fd" to standard output, timing out after 9/100 * of a second. If state->control.rate_limit is >0, and/or "allowed" is >0, only up * to "allowed" bytes can be written. The variables that "eof_in" and * "eof_out" point to are used to flag that we've finished reading and * writing respectively. * * Returns the number of bytes written, or negative on error (in which case * state->status.exit_status is updated). In line mode, the number of lines written * will be put into *lineswritten. */ ssize_t pv_transfer(pvstate_t state, int fd, bool *eof_in, bool *eof_out, off_t allowed, long *lineswritten) { bool ready_to_read, ready_to_write; int check_read_fd, check_write_fd; int n; if (NULL == state) return 0; #ifdef O_DIRECT /* * Set or clear O_DIRECT on the input and output file descriptors, * if the setting has changed. */ if (state->control.direct_io_changed) { if (!(*eof_in)) { if (0 != fcntl(fd, F_SETFL, (state->control.direct_io ? O_DIRECT : 0) | fcntl(fd, F_GETFL))) { /*@-compdef@ */ debug("%s: %s: %s", pv_current_file_name(state), "fcntl", strerror(errno)); /*@+compdef@ */ /* splint - see previous pv_current_file_name() calls. */ } } if (!(*eof_out)) { if (0 != fcntl(STDOUT_FILENO, F_SETFL, (state->control.direct_io ? O_DIRECT : 0) | fcntl(STDOUT_FILENO, F_GETFL))) { debug("%s: %s: %s", "(stdout)", "fcntl", strerror(errno)); } } state->control.direct_io_changed = false; } #endif /* O_DIRECT */ /* * Reinitialise the error skipping variables if the file descriptor * has changed since the last time we were called. */ if (fd != state->transfer.last_read_skip_fd) { state->transfer.last_read_skip_fd = fd; state->transfer.read_errors_in_a_row = 0; state->transfer.read_error_warning_shown = false; } /* * Allocate a new buffer, aligned appropriately for the input file * (important if using O_DIRECT). */ if (NULL == state->transfer.transfer_buffer) { state->transfer.transfer_buffer = pv__allocate_aligned_buffer(fd, state->control.target_buffer_size + 32); if (NULL == state->transfer.transfer_buffer) { pv_error(state, "%s: %s", _("buffer allocation failed"), strerror(errno)); state->status.exit_status |= 64; return -1; } state->transfer.buffer_size = state->control.target_buffer_size; } /* * Reallocate the buffer if the buffer size has changed * mid-transfer. We have to do this by allocating a new buffer, * copying to it, and freeing the old one (potentially leaking * memory) because the buffer may need to be aligned for O_DIRECT, * and we can't realloc() an aligned buffer. */ if (state->transfer.buffer_size < state->control.target_buffer_size) { char *newptr; newptr = pv__allocate_aligned_buffer(fd, state->control.target_buffer_size + 32); if (NULL == newptr) { /* * Reset target if realloc failed so we don't keep * trying to realloc over and over. */ debug("realloc: %s", strerror(errno)); state->control.target_buffer_size = state->transfer.buffer_size; } else { debug("%s: %ld", "buffer resized", state->transfer.buffer_size); /* * Copy the old buffer contents into the new buffer, * and free the old one. */ if (state->transfer.buffer_size > 0) { memcpy(newptr, state->transfer.transfer_buffer, state->transfer.buffer_size); /* flawfinder: ignore */ } /* * flawfinder rationale: number of bytes copied is * definitely always smaller than the new buffer * size. */ free(state->transfer.transfer_buffer); state->transfer.transfer_buffer = newptr; state->transfer.buffer_size = state->control.target_buffer_size; } } if ((state->control.linemode) && (lineswritten != NULL)) *lineswritten = 0; if ((*eof_in) && (*eof_out)) return 0; check_read_fd = -1; check_write_fd = -1; /* * If the input file is not at EOF and there's room in the buffer, * look for incoming data from it. */ if ((!(*eof_in)) && (state->transfer.read_position < state->transfer.buffer_size)) { check_read_fd = fd; } /* * Work out how much we're allowed to write, based on the amount of * data left in the buffer. If rate limiting is active or "allowed" * is >0, then this puts an upper limit on how much we're allowed to * write. */ state->transfer.to_write = (ssize_t) (state->transfer.read_position - state->transfer.write_position); if ((state->control.rate_limit > 0) || (allowed > 0)) { if ((off_t) (state->transfer.to_write) > allowed) { state->transfer.to_write = (ssize_t) allowed; } } /* * If we don't think we've finished writing and there's anything * we're allowed to write, look for the stdout becoming writable. */ if ((!(*eof_out)) && (state->transfer.to_write > 0)) { check_write_fd = STDOUT_FILENO; } ready_to_read = false; ready_to_write = false; n = is_data_ready(check_read_fd, &ready_to_read, check_write_fd, &ready_to_write, 90000); if (n < 0) { /* * Ignore transient errors by returning 0 immediately. */ if (EINTR == errno) return 0; /* * Any other error is a problem and we must report back. */ /*@-compdef@ */ pv_error(state, "%s: %s: %d: %s", pv_current_file_name(state), _("select call failed"), n, strerror(errno)); /*@+compdef@ */ /* splint - see previous pv_current_file_name() calls. */ state->status.exit_status |= 16; return -1; } state->transfer.written = 0; /* * If there is data to read, try to read some in. Return early if * there was a transient read error. * * NB this can update state->transfer.written because of splice(). */ if (ready_to_read) { if (pv__transfer_read(state, fd, eof_in, eof_out, allowed) == 0) return 0; } /* * In line mode, only write up to and including the last newline, * so that we're writing output line-by-line. */ if ((state->transfer.to_write > 0) && (state->control.linemode) && !(state->control.null_terminated_lines)) { char *start; char *end; start = (char *) (state->transfer.transfer_buffer + state->transfer.write_position); end = pv_memrchr(start, (int) '\n', (size_t) (state->transfer.to_write)); if (NULL != end) { state->transfer.to_write = (ssize_t) ((end - start) + 1); } } /* * If there is data to write, and stdout is ready to receive it, and * we didn't use splice() this time, write some data. Return early * if there was a transient write error. */ if (ready_to_write #ifdef HAVE_SPLICE && (!state->transfer.splice_used) #endif /* HAVE_SPLICE */ && (state->transfer.read_position > state->transfer.write_position) && (state->transfer.to_write > 0) && (NULL != lineswritten)) { if (pv__transfer_write(state, eof_in, eof_out, lineswritten) == 0) return 0; } #ifdef MAXIMISE_BUFFER_FILL /* * Rotate the written bytes out of the buffer so that it can be * filled up completely by the next read. */ if (state->transfer.write_position > 0) { if (state->transfer.write_position < state->transfer.read_position) { memmove(state->transfer.transfer_buffer, state->transfer.transfer_buffer + state->transfer.write_position, state->transfer.read_position - state->transfer.write_position); state->transfer.read_position -= state->transfer.write_position; state->transfer.write_position = 0; } else { state->transfer.write_position = 0; state->transfer.read_position = 0; } } #endif /* MAXIMISE_BUFFER_FILL */ return state->transfer.written; } /* EOF */ pv-1.8.5/src/pv/watchpid.c000066400000000000000000000442521452655021700153530ustar00rootroot00000000000000/* * Functions for watching file descriptors in other processes. * * Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023 Andrew Wood * * License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'. */ #include "config.h" #include "pv.h" #include "pv-internal.h" #include #include #include #include #define _GNU_SOURCE 1 #include #include #include #include #include #include #include #include #ifdef __APPLE__ #include #include #endif /*@-type@*/ /* splint has trouble with off_t and mode_t. */ /* * Set info->size to the size of the file info->file_fdpath points to, * assuming that info->sb_fd has been populated by stat(), or to 0 if the * file size could not be determined or the file was opened in write mode; * returns false if the file was not a block device or regular file. */ static bool filesize(pvwatchfd_t info) { if (S_ISBLK(info->sb_fd.st_mode)) { int fd; /* * Get the size of block devices by opening * them and seeking to the end. */ fd = open(info->file_fdpath, O_RDONLY); /* flawfinder: ignore */ /* * flawfinder: redirection check below; risk is minimal as * we are not actually reading any data here. */ if (fd >= 0) { /* * TOCTOU mitigation: check it's still a block * device before trying to seek to the end. * Otherwise treat it as unreadable and set the size * to 0. */ struct stat check_fd_sb; memset(&check_fd_sb, 0, sizeof(check_fd_sb)); info->size = 0; if (0 == fstat(fd, &check_fd_sb) && S_ISBLK(check_fd_sb.st_mode)) { info->size = lseek(fd, 0, SEEK_END); } (void) close(fd); } else { info->size = 0; } } else if (S_ISREG(info->sb_fd.st_mode)) { if ((info->sb_fd_link.st_mode & S_IWUSR) == 0) { info->size = info->sb_fd.st_size; } } else { return false; } return true; } /*@+type@*/ #ifdef __APPLE__ int pv_watchfd_info(pvstate_t state, pvwatchfd_t info, bool automatic) { struct vnode_fdinfowithpath vnodeInfo = { }; if (NULL == state) return -1; if (NULL == info) return -1; if (kill(info->watch_pid, 0) != 0) { if (!automatic) pv_error(state, "%s %u: %s", _("pid"), info->watch_pid, strerror(errno)); return 1; } int32_t proc_fd = (int32_t) info->watch_fd; int size = proc_pidfdinfo(info->watch_pid, proc_fd, PROC_PIDFDVNODEPATHINFO, &vnodeInfo, PROC_PIDFDVNODEPATHINFO_SIZE); if (size != PROC_PIDFDVNODEPATHINFO_SIZE) { pv_error(state, "%s %u: %s %d: %s", _("pid"), info->watch_pid, _("fd"), info->watch_fd, strerror(errno)); return 3; } strlcpy(info->file_fdpath, vnodeInfo.pvip.vip_path, PV_SIZEOF_FILE_FDPATH); info->size = 0; if (!(0 == stat(info->file_fdpath, &(info->sb_fd)))) { if (!automatic) pv_error(state, "%s %u: %s %d: %s: %s", _("pid"), info->watch_pid, _("fd"), info->watch_fd, info->file_fdpath, strerror(errno)); return 3; } if (!filesize(info)) { if (!automatic) pv_error(state, "%s %u: %s %d: %s: %s", _("pid"), info->watch_pid, _("fd"), info->watch_fd, info->file_fdpath, _("not a regular file or block device")); return 4; } return 0; } #else /* * Fill in the given information structure with the file paths and stat * details of the given file descriptor within the given process (given * within the info structure). * * Returns nonzero on error - error codes are: * * -1 - info or state were NULL * 1 - process does not exist * 2 - readlink on /proc/pid/fd/N failed * 3 - stat or lstat on /proc/pid/fd/N failed * 4 - file descriptor is not opened on a regular file * * If "automatic" is true, then this fd was picked automatically, and so if * it's not readable or not a regular file, no error is displayed and the * function just returns an error code. */ int pv_watchfd_info(pvstate_t state, pvwatchfd_t info, bool automatic) { if (NULL == state) return -1; if (NULL == info) return -1; if (kill(info->watch_pid, 0) != 0) { if (!automatic) pv_error(state, "%s %u: %s", _("pid"), info->watch_pid, strerror(errno)); return 1; } (void) pv_snprintf(info->file_fdinfo, PV_SIZEOF_FILE_FDINFO, "/proc/%u/fdinfo/%d", info->watch_pid, info->watch_fd); (void) pv_snprintf(info->file_fd, PV_SIZEOF_FILE_FD, "/proc/%u/fd/%d", info->watch_pid, info->watch_fd); memset(info->file_fdpath, 0, PV_SIZEOF_FILE_FDPATH); if (readlink(info->file_fd, info->file_fdpath, PV_SIZEOF_FILE_FDPATH - 1) < 0) { /* flawfinder: ignore */ /* * flawfinder: memset() has put \0 at the end already, and * we tell readlink() to use 1 byte less than the buffer * length, so \0 termination is assured. There is no * mitigation for the risk of the link changing while we * read it, but we are only reading from the destination, * and then only if it's a block device - see filesize(). */ if (!automatic) pv_error(state, "%s %u: %s %d: %s", _("pid"), info->watch_pid, _("fd"), info->watch_fd, strerror(errno)); return 2; } if (!((0 == stat(info->file_fd, &(info->sb_fd))) && (0 == lstat(info->file_fd, &(info->sb_fd_link))))) { if (!automatic) pv_error(state, "%s %u: %s %d: %s: %s", _("pid"), info->watch_pid, _("fd"), info->watch_fd, info->file_fdpath, strerror(errno)); return 3; } info->size = 0; if (!filesize(info)) { if (!automatic) pv_error(state, "%s %u: %s %d: %s: %s", _("pid"), info->watch_pid, _("fd"), info->watch_fd, info->file_fdpath, _("not a regular file or block device")); return 4; } return 0; } #endif #ifdef __APPLE__ bool pv_watchfd_changed(pvwatchfd_t info) { return true; } #else /* * Return true if the given file descriptor has changed in some way since * we started looking at it (i.e. changed destination or permissions). */ bool pv_watchfd_changed(pvwatchfd_t info) { struct stat sb_fd, sb_fd_link; memset(&sb_fd, 0, sizeof(sb_fd)); memset(&sb_fd_link, 0, sizeof(sb_fd_link)); if ((0 == stat(info->file_fd, &sb_fd)) && (0 == lstat(info->file_fd, &sb_fd_link))) { if ((sb_fd.st_dev != info->sb_fd.st_dev) || (sb_fd.st_ino != info->sb_fd.st_ino) || (sb_fd_link.st_mode != info->sb_fd_link.st_mode) ) { return true; } } else { return true; } return false; } #endif /* * Return the current file position of the given file descriptor, or -1 if * the fd has closed or has changed in some way. */ off_t pv_watchfd_position(pvwatchfd_t info) { off_t position; #ifdef __APPLE__ struct vnode_fdinfowithpath vnodeInfo = { }; int32_t proc_fd = (int32_t) info->watch_fd; int size = proc_pidfdinfo(info->watch_pid, proc_fd, PROC_PIDFDVNODEPATHINFO, &vnodeInfo, PROC_PIDFDVNODEPATHINFO_SIZE); if (size != PROC_PIDFDVNODEPATHINFO_SIZE) { return -1; } position = (off_t) vnodeInfo.pfi.fi_offset; #else long long pos_long; FILE *fptr; if (pv_watchfd_changed(info)) return -1; fptr = fopen(info->file_fdinfo, "r"); /* flawfinder: ignore */ /* flawfinder: trusted location (/proc). */ if (NULL == fptr) return -1; pos_long = -1; position = -1; if (1 == fscanf(fptr, "pos: %lld", &pos_long)) { position = (off_t) pos_long; } (void) fclose(fptr); #endif return position; } #ifdef __APPLE__ static int pidfds(pvstate_t state, unsigned int pid, struct proc_fdinfo **fds, int *count) { int size_needed = proc_pidinfo(pid, PROC_PIDLISTFDS, 0, 0, 0); if (size_needed == -1) { pv_error(state, "%s: unable to list pid fds: %s", _("pid"), strerror(errno)); return -1; } *count = size_needed / PROC_PIDLISTFD_SIZE; *fds = (struct proc_fdinfo *) malloc(size_needed); if (*fds == NULL) { pv_error(state, "%s: alloc failed: %s", _("pid"), strerror(errno)); return -1; } proc_pidinfo(pid, PROC_PIDLISTFDS, 0, *fds, size_needed); return 0; } #endif /*@-compdestroy @ */ /*@-usereleased @ */ /*@-compdef @ */ /* * splint: extending or creating entries and then zeroing them makes splint * believe that data previously there may refer to pointers that are now * lost - but these are newly added array entries so there is no loss. */ /* * Extend the info array by one, returning false on error. */ static bool extend_info_array(int *array_length_ptr, pvwatchfd_t * info_array_ptr) { int array_length = 0; struct pvwatchfd_s *info_array = NULL; struct pvwatchfd_s *new_info_array; array_length = *array_length_ptr; info_array = *info_array_ptr; array_length++; if (NULL == info_array) { new_info_array = malloc(array_length * sizeof(*info_array)); if (NULL != new_info_array) memset(new_info_array, 0, array_length * sizeof(*info_array)); } else { new_info_array = realloc(info_array, array_length * sizeof(*info_array)); if (NULL != new_info_array) memset(&(new_info_array[array_length - 1]), 0, sizeof(*info_array)); } if (NULL == new_info_array) { return false; } *info_array_ptr = new_info_array; *array_length_ptr = array_length; return true; } /*@+compdestroy @ */ /*@+usereleased @ */ /*@+compdef @ */ /* * Scan the given process and update the arrays with any new file * descriptors. * * Returns 0 on success, 1 if the process no longer exists or could not be * read, or 2 for a memory allocation error. */ int pv_watchpid_scanfds(pvstate_t state, pid_t watch_pid, int *array_length_ptr, pvwatchfd_t * info_array_ptr, int *fd_to_idx) { int array_length = 0; struct pvwatchfd_s *info_array = NULL; #ifdef __APPLE__ struct proc_fdinfo *fd_infos = NULL; int fd_infos_count = 0; if (pidfds(state, watch_pid, &fd_infos, &fd_infos_count) != 0) { pv_error(state, "%s: pidfds failed", _("pid")); return -1; } #else char fd_dir[512]; /* flawfinder: ignore - zeroed, bounded with pv_snprintf(). */ DIR *dptr; struct dirent *d; memset(fd_dir, 0, sizeof(fd_dir)); (void) pv_snprintf(fd_dir, sizeof(fd_dir), "/proc/%u/fd", watch_pid); dptr = opendir(fd_dir); if (NULL == dptr) return 1; #endif array_length = *array_length_ptr; info_array = *info_array_ptr; #ifdef __APPLE__ if (fd_infos_count < 1) { pv_error(state, "%s: no fds found", _("pid")); return -1; } for (int i = 0; i < fd_infos_count; i++) { #else while ((d = readdir(dptr)) != NULL) { #endif int fd, check_idx, use_idx, rc; off_t position_now; const char *use_format_string; fd = -1; #ifdef __APPLE__ fd = fd_infos[i].proc_fd; #else if (sscanf(d->d_name, "%d", &fd) != 1) continue; if ((fd < 0) || (fd >= FD_SETSIZE)) continue; #endif /* * Skip if this fd is already known to us. */ if (fd_to_idx[fd] != -1) { continue; } /* * See if there's an empty slot we can re-use. An empty slot * has a watch_pid of 0. */ use_idx = -1; for (check_idx = 0; check_idx < array_length; check_idx++) { if (info_array[check_idx].watch_pid == 0) { use_idx = check_idx; break; } } /* * If there's no empty slot, extend the array. */ if (use_idx < 0) { if (!extend_info_array(array_length_ptr, info_array_ptr)) return 2; array_length = *array_length_ptr; info_array = *info_array_ptr; use_idx = array_length - 1; } debug("%s: %d => index %d", "found new fd", fd, use_idx); /* * Initialise the details of this new entry. */ memset(&(info_array[use_idx]), 0, sizeof(info_array[use_idx])); info_array[use_idx].watch_pid = watch_pid; info_array[use_idx].watch_fd = fd; /* Allocate new display state. */ /*@-mustfreeonly@ *//* splint - this is not a leak, this is a new entry. */ info_array[use_idx].state = pv_state_alloc(state->status.program_name); /*@+mustfreeonly@ */ if (NULL == info_array[use_idx].state) return 2; /* Copy the main status.cwd value to the new state. */ memcpy(&(info_array[use_idx].state->status.cwd), &(state->status.cwd), sizeof(state->status.cwd)); /* flawfinder: ignore */ /* flawfinder: bounded to destination object size. */ /* * Copy over all the control values, blanking out the * dynamically allocated strings, and setting the default * format (fixed buffer) to the required format string * instead of allocating a new dynamic format string for the * copy (so there's less dynamic allocation going on). */ memcpy(&(info_array[use_idx].state->control), &(state->control), sizeof(state->control)); /* flawfinder: ignore */ /* flawfinder: bounded to destination object size. */ /*@-mustfreeonly@ *//* splint - this is not a leak, this is a new entry. */ info_array[use_idx].state->control.name = NULL; info_array[use_idx].state->control.format_string = NULL; /*@+mustfreeonly@ */ info_array[use_idx].state->control.default_format[0] = '\0'; use_format_string = NULL != state->control.format_string ? state->control.format_string : state->control.default_format; if (NULL != use_format_string) (void) pv_snprintf(info_array[use_idx].state->control.default_format, PV_SIZEOF_DEFAULT_FORMAT, "%.510s", use_format_string); /* * Copy over all the display values, blanking out the * dynamically allocated parts as above; then set the * average rate window so that a new history buffer is * allocated for this state. */ memcpy(&(info_array[use_idx].state->display), &(state->display), sizeof(state->display)); /* flawfinder: ignore */ /* flawfinder: bounded to destination object size. */ /*@-mustfreeonly@ *//* splint - this is not a leak, this is a new entry. */ info_array[use_idx].state->display.display_buffer = NULL; info_array[use_idx].state->display.display_buffer_size = 0; info_array[use_idx].state->display.history = NULL; info_array[use_idx].state->display.history_len = 0; /*@+mustfreeonly@ */ pv_state_average_rate_window_set(info_array[use_idx].state, state->control.average_rate_window); #ifdef __APPLE__ if (fd_infos[i].proc_fdtype != PROX_FDTYPE_VNODE) { continue; } #endif /* Retrieve the details of this file descriptor. */ rc = pv_watchfd_info(state, &(info_array[use_idx]), true); /* * Lookup failed - mark this slot as being free for re-use. */ if ((rc != 0) && (rc != 4)) { debug("%s %d: %s: %d", "fd", fd, "lookup failed - marking slot for re-use", use_idx); info_array[use_idx].watch_pid = 0; if (NULL != info_array[use_idx].state) pv_state_free(info_array[use_idx].state); /*@-mustfreeonly@ *//* not a leak - we've just free()d it. */ info_array[use_idx].state = NULL; /*@+mustfreeonly@ */ continue; } fd_to_idx[fd] = use_idx; /* * Not displayable - set fd to -1 so the main loop doesn't * show it. */ if (rc != 0) { debug("%s %d: %s", "fd", fd, "marking as not displayable"); info_array[use_idx].watch_fd = -1; } /* NULL check on the state - skip if not usable. */ if (NULL == info_array[use_idx].state) { debug("%s %d: %s", "fd", fd, "state is NULL - marking as not displayable"); info_array[use_idx].watch_fd = -1; continue; } /* * Set the displayed size appropriately; if the size is 0, * or not known, remove %e and %I from the state's default * format string so that neither estimated time remaining * nor estimated time of completion are displayed. */ info_array[use_idx].state->control.size = info_array[use_idx].size; if (info_array[use_idx].state->control.size < 1) { char *fmt; while (NULL != (fmt = strstr(info_array[use_idx].state->control.default_format, "%e"))) { debug("%s", "zero size - removing estimated time remaining"); /* strlen-1 here to include trailing \0 */ memmove(fmt, fmt + 2, strlen(fmt) - 1); /* flawfinder: ignore */ info_array[use_idx].state->flag.reparse_display = 1; } while (NULL != (fmt = strstr(info_array[use_idx].state->control.default_format, "%I"))) { debug("%s", "zero size - removing estimated completion time"); /* strlen-1 here to include trailing \0 */ memmove(fmt, fmt + 2, strlen(fmt) - 1); /* flawfinder: ignore */ info_array[use_idx].state->flag.reparse_display = 1; } /* flawfinder: default_format is always \0-terminated. */ } /* Set the info display_name appropriately. */ pv_watchpid_setname(state, &(info_array[use_idx])); /* Carry the display_name through to the display state, and reparse. */ pv_state_name_set(info_array[use_idx].state, info_array[use_idx].display_name); info_array[use_idx].state->flag.reparse_display = 1; pv_elapsedtime_read(&(info_array[use_idx].start_time)); /* * Set the starting position (and initial offset, for the * display), if known, so that ETA and so on are calculated * correctly. */ info_array[use_idx].state->display.initial_offset = 0; info_array[use_idx].position = 0; position_now = pv_watchfd_position(&(info_array[use_idx])); if (position_now >= 0) { info_array[use_idx].state->display.initial_offset = position_now; info_array[use_idx].position = position_now; } } #ifdef __APPLE__ free(fd_infos); #else (void) closedir(dptr); #endif return 0; } /* * Set the display name for the given watched file descriptor, truncating at * the relevant places according to the current screen width. * * If the file descriptor is pointing to a file under the current working * directory, show its relative path, not the full path. */ void pv_watchpid_setname(pvstate_t state, pvwatchfd_t info) { size_t path_length, cwd_length; int max_display_length; char *file_fdpath = info->file_fdpath; memset(info->display_name, 0, PV_SIZEOF_DISPLAY_NAME); path_length = strlen(info->file_fdpath); /* flawfinder: ignore */ cwd_length = strlen(state->status.cwd); /* flawfinder: ignore */ /* flawfinder: both strings are always \0 terminated. */ if (cwd_length > 0 && path_length > cwd_length) { if (0 == strncmp(info->file_fdpath, state->status.cwd, cwd_length)) { file_fdpath += cwd_length + 1; path_length -= cwd_length + 1; } } max_display_length = (int) (state->control.width / 2) - 6; if (max_display_length >= (int) path_length) { (void) pv_snprintf(info->display_name, PV_SIZEOF_DISPLAY_NAME, "%4d:%.498s", info->watch_fd, file_fdpath); } else { int prefix_length, suffix_length; prefix_length = max_display_length / 4; suffix_length = max_display_length - prefix_length - 3; (void) pv_snprintf(info->display_name, PV_SIZEOF_DISPLAY_NAME, "%4d:%.*s...%.*s", info->watch_fd, prefix_length, file_fdpath, suffix_length, file_fdpath + path_length - suffix_length); } debug("%s: %d: [%s]", "set name for fd", info->watch_fd, info->display_name); } /* EOF */ pv-1.8.5/tests/000077500000000000000000000000001452655021700133235ustar00rootroot00000000000000pv-1.8.5/tests/Bug_-_Display_length_at_magnitude_boundary_-_Bytes.test000077500000000000000000000016271452655021700262220ustar00rootroot00000000000000#!/bin/sh # # Check that the bytes count doesn't increase the line length as it passes # 1MiB, described here: # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=586763 # Dummy assignments for "shellcheck". testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}" # Transfer 1500kB of data in a bursty fashion. # (dd if=/dev/zero bs=1k count=999; sleep 1; dd if=/dev/zero bs=1k count=1; sleep 1; dd if=/dev/zero bs=1k count=500; sleep 1; ) 2>/dev/null | ("${testSubject}" -btIf -s 1500k >/dev/null) 2>"${workFile1}" # Count how many different line lengths we've seen. # lineLengthCount=$(tr '\r' '\n' < "${workFile1}" | sed 's/ *$//' | awk '{x=length($0);if(x>0)print length($0)}' | sort | uniq | wc -l | tr -dc '0-9') # There should only be one length (not counting 0). # test "${lineLengthCount}" = "1" && exit 0 echo "variable line lengths detected" tr '\r' '\n' < "${workFile1}" exit 1 # EOF pv-1.8.5/tests/Bug_-_Display_length_at_magnitude_boundary_-_Rate.test000077500000000000000000000016261452655021700260260ustar00rootroot00000000000000#!/bin/sh # # This is the same as the other display length at magnitude boundary check, # but for rate, not bytes transferred. # Dummy assignments for "shellcheck". testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}" # Transfer 1500kB of data in a bursty fashion. # (dd if=/dev/zero bs=1k count=999; sleep 1; dd if=/dev/zero bs=1k count=1; sleep 1; dd if=/dev/zero bs=3 count=1; sleep 1; dd if=/dev/zero bs=1k count=500; sleep 1; ) 2>/dev/null | ("${testSubject}" -rtIf -s 1500k >/dev/null) 2>"${workFile1}" # Count how many different line lengths we've seen. # lineLengthCount=$(tr '\r' '\n' < "${workFile1}" | sed 's/ *$//' | awk '{x=length($0);if(x>0)print length($0)}' | sort | uniq | wc -l | tr -dc '0-9') # There should only be one length (not counting 0). # test "${lineLengthCount}" = "1" && exit 0 echo "variable line lengths detected" tr '\r' '\n' < "${workFile1}" exit 1 # EOF pv-1.8.5/tests/Bug_-_Install_all_files.test000077500000000000000000000021211452655021700206540ustar00rootroot00000000000000#!/bin/sh # # Test that "make install" installs the expected minimum set of files. # Dummy assignments for "shellcheck". testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}" makeDir="${testSubject%/*}" if ! test -d "${makeDir}"; then echo "could not find the directory to run \`make' in" exit 77 fi makeCommand=$(command -v gmake 2>/dev/null) test -z "${makeCommand}" && makeCommand="make" testInstallDir=$(mktemp -d) if ! test -n "${testInstallDir}"; then echo "failed to create temporary installation directory" exit 77 fi export DESTDIR="${testInstallDir}" if ! ${makeCommand} -C "${makeDir}" install DESTDIR="${testInstallDir}" >"${workFile1}" 2>&1; then echo "\`make install' exited $?" rm -rf "${testInstallDir}" exit 1 fi exitStatus=0 if ! find "${testInstallDir}" -type f -name "pv.1*" | grep -Fq "pv.1"; then echo "installation of man page failed" exitStatus=1 fi if ! find "${testInstallDir}" -type f -name "pv*" | grep -Fv "pv.1" | grep -Fq "pv"; then echo "installation of binary failed" exitStatus=1 fi rm -rf "${testInstallDir}" exit "${exitStatus}" # EOF pv-1.8.5/tests/Display_-_--average-rate.test000077500000000000000000000016261452655021700206320ustar00rootroot00000000000000#!/bin/sh # # Check that the average transfer rate counter changes, but not more than it # should. # Dummy assignments for "shellcheck". testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}" # Transfer 210 bytes as 100 bytes, a 1 second gap, 110 bytes, and another 1 # second gap. # (dd if=/dev/zero bs=100 count=1 2>/dev/null; sleep 1; dd if=/dev/zero bs=110 count=1 2>/dev/null; sleep 1; ) | "${testSubject}" -f -i 0.5 -a >/dev/null 2>"${workFile1}" # Count the number of rates output that are below 80. # lineCount=$(tr '\r' '\n' < "${workFile1}" | tr -dc '0-9.\n' | sed '/^$/d' | awk '$1<80{print}' | wc -l | tr -dc '0-9') # Nearly all of the output rates should be above 80 since the average rate # will always be around 100 bytes per second, except for pauses. # test "${lineCount}" -lt 2 && exit 0 echo "average rate varied more than expected" tr '\r' '\n' < "${workFile1}" exit 1 # EOF pv-1.8.5/tests/Display_-_--bits.test000077500000000000000000000007151452655021700172260ustar00rootroot00000000000000#!/bin/sh # # Check that the byte counter counts in bits when --bits is selected. # Dummy assignments for "shellcheck". testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}" dd if=/dev/zero bs=100 count=1 2>/dev/null \ | "${testSubject}" -f -b -8 >/dev/null 2>"${workFile1}" counterValue=$(tr '\r' '\n' < "${workFile1}" | tr -d ' ') test "${counterValue}" = "800b" && exit 0 echo "unexpected bit counter value: ${counterValue}" exit 1 # EOF pv-1.8.5/tests/Display_-_--buffer-percent.test000077500000000000000000000013611452655021700211720ustar00rootroot00000000000000#!/bin/sh # # Check that "--buffer-percent" displays correctly. # Dummy assignments for "shellcheck". testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}" # The output should show 100% and 0% as the buffer initially fills up due to # there being nowhere to write it to, and then empties. ( dd if=/dev/zero bs=1024 count=1024; sleep 2; ) 2>/dev/null \ | "${testSubject}" -f -T -i 0.5 -B 1024 2>"${workFile1}" \ | (sleep 1; dd bs=1024 count=512; sleep 1; cat; ) >/dev/null 2>&1 differentLines=$(tr '\r' '\n' < "${workFile1}" | sed '/^ *$/d' | sort | uniq | wc -l | tr -dc '0-9') test "${differentLines}" -gt 1 && exit 0 echo "expected output changes not seen" tr '\r' '\n' < "${workFile1}" | sed 's/^ *$/d' | sort | uniq exit 1 # EOF pv-1.8.5/tests/Display_-_--bytes.test000077500000000000000000000006531452655021700174140ustar00rootroot00000000000000#!/bin/sh # # Check that the byte counter counts. # Dummy assignments for "shellcheck". testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}" dd if=/dev/zero bs=100 count=1 2>/dev/null \ | "${testSubject}" -f -b >/dev/null 2>"${workFile1}" counterValue=$(tr '\r' '\n' < "${workFile1}" | tr -d ' ') test "${counterValue}" = "100B" && exit 0 echo "unexpected byte counter value: ${counterValue}" exit 1 # EOF pv-1.8.5/tests/Display_-_--eta_-_plausible_values.test000077500000000000000000000016171452655021700226730ustar00rootroot00000000000000#!/bin/sh # # Check that the estimated time counter counts. # Dummy assignments for "shellcheck". testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}" dd if=/dev/zero bs=100 count=1 2>/dev/null \ | "${testSubject}" -f -e -s 100 -i 0.1 -L 25 >/dev/null 2>"${workFile1}" # Count the number of different ETA values there have been. # valueCount=$(tr '\r' '\n' < "${workFile1}" | tr -d ' ' | sed '/^$/d' | sort | uniq | wc -l | tr -dc '0-9') # 3 or less - not OK, since it should have taken 4 seconds. # if ! test "${valueCount}" -gt 3; then echo "fewer than 4 ETA values seen" tr '\r' '\n' < "${workFile1}" | sed '/^ *$/d' | sort | uniq exit 1 fi # 12 or more - not OK, since even on a heavily loaded system that's too long. # if ! test "${valueCount}" -lt 12; then echo "more than 11 ETA values seen" tr '\r' '\n' < "${workFile1}" | sed '/^ *$/d' | sort | uniq exit 1 fi exit 0 # EOF pv-1.8.5/tests/Display_-_--fineta_-_plausible_values.test000077500000000000000000000014641452655021700233700ustar00rootroot00000000000000#!/bin/sh # # Check that the estimated time counter can show the end time of day. # Dummy assignments for "shellcheck". testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}" dd if=/dev/zero bs=100 count=1 2>/dev/null \ | "${testSubject}" -f -I -s 100 -i 0.1 -L 25 >/dev/null 2>"${workFile1}" # Count the number of different ETA values there have been. # valueCount=$(tr '\r' '\n' < "${workFile1}" | tr -d ' ' | sed '/^$/d' | sort | uniq | wc -l | tr -dc '0-9') # There should be at least 1 line of output. # if ! test "${valueCount}" -gt 0; then echo "no output found" exit 1 fi # 8 or more different values - not OK. # if ! test "${valueCount}" -lt 8; then echo "more than 7 different values (${valueCount})" tr '\r' '\n' < "${workFile1}" | sed '/^ *$/d' | sort | uniq exit 1 fi exit 0 # EOF pv-1.8.5/tests/Display_-_--last-written.test000077500000000000000000000020761452655021700207240ustar00rootroot00000000000000#!/bin/sh # # Check that "--last-written" works. # Dummy assignments for "shellcheck". testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}" # Slowly write a sequence of numbers (rate-limited by another `pv' instance) # and watch the "--last-written" output of a second `pv' instance to make # sure the buffer contents are visible (we use "-B" to disable splice mode). seq -w 3 1 100 \ | "${testSubject}" -qL 200 \ | "${testSubject}" -f -B 1024 -A 16 -i 0.2 >/dev/null 2>"${workFile1}" differentLines=$(tr '\r' '\n' < "${workFile1}" | sed '/^ *$/d' | sort | uniq | wc -l | tr -dc '0-9') lastLine=$(tr '\r' '\n' < "${workFile1}" | sed '/^ *$/d' | sed -n '$p') if ! test "${differentLines}" -gt 5; then echo "fewer than 6 different outputs seen" tr '\r' '\n' < "${workFile1}" | sed '/^ *$/d' | sort | uniq exit 1 fi expectedLastLine="097.098.099.100." if ! test "${lastLine}" = "${expectedLastLine}"; then echo "final output differs from expected value" echo "expected value: [${expectedLastLine}]" echo "observed value: [${lastLine}]" exit 1 fi exit 0 # EOF pv-1.8.5/tests/Display_-_--numeric.test000077500000000000000000000016011452655021700177220ustar00rootroot00000000000000#!/bin/sh # # Check that numeric output outputs some percentages. # Dummy assignments for "shellcheck". testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}" # Process 100 bytes at 100 bytes per second, updating every 0.1 seconds for # around 10 output lines. # dd if=/dev/zero bs=100 count=1 2>/dev/null \ | "${testSubject}" -s 100 -n -i 0.1 -L 100 >/dev/null 2>"${workFile1}" lineCount=$(wc -l < "${workFile1}" | tr -dc '0-9') finalLine=$(sed -n '$p' < "${workFile1}") # The number of output lines should be >8 and <13, and the final percentage # should be 100. # if ! test "${lineCount}" -gt 8; then echo "fewer than 9 output lines (${lineCount})" exit 1 fi if ! test "${lineCount}" -lt 13; then echo "more than 12 output lines (${lineCount})" exit 1 fi if ! test "${finalLine}" = "100"; then echo "final percentage was not 100 (${finalLine})" exit 1 fi exit 0 # EOF pv-1.8.5/tests/Display_-_--numeric_--bytes.test000077500000000000000000000016421452655021700212670ustar00rootroot00000000000000#!/bin/sh # # Check that numeric output gives a byte count instead of a percentage when # used with -b. # Dummy assignments for "shellcheck". testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}" # Process 500 bytes at 500 bytes per second, updating every 0.1 seconds for # around 10 output lines. # dd if=/dev/zero bs=500 count=1 2>/dev/null \ | "${testSubject}" -s 500 -n -b -i 0.1 -L 500 >/dev/null 2>"${workFile1}" lineCount=$(wc -l < "${workFile1}" | tr -dc '0-9') finalLine=$(sed -n '$p' < "${workFile1}") # The number of output lines should be >8 and <13, and the final byte count # should be 500. # if ! test "${lineCount}" -gt 8; then echo "fewer than 9 output lines (${lineCount})" exit 1 fi if ! test "${lineCount}" -lt 13; then echo "more than 12 output lines (${lineCount})" exit 1 fi if ! test "${finalLine}" = "500"; then echo "final byte count was not 500 (${finalLine})" exit 1 fi # EOF pv-1.8.5/tests/Display_-_--numeric_--bytes_--line-mode.test000077500000000000000000000017301452655021700233500ustar00rootroot00000000000000#!/bin/sh # # Check that numeric output shows line counts instead of percentages, when # used in line mode together with bytes mode. # Dummy assignments for "shellcheck". testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}"; workFile2="${workFile2:-.tmp2}" # Pass through 100 lines. # seq -w 3 1 100 \ | "${testSubject}" -bnl -i 0.2 -f -L 100 2>"${workFile1}" > "${workFile2}" lineCount=$(wc -l < "${workFile1}" | tr -dc '0-9') finalStdoutLine=$(sed -n '$p' < "${workFile2}") # The number of output lines should be >3 and <10, and the final line of # transferred data on stdout should be 100. # if ! test "${lineCount}" -gt 3; then echo "fewer than 4 output lines (${lineCount})" cat "${workFile1}" exit 1 fi if ! test "${lineCount}" -lt 10; then echo "more than 9 output lines (${lineCount})" cat "${workFile1}" exit 1 fi if ! test "${finalStdoutLine}" = "100"; then echo "final transferred line was not 100 (${finalStdoutLine})" exit 1 fi exit 0 # EOF pv-1.8.5/tests/Display_-_--numeric_--timer.test000077500000000000000000000023101452655021700212520ustar00rootroot00000000000000#!/bin/sh # # Check that numeric output gives a timer when used with -t. # Dummy assignments for "shellcheck". testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}" # Process 100 bytes at 100 bytes per second, updating every 0.1 seconds for # around 10 output lines. # dd if=/dev/zero bs=100 count=1 2>/dev/null \ | "${testSubject}" -s 100 -n -t -i 0.1 -L 100 >/dev/null 2>"${workFile1}" lineCount=$(wc -l < "${workFile1}" | tr -dc '0-9') timesCount=$(tr ',' '.' < "${workFile1}" | awk '{print int(10*$1)}' | sort -n | uniq | wc -l | tr -dc '0-9') finalPercentage=$(sed -n '$p' < "${workFile1}" | awk '{print $2}') # The number of output lines should be >8 and <13, and the number of # different elapsed times should be at least 7. The last percentage should # be 100. # if ! test "${lineCount}" -gt 8; then echo "fewer than 9 output lines (${lineCount})" exit 1 fi if ! test "${lineCount}" -lt 13; then echo "more than 12 output lines (${lineCount})" exit 1 fi if ! test "${timesCount}" -gt 7; then echo "fewer than 8 different elapsed times (${timesCount})" exit 1 fi if ! test "${finalPercentage}" = "100"; then echo "final percentage was not 100 (${finalPercentage})" exit 1 fi exit 0 # EOF pv-1.8.5/tests/Display_-_--progress_-_basic_movement.test000077500000000000000000000011401452655021700234110ustar00rootroot00000000000000#!/bin/sh # # Check that the progress bar moves when data is coming in. # Dummy assignments for "shellcheck". testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}" dd if=/dev/zero bs=100 count=1 2>/dev/null \ | "${testSubject}" -f -p -i 0.1 -L 500 >/dev/null 2>"${workFile1}" # There should be more than 2 different lines of output. # lineCount=$(tr '\r' '\n' < "${workFile1}" | sort | uniq -u | wc -l | tr -dc '0-9') if ! test "${lineCount}" -gt 2; then echo "fewer than 3 different progress lines (${lineCount})" tr '\r' '\n' < "${workFile1}" | sort | uniq -u exit 1 fi exit 0 # EOF pv-1.8.5/tests/Display_-_--progress_-_increasing.test000077500000000000000000000021051452655021700225420ustar00rootroot00000000000000#!/bin/sh # # Check that the progress bar increases in size when data is coming in. # Dummy assignments for "shellcheck". testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}" dd if=/dev/zero bs=100 count=1 2>/dev/null \ | "${testSubject}" -f -p -i 0.1 -L 50 -s 100 >/dev/null 2>"${workFile1}" # There should be more than 5 different lines of output. # lineCount=$(tr '\r' '\n' < "${workFile1}" | sort | uniq -u | wc -l | tr -dc '0-9') if ! test "${lineCount}" -gt 5; then echo "fewer than 6 different progress lines (${lineCount})" tr '\r' '\n' < "${workFile1}" | sort | uniq -u exit 1 fi # Counting the "=" characters in each line that make up the progress bar # should give at least 5 different line lengths. # differentBarLengthsCount=$(tr '\r' '\n' < "${workFile1}" | tr -dc '=\n' | awk '{print length($1)}' | sort | uniq -u | wc -l | tr -dc '0-9') if ! test "${differentBarLengthsCount}" -gt 5; then echo "fewer than 6 different progress bar lengths detected (${differentBarLengthsCount})" tr '\r' '\n' < "${workFile1}" | sort | uniq -u exit 1 fi exit 0 # EOF pv-1.8.5/tests/Display_-_--quiet.test000077500000000000000000000006341452655021700174140ustar00rootroot00000000000000#!/bin/sh # # Check that the -q option shuts everything up. # Dummy assignments for "shellcheck". testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}" dd if=/dev/zero bs=1000 count=5 2>/dev/null \ | "${testSubject}" -f -q -i 0.1 -L 5000 >/dev/null 2>"${workFile1}" if test -s "${workFile1}"; then echo "output detected when there should be none" cat "${workFile1}" exit 1 fi exit 0 # EOF pv-1.8.5/tests/Display_-_--rate_-_displayed_value_changes.test000077500000000000000000000016271452655021700243610ustar00rootroot00000000000000#!/bin/sh # # Check that the transfer rate counter changes. # Dummy assignments for "shellcheck". testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}" # Transfer 200 bytes as two 100-byte blocks with a 2-second gap between. # (dd if=/dev/zero bs=100 count=1 2>/dev/null; sleep 2; dd if=/dev/zero bs=100 count=1 2>/dev/null; ) | "${testSubject}" -f -i 0.5 -r >/dev/null 2>"${workFile1}" # Count the number of different rates output. # rateCount=$(tr '\r' '\n' < "${workFile1}" | sort | uniq -u | wc -l | tr -dc '0-9') # There should be more than 2 different rates counted (around 100 bytes/sec # for the each block, 0 bytes/sec for the gap in the middle, and around 50 # bytes/sec for the average time reported at the end). # if ! test "${rateCount}" -gt 2; then echo "fewer than 3 different rates detected (${rateCount})" tr '\r' '\n' < "${workFile1}" | sort | uniq -u exit 1 fi exit 0 # EOF pv-1.8.5/tests/Display_-_--timer_-_displayed_value_changes.test000077500000000000000000000010541452655021700245400ustar00rootroot00000000000000#!/bin/sh # # Check that the elapsed time counter does count up. # Dummy assignments for "shellcheck". testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}" # Transfer a zero amount of data, but take 3 seconds to do it. # (sleep 3 | "${testSubject}" -f -t >/dev/null) 2>&1 | tr '\r' '\n' > "${workFile1}" # Count the number of different timer values; it should be >1. # valueCount=$(sort < "${workFile1}" | uniq -u | wc -l | tr -dc '0-9') if ! test "${valueCount}" -gt 1; then echo "timer value did not change" exit 1 fi exit 0 # EOF pv-1.8.5/tests/General_-_--pidfile.test000077500000000000000000000017061452655021700176520ustar00rootroot00000000000000#!/bin/sh # # Check that the process ID can be written to a file as described in the # manual. # Dummy assignments for "shellcheck". testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}" # Check we can run "kill -s 0". if ! kill -s 0 $$ >/dev/null 2>&1; then echo "cannot check process existence with \`kill -s 0'" exit 77 fi dd if=/dev/zero bs=150 count=1 2>/dev/null \ | "${testSubject}" -q -L 50 -P "${workFile1}" >/dev/null 2>/dev/null \ & testPid="$!" sleep 1 storedPid=$(cat "${workFile1}" 2>/dev/null) pidValid="0" kill -s 0 "${storedPid}" 2>/dev/null && pidValid="1" wait sleep 1 if test -s "${workFile1}"; then echo "PID file was not removed on exit" exit 1 fi true > "${workFile1}" if ! test "${testPid}" = "${storedPid}"; then echo "stored PID [${storedPid}] did not match actual PID [${testPid}]" exit 1 fi if ! test "${pidValid}" = "1"; then echo "stored PID [${storedPid}] was not reachable" exit 1 fi exit 0 # EOF pv-1.8.5/tests/General_-_--size_argument_handling.test000077500000000000000000000011271452655021700227530ustar00rootroot00000000000000#!/bin/sh # # Check that size arguments are processed correctly. # Dummy assignments for "shellcheck". testSubject="${testSubject:-false}" # Pass size argument $1 and check that the last reported number is $2. checkSizeArgument () { reportedCount=$("${testSubject}" -XfnbSs "$1" /dev/zero 2>&1 | sed -n '$p' | tr -dc '0-9') if ! test "${reportedCount}" = "$2"; then echo "passed size argument $1, expected count of $2, but got ${reportedCount}" exit 1 fi } checkSizeArgument 10000 10000 checkSizeArgument 1k 1024 checkSizeArgument 1M 1048576 checkSizeArgument 8G 8589934592 exit 0 # EOF pv-1.8.5/tests/Integrity_-_Basic.test000077500000000000000000000012761452655021700175300ustar00rootroot00000000000000#!/bin/sh # # Check that data can be just passed straight through. # Dummy assignment for "shellcheck". testSubject="${testSubject:-false}" inputString="TESTING" outputString=$(printf "%s" "${inputString}" | "${testSubject}" 2>/dev/null) || { echo "unexpected failure code"; exit 1; } if ! test "${inputString}" = "${outputString}"; then echo "output did not match input" exit 1 fi # Test again with --force. inputString="TESTINGAGAIN" outputString=$(printf "%s" "${inputString}" | "${testSubject}" -f 2>/dev/null) || { echo "unexpected failure code"; exit 1; } if ! test "${inputString}" = "${outputString}"; then echo "output did not match input when using --force" exit 1 fi exit 0 # EOF pv-1.8.5/tests/Integrity_-_Binary_data.test000077500000000000000000000011531452655021700207160ustar00rootroot00000000000000#!/bin/sh # # Transfer a large chunk of data through pv and check data correctness # afterwards. # Dummy assignments for "shellcheck". testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}"; workFile2="${workFile2:-.tmp2}" # generate some data dd if=/dev/urandom of="${workFile1}" bs=1024 count=10240 2>/dev/null inputChecksum=$(cksum "${workFile1}" | awk '{print $1}') # read through pv and test afterwards "${testSubject}" -B 100000 -q "${workFile1}" > "${workFile2}" outputChecksum=$(cksum "${workFile2}" | awk '{print $1}') test "${inputChecksum}" = "${outputChecksum}" || exit 1 exit 0 # EOF pv-1.8.5/tests/Integrity_-_From_bursty_source.test000077500000000000000000000027401452655021700223770ustar00rootroot00000000000000#!/bin/sh # # Transfer a large chunk of data through pv using pipes, sending it in a # bursty fashion, and check data correctness afterwards. # Dummy assignments for "shellcheck". testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}"; workFile2="${workFile2:-.tmp2}" # generate some data dd if=/dev/urandom of="${workFile1}" bs=1024 count=10240 2>/dev/null inputChecksum=$(cksum "${workFile1}" | awk '{print $1}') # read through pv and test afterwards ( dd if="${workFile1}" bs=1 count=9000 sleep 1 dd if="${workFile1}" bs=1 skip=9000 count=1240 sleep 1 dd if="${workFile1}" bs=1024 skip=10 count=1014 sleep 1 dd if="${workFile1}" bs=1024 skip=1024 count=1024 sleep 1 dd if="${workFile1}" bs=1024 skip=2048 ) 2>/dev/null | "${testSubject}" -q -L 2M | cat > "${workFile2}" outputChecksum=$(cksum "${workFile2}" | awk '{print $1}') if ! test "${inputChecksum}" = "${outputChecksum}"; then echo "checksum mismatch with dd | pv | cat" exit 1 fi # same again but with one less pipe ( dd if="${workFile1}" bs=1 count=9000 sleep 1 dd if="${workFile1}" bs=1 skip=9000 count=1240 sleep 1 dd if="${workFile1}" bs=1024 skip=10 count=1014 sleep 1 dd if="${workFile1}" bs=1024 skip=1024 count=1024 sleep 1 dd if="${workFile1}" bs=1024 skip=2048 ) 2>/dev/null | "${testSubject}" -q -L 2M > "${workFile2}" outputChecksum=$(cksum "${workFile2}" | awk '{print $1}') if ! test "${inputChecksum}" = "${outputChecksum}"; then echo "checksum mismatch with dd | pv > file" exit 1 fi exit 0 # EOF pv-1.8.5/tests/Integrity_-_Large_file_support.test000077500000000000000000000057721452655021700223410ustar00rootroot00000000000000#!/bin/sh # # Make sure that files larger than 2GB are supported. # Dummy assignments for "shellcheck". testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}"; workFile2="${workFile2:-.tmp2}" # Check there is enough free space for this test. workFile1Dir="${workFile1%/*}" workFile1FreeKiB=$(df -kP "${workFile1Dir}" | sed -n '$p' | awk '{print $(NF-2)}') test -n "${workFile1FreeKiB}" || workFile1FreeKiB=0 if ! test "${workFile1FreeKiB}" -gt 3300000 2>/dev/null; then echo "test requires at least 3GB free on ${workFile1Dir}" exit 77 fi # Generate a 3GB sparse file - we don't really need 3GB of free space unless # sparse files are not supported. true > "${workFile1}" if ! dd if="/dev/zero" of="${workFile1}" count=1 bs=1048576 seek=3072 2>/dev/null; then echo "failed to create 3GB specimen file" exit 77 fi # NB the "stat" command is not portable - BSD stat(1) has a different syntax # to GNU stat(1) - so we have to parse the output of ls(1). # shellcheck disable=SC2012 fileSize=$(ls -nl "${workFile1}" 2>/dev/null | awk '{print $5}') test -n "${fileSize}" || fileSize=0 if ! test "${fileSize}" -gt 3000000; then echo "failed to validate specimen file size" exit 77 fi # Transfer the file, and count how many bytes came through. bytesTransferred=$("${testSubject}" -n -b "${workFile1}" 2>"${workFile2}" | wc -c 2>/dev/null | tr -dc '0-9') test -n "${bytesTransferred}" || bytesTransferred=0 bytesReported=$(sed -n '$p' "${workFile2}" | tr -dc '0-9') test -n "${bytesReported}" || bytesReported=0 if ! test "${bytesTransferred}" -eq "${fileSize}"; then echo "transferred ${bytesTransferred} of ${fileSize} bytes" exit 1 fi if ! test "${bytesReported}" -eq "${fileSize}"; then echo "counted ${bytesReported} of ${fileSize} bytes" exit 1 fi # Transfer the file from stdin, and count how many bytes came through. bytesTransferred=$("${testSubject}" -n -b < "${workFile1}" 2>"${workFile2}" | wc -c 2>/dev/null | tr -dc '0-9') test -n "${bytesTransferred}" || bytesTransferred=0 bytesReported=$(sed -n '$p' "${workFile2}" | tr -dc '0-9') test -n "${bytesReported}" || bytesReported=0 if ! test "${bytesTransferred}" -eq "${fileSize}"; then echo "stdin - transferred ${bytesTransferred} of ${fileSize} bytes" exit 1 fi if ! test "${bytesReported}" -eq "${fileSize}"; then echo "stdin - counted ${bytesReported} of ${fileSize} bytes" exit 1 fi # Use the file as a size value and transfer its size of bytes from dev/zero, # and count how many bytes came through. bytesTransferred=$("${testSubject}" -n -b -S -s "@${workFile1}" /dev/zero 2>"${workFile2}" | wc -c 2>/dev/null | tr -dc '0-9') test -n "${bytesTransferred}" || bytesTransferred=0 bytesReported=$(sed -n '$p' "${workFile2}" | tr -dc '0-9') test -n "${bytesReported}" || bytesReported=0 if ! test "${bytesTransferred}" -eq "${fileSize}"; then echo "size read - transferred ${bytesTransferred} of ${fileSize} bytes" exit 1 fi if ! test "${bytesReported}" -eq "${fileSize}"; then echo "size read - counted ${bytesReported} of ${fileSize} bytes" exit 1 fi exit 0 # EOF pv-1.8.5/tests/Integrity_-_On_output_pipe_close.test000077500000000000000000000022531452655021700227010ustar00rootroot00000000000000#!/bin/sh # # Check that there is no SIGPIPE or dropped data on bigger data transfers. # Dummy assignments for "shellcheck". testSubject="${testSubject:-false}" # We nead GNU head. On some platforms it is named ghead instead of head. HEAD="head" for checkPath in $(echo "${PATH}" | tr ':' '\n') do if test -x "${checkPath}/ghead" then HEAD="${checkPath}/ghead" break fi done # Check that it really is GNU head, and skip the test if not. if ! echo | "${HEAD}" -c 10 >/dev/null 2>&1; then echo "GNU \`head' is required" exit 77 fi # Don't use dd. See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=324308 stopAtByteCount="100000000" #COUNT2=`"${testSubject}" -B 100000 -q /dev/zero | $HEAD -c $COUNT1 | wc -c | tr -d ' '` # We have to remove \n here, to fix the test on AIX. bytesTransferred=$("${testSubject}" -B 100000 -q /dev/zero | "${HEAD}" -c "${stopAtByteCount}" | tr -d '\n' | wc -c | tr -dc '0-9') if ! test "${stopAtByteCount}" = "${bytesTransferred}"; then echo "number bytes transferred was not the expected value" echo "transferred: ${bytesTransferred}" echo "expected: ${stopAtByteCount}" exit 1 fi exit 0 # EOF pv-1.8.5/tests/Integrity_-_When_adjusted_remotely.test000077500000000000000000000035431452655021700232120ustar00rootroot00000000000000#!/bin/sh # # Try repeatedly messaging a transfer process, and make sure the data stays # intact. # Dummy assignments for "shellcheck". testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}"; workFile2="${workFile2:-.tmp2}"; workFile3="${workFile3:-.tmp3}"; workFile4="${workFile4:-.tmp4}" # Do nothing if it is not supported. if ! "${testSubject}" -h 2>/dev/null | grep -Eq "^ -R,"; then echo "Not supported on this platform" exit 77 fi # Generate some data. dd if=/dev/urandom of="${workFile1}" bs=1024 count=10240 2>/dev/null # Run a few remote control commands in the background. # echo FAIL > "${workFile3}" ( set +e sleep 2 for loopCount in 1 2 3; do "${testSubject}" -R "$(cat "${workFile4}")" -apterb || exit 1 (usleep 200000 || sleep 1) 2>/dev/null "${testSubject}" -R "$(cat "${workFile4}")" -p || exit 1 (usleep 200000 || sleep 1) 2>/dev/null "${testSubject}" -R "$(cat "${workFile4}")" -N "test" || exit 1 (usleep 200000 || sleep 1) 2>/dev/null "${testSubject}" -R "$(cat "${workFile4}")" -F "%e" || exit 1 (usleep 200000 || sleep 1) 2>/dev/null "${testSubject}" -R "$(cat "${workFile4}")" -N "." || exit 1 (usleep 200000 || sleep 1) 2>/dev/null echo "${loopCount}" >/dev/null # dummy for shellcheck done "${testSubject}" -R "$(cat "${workFile4}")" -L 10M echo OK > "${workFile3}" ) & # Run our data transfer. "${testSubject}" -L 100k -i 0.1 -f -P "${workFile4}" "${workFile1}" > "${workFile2}" 2>/dev/null # Check our remote control calls ran OK. backgroundStatus=$(cat "${workFile3}") if ! test "${backgroundStatus}" = "OK"; then echo "remote control calls failed" exit 1 fi # Check data integrity. inputChecksum=$(cksum "${workFile1}" | awk '{print $1}') outputChecksum=$(cksum "${workFile2}" | awk '{print $1}') if ! test "${inputChecksum}" = "${outputChecksum}"; then echo "input and output checksums differ" exit 1 fi exit 0 # EOF pv-1.8.5/tests/Memory_safety_-_Basic.test000077500000000000000000000023431452655021700203710ustar00rootroot00000000000000#!/bin/sh # # Run valgrind's memory checker against a process using various different # transfer options. # Dummy assignments for "shellcheck". sourcePath="${sourcePath:-.}"; testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}"; workFile2="${workFile2:-.tmp2}"; workFile3="${workFile3:-.tmp3}"; workFile4="${workFile4:-.tmp4}" # Load the valgrind function. . "${sourcePath}/tests/run-valgrind.sh" # Plain, no options. { echo "testing" | runWithValgrind >/dev/null 2>&1; } 4>&1 || exit 1 # With --force. { echo "testing" | runWithValgrind -f >/dev/null 2>&1; } 4>&1 || exit 1 # Check "--average-rate". (dd if=/dev/zero bs=100 count=1 2>/dev/null; sleep 1; dd if=/dev/zero bs=110 count=1 2>/dev/null; sleep 1; ) | { runWithValgrind -f -i 0.5 -a >/dev/null 2>"${workFile1}"; } 4>&1 || exit 1 # Check "--buffer-size" and "--buffer-percent". { \ ( dd if=/dev/zero bs=1024 count=1024; sleep 2; ) 2>/dev/null \ | runWithValgrind -f -T -i 0.5 -B 1024 2>"${workFile1}" \ | (sleep 1; dd bs=1024 count=512; sleep 1; cat; ) >/dev/null 2>&1; \ } 4>&1 || exit 1 # Check "--numeric" "--bytes" "--line-mode". seq -w 3 1 100 \ | { runWithValgrind -bnl -i 0.2 -f -L 100 2>"${workFile1}" > "${workFile2}"; } 4>&1 || exit 1 exit 0 # EOF pv-1.8.5/tests/Memory_safety_-_Remote_control_receiver.test000077500000000000000000000030351452655021700242260ustar00rootroot00000000000000#!/bin/sh # # Run valgrind's memory checker while receiving remote control commands. # Dummy assignments for "shellcheck". sourcePath="${sourcePath:-.}"; testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}"; workFile2="${workFile2:-.tmp2}"; workFile3="${workFile3:-.tmp3}"; workFile4="${workFile4:-.tmp4}" # Do nothing if it is not supported. if ! "${testSubject}" -h 2>/dev/null | grep -Eq "^ -R,"; then echo "Not supported on this platform" exit 77 fi # Load the valgrind function. . "${sourcePath}/tests/run-valgrind.sh" dd if=/dev/urandom of="${workFile1}" bs=1024 count=10240 2>/dev/null # Check from the POV of the process being controlled. true > "${workFile3}" ( set +e while ! test -s "${workFile3}"; do usleep 200000 2>/dev/null || sleep 1; done for loopCount in 1 2 3; do "${testSubject}" -R "$(cat "${workFile3}")" -apterb || exit 1 (usleep 200000 || sleep 1) 2>/dev/null "${testSubject}" -R "$(cat "${workFile3}")" -p || exit 1 (usleep 200000 || sleep 1) 2>/dev/null "${testSubject}" -R "$(cat "${workFile3}")" -N "test" || exit 1 (usleep 200000 || sleep 1) 2>/dev/null "${testSubject}" -R "$(cat "${workFile3}")" -F "%e" || exit 1 (usleep 200000 || sleep 1) 2>/dev/null "${testSubject}" -R "$(cat "${workFile3}")" -N "." || exit 1 (usleep 200000 || sleep 1) 2>/dev/null echo "${loopCount}" >/dev/null # dummy for shellcheck done "${testSubject}" -R "$(cat "${workFile3}")" -L 10M ) & { runWithValgrind -L 100k -i 0.1 -f -P "${workFile3}" "${workFile1}" > "${workFile2}" 2>/dev/null; } 4>&1 || exit 1 exit 0 # EOF pv-1.8.5/tests/Memory_safety_-_Remote_control_sender.test000077500000000000000000000027561452655021700237130ustar00rootroot00000000000000#!/bin/sh # # Run valgrind's memory checker while using remote control to control # another process. # Dummy assignments for "shellcheck". sourcePath="${sourcePath:-.}"; testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}"; workFile2="${workFile2:-.tmp2}"; workFile3="${workFile3:-.tmp3}"; workFile4="${workFile4:-.tmp4}" # Do nothing if it is not supported. if ! "${testSubject}" -h 2>/dev/null | grep -Eq "^ -R,"; then echo "Not supported on this platform" exit 77 fi # Load the valgrind function. . "${sourcePath}/tests/run-valgrind.sh" dd if=/dev/urandom of="${workFile1}" bs=1024 count=10240 2>/dev/null # Check from the POV of the process sending a control command. true > "${workFile3}" "${testSubject}" -L 100k -i 0.1 -f -P "${workFile3}" "${workFile1}" > "${workFile2}" 2>/dev/null & while ! test -s "${workFile3}"; do usleep 200000 2>/dev/null || sleep 1; done runWithValgrind -R "$(cat "${workFile3}")" -apterb 4>&1 || exit 1 (usleep 200000 || sleep 1) 2>/dev/null runWithValgrind -R "$(cat "${workFile3}")" -p 4>&1 || exit 1 (usleep 200000 || sleep 1) 2>/dev/null runWithValgrind -R "$(cat "${workFile3}")" -N "test" 4>&1 || exit 1 (usleep 200000 || sleep 1) 2>/dev/null runWithValgrind -R "$(cat "${workFile3}")" -F "%e" 4>&1 || exit 1 (usleep 200000 || sleep 1) 2>/dev/null runWithValgrind -R "$(cat "${workFile3}")" -N "." 4>&1 || exit 1 (usleep 200000 || sleep 1) 2>/dev/null runWithValgrind -R "$(cat "${workFile3}")" -L 10M 4>&1 || exit 1 wait exit 0 # EOF pv-1.8.5/tests/Modifiers_-_--direct-io.test000077500000000000000000000034211452655021700204550ustar00rootroot00000000000000#!/bin/sh # # Transfer a large chunk of data with "--direct-io" and check data # correctness afterwards, both with and without rate limits. Note that this # doesn't check that O_DIRECT is actually being used, it just checks that # data is not being corrupted. # Dummy assignments for "shellcheck". testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}"; workFile2="${workFile2:-.tmp2}" # generate some data dd if=/dev/urandom of="${workFile1}" bs=1024 count=2560 2>/dev/null inputChecksum=$(cksum "${workFile1}" | awk '{print $1}') doubleInputChecksum=$(cat "${workFile1}" "${workFile1}" | cksum | awk '{print $1}') # read through pv and test afterwards "${testSubject}" -q "${workFile1}" > "${workFile2}" outputChecksum=$(cksum "${workFile2}" | awk '{print $1}') if ! test "${inputChecksum}" = "${outputChecksum}"; then echo "checksum mismatched even without \"--direct-io\"" exit 1 fi # Same again but with "--direct-io" "${testSubject}" -K -q "${workFile1}" > "${workFile2}" outputChecksum=$(cksum "${workFile2}" | awk '{print $1}') if ! test "${inputChecksum}" = "${outputChecksum}"; then echo "checksum mismatched with \"--direct-io\"" exit 1 fi # Now with "--direct-io" and "--rate-limit" "${testSubject}" -K -L 800K -q "${workFile1}" > "${workFile2}" outputChecksum=$(cksum "${workFile2}" | awk '{print $1}') if ! test "${inputChecksum}" = "${outputChecksum}"; then echo "checksum mismatched with \"--direct-io\" + \"--rate-limit\"" exit 1 fi # Now with "--direct-io" on the same file twice "${testSubject}" -K -q "${workFile1}" "${workFile1}" > "${workFile2}" outputChecksum=$(cksum "${workFile2}" | awk '{print $1}') if ! test "${doubleInputChecksum}" = "${outputChecksum}"; then echo "checksum mismatched with \"--direct-io\" on two files" exit 1 fi exit 0 # EOF pv-1.8.5/tests/Modifiers_-_--force.test000077500000000000000000000020051452655021700176710ustar00rootroot00000000000000#!/bin/sh # # Check that the progress bar is produced when "--force" is used, and is not # when it is not, providing stderr is a file. # Dummy assignments for "shellcheck". testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}"; dd if=/dev/zero bs=100 count=1 2>/dev/null \ | "${testSubject}" -f -p -i 0.1 -L 100 >/dev/null 2>"${workFile1}" # There should be more than 2 different lines of output. # lineCount=$(tr '\r' '\n' < "${workFile1}" | sort | uniq -u | wc -l | tr -dc '0-9') if ! test "${lineCount}" -gt 2; then echo "fewer than 3 different progress lines with \"--force\" (${lineCount})" tr '\r' '\n' < "${workFile1}" | sort | uniq -u exit 1 fi # Now try again without "--force". dd if=/dev/zero bs=100 count=1 2>/dev/null \ | "${testSubject}" -p -i 0.1 -L 100 >/dev/null 2>"${workFile1}" # There should be no output without "--force". # if test -s "${workFile1}"; then echo "unexpected output when not using \"--force\"" tr '\r' '\n' < "${workFile1}" | sort | uniq -u exit 1 fi exit 0 # EOF pv-1.8.5/tests/Modifiers_-_--interval.test000077500000000000000000000007361452655021700204300ustar00rootroot00000000000000#!/bin/sh # # Check that the update interval can be set. # Dummy assignments for "shellcheck". testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}" sleep 1 | "${testSubject}" -f -i 0.1 >/dev/null 2>"${workFile1}" # There should be more than 6 lines of output. # lineCount=$(tr '\r' '\n' < "${workFile1}" | wc -l | tr -dc '0-9') if ! test "${lineCount}" -gt 6; then echo "fewer than 7 lines of output" tr '\r' '\n' < "${workFile1}" exit 1 fi exit 0 # EOF pv-1.8.5/tests/Modifiers_-_--line-mode.test000077500000000000000000000015731452655021700204550ustar00rootroot00000000000000#!/bin/sh # # Check that line mode counts lines instead of bytes. # Dummy assignments for "shellcheck". testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}" # Pass through 100 lines. # seq 1 100 \ | "${testSubject}" -bl -i 0.2 -f -L 50 >/dev/null 2>"${workFile1}" lineCount=$(tr '\r' '\n' < "${workFile1}" | sort | uniq -u | wc -l | tr -dc '0-9') lastNumber=$(tr '\r' '\n' < "${workFile1}" | awk '/[0-9]/{printf "%.0f\n",$1}' | sed -n '$p') # The last number output should be the number of input lines. if ! test "${lastNumber}" = "100"; then echo "line counter was incorrect (${lastNumber} instead of 100)" tr '\r' '\n' < "${workFile1}" exit 1 fi # There should be more than 3 output lines as the counter increased. if ! test "${lineCount}" -gt 3; then echo "fewer than 4 line counter values (${lineCount})" tr '\r' '\n' < "${workFile1}" exit 1 fi exit 0 # EOF pv-1.8.5/tests/Modifiers_-_--size.test000077500000000000000000000030111452655021700175430ustar00rootroot00000000000000#!/bin/sh # # Check that "--size" affects the percentage shown. # Dummy assignments for "shellcheck". testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}" # Process 100 bytes at 100 bytes per second, updating every 0.1 seconds for # around 10 output lines, but set the size to 200. # dd if=/dev/zero bs=100 count=1 2>/dev/null \ | "${testSubject}" -s 200 -n -i 0.1 -L 100 >/dev/null 2>"${workFile1}" lineCount=$(wc -l < "${workFile1}" | tr -dc '0-9') finalLine=$(sed -n '$p' < "${workFile1}") # The number of output lines should be >8 and <13, and the final percentage # should be 50. # if ! test "${lineCount}" -gt 8; then echo "part 1: fewer than 9 output lines (${lineCount})" exit 1 fi if ! test "${lineCount}" -lt 13; then echo "part 1: more than 12 output lines (${lineCount})" exit 1 fi if ! test "${finalLine}" = "50"; then echo "part 1: final percentage was not 50 (${finalLine})" exit 1 fi # Same as above, but this time with a size of 50 for 100 input bytes. # dd if=/dev/zero bs=100 count=1 2>/dev/null \ | "${testSubject}" -s 50 -n -i 0.1 -L 100 >/dev/null 2>"${workFile1}" lineCount=$(wc -l < "${workFile1}" | tr -dc '0-9') finalLine=$(sed -n '$p' < "${workFile1}") if ! test "${lineCount}" -gt 8; then echo "part 2: fewer than 9 output lines (${lineCount})" exit 1 fi if ! test "${lineCount}" -lt 13; then echo "part 2: more than 12 output lines (${lineCount})" exit 1 fi if ! test "${finalLine}" = "200"; then echo "part 2: final percentage was not 200 (${finalLine})" exit 1 fi exit 0 # EOF pv-1.8.5/tests/Modifiers_-_--size_from_file_size.test000077500000000000000000000026341452655021700226310ustar00rootroot00000000000000#!/bin/sh # # Similar to the "--size" check but, instead, using another file's size with # "--size @". # Dummy assignments for "shellcheck". testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}"; workFile2="${workFile2:-.tmp2}" # Process 100 bytes at 100 bytes per second, interval 0.1 seconds, with the # size set from a file of $1 bytes and expecting a percentage of $2 at the # end. sizeCheck () { # Make a file of size $1 bytes, for reference. dd if=/dev/zero bs="$1" count=1 2>/dev/null >"${workFile2}" # Run 100 bytes through the program, using the reference file's size # as the percentage reference. dd if=/dev/zero bs=100 count=1 2>/dev/null \ | "${testSubject}" -s "@${workFile2}" -n -i 0.1 -L 100 >/dev/null 2>"${workFile1}" lineCount=$(wc -l < "${workFile1}" | tr -dc '0-9') finalLine=$(sed -n '$p' < "${workFile1}") # The number of output lines should be >5 and <13, and the final # percentage should be $2. # if ! test "${lineCount}" -gt 5; then echo "(reference size=$1) fewer than 6 output lines (${lineCount})" exit 1 fi if ! test "${lineCount}" -lt 13; then echo "(reference size=$1) more than 12 output lines (${lineCount})" exit 1 fi if ! test "${finalLine}" = "$2"; then echo "(reference size=$1): final percentage was not $2 (${finalLine})" ls -l "${workFile2}" cat "${workFile1}" exit 1 fi } sizeCheck 100 100 sizeCheck 200 50 sizeCheck 50 200 exit 0 # EOF pv-1.8.5/tests/Modifiers_-_--sync.test000077500000000000000000000025521452655021700175560ustar00rootroot00000000000000#!/bin/sh # # Transfer a large chunk of data with "--sync" and check data correctness # afterwards, both with and without rate limits. Note that this doesn't # check that fdatasync() is actually being called, it just checks that data # is not being corrupted. # Dummy assignments for "shellcheck". testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}"; workFile2="${workFile2:-.tmp2}" # generate some data dd if=/dev/urandom of="${workFile1}" bs=1024 count=2560 2>/dev/null inputChecksum=$(cksum "${workFile1}" | awk '{print $1}') # read through pv and test afterwards "${testSubject}" -q "${workFile1}" > "${workFile2}" outputChecksum=$(cksum "${workFile2}" | awk '{print $1}') if ! test "${inputChecksum}" = "${outputChecksum}"; then echo "checksum mismatched even without \"--sync\"" exit 1 fi # Same again but with "--sync" "${testSubject}" -Y -q "${workFile1}" > "${workFile2}" outputChecksum=$(cksum "${workFile2}" | awk '{print $1}') if ! test "${inputChecksum}" = "${outputChecksum}"; then echo "checksum mismatched with \"--sync\"" exit 1 fi # Now with "--sync" and "--rate-limit" "${testSubject}" -Y -L 800K -q "${workFile1}" > "${workFile2}" outputChecksum=$(cksum "${workFile2}" | awk '{print $1}') if ! test "${inputChecksum}" = "${outputChecksum}"; then echo "checksum mismatched with \"--sync\" + \"--rate-limit\"" exit 1 fi exit 0 # EOF pv-1.8.5/tests/Terminal_-_Detect_width.test000077500000000000000000000050001452655021700207000ustar00rootroot00000000000000#!/bin/sh # # Check that the terminal width is detected on startup. # Dummy assignments for "shellcheck". testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}"; workFile2="${workFile2:-.tmp2}" # Skip the test if `tmux' is not available. if ! command -v tmux >/dev/null 2>&1; then echo "test requires \`tmux'" exit 77 fi # Skip the test if `tmux' does not have "-C". if echo "kill-server" | tmux -C -L pvtest 2>&1 | grep -Fq "tmux: unknown option"; then echo "test requires a newer \`tmux'" exit 77 fi # Run the given command $3 inside a terminal of the given width $1, waiting # $2 seconds, and output the results. # runInTerminal () { terminalWidth="$1" secondsToWait="$2" commandToRun="$3" { echo "set remain-on-exit on" echo "new-session -d -x ${terminalWidth} -y 5" # starting the session doesn't always correctly set the size echo "resize-window -x ${terminalWidth} -y 5" # tmux 1.8 doesn't have "resize-window" echo "resize-pane -x ${terminalWidth} -y 5" echo "pipe-pane 'cat > ${workFile1}'" echo "respawn-pane -k \"${commandToRun}\"" sleep "${secondsToWait}" echo "kill-server" sleep 1 } \ | tmux -C -L pvtest >/dev/null cat "${workFile1}" } # Run a progress meter inside a terminal of the given width, and output the # longest number of characters seen between "[" and "]". # runWidthTest () { runInTerminal "$1" 1 "${testSubject} -pSs 1K /dev/null" \ | tr '\r' '\n' \ | sed -n 's/^.*\[//;s/\].*$//p' \ | awk 'BEGIN {m=0} {n=length($0); m=(n>m?n:m)} END {print m}' } # Perform a test run of the given width and exit on failure. The longest # bar found by runWidthTest() should be the width of the terminal minus the # "[] 100%" characters, i.e. 7 less. # widthTest () { terminalWidth="$1" longestBar=$(runWidthTest "${terminalWidth}") if test -z "${longestBar}"; then echo "no output from test at width=${terminalWidth}" exit 1 elif ! test "${longestBar}" -eq $((terminalWidth-7)); then echo "bar size incorrect (${longestBar}) at width=${terminalWidth}" exit 1 fi } # Check that tmux can actually resize the terminal. checkSize="100" detectedWidth=$(runInTerminal "${checkSize}" 1 "stty -a | tr \\\";\\\" \\\"\\\\n\\\" | grep col | sed -n 1p | tr -dc 0-9") if ! test "${detectedWidth}" = "${checkSize}"; then echo "test requires a \`tmux' that can resize a detached window (requested width ${checkSize}, detected ${detectedWidth})" exit 77 fi # Test the progress bar width at various terminal sizes. widthTest 80 widthTest 120 widthTest 400 widthTest 20 exit 0 # EOF pv-1.8.5/tests/Transfer_-_--rate-limit.test000077500000000000000000000006731452655021700205160ustar00rootroot00000000000000#!/bin/sh # # A simple test of rate limiting. # Dummy assignments for "shellcheck". testSubject="${testSubject:-false}" # Transfer 102 bytes at 100 bytes/sec. It should take at least 1 second. # startTime=$(date +%S) dd if=/dev/zero bs=102 count=1 2>/dev/null | "${testSubject}" -L 100 2>/dev/null | cat >/dev/null endTime=$(date +%S) if test "${startTime}" = "${endTime}"; then echo "transfer took zero seconds" exit 1 fi exit 0 # EOF pv-1.8.5/tests/Transfer_-_--remote.test000077500000000000000000000020451452655021700177350ustar00rootroot00000000000000#!/bin/sh # # Try changing the format of a transfer remotely. # Dummy assignments for "shellcheck". testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}"; workFile2="${workFile2:-.tmp2}"; workFile3="${workFile3:-.tmp3}"; workFile4="${workFile4:-.tmp4}" # Do nothing if it is not supported. if ! "${testSubject}" -h 2>/dev/null | grep -Eq "^ -R,"; then echo "Not supported on this platform" exit 77 fi # Generate an empty test file. dd if=/dev/zero of="${workFile1}" bs=1024 count=10240 2>/dev/null ( sleep 1 "${testSubject}" -R "$(cat "${workFile4}")" -a sleep 2 "${testSubject}" -R "$(cat "${workFile4}")" -L 10M ) & "${testSubject}" -L 2M -f -P "${workFile4}" "${workFile1}" > "${workFile2}" 2>"${workFile3}" # Make sure there is more than one length of line (excluding blank lines). line_lengths=$(tr '\r' '\n' < "${workFile3}" | awk '{print length($0)}' | grep -Fvx 0 | sort -n | uniq | wc -l | tr -dc '0-9') if ! test "${line_lengths}" -gt 1; then echo "only one line length seen - format change failed" exit 1 fi exit 0 # EOF pv-1.8.5/tests/Transfer_-_--stop-at-size.test000077500000000000000000000013551452655021700210040ustar00rootroot00000000000000#!/bin/sh # # Make sure -S stops at the given size. # Dummy assignments for "shellcheck". testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}"; workFile2="${workFile2:-.tmp2}" # generate some data dd if=/dev/urandom of="${workFile1}" bs=1024 count=10 2>/dev/null # read through pv and test afterwards "${testSubject}" -S -s 5120 -q "${workFile1}" > "${workFile2}" outputChecksum=$(cksum "${workFile2}" | awk '{print $1}') # take the first 5120 bytes of workFile1 and cksum them dd if="${workFile1}" of="${workFile2}" bs=1024 count=5 2>/dev/null inputChecksum=$(cksum "${workFile2}" | awk '{print $1}') if ! test "${inputChecksum}" = "${outputChecksum}"; then echo "input and output checksums differ" exit 1 fi exit 0 # EOF pv-1.8.5/tests/run-valgrind.sh000077500000000000000000000034231452655021700162740ustar00rootroot00000000000000#!/bin/sh # # Function to launch the test subject under valgrind. # # If valgrind is unavailable, exits the script with status 77, after writing # a note to file descriptor 4. # # If valgrind finds an error, writes the error to "valgrind.out" in the # current directory, and exits the script with status 1 after writing a note # to file descriptor 4. # # If valgrind does not find any errors, the function returns with the exit # status of the test subject. # # Source this file from test scripts that use valgrind. # # Requires ${testSubject} and ${workFile4}. This means that the caller must # not use file ${workFile4}, as this function will overwrite it. # # Output file for failures. valgrindOutputFile="valgrind.out" # Dummy assignments for "shellcheck". testSubject="${testSubject:-false}"; workFile4="${workFile4:-.tmp4}" if ! command -v valgrind >/dev/null 2>&1; then echo "test requires \`valgrind'" exit 77 fi valgrindHelp="$(valgrind --help 2>&1)" for valgrindOption in "verbose" "show-error-list" "error-exitcode" "track-fds" "leak-check"; do echo "${valgrindHelp}" | grep -Fq "${valgrindOption}" || { echo "test requires \`valgrind --${valgrindOption}'"; exit 77; } done runWithValgrind () { valgrind --tool=memcheck \ --verbose --show-error-list=yes --log-fd=3 \ --error-exitcode=125 \ --track-fds=yes \ --leak-check=full \ "${testSubject}" "$@" \ 3>"${workFile4}" 4<&- returnValue=$? if test "${returnValue}" -eq 125; then { echo "================================================" date echo "Command: ${testSubject} $*" echo cat "${workFile4}" echo "================================================" echo } >> "${valgrindOutputFile}" echo "memory check failed - see file \`valgrind.out'." 1>&4 exit 1 fi return "${returnValue}" } # EOF pv-1.8.5/tests/test-env.sh000066400000000000000000000016211452655021700154240ustar00rootroot00000000000000#!/bin/sh # # Set up the environment variables, temporary working files, and cleanup # processes required to run each test. # # Tests must exit with 0 for success, 1 for failure, 77 to skip the test, or # 99 for a fatal error with the test framework. # Parameters. testSubject="./pv" sourcePath="${srcdir}" # Set everything to the "C" locale. LANG=C LC_ALL=C export LANG LC_ALL # Temporary working files, for the test scripts to use. workFile1=$(mktemp 2>/dev/null) || workFile1="./.tmp1" workFile2=$(mktemp 2>/dev/null) || workFile2="./.tmp2" workFile3=$(mktemp 2>/dev/null) || workFile3="./.tmp3" workFile4=$(mktemp 2>/dev/null) || workFile4="./.tmp4" # Clean up the temporary files on exit, in case we are interrupted. trap 'rm -f "${workFile1}" "${workFile2}" "${workFile3}" "${workFile4}"' EXIT # Variables used by the test scripts. export testSubject sourcePath workFile1 workFile2 workFile3 workFile4