diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
new file mode 100644
index 000000000..145db560f
--- /dev/null
+++ b/.github/workflows/build.yml
@@ -0,0 +1,65 @@
+name: GitHub Actions Build Test
+permissions:
+ contents: read
+on:
+ push:
+ branches:
+ - master
+ pull_request:
+ branches:
+ - master
+jobs:
+ cppcheck-test:
+ runs-on: ubuntu-latest
+ steps:
+ - run: echo "This job was triggered by a ${{ github.event_name }} event."
+ - name: Checkout Repo
+ uses: actions/checkout@v5
+ - name: install dependencies
+ run: |
+ sudo apt-get -y update && sudo apt-get install -y cppcheck && \
+ cppcheck . --force --inline-suppr
+ build-test-ubuntu-ish:
+ strategy:
+ matrix:
+ os: [ubuntu-latest, ubuntu-22.04, ubuntu-22.04-arm]
+ runs-on: ${{ matrix.os }}
+ steps:
+ - uses: actions/checkout@v5
+ - name: install dependencies
+ run: |
+ sudo apt-get -y update && sudo apt-get install -y build-essential
+ - name: build
+ run: |
+ ./configure && make && make check
+ timeout 300 src/iperf3 -s &
+ ./test_commands.sh localhost
+ build-test-macos-ish:
+ strategy:
+ matrix:
+ os: [macos-15, macos-14]
+ runs-on: ${{ matrix.os }}
+ steps:
+ - uses: actions/checkout@v5
+ - name: install dependencies
+ run: |
+ brew install coreutils
+ - name: build
+ run: |
+ ./configure && make && make check
+ timeout 300 src/iperf3 -s &
+ ./test_commands.sh localhost
+ build-test-sanitizer-address:
+ runs-on: ubuntu-latest
+ steps:
+ - run: echo "Running address sanitzer"
+ - name: Checkout Repo
+ uses: actions/checkout@v5
+ - name: install dependencies
+ run: |
+ sudo apt-get -y update && sudo apt-get install -y build-essential
+ - name: build
+ run: |
+ ./configure CFLAGS="-g -O0 -fsanitize=address" LDFLAGS="-fsanitize=address" && make && make check
+ timeout 300 src/iperf3 -s &
+ ./test_commands.sh localhost
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 000000000..b5c98ab2a
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,43 @@
+# To contribute improvements to CI/CD templates, please follow the Development guide at:
+# https://docs.gitlab.com/development/cicd/templates/
+# This specific template is located at:
+# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/C++.gitlab-ci.yml
+
+# use the official gcc image, based on debian
+# can use versions as well, like gcc:5.2
+# see https://hub.docker.com/_/gcc/
+# To contribute improvements to CI/CD templates, please follow the Development guide at:
+# https://docs.gitlab.com/development/cicd/templates/
+# This specific template is located at:
+# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/C++.gitlab-ci.yml
+
+# use the official gcc image, based on debian
+# can use versions as well, like gcc:5.2
+# see https://hub.docker.com/_/gcc/
+
+image: gcc
+
+build:
+ stage: build
+ before_script:
+ - apt update && apt -y install make autoconf libssl-dev
+ script:
+ - ./configure CFLAGS="-g -O0 -fsanitize=address" LDFLAGS="-fsanitize=address"
+ - make
+ - timeout 300 ./src/iperf3 -s &
+ - ./test_commands.sh localhost
+ artifacts:
+ paths:
+ - src/iperf3
+ - src/.libs/*
+
+# run tests using the binary built before
+test:
+ stage: test
+ script:
+ - ls
+
+deploy:
+ stage: deploy
+ script: echo "Define your deployment script!"
+ environment: production
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 67ba0829d..000000000
--- a/.travis.yml
+++ /dev/null
@@ -1,14 +0,0 @@
-language: c
-compiler:
- - gcc
- - clang
-os:
- - linux
- - osx
- - freebsd
-
-notifications:
- slack:
- secure: ImUmX7hcYotHWCDBfOcIvF6H7kkeGqiaUCy7SVPFtgPbz33ttpbRd94E7oxWVmZMLKb+i6+JCujTEWGwGBimzH+DjL0LLWs0ShzXZIUa1UzEPTc4hgV6VAxucYKFg2WrbXgOPWbulkMG1VZ6pX7GlAEGf0qyNqn44F7S2ay9m18=
-
-script: ./configure && make && make check
diff --git a/LICENSE b/LICENSE
index 1adda218b..7bad8178b 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,4 @@
-"iperf, Copyright (c) 2014-2023, The Regents of the University of California,
+"iperf, Copyright (c) 2014-2026, The Regents of the University of California,
through Lawrence Berkeley National Laboratory (subject to receipt of any
required approvals from the U.S. Dept. of Energy). All rights reserved."
@@ -212,7 +212,7 @@ This software contains source code (src/units.{c.h}) that is:
* 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 CONTIBUTORS OR COPYRIGHT
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE
diff --git a/Makefile.in b/Makefile.in
index 522ca305c..12bfebdbc 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.5 from Makefile.am.
+# Makefile.in generated by automake 1.18.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2021 Free Software Foundation, Inc.
+# Copyright (C) 1994-2025 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -69,6 +69,8 @@ am__make_running_with_option = \
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))
+am__rm_f = rm -f $(am__rm_f_notfound)
+am__rm_rf = rm -rf $(am__rm_f_notfound)
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
@@ -90,6 +92,7 @@ host_triplet = @host@
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/config/ax_check_openssl.m4 \
+ $(top_srcdir)/config/ax_pthread.m4 \
$(top_srcdir)/config/iperf_config_static_bin.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -169,8 +172,8 @@ 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)" \
+ find "$(distdir)" -type d ! -perm -700 -exec chmod u+rwx {} ';' \
+ ; rm -rf "$(distdir)" \
|| { sleep 5 && rm -rf "$(distdir)"; }; \
else :; fi
am__post_remove_distdir = $(am__remove_distdir)
@@ -200,14 +203,16 @@ am__relativize = \
done; \
reldir="$$dir2"
DIST_ARCHIVES = $(distdir).tar.gz
-GZIP_ENV = --best
+GZIP_ENV = -9
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
+distcleancheck_listfiles = \
+ find . \( -type f -a \! \
+ \( -name .nfs* -o -name .smb* -o -name .__afs* \) \) -print
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
@@ -219,6 +224,7 @@ AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CSCOPE = @CSCOPE@
CTAGS = @CTAGS@
@@ -243,6 +249,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
+LDCONFIG = @LDCONFIG@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
@@ -273,6 +280,10 @@ PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
+PTHREAD_CC = @PTHREAD_CC@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_CXX = @PTHREAD_CXX@
+PTHREAD_LIBS = @PTHREAD_LIBS@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
@@ -289,8 +300,11 @@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
+am__rm_f_notfound = @am__rm_f_notfound@
am__tar = @am__tar@
am__untar = @am__untar@
+am__xargs_n = @am__xargs_n@
+ax_pthread_config = @ax_pthread_config@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
@@ -486,12 +500,13 @@ cscopelist-am: $(am__tagged_files)
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-rm -f cscope.out cscope.in.out cscope.po.out cscope.files
+
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
$(am__remove_distdir)
- test -d "$(distdir)" || mkdir "$(distdir)"
+ $(AM_V_at)$(MKDIR_P) "$(distdir)"
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
@@ -561,6 +576,10 @@ dist-bzip2: distdir
tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
$(am__post_remove_distdir)
+dist-bzip3: distdir
+ tardir=$(distdir) && $(am__tar) | bzip3 -c >$(distdir).tar.bz3
+ $(am__post_remove_distdir)
+
dist-lzip: distdir
tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
$(am__post_remove_distdir)
@@ -602,9 +621,11 @@ dist dist-all:
distcheck: dist
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
- eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
+ eval GZIP= gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
+ *.tar.bz3*) \
+ bzip3 -dc $(distdir).tar.bz3 | $(am__untar) ;;\
*.tar.lz*) \
lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
*.tar.xz*) \
@@ -612,7 +633,7 @@ distcheck: dist
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
- eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
+ eval GZIP= gzip -dc $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
*.tar.zst*) \
@@ -712,8 +733,8 @@ mostlyclean-generic:
clean-generic:
distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+ -$(am__rm_f) $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@@ -793,8 +814,8 @@ uninstall-am:
.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
am--refresh check check-am clean clean-cscope clean-generic \
clean-libtool 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 \
+ dist-all dist-bzip2 dist-bzip3 dist-gzip dist-lzip dist-shar \
+ dist-tarZ dist-xz dist-zip dist-zstd distcheck distclean \
distclean-generic distclean-libtool distclean-tags \
distcleancheck distdir distuninstallcheck dvi dvi-am html \
html-am info info-am install install-am install-data \
@@ -813,3 +834,10 @@ uninstall-am:
# 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:
+
+# Tell GNU make to disable its built-in pattern rules.
+%:: %,v
+%:: RCS/%,v
+%:: RCS/%
+%:: s.%
+%:: SCCS/s.%
diff --git a/README.md b/README.md
index da7cecbab..b04dac117 100644
--- a/README.md
+++ b/README.md
@@ -32,6 +32,8 @@ Source code and issue tracker: https://github.com/esnet/iperf
Discussion forums: https://github.com/esnet/iperf/discussions
+Reporting security vulnerabilities: iperf@es.net
+
Obtaining iperf3
----------------
@@ -78,8 +80,8 @@ These flags include:
-Z, --zerocopy use a 'zero copy' sendfile() method of sending data
-A, --affinity n/n,m set CPU affinity
-Bug Reports
------------
+Bug and Security Reports
+------------------------
Before submitting a bug report, please make sure you're running the
latest version of the code, and confirm that your issue has not
@@ -99,6 +101,11 @@ sensitive information.
If you have a question about usage or about the code, please do *not*
submit an issue. Please use one of the mailing lists for that.
+If you suspect there is a potential security issue, please contact the
+developers at:
+
+iperf@es.net
+
Relation to iperf 2.x
---------------------
@@ -108,26 +115,6 @@ The projects (as of mid-2021) are in active, but separate, development.
The continuing iperf2 development
project can be found at https://sourceforge.net/projects/iperf2/.
-iperf3 contains a number of options and functions not present in
-iperf2. In addition, some flags are changed from their iperf2
-counterparts:
-
- -C, --linux-congestion set congestion control algorithm (Linux only)
- (-Z in iperf2)
- --bidir bidirectional testing mode
- (-d in iperf2)
-
-Some iperf2 options are not available in iperf3:
-
- -r, --tradeoff Do a bidirectional test individually
- -T, --ttl time-to-live, for multicast (default 1)
- -x, --reportexclude [CDMSV] exclude C(connection) D(data) M(multicast)
- S(settings) V(server) reports
- -y, --reportstyle C report as a Comma-Separated Values
-
-Also removed is the ability to set the options via environment
-variables.
-
Known Issues
------------
@@ -150,7 +137,7 @@ responsibility for the content of these pages.
Copyright
---------
-iperf, Copyright (c) 2014-2023, The Regents of the University of
+iperf, Copyright (c) 2014-2026, The Regents of the University of
California, through Lawrence Berkeley National Laboratory (subject
to receipt of any required approvals from the U.S. Dept. of
Energy). All rights reserved.
diff --git a/RELNOTES.md b/RELNOTES.md
index d621a5bb2..2748aec97 100644
--- a/RELNOTES.md
+++ b/RELNOTES.md
@@ -1,6 +1,335 @@
iperf3 Release Notes
====================
+iperf-3.20 2025-11-14
+---------------------
+
+NOTE: iperf-3.20 incorporates all of the changes in prior iperf3
+releases, including iperf-3.19.1.
+
+* Notable user-visible changes
+
+ * Millisecond-resolution representations have been added to JSON
+ timestamps. (PR #1846)
+
+ * The reorder_seen metric, where available, is now available in
+ the JSON output. (PR #1278)
+
+ * A division by zero error has been fixed. (PR #1906)
+
+ * Some command-line options were not properly restricted to the
+ client or server; this problem has been fixed. (#1892 / PR #1894)
+
+ * The combination of `--udp` and `--file` is now explicitly
+ disallowed. (PR #1909)
+
+ * It is now possible to get both the full JSON result object as
+ well as streaming intermediate JSON result objects. This
+ functionality is enabled by using the new `--json-stream-full`
+ command-line flag, in addition to the existing `--json-stream`
+ flag (PR #1903)
+
+ * Sends with `--zerocopy` are now properly seeded with data
+ instead of being all-zeroes. (PR #1949)
+
+ * The `--server-max-duration` flag is now allowed on the iperf3 server to impose
+ a maximum duration on timed tests. (PR #1684)
+
+ * The `--rcv-timeout` flag is now ignored for `--bidir`
+ tests. This change prevents premature termination of
+ bidirectional tests. (#1766 / PR #1946)
+
+ * Several errors in the authentication code were uncovered when
+ building with OpenSSL 3.5.3 and later versions. These were
+ fixed. (#1951 / PR #1956)
+
+ * Various issues in the iperf3 manual page were fixed up. (PR
+ #1887, PR #1927, PR #1936, PR #1941, #1891 / PR #1952)
+
+* Notable developer-visible changes
+
+ * A build failure with uClibc has been fixed. (#1888 / PR #1890)
+
+ * It is now possible to use the API to load RSA keys from a file.
+ (PR #1889)
+
+ * Some calls to sprintf() were replaced with calls to
+ snprintf(). There were no hazards in the code as written, but
+ this change might help silence some compiler warnings and
+ potentially prevent future vulnerabilities. (PR #1929)
+
+ * Proper error handling has been added to the `unit_atoX()`
+ functions. (PR #1394)
+
+ * Some memory handling errors in `t_auth` were fixed. (PR #1953)
+
+ * Minor enhancements and fixes to GitHub Actions workflows (PR
+ #1919, PR #1928, PR #1942).
+
+iperf-3.19.1 2025-07-25
+-----------------------
+
+* Notable user-visible changes
+
+ * SECURITY NOTE: Thanks to Han Lee with Apple Information Security
+ for finding and reporting several memory errors
+ including a buffer overflow within the
+ `--skip-rx-copy` option, and two memory errors
+ within authentication, including a heap overflow
+ in the plaintext password and an assert.
+
+ * An off-by-one heap overflow has been fixed in authentication.
+ (CVE-2025-54349, ESNET-SECADV-2025-0003)
+
+ * An assert in authentication has been removed. (CVE-2025-54350,
+ ESNET-SECADV-2025-0002)
+
+ * A buffer overflow in the `--skip-rx-copy` option for zerocopy
+ has been fixed. (CVE-2025-54351, ESNET-SECADV-2025-0001)
+
+
+iperf-3.19 2025-05-16
+---------------------
+
+* Notable user-visible changes
+
+ * iperf3 now supports the use of Multi-Path TCP (MPTCPv1) on Linux
+ with the use of the `-m` or `--mptcp` flag. (PR #1661)
+
+ * iperf3 now supports a `--cntl-ka` option to enable TCP keepalives
+ on the control connection. (#812, #835, PR #1423)
+
+ * iperf3 now supports the `MSG_TRUNC` receive option, specified by
+ the `--skip-rx-copy`. This theoretically improves the rated
+ throughput of tests at high bitrates by not delivering network
+ payload data to userspace. (#1678, PR #1717)
+
+ * A bug that caused the bitrate setting to be ignored when bursts
+ are set, has been fixed. (#1773, #1820, PR #1821, PR #1848)
+
+ * The congestion control protocol setting, if used, is now
+ properly reset between tests. (PR #1812)
+
+ * iperf3 now exits with a non-error 0 exit code if exiting via a
+ `SIGTERM`, `SIGHUP`, or `SIGINT`. (#1009, PR# 1829)
+
+ * The current behavior of iperf3 with respect to the `-n` and `-k`
+ options is now documented as correct. (#1768, #1775, #596, PR #1800)
+
+* Notable developer-visible changes
+
+ * iperf3 now supports a callback function to get the JSON output
+ strings. (#1711, PR #1798)
+
+ * iperf3 now builds correctly with gcc-15 (#1838, PR #1805)
+
+ * Various memory leaks were fixed (#1881, PR#1823, #1814, PR#1822)
+
+ * A potential segfault crash was fixed (#1807)
+
+ * Improved warning messages when reading malformed JSON messages
+ (PR #1817)
+
+ * The Github CI configuration was changed to use a more up-to-date
+ set of runners (PR #1864)
+
+iperf-3.18 2024-12-13
+---------------------
+
+* Notable user-visible changes
+
+ * SECURITY NOTE: Thanks to Leonid Krolle Bi.Zone for discovering a
+ JSON type security vulnerability that caused a
+ segmentation fault in the
+ server. (CVE-2024-53580) This has now been
+ fixed. (PR#1810)
+
+ * UDP packets per second now reports the correct number of
+ packets, by reporting NET_SOFTERROR if there's a EAGAIN/EINTR
+ errno if no data was sent (#1367/PR#1379).
+
+ * Several segmentation faults related to threading were fixed. One
+ where `pthread_cancel` was called on an improperly initialized
+ thread (#1801), another where threads were being recycled
+ (#1760/PR#1761), and another where threads were improperly
+ handling signals (#1750/PR#1752).
+
+ * A segmentation fault from calling `freeaddrinfo` with `NULL` was
+ fixed (PR#1755).
+
+ * Some JSON options were fixed, including checking the size for
+ `json_read` (PR#1709), but the size limit was removed for
+ received server output (PR#1779).
+
+ * A rcv-timeout error has been fixed. The Nread timeout was
+ hardcoded and timed out before the `--rcv-timeout` option
+ (PR#1744).
+
+ * There is no longer a limit on the omit time period
+ (#1770/PR#1774).
+
+ * Fixed an output crash under 32-bit big-endian systems (PR#1713).
+
+ * An issue was fixed where CPU utilization was unexpectedly high
+ during limited baud rate tests. The `--pacing-timer` option was
+ removed, but it is still available in the library
+ (#1741/PR#1743).
+
+ * Add SCTP information to `--json` output and fixed compile error
+ when SCTP is not supported (#1731).
+
+ * `--fq-rate` was changed from a uint to a uint64 to allow pacing above
+ 32G. Not yet tested on big-endian systems (PR#1728).
+
+* Notable developer-visible changes
+
+ * Clang compilation failure on Android were fixed (PR#1687).
+
+ * `iperf_time_add()` was optimized to improve performance
+ (PR#1742).
+
+ * Debug messages were added when the state changes (PR#1734).
+
+ * To increase performance, the old UDP `prot_listener` is cleared
+ and removed after each test (PR#1708).
+
+ * A file descriptor leak was closed (PR#1619).
+
+iperf-3.17.1 2024-05-13
+-----------------------
+
+* Notable user-visible changes
+
+ * Version number has been corrected. (#1699)
+
+* Notable developer-visible changes
+
+ * No longer signing tags
+
+iperf-3.17 2024-05-10
+---------------------
+
+* Notable user-visible changes
+
+ * BREAKING CHANGE: iperf3's authentication features, when used with
+ OpenSSL prior to 3.2.0, contain a vulnerability to a side-channel
+ timing attack. To address this flaw, a change has been made to the
+ padding applied to encrypted strings. This change is not backwards
+ compatible with older versions of iperf3 (before 3.17). To restore
+ the older (vulnerable) behavior, and hence
+ backwards-compatibility, use the --use-pkcs1-padding flag. The
+ iperf3 team thanks Hubert Kario from RedHat for reporting this
+ issue and providing feedback on the fix. (CVE-2024-26306)(PR#1695)
+
+ * iperf3 no longer changes its current working directory in --daemon
+ mode. This results in more predictable behavior with relative
+ paths, in particular finding key and credential files for
+ authentication. (PR#1672)
+
+ * A new --json-stream option has been added to enable a streaming
+ output format, consisting of a series of JSON objects (for the
+ start of the test, each measurement interval, and the end of the
+ test) separated by newlines (#444, #923, #1098).
+
+ * UDP tests now work correctly between different endian hosts
+ (#1415).
+
+ * The --fq-rate parameter now works for --reverse tests (#1632, PR#1667).
+
+ * The statistics reporting interval is now available in the --json
+ start test object (#1663).
+
+ * A negative time test duration is now properly flagged as an error
+ (IS#1662 / PR#1666).
+
+* Notable developer-visible changes
+
+ * Fixes have been made to better (unofficially) support builds on
+ Android (#1641 / #1651) and VxWorks (#1595).
+
+ * iperf3 now builds correctly on architectures without native
+ support for 64-bit atomic types, by linking with the libatomic
+ library (#1611).
+
+iperf-3.16 2023-11-30
+---------------------
+
+* Notable user-visible changes
+
+ * Multiple test streams started with -P/--parallel will now be
+ serviced by different threads. This allows iperf3 to take
+ advantage of multiple CPU cores on modern processors, and will
+ generally result in significant throughput increases (PR #1591).
+
+ * OpenSSL 3 is now detected at build time. If OpenSSL 3 is found,
+ various older, deprecated, APIs will not be used. iperf3 will
+ continue to work with OpenSSL 1.1.1. OpenSSL is used as a part
+ of the iperf3 authentication functionality (Issue #1300, PR
+ #1589).
+
+ * The authorized users file used by the authentication functionality
+ is now checked for accessibility much earlier during the program
+ startup, as opposed to being checked near the start of a
+ test (Issue #1583, PR #1585).
+
+* Developer-visible changes
+
+ * BREAKING CHANGE: iperf3 now requires pthreads and C atomic
+ variables to compile and run.
+
+iperf-3.15 2023-09-14
+---------------------
+
+* Notable user-visible changes
+
+ * Several bugs that could allow the iperf3 server to hang waiting
+ for input on the control connection has been fixed. ESnet thanks
+ Jorge Sancho Larraz from Canonical for reporting this issue. For
+ more information, see:
+ https://downloads.es.net/pub/iperf/esnet-secadv-2023-0002.txt.asc
+
+ * A bug that caused garbled output with UDP tests on 32-bit hosts
+ has been fixed (PR #1554, PR #1556). This bug was introduced in
+ iperf-3.14.
+
+ * A bug in counting UDP messages has been fixed (PR #1367, PR
+ #1380).
+
+iperf-3.14 2023-07-07
+---------------------
+
+* Notable user-visible changes
+
+ * A memory allocation hazard was fixed (Issue #1542/PR #1543). For
+ more information see:
+ https://downloads.es.net/pub/iperf/esnet-secadv-2023-0001.txt.asc
+
+ * JSON output was improved, such as print JSON numbers as signed (PR
+ #1539, Issue #1435), the exit code when doing JSON output was
+ fixed (PR #1523), and client_api was fixed so that it still
+ returns an error code when JSON is enabled (Issue #1405). Also,
+ duplicate fields when using multiple streams was removed from the
+ JSON output (#1492).
+
+ * Prevent UDP packet count and operations overflow (PR #1536/Issue
+ #1534).
+
+ * Statistics are fixed when --omit is used (Issue #1489/PR #1498).
+
+* Developer-visible changes
+
+ * CI builds and tests using GitHub actions have been added (PR
+ #1519).
+
+ * A fix for Android "unable to create a new stream error" was added
+ (PR #1506).
+
+ * Support for Voice Admit DSCP code point from RFC 5865 was added
+ (PR #1490).
+
+ * A fix for preventing a crash when RSA public key path doesn't
+ exist was fixed (PR #1488/Issue #1471).
+
iperf-3.13 2023-02-16
---------------------
@@ -448,7 +777,7 @@ iperf 3.2 2017-06-26
accepted for backwards compatibility (#583).
* Application-level bandwidth pacing (--bitrate option) is now
- checked every millisecond by default, instead of of every tenth of
+ checked every millisecond by default, instead of every tenth of
a second, to provide smoother traffic behavior when using
application pacing (#460). The pacing can be tuned via the use of
the --pacing-timer option (#563).
@@ -804,7 +1133,7 @@ iperf 3.0.8 2014-09-30
* User-visible changes
- * Updated license and copyright verbage to confirm to LBNL Tech
+ * Updated license and copyright verbiage to confirm to LBNL Tech
Transfer requirements. No substantive changes; license remains
the 3-clause BSD license.
diff --git a/aclocal.m4 b/aclocal.m4
index 60439e91e..ae2d1b5f7 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,6 +1,6 @@
-# generated automatically by aclocal 1.16.5 -*- Autoconf -*-
+# generated automatically by aclocal 1.18.1 -*- Autoconf -*-
-# Copyright (C) 1996-2021 Free Software Foundation, Inc.
+# Copyright (C) 1996-2025 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -14,15 +14,15 @@
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.
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.72],,
+[m4_warning([this file was generated for autoconf 2.72.
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'.])])
# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
#
-# Copyright (C) 1996-2001, 2003-2019, 2021-2022 Free Software
+# Copyright (C) 1996-2001, 2003-2019, 2021-2024 Free Software
# Foundation, Inc.
# Written by Gordon Matzigkeit, 1996
#
@@ -31,13 +31,13 @@ To do so, use the procedure documented by the package, typically 'autoreconf'.])
# modifications, as long as this notice is preserved.
m4_define([_LT_COPYING], [dnl
-# Copyright (C) 2014 Free Software Foundation, Inc.
+# Copyright (C) 2024 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.
# GNU Libtool is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of of the License, or
+# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# As a special exception to the GNU General Public License, if you
@@ -54,7 +54,7 @@ m4_define([_LT_COPYING], [dnl
# along with this program. If not, see .
])
-# serial 59 LT_INIT
+# serial 63 LT_INIT
# LT_PREREQ(VERSION)
@@ -82,7 +82,7 @@ esac
# LT_INIT([OPTIONS])
# ------------------
AC_DEFUN([LT_INIT],
-[AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK
+[AC_PREREQ([2.64])dnl We use AC_PATH_PROGS_FEATURE_CHECK
AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
AC_BEFORE([$0], [LT_LANG])dnl
AC_BEFORE([$0], [LT_OUTPUT])dnl
@@ -632,7 +632,7 @@ m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
# LT_OUTPUT
# ---------
# This macro allows early generation of the libtool script (before
-# AC_OUTPUT is called), incase it is used in configure for compilation
+# AC_OUTPUT is called), in case it is used in configure for compilation
# tests.
AC_DEFUN([LT_OUTPUT],
[: ${CONFIG_LT=./config.lt}
@@ -667,9 +667,9 @@ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
configured by $[0], generated by m4_PACKAGE_STRING.
-Copyright (C) 2011 Free Software Foundation, Inc.
+Copyright (C) 2024 Free Software Foundation, Inc.
This config.lt script is free software; the Free Software Foundation
-gives unlimited permision to copy, distribute and modify it."
+gives unlimited permission to copy, distribute and modify it."
while test 0 != $[#]
do
@@ -746,7 +746,6 @@ _LT_CONFIG_SAVE_COMMANDS([
cat <<_LT_EOF >> "$cfgfile"
#! $SHELL
# Generated automatically by $as_me ($PACKAGE) $VERSION
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
# NOTE: Changes made to this file will be lost: look at ltmain.sh.
# Provide generalized library-building support services.
@@ -989,6 +988,7 @@ _lt_linker_boilerplate=`cat conftest.err`
$RM -r conftest*
])# _LT_LINKER_BOILERPLATE
+
# _LT_REQUIRED_DARWIN_CHECKS
# -------------------------
m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
@@ -1039,6 +1039,21 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
rm -f conftest.*
fi])
+ # Feature test to disable chained fixups since it is not
+ # compatible with '-undefined dynamic_lookup'
+ AC_CACHE_CHECK([for -no_fixup_chains linker flag],
+ [lt_cv_support_no_fixup_chains],
+ [ save_LDFLAGS=$LDFLAGS
+ LDFLAGS="$LDFLAGS -Wl,-no_fixup_chains"
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM([],[])],
+ lt_cv_support_no_fixup_chains=yes,
+ lt_cv_support_no_fixup_chains=no
+ )
+ LDFLAGS=$save_LDFLAGS
+ ]
+ )
+
AC_CACHE_CHECK([for -exported_symbols_list linker flag],
[lt_cv_ld_exported_symbols_list],
[lt_cv_ld_exported_symbols_list=no
@@ -1063,7 +1078,7 @@ _LT_EOF
echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
$RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
cat > conftest.c << _LT_EOF
-int main() { return 0;}
+int main(void) { return 0;}
_LT_EOF
echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
@@ -1088,13 +1103,32 @@ _LT_EOF
10.[[012]],*|,*powerpc*-darwin[[5-8]]*)
_lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
*)
- _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
+ _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup'
+ if test yes = "$lt_cv_support_no_fixup_chains"; then
+ AS_VAR_APPEND([_lt_dar_allow_undefined], [' $wl-no_fixup_chains'])
+ fi
+ ;;
esac
;;
esac
if test yes = "$lt_cv_apple_cc_single_mod"; then
_lt_dar_single_mod='$single_module'
fi
+ _lt_dar_needs_single_mod=no
+ case $host_os in
+ rhapsody* | darwin1.*)
+ _lt_dar_needs_single_mod=yes ;;
+ darwin*)
+ # When targeting Mac OS X 10.4 (darwin 8) or later,
+ # -single_module is the default and -multi_module is unsupported.
+ # The toolchain on macOS 10.14 (darwin 18) and later cannot
+ # target any OS version that needs -single_module.
+ case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+ 10.0,*-darwin[[567]].*|10.[[0-3]],*-darwin[[5-9]].*|10.[[0-3]],*-darwin1[[0-7]].*)
+ _lt_dar_needs_single_mod=yes ;;
+ esac
+ ;;
+ esac
if test yes = "$lt_cv_ld_exported_symbols_list"; then
_lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'
else
@@ -1140,7 +1174,7 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES],
_LT_TAGVAR(archive_expsym_cmds, $1)="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
_LT_TAGVAR(module_expsym_cmds, $1)="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
m4_if([$1], [CXX],
-[ if test yes != "$lt_cv_apple_cc_single_mod"; then
+[ if test yes = "$_lt_dar_needs_single_mod" -a yes != "$lt_cv_apple_cc_single_mod"; then
_LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil"
_LT_TAGVAR(archive_expsym_cmds, $1)="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil"
fi
@@ -1270,7 +1304,9 @@ lt_sysroot=
case $with_sysroot in #(
yes)
if test yes = "$GCC"; then
- lt_sysroot=`$CC --print-sysroot 2>/dev/null`
+ # Trim trailing / since we'll always append absolute paths and we want
+ # to avoid //, if only for less confusing output for the user.
+ lt_sysroot=`$CC --print-sysroot 2>/dev/null | $SED 's:/\+$::'`
fi
;; #(
/*)
@@ -1382,7 +1418,7 @@ mips64*-*linux*)
;;
x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
-s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
+s390*-*linux*|s390*-*tpf*|sparc*-*linux*|x86_64-gnu*)
# Find out what ABI is being produced by ac_compile, and set linker
# options accordingly. Note that the listed cases only cover the
# situations where additional linker options are needed (such as when
@@ -1397,7 +1433,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
x86_64-*kfreebsd*-gnu)
LD="${LD-ld} -m elf_i386_fbsd"
;;
- x86_64-*linux*)
+ x86_64-*linux*|x86_64-gnu*)
case `$FILECMD conftest.o` in
*x86-64*)
LD="${LD-ld} -m elf32_x86_64"
@@ -1426,7 +1462,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
x86_64-*kfreebsd*-gnu)
LD="${LD-ld} -m elf_x86_64_fbsd"
;;
- x86_64-*linux*)
+ x86_64-*linux*|x86_64-gnu*)
LD="${LD-ld} -m elf_x86_64"
;;
powerpcle-*linux*)
@@ -1509,7 +1545,7 @@ _LT_DECL([], [AR], [1], [The archiver])
# Use ARFLAGS variable as AR's operation code to sync the variable naming with
# Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have
-# higher priority because thats what people were doing historically (setting
+# higher priority because that's what people were doing historically (setting
# ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS
# variable obsoleted/removed.
@@ -1559,7 +1595,7 @@ AC_CHECK_TOOL(STRIP, strip, :)
test -z "$STRIP" && STRIP=:
_LT_DECL([], [STRIP], [1], [A symbol stripping program])
-AC_CHECK_TOOL(RANLIB, ranlib, :)
+AC_REQUIRE([AC_PROG_RANLIB])
test -z "$RANLIB" && RANLIB=:
_LT_DECL([], [RANLIB], [1],
[Commands used to install an old-style archive])
@@ -1570,15 +1606,8 @@ old_postinstall_cmds='chmod 644 $oldlib'
old_postuninstall_cmds=
if test -n "$RANLIB"; then
- case $host_os in
- bitrig* | openbsd*)
- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
- ;;
- *)
- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
- ;;
- esac
old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
fi
case $host_os in
@@ -1710,14 +1739,14 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
lt_cv_sys_max_cmd_len=12288; # 12K is about right
;;
- gnu*)
- # Under GNU Hurd, this test is not required because there is
- # no limit to the length of command line arguments.
+ gnu* | ironclad*)
+ # Under GNU Hurd and Ironclad, this test is not required because there
+ # is no limit to the length of command line arguments.
# Libtool will interpret -1 as no limit whatsoever
lt_cv_sys_max_cmd_len=-1;
;;
- cygwin* | mingw* | cegcc*)
+ cygwin* | mingw* | windows* | cegcc*)
# On Win9x/ME, this test blows up -- it succeeds, but takes
# about 5 minutes as the teststring grows exponentially.
# Worse, since 9x/ME are not pre-emptively multitasking,
@@ -1739,7 +1768,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
lt_cv_sys_max_cmd_len=8192;
;;
- bitrig* | darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*)
+ darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*)
# This has been around since 386BSD, at least. Likely further.
if test -x /sbin/sysctl; then
lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
@@ -1899,11 +1928,11 @@ else
/* When -fvisibility=hidden is used, assume the code has been annotated
correspondingly for the symbols needed. */
#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
-int fnord () __attribute__((visibility("default")));
+int fnord (void) __attribute__((visibility("default")));
#endif
-int fnord () { return 42; }
-int main ()
+int fnord (void) { return 42; }
+int main (void)
{
void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
int status = $lt_dlunknown;
@@ -1960,7 +1989,7 @@ else
lt_cv_dlopen_self=yes
;;
- mingw* | pw32* | cegcc*)
+ mingw* | windows* | pw32* | cegcc*)
lt_cv_dlopen=LoadLibrary
lt_cv_dlopen_libs=
;;
@@ -2328,7 +2357,7 @@ if test yes = "$GCC"; then
*) lt_awk_arg='/^libraries:/' ;;
esac
case $host_os in
- mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;;
+ mingw* | windows* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;;
*) lt_sed_strip_eq='s|=/|/|g' ;;
esac
lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
@@ -2386,7 +2415,7 @@ BEGIN {RS = " "; FS = "/|\n";} {
# AWK program above erroneously prepends '/' to C:/dos/paths
# for these hosts.
case $host_os in
- mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
+ mingw* | windows* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
$SED 's|/\([[A-Za-z]]:\)|\1|g'` ;;
esac
sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
@@ -2461,7 +2490,7 @@ aix[[4-9]]*)
# Unfortunately, runtime linking may impact performance, so we do
# not want this to be the default eventually. Also, we use the
# versioned .so libs for executables only if there is the -brtl
- # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
+ # linker flag in LDFLAGS as well, or --enable-aix-soname=svr4 only.
# To allow for filename-based versioning support, we need to create
# libNAME.so.V as an archive file, containing:
# *) an Import File, referring to the versioned filename of the
@@ -2555,7 +2584,7 @@ bsdi[[45]]*)
# libtool to hard-code these into programs
;;
-cygwin* | mingw* | pw32* | cegcc*)
+cygwin* | mingw* | windows* | pw32* | cegcc*)
version_type=windows
shrext_cmds=.dll
need_version=no
@@ -2566,15 +2595,29 @@ cygwin* | mingw* | pw32* | cegcc*)
# gcc
library_names_spec='$libname.dll.a'
# DLL is installed to $(libdir)/../bin by postinstall_cmds
- postinstall_cmds='base_file=`basename \$file`~
- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
- dldir=$destdir/`dirname \$dlpath`~
- test -d \$dldir || mkdir -p \$dldir~
- $install_prog $dir/$dlname \$dldir/$dlname~
- chmod a+x \$dldir/$dlname~
- if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
- eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
- fi'
+ # If user builds GCC with multilib enabled,
+ # it should just install on $(libdir)
+ # not on $(libdir)/../bin or 32 bits dlls would override 64 bit ones.
+ if test xyes = x"$multilib"; then
+ postinstall_cmds='base_file=`basename \$file`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ $install_prog $dir/$dlname $destdir/$dlname~
+ chmod a+x $destdir/$dlname~
+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+ eval '\''$striplib $destdir/$dlname'\'' || exit \$?;
+ fi'
+ else
+ postinstall_cmds='base_file=`basename \$file`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname~
+ chmod a+x \$dldir/$dlname~
+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+ eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+ fi'
+ fi
postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
dlpath=$dir/\$dldll~
$RM \$dlpath'
@@ -2587,7 +2630,7 @@ cygwin* | mingw* | pw32* | cegcc*)
m4_if([$1], [],[
sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
;;
- mingw* | cegcc*)
+ mingw* | windows* | cegcc*)
# MinGW DLLs use traditional 'lib' prefix
soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
;;
@@ -2606,7 +2649,7 @@ m4_if([$1], [],[
library_names_spec='$libname.dll.lib'
case $build_os in
- mingw*)
+ mingw* | windows*)
sys_lib_search_path_spec=
lt_save_ifs=$IFS
IFS=';'
@@ -2713,7 +2756,21 @@ freebsd* | dragonfly* | midnightbsd*)
need_version=yes
;;
esac
- shlibpath_var=LD_LIBRARY_PATH
+ case $host_cpu in
+ powerpc64)
+ # On FreeBSD bi-arch platforms, a different variable is used for 32-bit
+ # binaries. See .
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[int test_pointer_size[sizeof (void *) - 5];
+ ]])],
+ [shlibpath_var=LD_LIBRARY_PATH],
+ [shlibpath_var=LD_32_LIBRARY_PATH])
+ ;;
+ *)
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+ esac
case $host_os in
freebsd2.*)
shlibpath_overrides_runpath=yes
@@ -2743,8 +2800,9 @@ haiku*)
soname_spec='$libname$release$shared_ext$major'
shlibpath_var=LIBRARY_PATH
shlibpath_overrides_runpath=no
- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
- hardcode_into_libs=yes
+ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib'
+ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib'
+ hardcode_into_libs=no
;;
hpux9* | hpux10* | hpux11*)
@@ -2854,7 +2912,7 @@ linux*android*)
version_type=none # Android doesn't support versioned libraries.
need_lib_prefix=no
need_version=no
- library_names_spec='$libname$release$shared_ext'
+ library_names_spec='$libname$release$shared_ext $libname$shared_ext'
soname_spec='$libname$release$shared_ext'
finish_cmds=
shlibpath_var=LD_LIBRARY_PATH
@@ -2866,8 +2924,9 @@ linux*android*)
hardcode_into_libs=yes
dynamic_linker='Android linker'
- # Don't embed -rpath directories since the linker doesn't support them.
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ # -rpath works at least for libraries that are not overridden by
+ # libraries installed in system locations.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
;;
# This must be glibc/ELF.
@@ -2901,7 +2960,7 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
# before this can be enabled.
hardcode_into_libs=yes
- # Ideally, we could use ldconfig to report *all* directores which are
+ # Ideally, we could use ldconfig to report *all* directories which are
# searched for libraries, however this is still not possible. Aside from not
# being certain /sbin/ldconfig is available, command
# 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
@@ -2921,6 +2980,18 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
dynamic_linker='GNU/Linux ld.so'
;;
+netbsdelf*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='NetBSD ld.elf_so'
+ ;;
+
netbsd*)
version_type=sunos
need_lib_prefix=no
@@ -2939,6 +3010,18 @@ netbsd*)
hardcode_into_libs=yes
;;
+*-mlibc)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ dynamic_linker='mlibc ld.so'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
newsos6)
version_type=linux # correct to gnu/linux during the next big refactor
library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
@@ -2958,7 +3041,7 @@ newsos6)
dynamic_linker='ldqnx.so'
;;
-openbsd* | bitrig*)
+openbsd*)
version_type=sunos
sys_lib_dlsearch_path_spec=/usr/lib
need_lib_prefix=no
@@ -3018,6 +3101,17 @@ rdos*)
dynamic_linker=no
;;
+serenity*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ dynamic_linker='SerenityOS LibELF'
+ ;;
+
solaris*)
version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
@@ -3115,6 +3209,21 @@ uts4*)
shlibpath_var=LD_LIBRARY_PATH
;;
+emscripten*)
+ version_type=none
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext'
+ soname_spec='$libname$release$shared_ext'
+ finish_cmds=
+ dynamic_linker="Emscripten linker"
+ _LT_COMPILER_PIC($1)='-fPIC'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -sSIDE_MODULE=2 -shared $libobjs $deplibs $compiler_flags -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -sSIDE_MODULE=2 -shared $libobjs $deplibs $compiler_flags -o $lib -s EXPORTED_FUNCTIONS=@$output_objdir/$soname.expsym'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(no_undefined_flag, $1)=
+ ;;
+
*)
dynamic_linker=no
;;
@@ -3290,7 +3399,7 @@ if test yes = "$GCC"; then
# Check if gcc -print-prog-name=ld gives a path.
AC_MSG_CHECKING([for ld used by $CC])
case $host in
- *-*-mingw*)
+ *-*-mingw* | *-*-windows*)
# gcc leaves a trailing carriage return, which upsets mingw
ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
*)
@@ -3399,7 +3508,7 @@ case $reload_flag in
esac
reload_cmds='$LD$reload_flag -o $output$reload_objs'
case $host_os in
- cygwin* | mingw* | pw32* | cegcc*)
+ cygwin* | mingw* | windows* | pw32* | cegcc*)
if test yes != "$GCC"; then
reload_cmds=false
fi
@@ -3471,7 +3580,6 @@ lt_cv_deplibs_check_method='unknown'
# 'none' -- dependencies not supported.
# 'unknown' -- same as none, but documents that we really don't know.
# 'pass_all' -- all dependencies passed with no checks.
-# 'test_compile' -- check by making test program.
# 'file_magic [[regex]]' -- check by looking for files in library path
# that responds to the $file_magic_cmd with a given extended regex.
# If you have 'file' or equivalent on your system and you're not sure
@@ -3498,7 +3606,7 @@ cygwin*)
lt_cv_file_magic_cmd='func_win32_libid'
;;
-mingw* | pw32*)
+mingw* | windows* | pw32*)
# Base MSYS/MinGW do not provide the 'file' command needed by
# func_win32_libid shell function, so use a weaker test based on 'objdump',
# unless we find 'file', for example because we are cross-compiling.
@@ -3507,7 +3615,7 @@ mingw* | pw32*)
lt_cv_file_magic_cmd='func_win32_libid'
else
# Keep this pattern in sync with the one in func_win32_libid.
- lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+ lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64|pe-aarch64)'
lt_cv_file_magic_cmd='$OBJDUMP -f'
fi
;;
@@ -3580,7 +3688,11 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
lt_cv_deplibs_check_method=pass_all
;;
-netbsd*)
+*-mlibc)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+netbsd* | netbsdelf*-gnu)
if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
else
@@ -3598,7 +3710,7 @@ newos6*)
lt_cv_deplibs_check_method=pass_all
;;
-openbsd* | bitrig*)
+openbsd*)
if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
else
@@ -3614,6 +3726,10 @@ rdos*)
lt_cv_deplibs_check_method=pass_all
;;
+serenity*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
solaris*)
lt_cv_deplibs_check_method=pass_all
;;
@@ -3662,7 +3778,7 @@ file_magic_glob=
want_nocaseglob=no
if test "$build" = "$host"; then
case $host_os in
- mingw* | pw32*)
+ mingw* | windows* | pw32*)
if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
want_nocaseglob=yes
else
@@ -3714,7 +3830,7 @@ else
# Tru64's nm complains that /dev/null is an invalid object file
# MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty
case $build_os in
- mingw*) lt_bad_file=conftest.nm/nofile ;;
+ mingw* | windows*) lt_bad_file=conftest.nm/nofile ;;
*) lt_bad_file=/dev/null ;;
esac
case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in
@@ -3805,7 +3921,7 @@ lt_cv_sharedlib_from_linklib_cmd,
[lt_cv_sharedlib_from_linklib_cmd='unknown'
case $host_os in
-cygwin* | mingw* | pw32* | cegcc*)
+cygwin* | mingw* | windows* | pw32* | cegcc*)
# two different shell functions defined in ltmain.sh;
# decide which one to use based on capabilities of $DLLTOOL
case `$DLLTOOL --help 2>&1` in
@@ -3837,16 +3953,16 @@ _LT_DECL([], [sharedlib_from_linklib_cmd], [1],
m4_defun([_LT_PATH_MANIFEST_TOOL],
[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
-AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
- [lt_cv_path_mainfest_tool=no
+AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_manifest_tool],
+ [lt_cv_path_manifest_tool=no
echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
$MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
cat conftest.err >&AS_MESSAGE_LOG_FD
if $GREP 'Manifest Tool' conftest.out > /dev/null; then
- lt_cv_path_mainfest_tool=yes
+ lt_cv_path_manifest_tool=yes
fi
rm -f conftest*])
-if test yes != "$lt_cv_path_mainfest_tool"; then
+if test yes != "$lt_cv_path_manifest_tool"; then
MANIFEST_TOOL=:
fi
_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
@@ -3875,7 +3991,7 @@ AC_DEFUN([LT_LIB_M],
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
LIBM=
case $host in
-*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
+*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-mingw* | *-*-pw32* | *-*-darwin*)
# These system don't have libm, or don't need it
;;
*-ncr-sysv4.3*)
@@ -3950,7 +4066,7 @@ case $host_os in
aix*)
symcode='[[BCDT]]'
;;
-cygwin* | mingw* | pw32* | cegcc*)
+cygwin* | mingw* | windows* | pw32* | cegcc*)
symcode='[[ABCDGISTW]]'
;;
hpux*)
@@ -3965,7 +4081,7 @@ osf*)
symcode='[[BCDEGQRST]]'
;;
solaris*)
- symcode='[[BDRT]]'
+ symcode='[[BCDRT]]'
;;
sco3.2v5*)
symcode='[[DT]]'
@@ -4029,7 +4145,7 @@ $lt_c_name_lib_hook\
# Handle CRLF in mingw tool chain
opt_cr=
case $build_os in
-mingw*)
+mingw* | windows*)
opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
;;
esac
@@ -4080,13 +4196,14 @@ void nm_test_func(void){}
#ifdef __cplusplus
}
#endif
-int main(){nm_test_var='a';nm_test_func();return(0);}
+int main(void){nm_test_var='a';nm_test_func();return(0);}
_LT_EOF
if AC_TRY_EVAL(ac_compile); then
# Now try to grab the symbols.
nlist=conftest.nm
- if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
+ $ECHO "$as_me:$LINENO: $NM conftest.$ac_objext | $lt_cv_sys_global_symbol_pipe > $nlist" >&AS_MESSAGE_LOG_FD
+ if eval "$NM" conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist 2>&AS_MESSAGE_LOG_FD && test -s "$nlist"; then
# Try sorting and uniquifying the output.
if sort "$nlist" | uniq > "$nlist"T; then
mv -f "$nlist"T "$nlist"
@@ -4256,7 +4373,7 @@ m4_if([$1], [CXX], [
beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
# PIC is the default for these OSes.
;;
- mingw* | cygwin* | os2* | pw32* | cegcc*)
+ mingw* | windows* | cygwin* | os2* | pw32* | cegcc*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
# Although the cygwin gcc ignores -fPIC, still need this for old-style
@@ -4332,7 +4449,7 @@ m4_if([$1], [CXX], [
;;
esac
;;
- mingw* | cygwin* | os2* | pw32* | cegcc*)
+ mingw* | windows* | cygwin* | os2* | pw32* | cegcc*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
m4_if([$1], [GCJ], [],
@@ -4458,7 +4575,9 @@ m4_if([$1], [CXX], [
;;
esac
;;
- netbsd*)
+ netbsd* | netbsdelf*-gnu)
+ ;;
+ *-mlibc)
;;
*qnx* | *nto*)
# QNX uses GNU C++, but need to define -shared option too, otherwise
@@ -4488,6 +4607,8 @@ m4_if([$1], [CXX], [
;;
psos*)
;;
+ serenity*)
+ ;;
solaris*)
case $cc_basename in
CC* | sunCC*)
@@ -4580,7 +4701,7 @@ m4_if([$1], [CXX], [
# PIC is the default for these OSes.
;;
- mingw* | cygwin* | pw32* | os2* | cegcc*)
+ mingw* | windows* | cygwin* | pw32* | os2* | cegcc*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
# Although the cygwin gcc ignores -fPIC, still need this for old-style
@@ -4684,7 +4805,7 @@ m4_if([$1], [CXX], [
esac
;;
- mingw* | cygwin* | pw32* | os2* | cegcc*)
+ mingw* | windows* | cygwin* | pw32* | os2* | cegcc*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
m4_if([$1], [GCJ], [],
@@ -4726,6 +4847,12 @@ m4_if([$1], [CXX], [
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
;;
+ *flang* | ftn | f18* | f95*)
+ # Flang compiler.
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
# icc used to be incompatible with GCC.
# ICC 10 doesn't accept -KPIC any more.
icc* | ifort*)
@@ -4808,6 +4935,12 @@ m4_if([$1], [CXX], [
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
;;
+ *-mlibc)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+
*nto* | *qnx*)
# QNX uses GNU C++, but need to define -shared option too, otherwise
# it will coredump.
@@ -4824,6 +4957,9 @@ m4_if([$1], [CXX], [
_LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
;;
+ serenity*)
+ ;;
+
solaris*)
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
@@ -4959,7 +5095,7 @@ m4_if([$1], [CXX], [
pw32*)
_LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds
;;
- cygwin* | mingw* | cegcc*)
+ cygwin* | mingw* | windows* | cegcc*)
case $cc_basename in
cl* | icl*)
_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
@@ -5017,7 +5153,7 @@ dnl Note also adjust exclude_expsyms for C++ above.
extract_expsyms_cmds=
case $host_os in
- cygwin* | mingw* | pw32* | cegcc*)
+ cygwin* | mingw* | windows* | pw32* | cegcc*)
# FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++ or Intel C++ Compiler.
@@ -5029,9 +5165,6 @@ dnl Note also adjust exclude_expsyms for C++ above.
# we just hope/assume this is gcc and not c89 (= MSVC++ or ICC)
with_gnu_ld=yes
;;
- openbsd* | bitrig*)
- with_gnu_ld=no
- ;;
esac
_LT_TAGVAR(ld_shlibs, $1)=yes
@@ -5132,7 +5265,7 @@ _LT_EOF
fi
;;
- cygwin* | mingw* | pw32* | cegcc*)
+ cygwin* | mingw* | windows* | pw32* | cegcc*)
# _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
# as there is no search path for DLLs.
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
@@ -5142,6 +5275,7 @@ _LT_EOF
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
_LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
+ _LT_TAGVAR(file_list_spec, $1)='@'
if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
@@ -5161,7 +5295,7 @@ _LT_EOF
haiku*)
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
- _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(link_all_deplibs, $1)=no
;;
os2*)
@@ -5188,7 +5322,7 @@ _LT_EOF
cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
emximp -o $lib $output_objdir/$libname.def'
- _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+ _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
_LT_TAGVAR(file_list_spec, $1)='@'
;;
@@ -5267,6 +5401,7 @@ _LT_EOF
case $cc_basename in
tcc*)
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
_LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic'
;;
xlf* | bgf* | bgxlf* | mpixlf*)
@@ -5287,7 +5422,12 @@ _LT_EOF
fi
;;
- netbsd*)
+ *-mlibc)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+
+ netbsd* | netbsdelf*-gnu)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
wlarc=
@@ -5589,7 +5729,7 @@ _LT_EOF
_LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
;;
- cygwin* | mingw* | pw32* | cegcc*)
+ cygwin* | mingw* | windows* | pw32* | cegcc*)
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++ or Intel C++ Compiler.
# hardcode_libdir_flag_spec is actually meaningless, as there is
@@ -5606,14 +5746,14 @@ _LT_EOF
# Tell ltmain to make .dll files, not .so files.
shrext_cmds=.dll
# FIXME: Setting linknames here is a bad hack.
- _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
+ _LT_TAGVAR(archive_cmds, $1)='$CC -Fe$output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
cp "$export_symbols" "$output_objdir/$soname.def";
echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
else
$SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
fi~
- $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+ $CC -Fe$tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
linknames='
# The linker will not automatically build a static lib if we build a DLL.
# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
@@ -5825,11 +5965,15 @@ _LT_EOF
# Fabrice Bellard et al's Tiny C Compiler
_LT_TAGVAR(ld_shlibs, $1)=yes
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
;;
esac
;;
- netbsd*)
+ *-mlibc)
+ ;;
+
+ netbsd* | netbsdelf*-gnu)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
else
@@ -5851,7 +5995,7 @@ _LT_EOF
*nto* | *qnx*)
;;
- openbsd* | bitrig*)
+ openbsd*)
if test -f /usr/libexec/ld.so; then
_LT_TAGVAR(hardcode_direct, $1)=yes
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
@@ -5894,7 +6038,7 @@ _LT_EOF
cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
emximp -o $lib $output_objdir/$libname.def'
- _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+ _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
_LT_TAGVAR(file_list_spec, $1)='@'
;;
@@ -5930,6 +6074,9 @@ _LT_EOF
_LT_TAGVAR(hardcode_libdir_separator, $1)=:
;;
+ serenity*)
+ ;;
+
solaris*)
_LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
if test yes = "$GCC"; then
@@ -6188,7 +6335,7 @@ _LT_TAGDECL([], [hardcode_direct], [0],
_LT_TAGDECL([], [hardcode_direct_absolute], [0],
[Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
DIR into the resulting binary and the resulting library dependency is
- "absolute", i.e impossible to change by setting $shlibpath_var if the
+ "absolute", i.e. impossible to change by setting $shlibpath_var if the
library is relocated])
_LT_TAGDECL([], [hardcode_minus_L], [0],
[Set to "yes" if using the -LDIR flag during linking hardcodes DIR
@@ -6246,7 +6393,7 @@ _LT_TAGVAR(objext, $1)=$objext
lt_simple_compile_test_code="int some_variable = 0;"
# Code to be used in simple link tests
-lt_simple_link_test_code='int main(){return(0);}'
+lt_simple_link_test_code='int main(void){return(0);}'
_LT_TAG_COMPILER
# Save the default compiler, since it gets overwritten when the other
@@ -6431,8 +6578,7 @@ if test yes != "$_lt_caught_CXX_error"; then
wlarc='$wl'
# ancient GNU ld didn't support --whole-archive et. al.
- if eval "`$CC -print-prog-name=ld` --help 2>&1" |
- $GREP 'no-whole-archive' > /dev/null; then
+ if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
_LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
else
_LT_TAGVAR(whole_archive_flag_spec, $1)=
@@ -6452,7 +6598,7 @@ if test yes != "$_lt_caught_CXX_error"; then
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " [[-]]L"'
else
GXX=no
@@ -6661,7 +6807,7 @@ if test yes != "$_lt_caught_CXX_error"; then
esac
;;
- cygwin* | mingw* | pw32* | cegcc*)
+ cygwin* | mingw* | windows* | pw32* | cegcc*)
case $GXX,$cc_basename in
,cl* | no,cl* | ,icl* | no,icl*)
# Native MSVC or ICC
@@ -6714,6 +6860,7 @@ if test yes != "$_lt_caught_CXX_error"; then
_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
_LT_TAGVAR(always_export_symbols, $1)=no
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='@'
if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
_LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
@@ -6760,7 +6907,7 @@ if test yes != "$_lt_caught_CXX_error"; then
cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
emximp -o $lib $output_objdir/$libname.def'
- _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+ _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
_LT_TAGVAR(file_list_spec, $1)='@'
;;
@@ -6801,7 +6948,7 @@ if test yes != "$_lt_caught_CXX_error"; then
haiku*)
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
- _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(link_all_deplibs, $1)=no
;;
hpux9*)
@@ -6828,7 +6975,7 @@ if test yes != "$_lt_caught_CXX_error"; then
# explicitly linking system object files so we need to strip them
# from the output so that they don't get included in the library
# dependencies.
- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "[[-]]L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
;;
*)
if test yes = "$GXX"; then
@@ -6893,7 +7040,7 @@ if test yes != "$_lt_caught_CXX_error"; then
# explicitly linking system object files so we need to strip them
# from the output so that they don't get included in the library
# dependencies.
- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP " [[-]]L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
;;
*)
if test yes = "$GXX"; then
@@ -7125,6 +7272,10 @@ if test yes != "$_lt_caught_CXX_error"; then
esac
;;
+ *-mlibc)
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ ;;
+
netbsd*)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
@@ -7141,7 +7292,7 @@ if test yes != "$_lt_caught_CXX_error"; then
_LT_TAGVAR(ld_shlibs, $1)=yes
;;
- openbsd* | bitrig*)
+ openbsd*)
if test -f /usr/libexec/ld.so; then
_LT_TAGVAR(hardcode_direct, $1)=yes
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
@@ -7232,7 +7383,7 @@ if test yes != "$_lt_caught_CXX_error"; then
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " [[-]]L"'
else
# FIXME: insert proper C++ library support
@@ -7247,6 +7398,9 @@ if test yes != "$_lt_caught_CXX_error"; then
_LT_TAGVAR(ld_shlibs, $1)=no
;;
+ serenity*)
+ ;;
+
sunos4*)
case $cc_basename in
CC*)
@@ -7316,7 +7470,7 @@ if test yes != "$_lt_caught_CXX_error"; then
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " [[-]]L"'
else
# g++ 2.7 appears to require '-G' NOT '-shared' on this
# platform.
@@ -7327,7 +7481,7 @@ if test yes != "$_lt_caught_CXX_error"; then
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
- output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " [[-]]L"'
fi
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir'
@@ -7565,10 +7719,11 @@ if AC_TRY_EVAL(ac_compile); then
case $prev$p in
-L* | -R* | -l*)
- # Some compilers place space between "-{L,R}" and the path.
+ # Some compilers place space between "-{L,R,l}" and the path.
# Remove the space.
- if test x-L = "$p" ||
- test x-R = "$p"; then
+ if test x-L = x"$p" ||
+ test x-R = x"$p" ||
+ test x-l = x"$p"; then
prev=$p
continue
fi
@@ -8218,7 +8373,7 @@ AC_SUBST([DLLTOOL])
# ----------------
# Check for a file(cmd) program that can be used to detect file type and magic
m4_defun([_LT_DECL_FILECMD],
-[AC_CHECK_TOOL([FILECMD], [file], [:])
+[AC_CHECK_PROG([FILECMD], [file], [file], [:])
_LT_DECL([], [FILECMD], [1], [A file(cmd) program that detects file types])
])# _LD_DECL_FILECMD
@@ -8234,71 +8389,6 @@ _LT_DECL([], [SED], [1], [A sed program that does not truncate output])
_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
[Sed that helps us avoid accidentally triggering echo(1) options like -n])
])# _LT_DECL_SED
-
-m4_ifndef([AC_PROG_SED], [
-# NOTE: This macro has been submitted for inclusion into #
-# GNU Autoconf as AC_PROG_SED. When it is available in #
-# a released version of Autoconf we should remove this #
-# macro and use it instead. #
-
-m4_defun([AC_PROG_SED],
-[AC_MSG_CHECKING([for a sed that does not truncate output])
-AC_CACHE_VAL(lt_cv_path_SED,
-[# Loop through the user's path and test for sed and gsed.
-# Then use that list of sed's as ones to test for truncation.
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for lt_ac_prog in sed gsed; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
- lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
- fi
- done
- done
-done
-IFS=$as_save_IFS
-lt_ac_max=0
-lt_ac_count=0
-# Add /usr/xpg4/bin/sed as it is typically found on Solaris
-# along with /bin/sed that truncates output.
-for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
- test ! -f "$lt_ac_sed" && continue
- cat /dev/null > conftest.in
- lt_ac_count=0
- echo $ECHO_N "0123456789$ECHO_C" >conftest.in
- # Check for GNU sed and select it if it is found.
- if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
- lt_cv_path_SED=$lt_ac_sed
- break
- fi
- while true; do
- cat conftest.in conftest.in >conftest.tmp
- mv conftest.tmp conftest.in
- cp conftest.in conftest.nl
- echo >>conftest.nl
- $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
- cmp -s conftest.out conftest.nl || break
- # 10000 chars as input seems more than enough
- test 10 -lt "$lt_ac_count" && break
- lt_ac_count=`expr $lt_ac_count + 1`
- if test "$lt_ac_count" -gt "$lt_ac_max"; then
- lt_ac_max=$lt_ac_count
- lt_cv_path_SED=$lt_ac_sed
- fi
- done
-done
-])
-SED=$lt_cv_path_SED
-AC_SUBST([SED])
-AC_MSG_RESULT([$SED])
-])#AC_PROG_SED
-])#m4_ifndef
-
-# Old name:
-AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([LT_AC_PROG_SED], [])
@@ -8345,7 +8435,7 @@ AC_CACHE_VAL(lt_cv_to_host_file_cmd,
[case $host in
*-*-mingw* )
case $build in
- *-*-mingw* ) # actually msys
+ *-*-mingw* | *-*-windows* ) # actually msys
lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
;;
*-*-cygwin* )
@@ -8358,7 +8448,7 @@ AC_CACHE_VAL(lt_cv_to_host_file_cmd,
;;
*-*-cygwin* )
case $build in
- *-*-mingw* ) # actually msys
+ *-*-mingw* | *-*-windows* ) # actually msys
lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
;;
*-*-cygwin* )
@@ -8384,9 +8474,9 @@ AC_CACHE_VAL(lt_cv_to_tool_file_cmd,
[#assume ordinary cross tools, or native build.
lt_cv_to_tool_file_cmd=func_convert_file_noop
case $host in
- *-*-mingw* )
+ *-*-mingw* | *-*-windows* )
case $build in
- *-*-mingw* ) # actually msys
+ *-*-mingw* | *-*-windows* ) # actually msys
lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
;;
esac
@@ -8401,7 +8491,7 @@ _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
# Helper functions for option handling. -*- Autoconf -*-
#
-# Copyright (C) 2004-2005, 2007-2009, 2011-2019, 2021-2022 Free
+# Copyright (C) 2004-2005, 2007-2009, 2011-2019, 2021-2024 Free
# Software Foundation, Inc.
# Written by Gary V. Vaughan, 2004
#
@@ -8409,7 +8499,7 @@ _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
-# serial 8 ltoptions.m4
+# serial 10 ltoptions.m4
# This is to help aclocal find these macros, as it can't see m4_define.
AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
@@ -8526,7 +8616,7 @@ LT_OPTION_DEFINE([LT_INIT], [win32-dll],
[enable_win32_dll=yes
case $host in
-*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
+*-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-cegcc*)
AC_CHECK_TOOL(AS, as, false)
AC_CHECK_TOOL(DLLTOOL, dlltool, false)
AC_CHECK_TOOL(OBJDUMP, objdump, false)
@@ -8721,29 +8811,39 @@ dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
# _LT_WITH_AIX_SONAME([DEFAULT])
# ----------------------------------
-# implement the --with-aix-soname flag, and support the `aix-soname=aix'
-# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT
-# is either `aix', `both' or `svr4'. If omitted, it defaults to `aix'.
+# implement the --enable-aix-soname configure option, and support the
+# `aix-soname=aix' and `aix-soname=both' and `aix-soname=svr4' LT_INIT options.
+# DEFAULT is either `aix', `both', or `svr4'. If omitted, it defaults to `aix'.
m4_define([_LT_WITH_AIX_SONAME],
[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl
shared_archive_member_spec=
case $host,$enable_shared in
power*-*-aix[[5-9]]*,yes)
AC_MSG_CHECKING([which variant of shared library versioning to provide])
- AC_ARG_WITH([aix-soname],
- [AS_HELP_STRING([--with-aix-soname=aix|svr4|both],
+ AC_ARG_ENABLE([aix-soname],
+ [AS_HELP_STRING([--enable-aix-soname=aix|svr4|both],
[shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])],
- [case $withval in
- aix|svr4|both)
- ;;
- *)
- AC_MSG_ERROR([Unknown argument to --with-aix-soname])
- ;;
- esac
- lt_cv_with_aix_soname=$with_aix_soname],
- [AC_CACHE_VAL([lt_cv_with_aix_soname],
- [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT)
- with_aix_soname=$lt_cv_with_aix_soname])
+ [case $enableval in
+ aix|svr4|both)
+ ;;
+ *)
+ AC_MSG_ERROR([Unknown argument to --enable-aix-soname])
+ ;;
+ esac
+ lt_cv_with_aix_soname=$enable_aix_soname],
+ [_AC_ENABLE_IF([with], [aix-soname],
+ [case $withval in
+ aix|svr4|both)
+ ;;
+ *)
+ AC_MSG_ERROR([Unknown argument to --with-aix-soname])
+ ;;
+ esac
+ lt_cv_with_aix_soname=$with_aix_soname],
+ [AC_CACHE_VAL([lt_cv_with_aix_soname],
+ [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT)])
+ enable_aix_soname=$lt_cv_with_aix_soname])
+ with_aix_soname=$enable_aix_soname
AC_MSG_RESULT([$with_aix_soname])
if test aix != "$with_aix_soname"; then
# For the AIX way of multilib, we name the shared archive member
@@ -8774,30 +8874,50 @@ LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])])
# _LT_WITH_PIC([MODE])
# --------------------
-# implement the --with-pic flag, and support the 'pic-only' and 'no-pic'
+# implement the --enable-pic flag, and support the 'pic-only' and 'no-pic'
# LT_INIT options.
# MODE is either 'yes' or 'no'. If omitted, it defaults to 'both'.
m4_define([_LT_WITH_PIC],
-[AC_ARG_WITH([pic],
- [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
+[AC_ARG_ENABLE([pic],
+ [AS_HELP_STRING([--enable-pic@<:@=PKGS@:>@],
[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
[lt_p=${PACKAGE-default}
- case $withval in
- yes|no) pic_mode=$withval ;;
- *)
- pic_mode=default
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
- for lt_pkg in $withval; do
- IFS=$lt_save_ifs
- if test "X$lt_pkg" = "X$lt_p"; then
- pic_mode=yes
- fi
- done
- IFS=$lt_save_ifs
- ;;
- esac],
- [pic_mode=m4_default([$1], [default])])
+ case $enableval in
+ yes|no) pic_mode=$enableval ;;
+ *)
+ pic_mode=default
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
+ for lt_pkg in $enableval; do
+ IFS=$lt_save_ifs
+ if test "X$lt_pkg" = "X$lt_p"; then
+ pic_mode=yes
+ fi
+ done
+ IFS=$lt_save_ifs
+ ;;
+ esac],
+ [dnl Continue to support --with-pic and --without-pic, for backward
+ dnl compatibility.
+ _AC_ENABLE_IF([with], [pic],
+ [lt_p=${PACKAGE-default}
+ case $withval in
+ yes|no) pic_mode=$withval ;;
+ *)
+ pic_mode=default
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
+ for lt_pkg in $withval; do
+ IFS=$lt_save_ifs
+ if test "X$lt_pkg" = "X$lt_p"; then
+ pic_mode=yes
+ fi
+ done
+ IFS=$lt_save_ifs
+ ;;
+ esac],
+ [pic_mode=m4_default([$1], [default])])]
+ )
_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
])# _LT_WITH_PIC
@@ -8833,7 +8953,7 @@ LT_OPTION_DEFINE([LTDL_INIT], [convenience],
# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
#
-# Copyright (C) 2004-2005, 2007-2008, 2011-2019, 2021-2022 Free Software
+# Copyright (C) 2004-2005, 2007-2008, 2011-2019, 2021-2024 Free Software
# Foundation, Inc.
# Written by Gary V. Vaughan, 2004
#
@@ -8958,7 +9078,7 @@ m4_define([lt_dict_filter],
# ltversion.m4 -- version numbers -*- Autoconf -*-
#
-# Copyright (C) 2004, 2011-2019, 2021-2022 Free Software Foundation,
+# Copyright (C) 2004, 2011-2019, 2021-2024 Free Software Foundation,
# Inc.
# Written by Scott James Remnant, 2004
#
@@ -8968,22 +9088,22 @@ m4_define([lt_dict_filter],
# @configure_input@
-# serial 4245 ltversion.m4
+# serial 4441 ltversion.m4
# This file is part of GNU Libtool
-m4_define([LT_PACKAGE_VERSION], [2.4.7])
-m4_define([LT_PACKAGE_REVISION], [2.4.7])
+m4_define([LT_PACKAGE_VERSION], [2.5.4])
+m4_define([LT_PACKAGE_REVISION], [2.5.4])
AC_DEFUN([LTVERSION_VERSION],
-[macro_version='2.4.7'
-macro_revision='2.4.7'
+[macro_version='2.5.4'
+macro_revision='2.5.4'
_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
_LT_DECL(, macro_revision, 0)
])
# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
#
-# Copyright (C) 2004-2005, 2007, 2009, 2011-2019, 2021-2022 Free
+# Copyright (C) 2004-2005, 2007, 2009, 2011-2019, 2021-2024 Free
# Software Foundation, Inc.
# Written by Scott James Remnant, 2004.
#
@@ -9081,7 +9201,7 @@ m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])])
m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])])
m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])
-# Copyright (C) 2002-2021 Free Software Foundation, Inc.
+# Copyright (C) 2002-2025 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -9093,10 +9213,10 @@ m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])
# 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'
+[am__api_version='1.18'
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], [],
+m4_if([$1], [1.18.1], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
@@ -9112,14 +9232,14 @@ m4_define([_AM_AUTOCONF_VERSION], [])
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.16.5])dnl
+[AM_AUTOMAKE_VERSION([1.18.1])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.
+# Copyright (C) 2001-2025 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -9171,7 +9291,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd`
# AM_CONDITIONAL -*- Autoconf -*-
-# Copyright (C) 1997-2021 Free Software Foundation, Inc.
+# Copyright (C) 1997-2025 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -9202,7 +9322,7 @@ AC_CONFIG_COMMANDS_PRE(
Usually this means the macro was only invoked conditionally.]])
fi])])
-# Copyright (C) 1999-2021 Free Software Foundation, Inc.
+# Copyright (C) 1999-2025 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -9334,7 +9454,7 @@ AC_CACHE_CHECK([dependency style of $depcc],
# 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:
+ # When given -MP, icc 7.0 and 7.1 complain thus:
# 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
@@ -9393,7 +9513,7 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl
# Generate code to set up dependency tracking. -*- Autoconf -*-
-# Copyright (C) 1999-2021 Free Software Foundation, Inc.
+# Copyright (C) 1999-2025 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -9461,7 +9581,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
# Do all the work for Automake. -*- Autoconf -*-
-# Copyright (C) 1996-2021 Free Software Foundation, Inc.
+# Copyright (C) 1996-2025 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -9561,8 +9681,9 @@ 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([tar-pax], [_AM_PROG_TAR([pax])],
+ [_AM_IF_OPTION([tar-v7], [_AM_PROG_TAR([v7])],
+ [_AM_PROG_TAR([ustar])])])])
_AM_IF_OPTION([no-dependencies],,
[AC_PROVIDE_IFELSE([AC_PROG_CC],
[_AM_DEPENDENCIES([CC])],
@@ -9595,7 +9716,7 @@ if test -z "$CSCOPE"; then
fi
AC_SUBST([CSCOPE])
-AC_REQUIRE([AM_SILENT_RULES])dnl
+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.
@@ -9603,47 +9724,9 @@ 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: .
+AC_REQUIRE([_AM_PROG_RM_F])
+AC_REQUIRE([_AM_PROG_XARGS_N])
-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.
@@ -9676,7 +9759,7 @@ for _am_header in $config_headers :; do
done
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
-# Copyright (C) 2001-2021 Free Software Foundation, Inc.
+# Copyright (C) 2001-2025 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -9697,7 +9780,7 @@ if test x"${install_sh+set}" != xset; then
fi
AC_SUBST([install_sh])])
-# Copyright (C) 2003-2021 Free Software Foundation, Inc.
+# Copyright (C) 2003-2025 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -9719,7 +9802,7 @@ AC_SUBST([am__leading_dot])])
# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
# From Jim Meyering
-# Copyright (C) 1996-2021 Free Software Foundation, Inc.
+# Copyright (C) 1996-2025 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -9754,7 +9837,7 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
# Check to see how 'make' treats includes. -*- Autoconf -*-
-# Copyright (C) 2001-2021 Free Software Foundation, Inc.
+# Copyright (C) 2001-2025 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -9797,7 +9880,7 @@ AC_SUBST([am__quote])])
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
-# Copyright (C) 1997-2021 Free Software Foundation, Inc.
+# Copyright (C) 1997-2025 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -9831,7 +9914,7 @@ fi
# Helper functions for option handling. -*- Autoconf -*-
-# Copyright (C) 2001-2021 Free Software Foundation, Inc.
+# Copyright (C) 2001-2025 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -9860,7 +9943,7 @@ AC_DEFUN([_AM_SET_OPTIONS],
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
-# Copyright (C) 1999-2021 Free Software Foundation, Inc.
+# Copyright (C) 1999-2025 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -9892,7 +9975,10 @@ AC_CACHE_CHECK(
break
fi
done
- rm -f core conftest*
+ # aligned with autoconf, so not including core; see bug#72225.
+ rm -f -r a.out a.exe b.out conftest.$ac_ext conftest.$ac_objext \
+ conftest.dSYM conftest1.$ac_ext conftest1.$ac_objext conftest1.dSYM \
+ conftest2.$ac_ext conftest2.$ac_objext conftest2.dSYM
unset am_i])
if test "$am_cv_prog_cc_c_o" != yes; then
# Losing compiler, so override with the script.
@@ -9907,7 +9993,23 @@ 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.
+# Copyright (C) 2022-2025 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_RM_F
+# ---------------
+# Check whether 'rm -f' without any arguments works.
+# https://bugs.gnu.org/10828
+AC_DEFUN([_AM_PROG_RM_F],
+[am__rm_f_notfound=
+AS_IF([(rm -f && rm -fr && rm -rf) 2>/dev/null], [], [am__rm_f_notfound='""'])
+AC_SUBST(am__rm_f_notfound)
+])
+
+# Copyright (C) 2001-2025 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -9926,26 +10028,181 @@ AC_DEFUN([AM_RUN_LOG],
# Check to make sure that the build environment is sane. -*- Autoconf -*-
-# Copyright (C) 1996-2021 Free Software Foundation, Inc.
+# Copyright (C) 1996-2025 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_SLEEP_FRACTIONAL_SECONDS
+# ----------------------------
+AC_DEFUN([_AM_SLEEP_FRACTIONAL_SECONDS], [dnl
+AC_CACHE_CHECK([whether sleep supports fractional seconds],
+ am_cv_sleep_fractional_seconds, [dnl
+AS_IF([sleep 0.001 2>/dev/null], [am_cv_sleep_fractional_seconds=yes],
+ [am_cv_sleep_fractional_seconds=no])
+])])
+
+# _AM_FILESYSTEM_TIMESTAMP_RESOLUTION
+# -----------------------------------
+# Determine the filesystem's resolution for file modification
+# timestamps. The coarsest we know of is FAT, with a resolution
+# of only two seconds, even with the most recent "exFAT" extensions.
+# The finest (e.g. ext4 with large inodes, XFS, ZFS) is one
+# nanosecond, matching clock_gettime. However, it is probably not
+# possible to delay execution of a shell script for less than one
+# millisecond, due to process creation overhead and scheduling
+# granularity, so we don't check for anything finer than that. (See below.)
+AC_DEFUN([_AM_FILESYSTEM_TIMESTAMP_RESOLUTION], [dnl
+AC_REQUIRE([_AM_SLEEP_FRACTIONAL_SECONDS])
+AC_CACHE_CHECK([filesystem timestamp resolution],
+ am_cv_filesystem_timestamp_resolution, [dnl
+# Default to the worst case.
+am_cv_filesystem_timestamp_resolution=2
+
+# Only try to go finer than 1 sec if sleep can do it.
+# Don't try 1 sec, because if 0.01 sec and 0.1 sec don't work,
+# - 1 sec is not much of a win compared to 2 sec, and
+# - it takes 2 seconds to perform the test whether 1 sec works.
+#
+# Instead, just use the default 2s on platforms that have 1s resolution,
+# accept the extra 1s delay when using $sleep in the Automake tests, in
+# exchange for not incurring the 2s delay for running the test for all
+# packages.
+#
+am_try_resolutions=
+if test "$am_cv_sleep_fractional_seconds" = yes; then
+ # Even a millisecond often causes a bunch of false positives,
+ # so just try a hundredth of a second. The time saved between .001 and
+ # .01 is not terribly consequential.
+ am_try_resolutions="0.01 0.1 $am_try_resolutions"
+fi
+
+# In order to catch current-generation FAT out, we must *modify* files
+# that already exist; the *creation* timestamp is finer. Use names
+# that make ls -t sort them differently when they have equal
+# timestamps than when they have distinct timestamps, keeping
+# in mind that ls -t prints the *newest* file first.
+rm -f conftest.ts?
+: > conftest.ts1
+: > conftest.ts2
+: > conftest.ts3
+
+# Make sure ls -t actually works. Do 'set' in a subshell so we don't
+# clobber the current shell's arguments. (Outer-level square brackets
+# are removed by m4; they're present so that m4 does not expand
+# ; be careful, easy to get confused.)
+if (
+ set X `[ls -t conftest.ts[12]]` &&
+ {
+ test "$[]*" != "X conftest.ts1 conftest.ts2" ||
+ test "$[]*" != "X conftest.ts2 conftest.ts1";
+ }
+); then :; else
+ # 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_ECHO_UNQUOTED(
+ ["Bad output from ls -t: \"`[ls -t conftest.ts[12]]`\""],
+ [AS_MESSAGE_LOG_FD])
+ AC_MSG_FAILURE([ls -t produces unexpected output.
+Make sure there is not a broken ls alias in your environment.])
+fi
+
+for am_try_res in $am_try_resolutions; do
+ # Any one fine-grained sleep might happen to cross the boundary
+ # between two values of a coarser actual resolution, but if we do
+ # two fine-grained sleeps in a row, at least one of them will fall
+ # entirely within a coarse interval.
+ echo alpha > conftest.ts1
+ sleep $am_try_res
+ echo beta > conftest.ts2
+ sleep $am_try_res
+ echo gamma > conftest.ts3
+
+ # We assume that 'ls -t' will make use of high-resolution
+ # timestamps if the operating system supports them at all.
+ if (set X `ls -t conftest.ts?` &&
+ test "$[]2" = conftest.ts3 &&
+ test "$[]3" = conftest.ts2 &&
+ test "$[]4" = conftest.ts1); then
+ #
+ # Ok, ls -t worked. If we're at a resolution of 1 second, we're done,
+ # because we don't need to test make.
+ make_ok=true
+ if test $am_try_res != 1; then
+ # But if we've succeeded so far with a subsecond resolution, we
+ # have one more thing to check: make. It can happen that
+ # everything else supports the subsecond mtimes, but make doesn't;
+ # notably on macOS, which ships make 3.81 from 2006 (the last one
+ # released under GPLv2). https://bugs.gnu.org/68808
+ #
+ # We test $MAKE if it is defined in the environment, else "make".
+ # It might get overridden later, but our hope is that in practice
+ # it does not matter: it is the system "make" which is (by far)
+ # the most likely to be broken, whereas if the user overrides it,
+ # probably they did so with a better, or at least not worse, make.
+ # https://lists.gnu.org/archive/html/automake/2024-06/msg00051.html
+ #
+ # Create a Makefile (real tab character here):
+ rm -f conftest.mk
+ echo 'conftest.ts1: conftest.ts2' >conftest.mk
+ echo ' touch conftest.ts2' >>conftest.mk
+ #
+ # Now, running
+ # touch conftest.ts1; touch conftest.ts2; make
+ # should touch ts1 because ts2 is newer. This could happen by luck,
+ # but most often, it will fail if make's support is insufficient. So
+ # test for several consecutive successes.
+ #
+ # (We reuse conftest.ts[12] because we still want to modify existing
+ # files, not create new ones, per above.)
+ n=0
+ make=${MAKE-make}
+ until test $n -eq 3; do
+ echo one > conftest.ts1
+ sleep $am_try_res
+ echo two > conftest.ts2 # ts2 should now be newer than ts1
+ if $make -f conftest.mk | grep 'up to date' >/dev/null; then
+ make_ok=false
+ break # out of $n loop
+ fi
+ n=`expr $n + 1`
+ done
+ fi
+ #
+ if $make_ok; then
+ # Everything we know to check worked out, so call this resolution good.
+ am_cv_filesystem_timestamp_resolution=$am_try_res
+ break # out of $am_try_res loop
+ fi
+ # Otherwise, we'll go on to check the next resolution.
+ fi
+done
+rm -f conftest.ts?
+# (end _am_filesystem_timestamp_resolution)
+])])
+
# AM_SANITY_CHECK
# ---------------
AC_DEFUN([AM_SANITY_CHECK],
-[AC_MSG_CHECKING([whether build environment is sane])
+[AC_REQUIRE([_AM_FILESYSTEM_TIMESTAMP_RESOLUTION])
+# This check should not be cached, as it may vary across builds of
+# different projects.
+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_RESULT([no])
AC_MSG_ERROR([unsafe absolute working directory name]);;
esac
case $srcdir in
*[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
+ AC_MSG_RESULT([no])
AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
esac
@@ -9954,49 +10211,40 @@ esac
# 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!
+am_build_env_is_sane=no
+am_has_slept=no
+rm -f conftest.file
+for am_try in 1 2; do
+ echo "timestamp, slept: $am_has_slept" > conftest.file
+ if (
+ 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
+ test "$[]2" = conftest.file
+ ); then
+ am_build_env_is_sane=yes
+ break
+ fi
+ # Just in case.
+ sleep "$am_cv_filesystem_timestamp_resolution"
+ am_has_slept=yes
+done
+
+AC_MSG_RESULT([$am_build_env_is_sane])
+if test "$am_build_env_is_sane" = no; then
+ 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 ) &
+AS_IF([test -e conftest.file || grep 'slept: no' conftest.file >/dev/null 2>&1],, [dnl
+ ( sleep "$am_cv_filesystem_timestamp_resolution" ) &
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
@@ -10007,18 +10255,18 @@ AC_CONFIG_COMMANDS_PRE(
rm -f conftest.file
])
-# Copyright (C) 2009-2021 Free Software Foundation, Inc.
+# Copyright (C) 2009-2025 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
+# _AM_SILENT_RULES
+# ----------------
+# Enable less verbose build rules support.
+AC_DEFUN([_AM_SILENT_RULES],
+[AM_DEFAULT_VERBOSITY=1
+AC_ARG_ENABLE([silent-rules], [dnl
AS_HELP_STRING(
[--enable-silent-rules],
[less verbose build output (undo: "make V=1")])
@@ -10026,11 +10274,6 @@ 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.
@@ -10049,14 +10292,6 @@ am__doit:
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
@@ -10065,9 +10300,37 @@ AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
AM_BACKSLASH='\'
AC_SUBST([AM_BACKSLASH])dnl
_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
+dnl Delay evaluation of AM_DEFAULT_VERBOSITY to the end to allow multiple calls
+dnl to AM_SILENT_RULES to change the default value.
+AC_CONFIG_COMMANDS_PRE([dnl
+case $enable_silent_rules in @%:@ (((
+ yes) AM_DEFAULT_VERBOSITY=0;;
+ no) AM_DEFAULT_VERBOSITY=1;;
+esac
+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
+])dnl
])
-# Copyright (C) 2001-2021 Free Software Foundation, Inc.
+# AM_SILENT_RULES([DEFAULT])
+# --------------------------
+# Set the default verbosity level to DEFAULT ("yes" being less verbose, "no" or
+# empty being verbose).
+AC_DEFUN([AM_SILENT_RULES],
+[AC_REQUIRE([_AM_SILENT_RULES])
+AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1])m4_newline
+dnl We intentionally force a newline after the assignment, since a) nothing
+dnl good can come of more text following, and b) that was the behavior
+dnl before 1.17. See https://bugs.gnu.org/72267.
+])
+
+# Copyright (C) 2001-2025 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -10095,7 +10358,7 @@ fi
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
-# Copyright (C) 2006-2021 Free Software Foundation, Inc.
+# Copyright (C) 2006-2025 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -10114,7 +10377,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
# Check how to create a tarball. -*- Autoconf -*-
-# Copyright (C) 2004-2021 Free Software Foundation, Inc.
+# Copyright (C) 2004-2025 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -10160,15 +10423,19 @@ m4_if([$1], [v7],
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])
+ if test x$am_uid = xunknown; then
+ AC_MSG_WARN([ancient id detected; assuming current UID is ok, but dist-ustar might not work])
+ elif test $am_uid -le $am_max_uid; then
+ AC_MSG_RESULT([yes])
else
- AC_MSG_RESULT([no])
- _am_tools=none
+ 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])
+ if test x$gm_gid = xunknown; then
+ AC_MSG_WARN([ancient id detected; assuming current GID is ok, but dist-ustar might not work])
+ elif test $am_gid -le $am_max_gid; then
+ AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
_am_tools=none
@@ -10245,3 +10512,23 @@ AC_SUBST([am__tar])
AC_SUBST([am__untar])
]) # _AM_PROG_TAR
+# Copyright (C) 2022-2025 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_XARGS_N
+# ----------------
+# Check whether 'xargs -n' works. It should work everywhere, so the fallback
+# is not optimized at all as we never expect to use it.
+AC_DEFUN([_AM_PROG_XARGS_N],
+[AC_CACHE_CHECK([xargs -n works], am_cv_xargs_n_works, [dnl
+AS_IF([test "`echo 1 2 3 | xargs -n2 echo`" = "1 2
+3"], [am_cv_xargs_n_works=yes], [am_cv_xargs_n_works=no])])
+AS_IF([test "$am_cv_xargs_n_works" = yes], [am__xargs_n='xargs -n'], [dnl
+ am__xargs_n='am__xargs_n () { shift; sed "s/ /\\n/g" | while read am__xargs_n_arg; do "$@" "$am__xargs_n_arg"; done; }'
+])dnl
+AC_SUBST(am__xargs_n)
+])
+
diff --git a/config/ax_check_openssl.m4 b/config/ax_check_openssl.m4
index 28e48cbef..9e0e920c9 100644
--- a/config/ax_check_openssl.m4
+++ b/config/ax_check_openssl.m4
@@ -75,7 +75,7 @@ AC_DEFUN([AX_CHECK_OPENSSL], [
if ! $found; then
OPENSSL_INCLUDES=
for ssldir in $ssldirs; do
- AC_MSG_CHECKING([for openssl/ssl.h in $ssldir])
+ AC_MSG_CHECKING([for include/openssl/ssl.h in $ssldir])
if test -f "$ssldir/include/openssl/ssl.h"; then
OPENSSL_INCLUDES="-I$ssldir/include"
OPENSSL_LDFLAGS="-L$ssldir/lib"
diff --git a/config/ax_pthread.m4 b/config/ax_pthread.m4
new file mode 100644
index 000000000..9f35d1391
--- /dev/null
+++ b/config/ax_pthread.m4
@@ -0,0 +1,522 @@
+# ===========================================================================
+# https://www.gnu.org/software/autoconf-archive/ax_pthread.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
+#
+# DESCRIPTION
+#
+# This macro figures out how to build C programs using POSIX threads. It
+# sets the PTHREAD_LIBS output variable to the threads library and linker
+# flags, and the PTHREAD_CFLAGS output variable to any special C compiler
+# flags that are needed. (The user can also force certain compiler
+# flags/libs to be tested by setting these environment variables.)
+#
+# Also sets PTHREAD_CC and PTHREAD_CXX to any special C compiler that is
+# needed for multi-threaded programs (defaults to the value of CC
+# respectively CXX otherwise). (This is necessary on e.g. AIX to use the
+# special cc_r/CC_r compiler alias.)
+#
+# NOTE: You are assumed to not only compile your program with these flags,
+# but also to link with them as well. For example, you might link with
+# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS
+# $PTHREAD_CXX $CXXFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS
+#
+# If you are only building threaded programs, you may wish to use these
+# variables in your default LIBS, CFLAGS, and CC:
+#
+# LIBS="$PTHREAD_LIBS $LIBS"
+# CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+# CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS"
+# CC="$PTHREAD_CC"
+# CXX="$PTHREAD_CXX"
+#
+# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant
+# has a nonstandard name, this macro defines PTHREAD_CREATE_JOINABLE to
+# that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
+#
+# Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the
+# PTHREAD_PRIO_INHERIT symbol is defined when compiling with
+# PTHREAD_CFLAGS.
+#
+# ACTION-IF-FOUND is a list of shell commands to run if a threads library
+# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it
+# is not found. If ACTION-IF-FOUND is not specified, the default action
+# will define HAVE_PTHREAD.
+#
+# Please let the authors know if this macro fails on any platform, or if
+# you have any other suggestions or comments. This macro was based on work
+# by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help
+# from M. Frigo), as well as ac_pthread and hb_pthread macros posted by
+# Alejandro Forero Cuervo to the autoconf macro repository. We are also
+# grateful for the helpful feedback of numerous users.
+#
+# Updated for Autoconf 2.68 by Daniel Richard G.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Steven G. Johnson
+# Copyright (c) 2011 Daniel Richard G.
+# Copyright (c) 2019 Marc Stevens
+#
+# 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 .
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. You
+# need not follow the terms of the GNU General Public License when using
+# or distributing such scripts, even though portions of the text of the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+#serial 31
+
+AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD])
+AC_DEFUN([AX_PTHREAD], [
+AC_REQUIRE([AC_CANONICAL_HOST])
+AC_REQUIRE([AC_PROG_CC])
+AC_REQUIRE([AC_PROG_SED])
+AC_LANG_PUSH([C])
+ax_pthread_ok=no
+
+# We used to check for pthread.h first, but this fails if pthread.h
+# requires special compiler flags (e.g. on Tru64 or Sequent).
+# It gets checked for in the link test anyway.
+
+# First of all, check if the user has set any of the PTHREAD_LIBS,
+# etcetera environment variables, and if threads linking works using
+# them:
+if test "x$PTHREAD_CFLAGS$PTHREAD_LIBS" != "x"; then
+ ax_pthread_save_CC="$CC"
+ ax_pthread_save_CFLAGS="$CFLAGS"
+ ax_pthread_save_LIBS="$LIBS"
+ AS_IF([test "x$PTHREAD_CC" != "x"], [CC="$PTHREAD_CC"])
+ AS_IF([test "x$PTHREAD_CXX" != "x"], [CXX="$PTHREAD_CXX"])
+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+ LIBS="$PTHREAD_LIBS $LIBS"
+ AC_MSG_CHECKING([for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS])
+ AC_LINK_IFELSE([AC_LANG_CALL([], [pthread_join])], [ax_pthread_ok=yes])
+ AC_MSG_RESULT([$ax_pthread_ok])
+ if test "x$ax_pthread_ok" = "xno"; then
+ PTHREAD_LIBS=""
+ PTHREAD_CFLAGS=""
+ fi
+ CC="$ax_pthread_save_CC"
+ CFLAGS="$ax_pthread_save_CFLAGS"
+ LIBS="$ax_pthread_save_LIBS"
+fi
+
+# We must check for the threads library under a number of different
+# names; the ordering is very important because some systems
+# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
+# libraries is broken (non-POSIX).
+
+# Create a list of thread flags to try. Items with a "," contain both
+# C compiler flags (before ",") and linker flags (after ","). Other items
+# starting with a "-" are C compiler flags, and remaining items are
+# library names, except for "none" which indicates that we try without
+# any flags at all, and "pthread-config" which is a program returning
+# the flags for the Pth emulation library.
+
+ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
+
+# The ordering *is* (sometimes) important. Some notes on the
+# individual items follow:
+
+# pthreads: AIX (must check this before -lpthread)
+# none: in case threads are in libc; should be tried before -Kthread and
+# other compiler flags to prevent continual compiler warnings
+# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
+# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads), Tru64
+# (Note: HP C rejects this with "bad form for `-t' option")
+# -pthreads: Solaris/gcc (Note: HP C also rejects)
+# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
+# doesn't hurt to check since this sometimes defines pthreads and
+# -D_REENTRANT too), HP C (must be checked before -lpthread, which
+# is present but should not be used directly; and before -mthreads,
+# because the compiler interprets this as "-mt" + "-hreads")
+# -mthreads: Mingw32/gcc, Lynx/gcc
+# pthread: Linux, etcetera
+# --thread-safe: KAI C++
+# pthread-config: use pthread-config program (for GNU Pth library)
+
+case $host_os in
+
+ freebsd*)
+
+ # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
+ # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
+
+ ax_pthread_flags="-kthread lthread $ax_pthread_flags"
+ ;;
+
+ hpux*)
+
+ # From the cc(1) man page: "[-mt] Sets various -D flags to enable
+ # multi-threading and also sets -lpthread."
+
+ ax_pthread_flags="-mt -pthread pthread $ax_pthread_flags"
+ ;;
+
+ openedition*)
+
+ # IBM z/OS requires a feature-test macro to be defined in order to
+ # enable POSIX threads at all, so give the user a hint if this is
+ # not set. (We don't define these ourselves, as they can affect
+ # other portions of the system API in unpredictable ways.)
+
+ AC_EGREP_CPP([AX_PTHREAD_ZOS_MISSING],
+ [
+# if !defined(_OPEN_THREADS) && !defined(_UNIX03_THREADS)
+ AX_PTHREAD_ZOS_MISSING
+# endif
+ ],
+ [AC_MSG_WARN([IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support.])])
+ ;;
+
+ solaris*)
+
+ # On Solaris (at least, for some versions), libc contains stubbed
+ # (non-functional) versions of the pthreads routines, so link-based
+ # tests will erroneously succeed. (N.B.: The stubs are missing
+ # pthread_cleanup_push, or rather a function called by this macro,
+ # so we could check for that, but who knows whether they'll stub
+ # that too in a future libc.) So we'll check first for the
+ # standard Solaris way of linking pthreads (-mt -lpthread).
+
+ ax_pthread_flags="-mt,-lpthread pthread $ax_pthread_flags"
+ ;;
+esac
+
+# Are we compiling with Clang?
+
+AC_CACHE_CHECK([whether $CC is Clang],
+ [ax_cv_PTHREAD_CLANG],
+ [ax_cv_PTHREAD_CLANG=no
+ # Note that Autoconf sets GCC=yes for Clang as well as GCC
+ if test "x$GCC" = "xyes"; then
+ AC_EGREP_CPP([AX_PTHREAD_CC_IS_CLANG],
+ [/* Note: Clang 2.7 lacks __clang_[a-z]+__ */
+# if defined(__clang__) && defined(__llvm__)
+ AX_PTHREAD_CC_IS_CLANG
+# endif
+ ],
+ [ax_cv_PTHREAD_CLANG=yes])
+ fi
+ ])
+ax_pthread_clang="$ax_cv_PTHREAD_CLANG"
+
+
+# GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC)
+
+# Note that for GCC and Clang -pthread generally implies -lpthread,
+# except when -nostdlib is passed.
+# This is problematic using libtool to build C++ shared libraries with pthread:
+# [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25460
+# [2] https://bugzilla.redhat.com/show_bug.cgi?id=661333
+# [3] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=468555
+# To solve this, first try -pthread together with -lpthread for GCC
+
+AS_IF([test "x$GCC" = "xyes"],
+ [ax_pthread_flags="-pthread,-lpthread -pthread -pthreads $ax_pthread_flags"])
+
+# Clang takes -pthread (never supported any other flag), but we'll try with -lpthread first
+
+AS_IF([test "x$ax_pthread_clang" = "xyes"],
+ [ax_pthread_flags="-pthread,-lpthread -pthread"])
+
+
+# The presence of a feature test macro requesting re-entrant function
+# definitions is, on some systems, a strong hint that pthreads support is
+# correctly enabled
+
+case $host_os in
+ darwin* | hpux* | linux* | osf* | solaris*)
+ ax_pthread_check_macro="_REENTRANT"
+ ;;
+
+ aix*)
+ ax_pthread_check_macro="_THREAD_SAFE"
+ ;;
+
+ *)
+ ax_pthread_check_macro="--"
+ ;;
+esac
+AS_IF([test "x$ax_pthread_check_macro" = "x--"],
+ [ax_pthread_check_cond=0],
+ [ax_pthread_check_cond="!defined($ax_pthread_check_macro)"])
+
+
+if test "x$ax_pthread_ok" = "xno"; then
+for ax_pthread_try_flag in $ax_pthread_flags; do
+
+ case $ax_pthread_try_flag in
+ none)
+ AC_MSG_CHECKING([whether pthreads work without any flags])
+ ;;
+
+ *,*)
+ PTHREAD_CFLAGS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\1/"`
+ PTHREAD_LIBS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\2/"`
+ AC_MSG_CHECKING([whether pthreads work with "$PTHREAD_CFLAGS" and "$PTHREAD_LIBS"])
+ ;;
+
+ -*)
+ AC_MSG_CHECKING([whether pthreads work with $ax_pthread_try_flag])
+ PTHREAD_CFLAGS="$ax_pthread_try_flag"
+ ;;
+
+ pthread-config)
+ AC_CHECK_PROG([ax_pthread_config], [pthread-config], [yes], [no])
+ AS_IF([test "x$ax_pthread_config" = "xno"], [continue])
+ PTHREAD_CFLAGS="`pthread-config --cflags`"
+ PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
+ ;;
+
+ *)
+ AC_MSG_CHECKING([for the pthreads library -l$ax_pthread_try_flag])
+ PTHREAD_LIBS="-l$ax_pthread_try_flag"
+ ;;
+ esac
+
+ ax_pthread_save_CFLAGS="$CFLAGS"
+ ax_pthread_save_LIBS="$LIBS"
+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+ LIBS="$PTHREAD_LIBS $LIBS"
+
+ # Check for various functions. We must include pthread.h,
+ # since some functions may be macros. (On the Sequent, we
+ # need a special flag -Kthread to make this header compile.)
+ # We check for pthread_join because it is in -lpthread on IRIX
+ # while pthread_create is in libc. We check for pthread_attr_init
+ # due to DEC craziness with -lpthreads. We check for
+ # pthread_cleanup_push because it is one of the few pthread
+ # functions on Solaris that doesn't have a non-functional libc stub.
+ # We try pthread_create on general principles.
+
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([#include
+# if $ax_pthread_check_cond
+# error "$ax_pthread_check_macro must be defined"
+# endif
+ static void *some_global = NULL;
+ static void routine(void *a)
+ {
+ /* To avoid any unused-parameter or
+ unused-but-set-parameter warning. */
+ some_global = a;
+ }
+ static void *start_routine(void *a) { return a; }],
+ [pthread_t th; pthread_attr_t attr;
+ pthread_create(&th, 0, start_routine, 0);
+ pthread_join(th, 0);
+ pthread_attr_init(&attr);
+ pthread_cleanup_push(routine, 0);
+ pthread_cleanup_pop(0) /* ; */])],
+ [ax_pthread_ok=yes],
+ [])
+
+ CFLAGS="$ax_pthread_save_CFLAGS"
+ LIBS="$ax_pthread_save_LIBS"
+
+ AC_MSG_RESULT([$ax_pthread_ok])
+ AS_IF([test "x$ax_pthread_ok" = "xyes"], [break])
+
+ PTHREAD_LIBS=""
+ PTHREAD_CFLAGS=""
+done
+fi
+
+
+# Clang needs special handling, because older versions handle the -pthread
+# option in a rather... idiosyncratic way
+
+if test "x$ax_pthread_clang" = "xyes"; then
+
+ # Clang takes -pthread; it has never supported any other flag
+
+ # (Note 1: This will need to be revisited if a system that Clang
+ # supports has POSIX threads in a separate library. This tends not
+ # to be the way of modern systems, but it's conceivable.)
+
+ # (Note 2: On some systems, notably Darwin, -pthread is not needed
+ # to get POSIX threads support; the API is always present and
+ # active. We could reasonably leave PTHREAD_CFLAGS empty. But
+ # -pthread does define _REENTRANT, and while the Darwin headers
+ # ignore this macro, third-party headers might not.)
+
+ # However, older versions of Clang make a point of warning the user
+ # that, in an invocation where only linking and no compilation is
+ # taking place, the -pthread option has no effect ("argument unused
+ # during compilation"). They expect -pthread to be passed in only
+ # when source code is being compiled.
+ #
+ # Problem is, this is at odds with the way Automake and most other
+ # C build frameworks function, which is that the same flags used in
+ # compilation (CFLAGS) are also used in linking. Many systems
+ # supported by AX_PTHREAD require exactly this for POSIX threads
+ # support, and in fact it is often not straightforward to specify a
+ # flag that is used only in the compilation phase and not in
+ # linking. Such a scenario is extremely rare in practice.
+ #
+ # Even though use of the -pthread flag in linking would only print
+ # a warning, this can be a nuisance for well-run software projects
+ # that build with -Werror. So if the active version of Clang has
+ # this misfeature, we search for an option to squash it.
+
+ AC_CACHE_CHECK([whether Clang needs flag to prevent "argument unused" warning when linking with -pthread],
+ [ax_cv_PTHREAD_CLANG_NO_WARN_FLAG],
+ [ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown
+ # Create an alternate version of $ac_link that compiles and
+ # links in two steps (.c -> .o, .o -> exe) instead of one
+ # (.c -> exe), because the warning occurs only in the second
+ # step
+ ax_pthread_save_ac_link="$ac_link"
+ ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g'
+ ax_pthread_link_step=`AS_ECHO(["$ac_link"]) | sed "$ax_pthread_sed"`
+ ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)"
+ ax_pthread_save_CFLAGS="$CFLAGS"
+ for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do
+ AS_IF([test "x$ax_pthread_try" = "xunknown"], [break])
+ CFLAGS="-Werror -Wunknown-warning-option $ax_pthread_try -pthread $ax_pthread_save_CFLAGS"
+ ac_link="$ax_pthread_save_ac_link"
+ AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])],
+ [ac_link="$ax_pthread_2step_ac_link"
+ AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])],
+ [break])
+ ])
+ done
+ ac_link="$ax_pthread_save_ac_link"
+ CFLAGS="$ax_pthread_save_CFLAGS"
+ AS_IF([test "x$ax_pthread_try" = "x"], [ax_pthread_try=no])
+ ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try"
+ ])
+
+ case "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" in
+ no | unknown) ;;
+ *) PTHREAD_CFLAGS="$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG $PTHREAD_CFLAGS" ;;
+ esac
+
+fi # $ax_pthread_clang = yes
+
+
+
+# Various other checks:
+if test "x$ax_pthread_ok" = "xyes"; then
+ ax_pthread_save_CFLAGS="$CFLAGS"
+ ax_pthread_save_LIBS="$LIBS"
+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+ LIBS="$PTHREAD_LIBS $LIBS"
+
+ # Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
+ AC_CACHE_CHECK([for joinable pthread attribute],
+ [ax_cv_PTHREAD_JOINABLE_ATTR],
+ [ax_cv_PTHREAD_JOINABLE_ATTR=unknown
+ for ax_pthread_attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([#include ],
+ [int attr = $ax_pthread_attr; return attr /* ; */])],
+ [ax_cv_PTHREAD_JOINABLE_ATTR=$ax_pthread_attr; break],
+ [])
+ done
+ ])
+ AS_IF([test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xunknown" && \
+ test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xPTHREAD_CREATE_JOINABLE" && \
+ test "x$ax_pthread_joinable_attr_defined" != "xyes"],
+ [AC_DEFINE_UNQUOTED([PTHREAD_CREATE_JOINABLE],
+ [$ax_cv_PTHREAD_JOINABLE_ATTR],
+ [Define to necessary symbol if this constant
+ uses a non-standard name on your system.])
+ ax_pthread_joinable_attr_defined=yes
+ ])
+
+ AC_CACHE_CHECK([whether more special flags are required for pthreads],
+ [ax_cv_PTHREAD_SPECIAL_FLAGS],
+ [ax_cv_PTHREAD_SPECIAL_FLAGS=no
+ case $host_os in
+ solaris*)
+ ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS"
+ ;;
+ esac
+ ])
+ AS_IF([test "x$ax_cv_PTHREAD_SPECIAL_FLAGS" != "xno" && \
+ test "x$ax_pthread_special_flags_added" != "xyes"],
+ [PTHREAD_CFLAGS="$ax_cv_PTHREAD_SPECIAL_FLAGS $PTHREAD_CFLAGS"
+ ax_pthread_special_flags_added=yes])
+
+ AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT],
+ [ax_cv_PTHREAD_PRIO_INHERIT],
+ [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]],
+ [[int i = PTHREAD_PRIO_INHERIT;
+ return i;]])],
+ [ax_cv_PTHREAD_PRIO_INHERIT=yes],
+ [ax_cv_PTHREAD_PRIO_INHERIT=no])
+ ])
+ AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes" && \
+ test "x$ax_pthread_prio_inherit_defined" != "xyes"],
+ [AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], [1], [Have PTHREAD_PRIO_INHERIT.])
+ ax_pthread_prio_inherit_defined=yes
+ ])
+
+ CFLAGS="$ax_pthread_save_CFLAGS"
+ LIBS="$ax_pthread_save_LIBS"
+
+ # More AIX lossage: compile with *_r variant
+ if test "x$GCC" != "xyes"; then
+ case $host_os in
+ aix*)
+ AS_CASE(["x/$CC"],
+ [x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6],
+ [#handle absolute path differently from PATH based program lookup
+ AS_CASE(["x$CC"],
+ [x/*],
+ [
+ AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"])
+ AS_IF([test "x${CXX}" != "x"], [AS_IF([AS_EXECUTABLE_P([${CXX}_r])],[PTHREAD_CXX="${CXX}_r"])])
+ ],
+ [
+ AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC])
+ AS_IF([test "x${CXX}" != "x"], [AC_CHECK_PROGS([PTHREAD_CXX],[${CXX}_r],[$CXX])])
+ ]
+ )
+ ])
+ ;;
+ esac
+ fi
+fi
+
+test -n "$PTHREAD_CC" || PTHREAD_CC="$CC"
+test -n "$PTHREAD_CXX" || PTHREAD_CXX="$CXX"
+
+AC_SUBST([PTHREAD_LIBS])
+AC_SUBST([PTHREAD_CFLAGS])
+AC_SUBST([PTHREAD_CC])
+AC_SUBST([PTHREAD_CXX])
+
+# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+if test "x$ax_pthread_ok" = "xyes"; then
+ ifelse([$1],,[AC_DEFINE([HAVE_PTHREAD],[1],[Define if you have POSIX threads libraries and header files.])],[$1])
+ :
+else
+ ax_pthread_ok=no
+ $2
+fi
+AC_LANG_POP
+])dnl AX_PTHREAD
diff --git a/config/compile b/config/compile
index df363c8fb..02ff093c3 100755
--- a/config/compile
+++ b/config/compile
@@ -1,9 +1,9 @@
#! /bin/sh
# Wrapper for compilers which do not understand '-c -o'.
-scriptversion=2018-03-07.03; # UTC
+scriptversion=2025-06-18.21; # UTC
-# Copyright (C) 1999-2021 Free Software Foundation, Inc.
+# Copyright (C) 1999-2025 Free Software Foundation, Inc.
# Written by Tom Tromey .
#
# This program is free software; you can redistribute it and/or modify
@@ -37,11 +37,11 @@ IFS=" "" $nl"
file_conv=
-# func_file_conv build_file lazy
+# func_file_conv build_file unneeded_conversions
# 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.
+# type is listed in (the comma separated) UNNEEDED_CONVERSIONS, no
+# conversion will take place.
func_file_conv ()
{
file=$1
@@ -51,9 +51,20 @@ func_file_conv ()
# lazily determine how to convert abs files
case `uname -s` in
MINGW*)
- file_conv=mingw
+ if test -n "$MSYSTEM" && (cygpath --version) >/dev/null 2>&1; then
+ # MSYS2 environment.
+ file_conv=cygwin
+ else
+ # Original MinGW environment.
+ file_conv=mingw
+ fi
;;
- CYGWIN* | MSYS*)
+ MSYS*)
+ # Old MSYS environment, or MSYS2 with 32-bit MSYS2 shell.
+ file_conv=cygwin
+ ;;
+ CYGWIN*)
+ # Cygwin environment.
file_conv=cygwin
;;
*)
@@ -63,12 +74,14 @@ func_file_conv ()
fi
case $file_conv/,$2, in
*,$file_conv,*)
+ # This is the optimization mentioned above:
+ # If UNNEEDED_CONVERSIONS contains $file_conv, don't convert.
;;
mingw/*)
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
;;
- cygwin/* | msys/*)
- file=`cygpath -m "$file" || echo "$file"`
+ cygwin/*)
+ file=`cygpath -w "$file" || echo "$file"`
;;
wine/*)
file=`winepath -w "$file" || echo "$file"`
@@ -143,7 +156,7 @@ func_cl_wrapper ()
# configure might choose to run compile as 'compile cc -o foo foo.c'.
eat=1
case $2 in
- *.o | *.[oO][bB][jJ])
+ *.o | *.lo | *.[oO][bB][jJ])
func_file_conv "$2"
set x "$@" -Fo"$file"
shift
@@ -248,14 +261,17 @@ 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 .
+GNU Automake home page: .
+General help using GNU software: .
EOF
exit $?
;;
-v | --v*)
- echo "compile $scriptversion"
+ echo "compile (GNU Automake) $scriptversion"
exit $?
;;
cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \
+ clang-cl | *[/\\]clang-cl | clang-cl.exe | *[/\\]clang-cl.exe | \
icl | *[/\\]icl | icl.exe | *[/\\]icl.exe )
func_cl_wrapper "$@" # Doesn't return...
;;
@@ -340,9 +356,9 @@ exit $ret
# Local Variables:
# mode: shell-script
# sh-indentation: 2
-# eval: (add-hook 'before-save-hook 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp nil t)
# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-format: "%Y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:
diff --git a/config/config.guess b/config/config.guess
index e81d3ae7c..48a684601 100755
--- a/config/config.guess
+++ b/config/config.guess
@@ -1,14 +1,14 @@
#! /bin/sh
# Attempt to guess a canonical system name.
-# Copyright 1992-2021 Free Software Foundation, Inc.
+# Copyright 1992-2024 Free Software Foundation, Inc.
# shellcheck disable=SC2006,SC2268 # see below for rationale
-timestamp='2021-06-03'
+timestamp='2024-07-27'
# 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
+# 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
@@ -47,7 +47,7 @@ me=`echo "$0" | sed -e 's,.*/,,'`
usage="\
Usage: $0 [OPTION]
-Output the configuration name of the system \`$me' is run on.
+Output the configuration name of the system '$me' is run on.
Options:
-h, --help print this help, then exit
@@ -60,13 +60,13 @@ version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
-Copyright 1992-2021 Free Software Foundation, Inc.
+Copyright 1992-2024 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."
+Try '$me --help' for more information."
# Parse command line
while test $# -gt 0 ; do
@@ -102,8 +102,8 @@ GUESS=
# 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.
+# 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.
@@ -123,7 +123,7 @@ set_cc_for_build() {
dummy=$tmp/dummy
case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in
,,) echo "int x;" > "$dummy.c"
- for driver in cc gcc c89 c99 ; do
+ for driver in cc gcc c17 c99 c89 ; do
if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
CC_FOR_BUILD=$driver
break
@@ -155,6 +155,9 @@ Linux|GNU|GNU/*)
set_cc_for_build
cat <<-EOF > "$dummy.c"
+ #if defined(__ANDROID__)
+ LIBC=android
+ #else
#include
#if defined(__UCLIBC__)
LIBC=uclibc
@@ -162,6 +165,8 @@ Linux|GNU|GNU/*)
LIBC=dietlibc
#elif defined(__GLIBC__)
LIBC=gnu
+ #elif defined(__LLVM_LIBC__)
+ LIBC=llvm
#else
#include
/* First heuristic to detect musl libc. */
@@ -169,6 +174,7 @@ Linux|GNU|GNU/*)
LIBC=musl
#endif
#endif
+ #endif
EOF
cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
eval "$cc_set_libc"
@@ -437,7 +443,7 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in
# 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 -E - 2>/dev/null) | \
+ (CCOPTS="" $CC_FOR_BUILD -m64 -E - 2>/dev/null) | \
grep IS_64BIT_ARCH >/dev/null
then
SUN_ARCH=x86_64
@@ -459,7 +465,7 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in
UNAME_RELEASE=`uname -v`
;;
esac
- # Japanese Language versions have a version number like `4.1.3-JL'.
+ # 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
;;
@@ -628,7 +634,8 @@ EOF
sed 's/^ //' << EOF > "$dummy.c"
#include
- main()
+ int
+ main ()
{
if (!__power_pc())
exit(1);
@@ -712,7 +719,8 @@ EOF
#include
#include
- int main ()
+ int
+ main ()
{
#if defined(_SC_KERNEL_BITS)
long bits = sysconf(_SC_KERNEL_BITS);
@@ -904,7 +912,7 @@ EOF
fi
;;
*:FreeBSD:*:*)
- UNAME_PROCESSOR=`/usr/bin/uname -p`
+ UNAME_PROCESSOR=`uname -p`
case $UNAME_PROCESSOR in
amd64)
UNAME_PROCESSOR=x86_64 ;;
@@ -929,6 +937,9 @@ EOF
i*:PW*:*)
GUESS=$UNAME_MACHINE-pc-pw32
;;
+ *:SerenityOS:*:*)
+ GUESS=$UNAME_MACHINE-pc-serenity
+ ;;
*:Interix*:*)
case $UNAME_MACHINE in
x86)
@@ -963,11 +974,37 @@ EOF
GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC
;;
+ x86_64:[Mm]anagarm:*:*|i?86:[Mm]anagarm:*:*)
+ GUESS="$UNAME_MACHINE-pc-managarm-mlibc"
+ ;;
+ *:[Mm]anagarm:*:*)
+ GUESS="$UNAME_MACHINE-unknown-managarm-mlibc"
+ ;;
*:Minix:*:*)
GUESS=$UNAME_MACHINE-unknown-minix
;;
aarch64:Linux:*:*)
- GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ set_cc_for_build
+ CPU=$UNAME_MACHINE
+ LIBCABI=$LIBC
+ if test "$CC_FOR_BUILD" != no_compiler_found; then
+ ABI=64
+ sed 's/^ //' << EOF > "$dummy.c"
+ #ifdef __ARM_EABI__
+ #ifdef __ARM_PCS_VFP
+ ABI=eabihf
+ #else
+ ABI=eabi
+ #endif
+ #endif
+EOF
+ cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'`
+ eval "$cc_set_abi"
+ case $ABI in
+ eabi | eabihf) CPU=armv8l; LIBCABI=$LIBC$ABI ;;
+ esac
+ fi
+ GUESS=$CPU-unknown-linux-$LIBCABI
;;
aarch64_be:Linux:*:*)
UNAME_MACHINE=aarch64_be
@@ -1033,7 +1070,16 @@ EOF
k1om:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
- loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*)
+ kvx:Linux:*:*)
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
+ kvx:cos:*:*)
+ GUESS=$UNAME_MACHINE-unknown-cos
+ ;;
+ kvx:mbr:*:*)
+ GUESS=$UNAME_MACHINE-unknown-mbr
+ ;;
+ loongarch32:Linux:*:* | loongarch64:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
m32r*:Linux:*:*)
@@ -1148,16 +1194,27 @@ EOF
;;
x86_64:Linux:*:*)
set_cc_for_build
+ CPU=$UNAME_MACHINE
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
+ ABI=64
+ sed 's/^ //' << EOF > "$dummy.c"
+ #ifdef __i386__
+ ABI=x86
+ #else
+ #ifdef __ILP32__
+ ABI=x32
+ #endif
+ #endif
+EOF
+ cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'`
+ eval "$cc_set_abi"
+ case $ABI in
+ x86) CPU=i686 ;;
+ x32) LIBCABI=${LIBC}x32 ;;
+ esac
fi
- GUESS=$UNAME_MACHINE-pc-linux-$LIBCABI
+ GUESS=$CPU-pc-linux-$LIBCABI
;;
xtensa*:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
@@ -1177,7 +1234,7 @@ EOF
GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION
;;
i*86:OS/2:*:*)
- # If we were able to find `uname', then EMX Unix compatibility
+ # If we were able to find 'uname', then EMX Unix compatibility
# is probably installed.
GUESS=$UNAME_MACHINE-pc-os2-emx
;;
@@ -1318,7 +1375,7 @@ EOF
GUESS=ns32k-sni-sysv
fi
;;
- PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+ PENTIUM:*:4.0*:*) # Unisys 'ClearPath HMP IX 4000' SVR4/MP effort
# says
GUESS=i586-unisys-sysv4
;;
@@ -1364,8 +1421,11 @@ EOF
BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
GUESS=i586-pc-haiku
;;
- x86_64:Haiku:*:*)
- GUESS=x86_64-unknown-haiku
+ ppc:Haiku:*:*) # Haiku running on Apple PowerPC
+ GUESS=powerpc-apple-haiku
+ ;;
+ *:Haiku:*:*) # Haiku modern gcc (not bound by BeOS compat)
+ GUESS=$UNAME_MACHINE-unknown-haiku
;;
SX-4:SUPER-UX:*:*)
GUESS=sx4-nec-superux$UNAME_RELEASE
@@ -1522,6 +1582,9 @@ EOF
i*86:rdos:*:*)
GUESS=$UNAME_MACHINE-pc-rdos
;;
+ i*86:Fiwix:*:*)
+ GUESS=$UNAME_MACHINE-pc-fiwix
+ ;;
*:AROS:*:*)
GUESS=$UNAME_MACHINE-unknown-aros
;;
@@ -1534,6 +1597,9 @@ EOF
*:Unleashed:*:*)
GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE
;;
+ *:Ironclad:*:*)
+ GUESS=$UNAME_MACHINE-unknown-ironclad
+ ;;
esac
# Do we have a guess based on uname results?
@@ -1557,6 +1623,7 @@ cat > "$dummy.c" <."
version="\
GNU config.sub ($timestamp)
-Copyright 1992-2021 Free Software Foundation, Inc.
+Copyright 1992-2024 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."
+Try '$me --help' for more information."
# Parse command line
while test $# -gt 0 ; do
@@ -120,7 +120,6 @@ case $# in
esac
# Split fields of configuration type
-# shellcheck disable=SC2162
saved_IFS=$IFS
IFS="-" read field1 field2 field3 field4 <&2
+ echo "Invalid configuration '$1': more than four components" >&2
exit 1
;;
*-*-*-*)
@@ -142,10 +141,21 @@ case $1 in
# 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*)
+ cloudabi*-eabi* \
+ | kfreebsd*-gnu* \
+ | knetbsd*-gnu* \
+ | kopensolaris*-gnu* \
+ | linux-* \
+ | managarm-* \
+ | netbsd*-eabi* \
+ | netbsd*-gnu* \
+ | nto-qnx* \
+ | os2-emx* \
+ | rtmk-nova* \
+ | storm-chaos* \
+ | uclinux-gnu* \
+ | uclinux-uclibc* \
+ | windows-* )
basic_machine=$field1
basic_os=$maybe_os
;;
@@ -160,8 +170,12 @@ case $1 in
esac
;;
*-*)
- # A lone config we happen to match not fitting any pattern
case $field1-$field2 in
+ # Shorthands that happen to contain a single dash
+ convex-c[12] | convex-c3[248])
+ basic_machine=$field2-convex
+ basic_os=
+ ;;
decstation-3100)
basic_machine=mips-dec
basic_os=
@@ -169,28 +183,88 @@ case $1 in
*-*)
# Second component is usually, but not always the OS
case $field2 in
- # Prevent following clause from handling this valid os
+ # Do not treat sunos as a manufacturer
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)
+ 3100* \
+ | 32* \
+ | 3300* \
+ | 3600* \
+ | 7300* \
+ | acorn \
+ | altos* \
+ | apollo \
+ | apple \
+ | atari \
+ | att* \
+ | axis \
+ | be \
+ | bull \
+ | cbm \
+ | ccur \
+ | cisco \
+ | commodore \
+ | convergent* \
+ | convex* \
+ | cray \
+ | crds \
+ | dec* \
+ | delta* \
+ | dg \
+ | digital \
+ | dolphin \
+ | encore* \
+ | gould \
+ | harris \
+ | highlevel \
+ | hitachi* \
+ | hp \
+ | ibm* \
+ | intergraph \
+ | isi* \
+ | knuth \
+ | masscomp \
+ | microblaze* \
+ | mips* \
+ | motorola* \
+ | ncr* \
+ | news \
+ | next \
+ | ns \
+ | oki \
+ | omron* \
+ | pc533* \
+ | rebel \
+ | rom68k \
+ | rombug \
+ | semi \
+ | sequent* \
+ | siemens \
+ | sgi* \
+ | siemens \
+ | sim \
+ | sni \
+ | sony* \
+ | stratus \
+ | sun \
+ | sun[234]* \
+ | tektronix \
+ | tti* \
+ | ultra \
+ | unicom* \
+ | wec \
+ | winbond \
+ | wrs)
basic_machine=$field1-$field2
basic_os=
;;
+ zephyr*)
+ basic_machine=$field1-unknown
+ basic_os=$field2
+ ;;
*)
basic_machine=$field1
basic_os=$field2
@@ -271,26 +345,6 @@ case $1 in
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
@@ -713,15 +767,26 @@ case $basic_machine in
vendor=dec
basic_os=tops20
;;
- delta | 3300 | motorola-3300 | motorola-delta \
- | 3300-motorola | delta-motorola)
+ delta | 3300 | delta-motorola | 3300-motorola | motorola-delta | motorola-3300)
cpu=m68k
vendor=motorola
;;
- dpx2*)
+ # This used to be dpx2*, but that gets the RS6000-based
+ # DPX/20 and the x86-based DPX/2-100 wrong. See
+ # https://oldskool.silicium.org/stations/bull_dpx20.htm
+ # https://www.feb-patrimoine.com/english/bull_dpx2.htm
+ # https://www.feb-patrimoine.com/english/unix_and_bull.htm
+ dpx2 | dpx2[23]00 | dpx2[23]xx)
cpu=m68k
vendor=bull
- basic_os=sysv3
+ ;;
+ dpx2100 | dpx21xx)
+ cpu=i386
+ vendor=bull
+ ;;
+ dpx20)
+ cpu=rs6000
+ vendor=bull
;;
encore | umax | mmax)
cpu=ns32k
@@ -836,18 +901,6 @@ case $basic_machine in
next | m*-next)
cpu=m68k
vendor=next
- case $basic_os in
- openstep*)
- ;;
- nextstep*)
- ;;
- ns2*)
- basic_os=nextstep2
- ;;
- *)
- basic_os=nextstep3
- ;;
- esac
;;
np1)
cpu=np1
@@ -936,14 +989,13 @@ case $basic_machine in
;;
*-*)
- # shellcheck disable=SC2162
saved_IFS=$IFS
IFS="-" read cpu vendor <&2
+ echo "Invalid configuration '$1': machine '$cpu-$vendor' not recognized" 1>&2
exit 1
;;
esac
@@ -1301,11 +1491,12 @@ esac
# Decode manufacturer-specific aliases for certain operating systems.
-if test x$basic_os != x
+if test x"$basic_os" != x
then
-# First recognize some ad-hoc caes, or perhaps split kernel-os, or else just
+# First recognize some ad-hoc cases, or perhaps split kernel-os, or else just
# set os.
+obj=
case $basic_os in
gnu/linux*)
kernel=linux
@@ -1320,7 +1511,6 @@ case $basic_os in
os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'`
;;
*-*)
- # shellcheck disable=SC2162
saved_IFS=$IFS
IFS="-" read kernel os <&2
+ fi
+ ;;
+ *)
+ echo "Invalid configuration '$1': OS '$os' not recognized" 1>&2
+ exit 1
+ ;;
+esac
+
+case $obj in
+ aout* | coff* | elf* | pe*)
+ ;;
+ '')
+ # empty is fine
+ ;;
*)
- echo Invalid configuration \`"$1"\': OS \`"$os"\' not recognized 1>&2
+ echo "Invalid configuration '$1': Machine code format '$obj' not recognized" 1>&2
+ exit 1
+ ;;
+esac
+
+# Here we handle the constraint that a (synthetic) cpu and os are
+# valid only in combination with each other and nowhere else.
+case $cpu-$os in
+ # The "javascript-unknown-ghcjs" triple is used by GHC; we
+ # accept it here in order to tolerate that, but reject any
+ # variations.
+ javascript-ghcjs)
+ ;;
+ javascript-* | *-ghcjs)
+ echo "Invalid configuration '$1': cpu '$cpu' is not valid with os '$os$obj'" 1>&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* )
+case $kernel-$os-$obj in
+ linux-gnu*- | linux-android*- | linux-dietlibc*- | linux-llvm*- \
+ | linux-mlibc*- | linux-musl*- | linux-newlib*- \
+ | linux-relibc*- | linux-uclibc*- | linux-ohos*- )
+ ;;
+ uclinux-uclibc*- | uclinux-gnu*- )
+ ;;
+ managarm-mlibc*- | managarm-kernel*- )
;;
- uclinux-uclibc* )
+ windows*-msvc*-)
;;
- -dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* )
+ -dietlibc*- | -llvm*- | -mlibc*- | -musl*- | -newlib*- | -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
+ echo "Invalid configuration '$1': libc '$os' needs explicit kernel." 1>&2
exit 1
;;
- kfreebsd*-gnu* | kopensolaris*-gnu*)
+ -kernel*- )
+ echo "Invalid configuration '$1': '$os' needs explicit kernel." 1>&2
+ exit 1
;;
- vxworks-simlinux | vxworks-simwindows | vxworks-spe)
+ *-kernel*- )
+ echo "Invalid configuration '$1': '$kernel' does not support '$os'." 1>&2
+ exit 1
;;
- nto-qnx*)
+ *-msvc*- )
+ echo "Invalid configuration '$1': '$os' needs 'windows'." 1>&2
+ exit 1
;;
- os2-emx)
+ kfreebsd*-gnu*- | knetbsd*-gnu*- | netbsd*-gnu*- | kopensolaris*-gnu*-)
+ ;;
+ vxworks-simlinux- | vxworks-simwindows- | vxworks-spe-)
+ ;;
+ nto-qnx*-)
;;
- *-eabi* | *-gnueabi*)
+ os2-emx-)
;;
- -*)
+ rtmk-nova-)
+ ;;
+ *-eabi*- | *-gnueabi*-)
+ ;;
+ none--*)
+ # None (no kernel, i.e. freestanding / bare metal),
+ # can be paired with an machine code file format
+ ;;
+ -*-)
# Blank kernel with real OS is always fine.
;;
- *-*)
- echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2
+ --*)
+ # Blank kernel and OS with real machine code file format is always fine.
+ ;;
+ *-*-*)
+ echo "Invalid configuration '$1': Kernel '$kernel' not known to work with OS '$os'." 1>&2
exit 1
;;
esac
@@ -1803,7 +2273,7 @@ case $vendor in
*-riscix*)
vendor=acorn
;;
- *-sunos*)
+ *-sunos* | *-solaris*)
vendor=sun
;;
*-cnk* | *-aix*)
@@ -1873,7 +2343,7 @@ case $vendor in
;;
esac
-echo "$cpu-$vendor-${kernel:+$kernel-}$os"
+echo "$cpu-$vendor${kernel:+-$kernel}${os:+-$os}${obj:+-$obj}"
exit
# Local variables:
diff --git a/config/depcomp b/config/depcomp
index 715e34311..9f6725b9e 100755
--- a/config/depcomp
+++ b/config/depcomp
@@ -1,9 +1,9 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
-scriptversion=2018-03-07.03; # UTC
+scriptversion=2025-06-18.21; # UTC
-# Copyright (C) 1999-2021 Free Software Foundation, Inc.
+# Copyright (C) 1999-2025 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
@@ -47,11 +47,13 @@ Environment variables:
libtool Whether libtool is used (yes/no).
Report bugs to .
+GNU Automake home page: .
+General help using GNU software: .
EOF
exit $?
;;
-v | --v*)
- echo "depcomp $scriptversion"
+ echo "depcomp (GNU Automake) $scriptversion"
exit $?
;;
esac
@@ -113,7 +115,6 @@ nl='
# These definitions help.
upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
lower=abcdefghijklmnopqrstuvwxyz
-digits=0123456789
alpha=${upper}${lower}
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
@@ -128,7 +129,7 @@ tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
rm -f "$tmpdepfile"
-# Avoid interferences from the environment.
+# Avoid interference from the environment.
gccflag= dashmflag=
# Some modes work just like other modes, but use different flags. We
@@ -198,8 +199,8 @@ gcc3)
;;
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.
+## Note that this doesn't just cater to obsolete pre-3.x GCC compilers.
+## but also to in-use compilers like IBM 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:
@@ -783,9 +784,9 @@ exit 0
# Local Variables:
# mode: shell-script
# sh-indentation: 2
-# eval: (add-hook 'before-save-hook 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp nil t)
# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-format: "%Y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:
diff --git a/config/install-sh b/config/install-sh
index ec298b537..1d8d96696 100755
--- a/config/install-sh
+++ b/config/install-sh
@@ -1,7 +1,7 @@
#!/bin/sh
# install - install a program, script, or datafile
-scriptversion=2020-11-14.01; # UTC
+scriptversion=2025-06-18.21; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
@@ -124,9 +124,9 @@ 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/
-"
+Report bugs to .
+GNU Automake home page: .
+General help using GNU software: ."
while test $# -ne 0; do
case $1 in
@@ -170,7 +170,7 @@ while test $# -ne 0; do
-T) is_target_a_directory=never;;
- --version) echo "$0 $scriptversion"; exit $?;;
+ --version) echo "$0 (GNU Automake) $scriptversion"; exit $?;;
--) shift
break;;
@@ -345,7 +345,7 @@ do
' 0
# Because "mkdir -p" follows existing symlinks and we likely work
- # directly in world-writeable /tmp, make sure that the '$tmpdir'
+ # directly in world-writable /tmp, make sure that the '$tmpdir'
# directory is successfully created first before we actually test
# 'mkdir -p'.
if (umask $mkdir_umask &&
@@ -353,7 +353,7 @@ do
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
then
if test -z "$dir_arg" || {
- # Check for POSIX incompatibilities with -m.
+ # Check for POSIX incompatibility 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.
@@ -533,9 +533,9 @@ do
done
# Local variables:
-# eval: (add-hook 'before-save-hook 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp nil t)
# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-format: "%Y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:
diff --git a/config/ltmain.sh b/config/ltmain.sh
index 2a50d7f6f..3e6a3db3a 100644
--- a/config/ltmain.sh
+++ b/config/ltmain.sh
@@ -2,11 +2,11 @@
## DO NOT EDIT - This file generated from ./build-aux/ltmain.in
## by inline-source v2019-02-19.15
-# libtool (GNU libtool) 2.4.7
+# libtool (GNU libtool) 2.5.4
# Provide generalized library-building support services.
# Written by Gordon Matzigkeit , 1996
-# Copyright (C) 1996-2019, 2021-2022 Free Software Foundation, Inc.
+# Copyright (C) 1996-2019, 2021-2024 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.
@@ -31,8 +31,8 @@
PROGRAM=libtool
PACKAGE=libtool
-VERSION=2.4.7
-package_revision=2.4.7
+VERSION=2.5.4
+package_revision=2.5.4
## ------ ##
@@ -72,11 +72,11 @@ scriptversion=2019-02-19.15; # UTC
# This is free software. There is NO warranty; not even for
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
-# Copyright (C) 2004-2019, 2021 Bootstrap Authors
+# Copyright (C) 2004-2019, 2021, 2023-2024 Bootstrap Authors
#
# This file is dual licensed under the terms of the MIT license
-# , and GPL version 2 or later
-# . You must apply one of
+# , and GPL version 2 or later
+# . You must apply one of
# these licenses when using or redistributing this software or any of
# the files within it. See the URLs above, or the file `LICENSE`
# included in the Bootstrap distribution for the full license texts.
@@ -143,7 +143,7 @@ nl='
'
IFS="$sp $nl"
-# There are apparently some retarded systems that use ';' as a PATH separator!
+# There are apparently some systems that use ';' as a PATH separator!
if test "${PATH_SEPARATOR+set}" != set; then
PATH_SEPARATOR=:
(PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
@@ -589,7 +589,7 @@ func_require_term_colors ()
# _G_HAVE_PLUSEQ_OP
# Can be empty, in which case the shell is probed, "yes" if += is
- # useable or anything else if it does not work.
+ # usable or anything else if it does not work.
test -z "$_G_HAVE_PLUSEQ_OP" \
&& (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \
&& _G_HAVE_PLUSEQ_OP=yes
@@ -739,7 +739,7 @@ eval 'func_dirname ()
# to NONDIR_REPLACEMENT.
# value returned in "$func_dirname_result"
# basename: Compute filename of FILE.
-# value retuned in "$func_basename_result"
+# value returned in "$func_basename_result"
# For efficiency, we do not delegate to the functions above but instead
# duplicate the functionality here.
eval 'func_dirname_and_basename ()
@@ -897,7 +897,7 @@ func_mkdir_p ()
# While some portion of DIR does not yet exist...
while test ! -d "$_G_directory_path"; do
# ...make a list in topmost first order. Use a colon delimited
- # list incase some portion of path contains whitespace.
+ # list in case some portion of path contains whitespace.
_G_dir_list=$_G_directory_path:$_G_dir_list
# If the last portion added has no slash in it, the list is done
@@ -1536,11 +1536,11 @@ func_lt_ver ()
# This is free software. There is NO warranty; not even for
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
-# Copyright (C) 2010-2019, 2021 Bootstrap Authors
+# Copyright (C) 2010-2019, 2021, 2023-2024 Bootstrap Authors
#
# This file is dual licensed under the terms of the MIT license
-# , and GPL version 2 or later
-# . You must apply one of
+# , and GPL version 2 or later
+# . You must apply one of
# these licenses when using or redistributing this software or any of
# the files within it. See the URLs above, or the file `LICENSE`
# included in the Bootstrap distribution for the full license texts.
@@ -2215,7 +2215,30 @@ func_version ()
# End:
# Set a version string.
-scriptversion='(GNU libtool) 2.4.7'
+scriptversion='(GNU libtool) 2.5.4'
+
+# func_version
+# ------------
+# Echo version message to standard output and exit.
+func_version ()
+{
+ $debug_cmd
+
+ year=`date +%Y`
+
+ cat <
+This is free software: you are free to change and redistribute it.
+There is NO WARRANTY, to the extent permitted by law.
+
+Originally written by Gordon Matzigkeit, 1996
+(See AUTHORS for complete contributor listing)
+EOF
+
+ exit $?
+}
# func_echo ARG...
@@ -2238,18 +2261,6 @@ func_echo ()
}
-# func_warning ARG...
-# -------------------
-# Libtool warnings are not categorized, so override funclib.sh
-# func_warning with this simpler definition.
-func_warning ()
-{
- $debug_cmd
-
- $warning_func ${1+"$@"}
-}
-
-
## ---------------- ##
## Options parsing. ##
## ---------------- ##
@@ -2261,19 +2272,23 @@ usage='$progpath [OPTION]... [MODE-ARG]...'
# Short help message in response to '-h'.
usage_message="Options:
- --config show all configuration variables
- --debug enable verbose shell tracing
- -n, --dry-run display commands without modifying any files
- --features display basic configuration information and exit
- --mode=MODE use operation mode MODE
- --no-warnings equivalent to '-Wnone'
- --preserve-dup-deps don't remove duplicate dependency libraries
- --quiet, --silent don't print informational messages
- --tag=TAG use configuration variables from tag TAG
- -v, --verbose print more informational messages than default
- --version print version information
- -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all]
- -h, --help, --help-all print short, long, or detailed help message
+ --config show all configuration variables
+ --debug enable verbose shell tracing
+ -n, --dry-run display commands without modifying any files
+ --features display basic configuration information
+ --finish use operation '--mode=finish'
+ --mode=MODE use operation mode MODE
+ --no-finish don't update shared library cache
+ --no-quiet, --no-silent print default informational messages
+ --no-warnings equivalent to '-Wnone'
+ --preserve-dup-deps don't remove duplicate dependency libraries
+ --quiet, --silent don't print informational messages
+ --reorder-cache=DIRS reorder shared library cache for preferred DIRS
+ --tag=TAG use configuration variables from tag TAG
+ -v, --verbose print more informational messages than default
+ --version print version information
+ -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all]
+ -h, --help, --help-all print short, long, or detailed help message
"
# Additional text appended to 'usage_message' in response to '--help'.
@@ -2306,13 +2321,13 @@ include the following information:
compiler: $LTCC
compiler flags: $LTCFLAGS
linker: $LD (gnu? $with_gnu_ld)
- version: $progname (GNU libtool) 2.4.7
+ version: $progname $scriptversion
automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q`
Report bugs to .
-GNU libtool home page: .
-General help using GNU software: ."
+GNU libtool home page: .
+General help using GNU software: ."
exit 0
}
@@ -2502,8 +2517,11 @@ libtool_options_prep ()
opt_dry_run=false
opt_help=false
opt_mode=
+ opt_reorder_cache=false
opt_preserve_dup_deps=false
opt_quiet=false
+ opt_finishing=true
+ opt_warning=
nonopt=
preserve_args=
@@ -2593,14 +2611,18 @@ libtool_parse_options ()
clean|compile|execute|finish|install|link|relink|uninstall) ;;
# Catch anything else as an error
- *) func_error "invalid argument for $_G_opt"
+ *) func_error "invalid argument '$1' for $_G_opt"
exit_cmd=exit
- break
;;
esac
shift
;;
+ --no-finish)
+ opt_finishing=false
+ func_append preserve_args " $_G_opt"
+ ;;
+
--no-silent|--no-quiet)
opt_quiet=false
func_append preserve_args " $_G_opt"
@@ -2616,6 +2638,24 @@ libtool_parse_options ()
func_append preserve_args " $_G_opt"
;;
+ --reorder-cache)
+ opt_reorder_cache=true
+ shared_lib_dirs=$1
+ if test -n "$shared_lib_dirs"; then
+ case $1 in
+ # Must begin with /:
+ /*) ;;
+
+ # Catch anything else as an error (relative paths)
+ *) func_error "invalid argument '$1' for $_G_opt"
+ func_error "absolute paths are required for $_G_opt"
+ exit_cmd=exit
+ ;;
+ esac
+ fi
+ shift
+ ;;
+
--silent|--quiet)
opt_quiet=:
opt_verbose=false
@@ -2652,6 +2692,18 @@ libtool_parse_options ()
func_add_hook func_parse_options libtool_parse_options
+# func_warning ARG...
+# -------------------
+# Libtool warnings are not categorized, so override funclib.sh
+# func_warning with this simpler definition.
+func_warning ()
+{
+ if $opt_warning; then
+ $debug_cmd
+ $warning_func ${1+"$@"}
+ fi
+}
+
# libtool_validate_options [ARG]...
# ---------------------------------
@@ -2668,10 +2720,10 @@ libtool_validate_options ()
# preserve --debug
test : = "$debug_cmd" || func_append preserve_args " --debug"
- case $host in
+ case $host_os in
# Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452
# see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788
- *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*)
+ cygwin* | mingw* | windows* | pw32* | cegcc* | solaris2* | os2*)
# don't eliminate duplications in $postdeps and $predeps
opt_duplicate_compiler_generated_deps=:
;;
@@ -3003,7 +3055,7 @@ EOF
# func_convert_core_file_wine_to_w32 ARG
# Helper function used by file name conversion functions when $build is *nix,
-# and $host is mingw, cygwin, or some other w32 environment. Relies on a
+# and $host is mingw, windows, cygwin, or some other w32 environment. Relies on a
# correctly configured wine environment available, with the winepath program
# in $build's $PATH.
#
@@ -3035,9 +3087,10 @@ func_convert_core_file_wine_to_w32 ()
# func_convert_core_path_wine_to_w32 ARG
# Helper function used by path conversion functions when $build is *nix, and
-# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
-# configured wine environment available, with the winepath program in $build's
-# $PATH. Assumes ARG has no leading or trailing path separator characters.
+# $host is mingw, windows, cygwin, or some other w32 environment. Relies on a
+# correctly configured wine environment available, with the winepath program
+# in $build's $PATH. Assumes ARG has no leading or trailing path separator
+# characters.
#
# ARG is path to be converted from $build format to win32.
# Result is available in $func_convert_core_path_wine_to_w32_result.
@@ -3180,6 +3233,15 @@ func_convert_path_front_back_pathsep ()
# end func_convert_path_front_back_pathsep
+# func_convert_delimited_path PATH ORIG_DELIMITER NEW_DELIMITER
+# Replaces a delimiter for a given path.
+func_convert_delimited_path ()
+{
+ converted_path=`$ECHO "$1" | $SED "s#$2#$3#g"`
+}
+# end func_convert_delimited_path
+
+
##################################################
# $build to $host FILE NAME CONVERSION FUNCTIONS #
##################################################
@@ -3514,6 +3576,65 @@ func_dll_def_p ()
}
+# func_reorder_shared_lib_cache DIRS
+# Reorder the shared library cache by unconfiguring previous shared library cache
+# and configuring preferred search directories before previous search directories.
+# Previous shared library cache: /usr/lib /usr/local/lib
+# Preferred search directories: /tmp/testing
+# Reordered shared library cache: /tmp/testing /usr/lib /usr/local/lib
+func_reorder_shared_lib_cache ()
+{
+ $debug_cmd
+
+ case $host_os in
+ openbsd*)
+ get_search_directories=`PATH="$PATH:/sbin" ldconfig -r | $GREP "search directories" | $SED "s#.*search directories:\ ##g"`
+ func_convert_delimited_path "$get_search_directories" ':' '\ '
+ save_search_directories=$converted_path
+ func_convert_delimited_path "$1" ':' '\ '
+
+ # Ensure directories exist
+ for dir in $converted_path; do
+ # Ensure each directory is an absolute path
+ case $dir in
+ /*) ;;
+ *) func_error "Directory '$dir' is not an absolute path"
+ exit $EXIT_FAILURE ;;
+ esac
+ # Ensure no trailing slashes
+ func_stripname '' '/' "$dir"
+ dir=$func_stripname_result
+ if test -d "$dir"; then
+ if test -n "$preferred_search_directories"; then
+ preferred_search_directories="$preferred_search_directories $dir"
+ else
+ preferred_search_directories=$dir
+ fi
+ else
+ func_error "Directory '$dir' does not exist"
+ exit $EXIT_FAILURE
+ fi
+ done
+
+ PATH="$PATH:/sbin" ldconfig -U $save_search_directories
+ PATH="$PATH:/sbin" ldconfig -m $preferred_search_directories $save_search_directories
+ get_search_directories=`PATH="$PATH:/sbin" ldconfig -r | $GREP "search directories" | $SED "s#.*search directories:\ ##g"`
+ func_convert_delimited_path "$get_search_directories" ':' '\ '
+ reordered_search_directories=$converted_path
+
+ $ECHO "Original: $save_search_directories"
+ $ECHO "Reordered: $reordered_search_directories"
+ exit $EXIT_SUCCESS
+ ;;
+ *)
+ func_error "--reorder-cache is not supported for host_os=$host_os."
+ exit $EXIT_FAILURE
+ ;;
+ esac
+}
+# end func_reorder_shared_lib_cache
+
+
# func_mode_compile arg...
func_mode_compile ()
{
@@ -3692,7 +3813,7 @@ func_mode_compile ()
# On Cygwin there's no "real" PIC flag so we must build both object types
case $host_os in
- cygwin* | mingw* | pw32* | os2* | cegcc*)
+ cygwin* | mingw* | windows* | pw32* | os2* | cegcc*)
pic_mode=default
;;
esac
@@ -4086,6 +4207,12 @@ if $opt_help; then
fi
+# If option '--reorder-cache', reorder the shared library cache and exit.
+if $opt_reorder_cache; then
+ func_reorder_shared_lib_cache $shared_lib_dirs
+fi
+
+
# func_mode_execute arg...
func_mode_execute ()
{
@@ -4270,7 +4397,7 @@ func_mode_finish ()
fi
fi
- if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+ if test -n "$finish_cmds$finish_eval" && test -n "$libdirs" && $opt_finishing; then
for libdir in $libdirs; do
if test -n "$finish_cmds"; then
# Do each command in the finish commands.
@@ -4295,6 +4422,12 @@ func_mode_finish ()
for libdir in $libdirs; do
$ECHO " $libdir"
done
+ if test "false" = "$opt_finishing"; then
+ echo
+ echo "NOTE: finish_cmds were not executed during testing, so you must"
+ echo "manually run ldconfig to add a given test directory, LIBDIR, to"
+ echo "the search path for generated executables."
+ fi
echo
echo "If you ever happen to want to link against installed libraries"
echo "in a given directory, LIBDIR, you must either use libtool, and"
@@ -4531,8 +4664,15 @@ func_mode_install ()
func_append dir "$objdir"
if test -n "$relink_command"; then
+ # Strip any trailing slash from the destination.
+ func_stripname '' '/' "$libdir"
+ destlibdir=$func_stripname_result
+
+ func_stripname '' '/' "$destdir"
+ s_destdir=$func_stripname_result
+
# Determine the prefix the user has applied to our future dir.
- inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
+ inst_prefix_dir=`$ECHO "X$s_destdir" | $Xsed -e "s%$destlibdir\$%%"`
# Don't allow the user to place us outside of our expected
# location b/c this prevents finding dependent libraries that
@@ -4569,7 +4709,7 @@ func_mode_install ()
'exit $?'
tstripme=$stripme
case $host_os in
- cygwin* | mingw* | pw32* | cegcc*)
+ cygwin* | mingw* | windows* | pw32* | cegcc*)
case $realname in
*.dll.a)
tstripme=
@@ -4682,7 +4822,7 @@ func_mode_install ()
# Do a test to see if this is really a libtool program.
case $host in
- *cygwin* | *mingw*)
+ *cygwin* | *mingw* | *windows*)
if func_ltwrapper_executable_p "$file"; then
func_ltwrapper_scriptname "$file"
wrapper=$func_ltwrapper_scriptname_result
@@ -4910,7 +5050,7 @@ extern \"C\" {
$RM $export_symbols
eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
case $host in
- *cygwin* | *mingw* | *cegcc* )
+ *cygwin* | *mingw* | *windows* | *cegcc* )
eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
;;
@@ -4922,7 +5062,7 @@ extern \"C\" {
eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
eval '$MV "$nlist"T "$nlist"'
case $host in
- *cygwin* | *mingw* | *cegcc* )
+ *cygwin* | *mingw* | *windows* | *cegcc* )
eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
;;
@@ -4936,7 +5076,7 @@ extern \"C\" {
func_basename "$dlprefile"
name=$func_basename_result
case $host in
- *cygwin* | *mingw* | *cegcc* )
+ *cygwin* | *mingw* | *windows* | *cegcc* )
# if an import library, we need to obtain dlname
if func_win32_import_lib_p "$dlprefile"; then
func_tr_sh "$dlprefile"
@@ -4962,8 +5102,16 @@ extern \"C\" {
eval '$ECHO ": $name " >> "$nlist"'
fi
func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
- eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
- $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
+ case $host in
+ i[3456]86-*-mingw32*)
+ eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
+ $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
+ ;;
+ *)
+ eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
+ $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/__nm_//' >> '$nlist'"
+ ;;
+ esac
}
else # not an import lib
$opt_dry_run || {
@@ -5111,7 +5259,7 @@ static const void *lt_preloaded_setup() {
# Transform the symbol file into the correct name.
symfileobj=$output_objdir/${my_outputname}S.$objext
case $host in
- *cygwin* | *mingw* | *cegcc* )
+ *cygwin* | *mingw* | *windows* | *cegcc* )
if test -f "$output_objdir/$my_outputname.def"; then
compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
@@ -5187,7 +5335,7 @@ func_win32_libid ()
*ar\ archive*) # could be an import, or static
# Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
- $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
+ $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64|pe-aarch64)' >/dev/null; then
case $nm_interface in
"MS dumpbin")
if func_cygming_ms_implib_p "$1" ||
@@ -5454,7 +5602,7 @@ func_extract_archives ()
#
# Emit a libtool wrapper script on stdout.
# Don't directly open a file because we may want to
-# incorporate the script contents within a cygwin/mingw
+# incorporate the script contents within a cygwin/mingw/windows
# wrapper executable. Must ONLY be called from within
# func_mode_link because it depends on a number of variables
# set therein.
@@ -5462,7 +5610,7 @@ func_extract_archives ()
# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
# variable will take. If 'yes', then the emitted script
# will assume that the directory where it is stored is
-# the $objdir directory. This is a cygwin/mingw-specific
+# the $objdir directory. This is a cygwin/mingw/windows-specific
# behavior.
func_emit_wrapper ()
{
@@ -5587,7 +5735,7 @@ func_exec_program_core ()
"
case $host in
# Backslashes separate directories on plain windows
- *-*-mingw | *-*-os2* | *-cegcc*)
+ *-*-mingw* | *-*-windows* | *-*-os2* | *-cegcc*)
$ECHO "\
if test -n \"\$lt_option_debug\"; then
\$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2
@@ -5655,7 +5803,7 @@ func_exec_program ()
file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
done
- # Usually 'no', except on cygwin/mingw when embedded into
+ # Usually 'no', except on cygwin/mingw/windows when embedded into
# the cwrapper.
WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
@@ -5787,7 +5935,7 @@ EOF
#endif
#include
#include
-#ifdef _MSC_VER
+#if defined _WIN32 && !defined __GNUC__
# include
# include
# include
@@ -5812,7 +5960,7 @@ EOF
/* declarations of non-ANSI functions */
#if defined __MINGW32__
# ifdef __STRICT_ANSI__
-int _putenv (const char *);
+_CRTIMP int __cdecl _putenv (const char *);
# endif
#elif defined __CYGWIN__
# ifdef __STRICT_ANSI__
@@ -6010,7 +6158,7 @@ main (int argc, char *argv[])
{
EOF
case $host in
- *mingw* | *cygwin* )
+ *mingw* | *windows* | *cygwin* )
# make stdout use "unix" line endings
echo " setmode(1,_O_BINARY);"
;;
@@ -6029,7 +6177,7 @@ EOF
{
/* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
namespace, but it is not one of the ones we know about and
- have already dealt with, above (inluding dump-script), then
+ have already dealt with, above (including dump-script), then
report an error. Otherwise, targets might begin to believe
they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
namespace. The first time any user complains about this, we'll
@@ -6113,7 +6261,7 @@ EOF
EOF
case $host_os in
- mingw*)
+ mingw* | windows*)
cat <<"EOF"
{
char* p;
@@ -6155,7 +6303,7 @@ EOF
EOF
case $host_os in
- mingw*)
+ mingw* | windows*)
cat <<"EOF"
/* execv doesn't actually work on mingw as expected on unix */
newargz = prepare_spawn (newargz);
@@ -6574,7 +6722,7 @@ lt_update_lib_path (const char *name, const char *value)
EOF
case $host_os in
- mingw*)
+ mingw* | windows*)
cat <<"EOF"
/* Prepares an argument vector before calling spawn().
@@ -6749,7 +6897,7 @@ func_mode_link ()
$debug_cmd
case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+ *-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-os2* | *-cegcc*)
# It is impossible to link a dll without this setting, and
# we shouldn't force the makefile maintainer to figure out
# what system we are compiling for in order to pass an extra
@@ -6773,6 +6921,7 @@ func_mode_link ()
finalize_command=$nonopt
compile_rpath=
+ compile_rpath_tail=
finalize_rpath=
compile_shlibpath=
finalize_shlibpath=
@@ -6813,10 +6962,12 @@ func_mode_link ()
xrpath=
perm_rpath=
temp_rpath=
+ temp_rpath_tail=
thread_safe=no
vinfo=
vinfo_number=no
weak_libs=
+ rpath_arg=
single_module=$wl-single_module
func_infer_tag $base_compile
@@ -7079,7 +7230,7 @@ func_mode_link ()
case $arg in
[\\/]* | [A-Za-z]:[\\/]*) ;;
*)
- func_fatal_error "only absolute run-paths are allowed"
+ func_fatal_error "argument to -rpath is not absolute: $arg"
;;
esac
if test rpath = "$prev"; then
@@ -7255,7 +7406,7 @@ func_mode_link ()
;;
esac
case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+ *-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-os2* | *-cegcc*)
testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
case :$dllsearchpath: in
*":$dir:"*) ;;
@@ -7275,7 +7426,7 @@ func_mode_link ()
-l*)
if test X-lc = "X$arg" || test X-lm = "X$arg"; then
case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
+ *-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
# These systems don't actually have a C or math library (as such)
continue
;;
@@ -7283,7 +7434,7 @@ func_mode_link ()
# These systems don't actually have a C library (as such)
test X-lc = "X$arg" && continue
;;
- *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig* | *-*-midnightbsd*)
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-midnightbsd*)
# Do not include libc due to us having libc/libc_r.
test X-lc = "X$arg" && continue
;;
@@ -7303,7 +7454,7 @@ func_mode_link ()
esac
elif test X-lc_r = "X$arg"; then
case $host in
- *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig* | *-*-midnightbsd*)
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-midnightbsd*)
# Do not include libc_r directly, use -pthread flag.
continue
;;
@@ -7326,7 +7477,8 @@ func_mode_link ()
# Tru64 UNIX uses -model [arg] to determine the layout of C++
# classes, name mangling, and exception handling.
# Darwin uses the -arch flag to determine output architecture.
- -model|-arch|-isysroot|--sysroot)
+ # -q for IBM XL C/C++ compiler.
+ -model|-arch|-isysroot|--sysroot|-q)
func_append compiler_flags " $arg"
func_append compile_command " $arg"
func_append finalize_command " $arg"
@@ -7347,7 +7499,7 @@ func_mode_link ()
continue
;;
-mt|-mthreads|-kthread|-Kthread|-pthreads|--thread-safe \
- |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
+ |-threads|-fopenmp|-fopenmp=*|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
func_append compiler_flags " $arg"
func_append compile_command " $arg"
func_append finalize_command " $arg"
@@ -7370,7 +7522,7 @@ func_mode_link ()
-no-install)
case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
+ *-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
# The PATH hackery in wrapper scripts is required on Windows
# and Darwin in order for the loader to find any dlls it needs.
func_warning "'-no-install' is ignored for $host"
@@ -7430,7 +7582,7 @@ func_mode_link ()
dir=$lt_sysroot$func_stripname_result
;;
*)
- func_fatal_error "only absolute run-paths are allowed"
+ func_fatal_error "argument ($arg) to '-R' is not an absolute path: $dir"
;;
esac
case "$xrpath " in
@@ -7555,13 +7707,29 @@ func_mode_link ()
# -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
# -specs=* GCC specs files
# -stdlib=* select c++ std lib with clang
+ # -fdiagnostics-color* simply affects output
+ # -frecord-gcc-switches used to verify flags were respected
# -fsanitize=* Clang/GCC memory and address sanitizer
+ # -fno-sanitize* Clang/GCC memory and address sanitizer
+ # -shared-libsan Link with shared sanitizer runtimes (Clang)
+ # -static-libsan Link with static sanitizer runtimes (Clang)
+ # -no-canonical-prefixes Do not expand any symbolic links
# -fuse-ld=* Linker select flags for GCC
+ # -static-* direct GCC to link specific libraries statically
+ # -fcilkplus Cilk Plus language extension features for C/C++
+ # -rtlib=* select c runtime lib with clang
+ # --unwindlib=* select unwinder library with clang
+ # -f{file|debug|macro|profile}-prefix-map=* needed for lto linking
# -Wa,* Pass flags directly to the assembler
+ # -Werror, -Werror=* Report (specified) warnings as errors
-64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
-t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
- -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \
- -specs=*|-fsanitize=*|-fuse-ld=*|-Wa,*)
+ -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-no-canonical-prefixes| \
+ -stdlib=*|-rtlib=*|--unwindlib=*| \
+ -specs=*|-fsanitize=*|-fno-sanitize*|-shared-libsan|-static-libsan| \
+ -ffile-prefix-map=*|-fdebug-prefix-map=*|-fmacro-prefix-map=*|-fprofile-prefix-map=*| \
+ -fdiagnostics-color*|-frecord-gcc-switches| \
+ -fuse-ld=*|-static-*|-fcilkplus|-Wa,*|-Werror|-Werror=*)
func_quote_arg pretty "$arg"
arg=$func_quote_arg_result
func_append compile_command " $arg"
@@ -7719,8 +7887,20 @@ func_mode_link ()
# Now actually substitute the argument into the commands.
if test -n "$arg"; then
- func_append compile_command " $arg"
- func_append finalize_command " $arg"
+ if test -n "$rpath_arg"; then
+ func_append finalize_rpath " ${arg##*,}"
+ unset rpath_arg
+ else
+ case $arg in
+ -Wl,-rpath,*)
+ func_append finalize_rpath " ${arg##*,}";;
+ -Wl,-rpath)
+ rpath_arg=1;;
+ *)
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ esac
+ fi
fi
done # argument parsing loop
@@ -7891,7 +8071,7 @@ func_mode_link ()
found=false
case $deplib in
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
- |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
+ |-threads|-fopenmp|-fopenmp=*|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
if test prog,link = "$linkmode,$pass"; then
compile_deplibs="$deplib $compile_deplibs"
finalize_deplibs="$deplib $finalize_deplibs"
@@ -8068,18 +8248,15 @@ func_mode_link ()
;;
esac
if $valid_a_lib; then
- echo
- $ECHO "*** Warning: Linking the shared library $output against the"
- $ECHO "*** static library $deplib is not portable!"
+ func_warning "Linking the shared library $output against the static library $deplib is not portable!"
deplibs="$deplib $deplibs"
else
- echo
- $ECHO "*** Warning: Trying to link with static lib archive $deplib."
- echo "*** I have the capability to make that library automatically link in when"
- echo "*** you link to this library. But I can only do this if you have a"
- echo "*** shared version of the library, which you do not appear to have"
- echo "*** because the file extensions .$libext of this argument makes me believe"
- echo "*** that it is just a static archive that I should not use here."
+ func_warning "Trying to link with static lib archive $deplib."
+ func_warning "I have the capability to make that library automatically link in when"
+ func_warning "you link to this library. But I can only do this if you have a"
+ func_warning "shared version of the library, which you do not appear to have"
+ func_warning "because the file extensions .$libext of this argument makes me believe"
+ func_warning "that it is just a static archive that I should not use here."
fi
;;
esac
@@ -8274,7 +8451,7 @@ func_mode_link ()
fi
case $host in
# special handling for platforms with PE-DLLs.
- *cygwin* | *mingw* | *cegcc* )
+ *cygwin* | *mingw* | *windows* | *cegcc* )
# Linker will automatically link against shared library if both
# static and shared are present. Therefore, ensure we extract
# symbols from the import library if a shared library is present
@@ -8374,7 +8551,10 @@ func_mode_link ()
# Make sure the rpath contains only unique directories.
case $temp_rpath: in
*"$absdir:"*) ;;
- *) func_append temp_rpath "$absdir:" ;;
+ *) case $absdir in
+ "$progdir/"*) func_append temp_rpath "$absdir:" ;;
+ *) func_append temp_rpath_tail "$absdir:" ;;
+ esac
esac
fi
@@ -8384,9 +8564,12 @@ func_mode_link ()
case " $sys_lib_dlsearch_path " in
*" $absdir "*) ;;
*)
- case "$compile_rpath " in
+ case "$compile_rpath$compile_rpath_tail " in
*" $absdir "*) ;;
- *) func_append compile_rpath " $absdir" ;;
+ *) case $absdir in
+ "$progdir/"*) func_append compile_rpath " $absdir" ;;
+ *) func_append compile_rpath_tail " $absdir" ;;
+ esac
esac
;;
esac
@@ -8417,8 +8600,8 @@ func_mode_link ()
fi
if test -n "$library_names" &&
{ test no = "$use_static_libs" || test -z "$old_library"; }; then
- case $host in
- *cygwin* | *mingw* | *cegcc* | *os2*)
+ case $host_os in
+ cygwin* | mingw* | windows* | cegcc* | os2*)
# No point in relinking DLLs because paths are not encoded
func_append notinst_deplibs " $lib"
need_relink=no
@@ -8444,11 +8627,11 @@ func_mode_link ()
if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then
echo
if test prog = "$linkmode"; then
- $ECHO "*** Warning: Linking the executable $output against the loadable module"
+ func_warning "Linking the executable $output against the loadable module"
else
- $ECHO "*** Warning: Linking the shared library $output against the loadable module"
+ func_warning "Linking the shared library $output against the loadable module"
fi
- $ECHO "*** $linklib is not portable!"
+ func_warning "$linklib is not portable!"
fi
if test lib = "$linkmode" &&
test yes = "$hardcode_into_libs"; then
@@ -8458,9 +8641,12 @@ func_mode_link ()
case " $sys_lib_dlsearch_path " in
*" $absdir "*) ;;
*)
- case "$compile_rpath " in
+ case "$compile_rpath$compile_rpath_tail " in
*" $absdir "*) ;;
- *) func_append compile_rpath " $absdir" ;;
+ *) case $absdir in
+ "$progdir/"*) func_append compile_rpath " $absdir" ;;
+ *) func_append compile_rpath_tail " $absdir" ;;
+ esac
esac
;;
esac
@@ -8487,8 +8673,8 @@ func_mode_link ()
soname=$dlname
elif test -n "$soname_spec"; then
# bleh windows
- case $host in
- *cygwin* | mingw* | *cegcc* | *os2*)
+ case $host_os in
+ cygwin* | mingw* | windows* | cegcc* | os2*)
func_arith $current - $age
major=$func_arith_result
versuffix=-$major
@@ -8535,6 +8721,7 @@ func_mode_link ()
case $host in
*-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;;
*-*-sysv4*uw2*) add_dir=-L$dir ;;
+ *-*-emscripten*) add_dir=-L$dir ;;
*-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
*-*-unixware7*) add_dir=-L$dir ;;
*-*-darwin* )
@@ -8543,11 +8730,10 @@ func_mode_link ()
if /usr/bin/file -L $add 2> /dev/null |
$GREP ": [^:]* bundle" >/dev/null; then
if test "X$dlopenmodule" != "X$lib"; then
- $ECHO "*** Warning: lib $linklib is a module, not a shared library"
+ func_warning "lib $linklib is a module, not a shared library"
if test -z "$old_library"; then
- echo
- echo "*** And there doesn't seem to be a static archive available"
- echo "*** The link will probably fail, sorry"
+ func_warning "And there doesn't seem to be a static archive available"
+ func_warning "The link will probably fail, sorry"
else
add=$dir/$old_library
fi
@@ -8630,7 +8816,7 @@ func_mode_link ()
test no = "$hardcode_direct_absolute"; then
add=$libdir/$linklib
elif test yes = "$hardcode_minus_L"; then
- add_dir=-L$libdir
+ add_dir=-L$lt_sysroot$libdir
add=-l$name
elif test yes = "$hardcode_shlibpath_var"; then
case :$finalize_shlibpath: in
@@ -8647,7 +8833,7 @@ func_mode_link ()
fi
else
# We cannot seem to hardcode it, guess we'll fake it.
- add_dir=-L$libdir
+ add_dir=-L$lt_sysroot$libdir
# Try looking first in the location we're being installed to.
if test -n "$inst_prefix_dir"; then
case $libdir in
@@ -8687,21 +8873,19 @@ func_mode_link ()
# Just print a warning and add the library to dependency_libs so
# that the program can be linked against the static library.
- echo
- $ECHO "*** Warning: This system cannot link to static lib archive $lib."
- echo "*** I have the capability to make that library automatically link in when"
- echo "*** you link to this library. But I can only do this if you have a"
- echo "*** shared version of the library, which you do not appear to have."
+ func_warning "This system cannot link to static lib archive $lib."
+ func_warning "I have the capability to make that library automatically link in when"
+ func_warning "you link to this library. But I can only do this if you have a"
+ func_warning "shared version of the library, which you do not appear to have."
if test yes = "$module"; then
- echo "*** But as you try to build a module library, libtool will still create "
- echo "*** a static module, that should work as long as the dlopening application"
- echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
+ func_warning "But as you try to build a module library, libtool will still create "
+ func_warning "a static module, that should work as long as the dlopening application"
+ func_warning "is linked with the -dlopen flag to resolve symbols at runtime."
if test -z "$global_symbol_pipe"; then
- echo
- echo "*** However, this would only work if libtool was able to extract symbol"
- echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
- echo "*** not find such a program. So, this module is probably useless."
- echo "*** 'nm' from GNU binutils and a full rebuild may help."
+ func_warning "However, this would only work if libtool was able to extract symbol"
+ func_warning "lists from a program, using 'nm' or equivalent, but libtool could"
+ func_warning "not find such a program. So, this module is probably useless."
+ func_warning "'nm' from GNU binutils and a full rebuild may help."
fi
if test no = "$build_old_libs"; then
build_libtool_libs=module
@@ -8824,6 +9008,10 @@ func_mode_link ()
fi # link_all_deplibs != no
fi # linkmode = lib
done # for deplib in $libs
+
+ func_append temp_rpath "$temp_rpath_tail"
+ func_append compile_rpath "$compile_rpath_tail"
+
if test link = "$pass"; then
if test prog = "$linkmode"; then
compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
@@ -8861,42 +9049,46 @@ func_mode_link ()
# Add libraries to $var in reverse order
eval tmp_libs=\"\$$var\"
new_libs=
+ # FIXME: Pedantically, this is the right thing to do, so
+ # that some nasty dependency loop isn't accidentally
+ # broken: new_libs="$deplib $new_libs"
for deplib in $tmp_libs; do
- # FIXME: Pedantically, this is the right thing to do, so
- # that some nasty dependency loop isn't accidentally
- # broken:
- #new_libs="$deplib $new_libs"
- # Pragmatically, this seems to cause very few problems in
- # practice:
- case $deplib in
- -L*) new_libs="$deplib $new_libs" ;;
- -R*) ;;
- *)
- # And here is the reason: when a library appears more
- # than once as an explicit dependence of a library, or
- # is implicitly linked in more than once by the
- # compiler, it is considered special, and multiple
- # occurrences thereof are not removed. Compare this
- # with having the same library being listed as a
- # dependency of multiple other libraries: in this case,
- # we know (pedantically, we assume) the library does not
- # need to be listed more than once, so we keep only the
- # last copy. This is not always right, but it is rare
- # enough that we require users that really mean to play
- # such unportable linking tricks to link the library
- # using -Wl,-lname, so that libtool does not consider it
- # for duplicate removal.
- case " $specialdeplibs " in
- *" $deplib "*) new_libs="$deplib $new_libs" ;;
+ if $opt_preserve_dup_deps; then
+ new_libs="$deplib $new_libs"
+ else
+ # Pragmatically, this seems to cause very few problems in
+ # practice:
+ case $deplib in
+ -L*) new_libs="$deplib $new_libs" ;;
+ -R*) ;;
*)
- case " $new_libs " in
- *" $deplib "*) ;;
- *) new_libs="$deplib $new_libs" ;;
- esac
- ;;
+ # And here is the reason: when a library appears more
+ # than once as an explicit dependence of a library, or
+ # is implicitly linked in more than once by the
+ # compiler, it is considered special, and multiple
+ # occurrences thereof are not removed. Compare this
+ # with having the same library being listed as a
+ # dependency of multiple other libraries: in this case,
+ # we know (pedantically, we assume) the library does not
+ # need to be listed more than once, so we keep only the
+ # last copy. This is not always right, but it is rare
+ # enough that we require users that really mean to play
+ # such unportable linking tricks to link the library
+ # using -Wl,-lname, so that libtool does not consider it
+ # for duplicate removal. And if not possible for portability
+ # reasons, then --preserve-dup-deps should be used.
+ case " $specialdeplibs " in
+ *" $deplib "*) new_libs="$deplib $new_libs" ;;
+ *)
+ case " $new_libs " in
+ *" $deplib "*) ;;
+ *) new_libs="$deplib $new_libs" ;;
+ esac
+ ;;
+ esac
+ ;;
esac
- ;;
- esac
+ fi
done
tmp_libs=
for deplib in $new_libs; do
@@ -9028,9 +9220,7 @@ func_mode_link ()
if test pass_all != "$deplibs_check_method"; then
func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs"
else
- echo
- $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
- $ECHO "*** objects $objs is not portable!"
+ func_warning "Linking the shared library $output against the non-libtool objects $objs is not portable!"
func_append libobjs " $objs"
fi
fi
@@ -9091,13 +9281,13 @@ func_mode_link ()
#
case $version_type in
# correct linux to gnu/linux during the next big refactor
- darwin|freebsd-elf|linux|midnightbsd-elf|osf|windows|none)
+ darwin|freebsd-elf|linux|midnightbsd-elf|osf|qnx|windows|none)
func_arith $number_major + $number_minor
current=$func_arith_result
age=$number_minor
revision=$number_revision
;;
- freebsd-aout|qnx|sunos)
+ freebsd-aout|sco|sunos)
current=$number_major
revision=$number_minor
age=0
@@ -9109,6 +9299,9 @@ func_mode_link ()
revision=$number_minor
lt_irix_increment=no
;;
+ *)
+ func_fatal_configuration "$modename: unknown library version type '$version_type'"
+ ;;
esac
;;
no)
@@ -9244,8 +9437,9 @@ func_mode_link ()
;;
qnx)
- major=.$current
- versuffix=.$current
+ func_arith $current - $age
+ major=.$func_arith_result
+ versuffix=$major.$age.$revision
;;
sco)
@@ -9398,7 +9592,7 @@ func_mode_link ()
if test yes = "$build_libtool_libs"; then
if test -n "$rpath"; then
case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
+ *-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
# these systems don't actually have a c library (as such)!
;;
*-*-rhapsody* | *-*-darwin1.[012])
@@ -9449,108 +9643,6 @@ func_mode_link ()
# implementing what was already the behavior.
newdeplibs=$deplibs
;;
- test_compile)
- # This code stresses the "libraries are programs" paradigm to its
- # limits. Maybe even breaks it. We compile a program, linking it
- # against the deplibs as a proxy for the library. Then we can check
- # whether they linked in statically or dynamically with ldd.
- $opt_dry_run || $RM conftest.c
- cat > conftest.c < $output
- for obj in $save_libobjs
- do
- func_to_tool_file "$obj"
- $ECHO "$func_to_tool_file_result" >> $output
- done
- echo ')' >> $output
- func_append delfiles " $output"
- func_to_tool_file "$output"
- output=$func_to_tool_file_result
- elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then
+ if test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then
output=$output_objdir/$output_la.lnk
func_verbose "creating linker input file list: $output"
: > $output
@@ -10142,6 +10217,19 @@ EOF
func_append delfiles " $output"
func_to_tool_file "$output"
output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
+ elif test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then
+ output=$output_objdir/$output_la.lnkscript
+ func_verbose "creating GNU ld script: $output"
+ echo 'INPUT (' > $output
+ for obj in $save_libobjs
+ do
+ func_to_tool_file "$obj"
+ $ECHO "$func_to_tool_file_result" >> $output
+ done
+ echo ')' >> $output
+ func_append delfiles " $output"
+ func_to_tool_file "$output"
+ output=$func_to_tool_file_result
else
if test -n "$save_libobjs"; then
func_verbose "creating reloadable object files..."
@@ -10582,7 +10670,7 @@ EOF
esac
fi
case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+ *-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-os2* | *-cegcc*)
testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'`
case :$dllsearchpath: in
*":$libdir:"*) ;;
@@ -10660,7 +10748,7 @@ EOF
# Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
wrappers_required=false
;;
- *cygwin* | *mingw* )
+ *cygwin* | *mingw* | *windows* )
test yes = "$build_libtool_libs" || wrappers_required=false
;;
*)
@@ -10814,7 +10902,7 @@ EOF
*) exeext= ;;
esac
case $host in
- *cygwin* | *mingw* )
+ *cygwin* | *mingw* | windows* )
func_dirname_and_basename "$output" "" "."
output_name=$func_basename_result
output_path=$func_dirname_result
@@ -11148,7 +11236,7 @@ EOF
# tests/bindir.at for full details.
tdlname=$dlname
case $host,$output,$installed,$module,$dlname in
- *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
+ *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *windows*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
# If a -bindir argument was supplied, place the dll there.
if test -n "$bindir"; then
func_relative_path "$install_libdir" "$bindir"
diff --git a/config/missing b/config/missing
index 1fe1611f1..5e450bab3 100755
--- a/config/missing
+++ b/config/missing
@@ -1,9 +1,11 @@
#! /bin/sh
-# Common wrapper for a few potentially missing GNU programs.
+# Common wrapper for a few potentially missing GNU and other programs.
-scriptversion=2018-03-07.03; # UTC
+scriptversion=2025-06-18.21; # UTC
-# Copyright (C) 1996-2021 Free Software Foundation, Inc.
+# shellcheck disable=SC2006,SC2268 # we must support pre-POSIX shells
+
+# Copyright (C) 1996-2025 Free Software Foundation, Inc.
# Originally written by Fran,cois Pinard , 1996.
# This program is free software; you can redistribute it and/or modify
@@ -54,18 +56,20 @@ Options:
-v, --version output version information and exit
Supported PROGRAM values:
- aclocal autoconf autoheader autom4te automake makeinfo
- bison yacc flex lex help2man
+aclocal autoconf autogen autoheader autom4te automake autoreconf
+bison flex help2man lex makeinfo perl yacc
Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
'g' are ignored when checking the name.
-Send bug reports to ."
+Report bugs to .
+GNU Automake home page: .
+General help using GNU software: ."
exit $?
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
- echo "missing $scriptversion (GNU Automake)"
+ echo "missing (GNU Automake) $scriptversion"
exit $?
;;
@@ -108,7 +112,7 @@ gnu_software_URL=https://www.gnu.org/software
program_details ()
{
case $1 in
- aclocal|automake)
+ aclocal|automake|autoreconf)
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:"
@@ -123,6 +127,9 @@ program_details ()
echo "<$gnu_software_URL/m4/>"
echo "<$perl_URL>"
;;
+ *)
+ :
+ ;;
esac
}
@@ -137,48 +144,55 @@ give_advice ()
printf '%s\n' "'$1' is $msg."
configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
+ autoheader_deps="'acconfig.h'"
+ automake_deps="'Makefile.am'"
+ aclocal_deps="'acinclude.m4'"
case $normalized_program in
+ aclocal*)
+ echo "You should only need it if you modified $aclocal_deps or"
+ echo "$configure_deps."
+ ;;
autoconf*)
- echo "You should only need it if you modified 'configure.ac',"
- echo "or m4 files included by it."
- program_details 'autoconf'
+ echo "You should only need it if you modified $configure_deps."
+ ;;
+ autogen*)
+ echo "You should only need it if you modified a '.def' or '.tpl' file."
+ echo "You may want to install the GNU AutoGen package:"
+ echo "<$gnu_software_URL/autogen/>"
;;
autoheader*)
- echo "You should only need it if you modified 'acconfig.h' or"
+ echo "You should only need it if you modified $autoheader_deps 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 "You should only need it if you modified $automake_deps or"
echo "$configure_deps."
- program_details 'aclocal'
;;
- autom4te*)
+ autom4te*)
echo "You might have modified some maintainer files that require"
echo "the 'autom4te' program to be rebuilt."
- program_details 'autom4te'
+ ;;
+ autoreconf*)
+ echo "You should only need it if you modified $aclocal_deps or"
+ echo "$automake_deps or $autoheader_deps or $automake_deps or"
+ echo "$configure_deps."
;;
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/>"
;;
+ 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>"
+ ;;
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."
@@ -189,6 +203,12 @@ give_advice ()
echo "want to install GNU make:"
echo "<$gnu_software_URL/make/>"
;;
+ perl*)
+ echo "You should only need it to run GNU Autoconf, GNU Automake, "
+ echo " assorted other tools, or if you modified a Perl source file."
+ echo "You may want to install the Perl 5 language interpreter:"
+ echo "<$perl_URL>"
+ ;;
*)
echo "You might have modified some files without having the proper"
echo "tools for further handling them. Check the 'README' file, it"
@@ -197,6 +217,7 @@ give_advice ()
echo "case some other package contains this missing '$1' program."
;;
esac
+ program_details "$normalized_program"
}
give_advice "$1" | sed -e '1s/^/WARNING: /' \
@@ -207,9 +228,9 @@ give_advice "$1" | sed -e '1s/^/WARNING: /' \
exit $st
# Local variables:
-# eval: (add-hook 'before-save-hook 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp nil t)
# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-format: "%Y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:
diff --git a/config/mkinstalldirs b/config/mkinstalldirs
index c364f3d5e..498a641d2 100755
--- a/config/mkinstalldirs
+++ b/config/mkinstalldirs
@@ -1,7 +1,7 @@
#! /bin/sh
# mkinstalldirs --- make directory hierarchy
-scriptversion=2020-07-26.22; # UTC
+scriptversion=2025-06-18.21; # UTC
# Original author: Noah Friedman
# Created: 1993-05-16
@@ -23,7 +23,9 @@ Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ...
Create each directory DIR (with mode MODE, if specified), including all
leading file name components.
-Report bugs to ."
+Report bugs to .
+GNU Automake home page: .
+General help using GNU software: ."
# process command line arguments
while test $# -gt 0 ; do
@@ -39,7 +41,7 @@ while test $# -gt 0 ; do
shift
;;
--version)
- echo "$0 $scriptversion"
+ echo "$0 (GNU Automake) $scriptversion"
exit $?
;;
--) # stop option processing
@@ -154,9 +156,9 @@ exit $errstatus
# Local Variables:
# mode: shell-script
# sh-indentation: 2
-# eval: (add-hook 'before-save-hook 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp nil t)
# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-format: "%Y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:
diff --git a/config/test-driver b/config/test-driver
index be73b80ad..d81fba79c 100755
--- a/config/test-driver
+++ b/config/test-driver
@@ -1,9 +1,9 @@
#! /bin/sh
# test-driver - basic testsuite driver script.
-scriptversion=2018-03-07.03; # UTC
+scriptversion=2025-06-18.21; # UTC
-# Copyright (C) 2011-2021 Free Software Foundation, Inc.
+# Copyright (C) 2011-2025 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
@@ -44,11 +44,16 @@ print_usage ()
Usage:
test-driver --test-name NAME --log-file PATH --trs-file PATH
[--expect-failure {yes|no}] [--color-tests {yes|no}]
+ [--collect-skipped-logs {yes|no}]
[--enable-hard-errors {yes|no}] [--]
TEST-SCRIPT [TEST-SCRIPT-ARGUMENTS]
The '--test-name', '--log-file' and '--trs-file' options are mandatory.
See the GNU Automake documentation for information.
+
+Report bugs to .
+GNU Automake home page: .
+General help using GNU software: .
END
}
@@ -57,15 +62,17 @@ log_file= # Where to save the output of the test script.
trs_file= # Where to save the metadata of the test run.
expect_failure=no
color_tests=no
+collect_skipped_logs=yes
enable_hard_errors=yes
while test $# -gt 0; do
case $1 in
--help) print_usage; exit $?;;
- --version) echo "test-driver $scriptversion"; exit $?;;
+ --version) echo "test-driver (GNU Automake) $scriptversion"; exit $?;;
--test-name) test_name=$2; shift;;
--log-file) log_file=$2; shift;;
--trs-file) trs_file=$2; shift;;
--color-tests) color_tests=$2; shift;;
+ --collect-skipped-logs) collect_skipped_logs=$2; shift;;
--expect-failure) expect_failure=$2; shift;;
--enable-hard-errors) enable_hard_errors=$2; shift;;
--) shift; break;;
@@ -121,7 +128,7 @@ 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;;
+ 77:*) col=$blu res=SKIP recheck=no gcopy=$collect_skipped_logs;;
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;;
@@ -145,9 +152,9 @@ echo ":copy-in-global-log: $gcopy" >> $trs_file
# Local Variables:
# mode: shell-script
# sh-indentation: 2
-# eval: (add-hook 'before-save-hook 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp nil t)
# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-format: "%Y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:
diff --git a/configure b/configure
index f6c9b00c6..10ac13e39 100755
--- a/configure
+++ b/configure
@@ -1,11 +1,11 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.71 for iperf 3.13.
+# Generated by GNU Autoconf 2.72 for iperf 3.20+.
#
# Report bugs to .
#
#
-# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation,
+# Copyright (C) 1992-1996, 1998-2017, 2020-2023 Free Software Foundation,
# Inc.
#
#
@@ -17,7 +17,6 @@
# 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
@@ -26,12 +25,13 @@ then :
# 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 #(
+else case e in #(
+ e) case `(set -o) 2>/dev/null` in #(
*posix*) :
set -o posix ;; #(
*) :
;;
+esac ;;
esac
fi
@@ -103,7 +103,7 @@ IFS=$as_save_IFS
;;
esac
-# We did not find ourselves, most probably we were run as `sh COMMAND'
+# We did not find ourselves, most probably we were run as 'sh COMMAND'
# in which case we are not to be found in the path.
if test "x$as_myself" = x; then
as_myself=$0
@@ -133,15 +133,14 @@ case $- in # ((((
esac
exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
# Admittedly, this is quite paranoid, since all the known shells bail
-# out after a failed `exec'.
+# 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
+ as_bourne_compatible="if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1
then :
emulate sh
NULLCMD=:
@@ -149,12 +148,13 @@ then :
# 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 #(
+else case e in #(
+ e) case \`(set -o) 2>/dev/null\` in #(
*posix*) :
set -o posix ;; #(
*) :
;;
+esac ;;
esac
fi
"
@@ -172,8 +172,9 @@ 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.
+else case e in #(
+ e) exitcode=1; echo positional parameters were not saved. ;;
+esac
fi
test x\$exitcode = x0 || exit 1
blah=\$(echo \$(echo blah))
@@ -195,14 +196,15 @@ 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
+else case e in #(
+ e) as_have_required=no ;;
+esac
fi
if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null
then :
-else $as_nop
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+else case e in #(
+ e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
as_found=false
for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
do
@@ -235,12 +237,13 @@ IFS=$as_save_IFS
if $as_found
then :
-else $as_nop
- if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+else case e in #(
+ e) if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null
then :
CONFIG_SHELL=$SHELL as_have_required=yes
-fi
+fi ;;
+esac
fi
@@ -262,7 +265,7 @@ case $- in # ((((
esac
exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
# Admittedly, this is quite paranoid, since all the known shells bail
-# out after a failed `exec'.
+# out after a failed 'exec'.
printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2
exit 255
fi
@@ -282,7 +285,8 @@ $0: message. Then install a modern shell, or manually run
$0: the script under such a shell if you do have one."
fi
exit 1
-fi
+fi ;;
+esac
fi
fi
SHELL=${CONFIG_SHELL-/bin/sh}
@@ -321,14 +325,6 @@ as_fn_exit ()
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
# -------------
@@ -397,11 +393,12 @@ then :
{
eval $1+=\$2
}'
-else $as_nop
- as_fn_append ()
+else case e in #(
+ e) as_fn_append ()
{
eval $1=\$$1\$2
- }
+ } ;;
+esac
fi # as_fn_append
# as_fn_arith ARG...
@@ -415,21 +412,14 @@ then :
{
as_val=$(( $* ))
}'
-else $as_nop
- as_fn_arith ()
+else case e in #(
+ e) as_fn_arith ()
{
as_val=`expr "$@" || test $? -eq 1`
- }
+ } ;;
+esac
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]
# ----------------------------------------
@@ -503,6 +493,8 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits
/[$]LINENO/=
' <$as_myself |
sed '
+ t clear
+ :clear
s/[$]LINENO.*/&-/
t lineno
b
@@ -551,7 +543,6 @@ esac
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
@@ -563,9 +554,9 @@ if (echo >conf$$.file) 2>/dev/null; then
if ln -s conf$$.file conf$$ 2>/dev/null; then
as_ln_s='ln -s'
# ... but there are two gotchas:
- # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
- # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -pR'.
+ # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable.
+ # In both cases, we have to default to 'cp -pR'.
ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
as_ln_s='cp -pR'
elif ln conf$$.file conf$$ 2>/dev/null; then
@@ -590,10 +581,12 @@ as_test_x='test -x'
as_executable_p=as_fn_executable_p
# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+as_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
+as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated
# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
+as_tr_sh="eval sed '$as_sed_sh'" # deprecated
SHELL=${CONFIG_SHELL-/bin/sh}
@@ -621,8 +614,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='iperf'
PACKAGE_TARNAME='iperf'
-PACKAGE_VERSION='3.13'
-PACKAGE_STRING='iperf 3.13'
+PACKAGE_VERSION='3.20+'
+PACKAGE_STRING='iperf 3.20+'
PACKAGE_BUGREPORT='https://github.com/esnet/iperf'
PACKAGE_URL='https://software.es.net/iperf/'
@@ -666,8 +659,15 @@ OPENSSL_LDFLAGS
OPENSSL_LIBS
OPENSSL_INCLUDES
PKG_CONFIG
+PTHREAD_CFLAGS
+PTHREAD_LIBS
+PTHREAD_CXX
+PTHREAD_CC
+ax_pthread_config
+CPP
ENABLE_PROFILING_FALSE
ENABLE_PROFILING_TRUE
+LDCONFIG
MAINT
MAINTAINER_MODE_FALSE
MAINTAINER_MODE_TRUE
@@ -718,6 +718,8 @@ build_vendor
build_cpu
build
LIBTOOL
+am__xargs_n
+am__rm_f_notfound
AM_BACKSLASH
AM_DEFAULT_VERBOSITY
AM_DEFAULT_V
@@ -797,14 +799,17 @@ enable_static_bin
enable_silent_rules
enable_shared
enable_static
+enable_pic
with_pic
enable_fast_install
+enable_aix_soname
with_aix_soname
enable_dependency_tracking
with_gnu_ld
with_sysroot
enable_libtool_lock
enable_maintainer_mode
+with_ldconfig
enable_profiling
with_sctp
with_openssl
@@ -817,7 +822,8 @@ CFLAGS
LDFLAGS
LIBS
CPPFLAGS
-LT_SYS_LIBRARY_PATH'
+LT_SYS_LIBRARY_PATH
+CPP'
# Initialize some variables set by options.
@@ -926,7 +932,7 @@ do
ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid feature name: \`$ac_useropt'"
+ as_fn_error $? "invalid feature name: '$ac_useropt'"
ac_useropt_orig=$ac_useropt
ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
@@ -952,7 +958,7 @@ do
ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid feature name: \`$ac_useropt'"
+ as_fn_error $? "invalid feature name: '$ac_useropt'"
ac_useropt_orig=$ac_useropt
ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
@@ -1165,7 +1171,7 @@ do
ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid package name: \`$ac_useropt'"
+ as_fn_error $? "invalid package name: '$ac_useropt'"
ac_useropt_orig=$ac_useropt
ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
@@ -1181,7 +1187,7 @@ do
ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid package name: \`$ac_useropt'"
+ as_fn_error $? "invalid package name: '$ac_useropt'"
ac_useropt_orig=$ac_useropt
ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
@@ -1211,8 +1217,8 @@ do
| --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
x_libraries=$ac_optarg ;;
- -*) as_fn_error $? "unrecognized option: \`$ac_option'
-Try \`$0 --help' for more information"
+ -*) as_fn_error $? "unrecognized option: '$ac_option'
+Try '$0 --help' for more information"
;;
*=*)
@@ -1220,7 +1226,7 @@ Try \`$0 --help' for more information"
# Reject names that are not valid shell variable names.
case $ac_envvar in #(
'' | [0-9]* | *[!_$as_cr_alnum]* )
- as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
+ as_fn_error $? "invalid variable name: '$ac_envvar'" ;;
esac
eval $ac_envvar=\$ac_optarg
export $ac_envvar ;;
@@ -1270,7 +1276,7 @@ do
as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
done
-# There might be people who depend on the old broken behavior: `$host'
+# There might be people who depend on the old broken behavior: '$host'
# used to hold the argument of --host etc.
# FIXME: To remove some day.
build=$build_alias
@@ -1338,7 +1344,7 @@ if test ! -r "$srcdir/$ac_unique_file"; then
test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
fi
-ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_msg="sources are in $srcdir, but 'cd $srcdir' does not work"
ac_abs_confdir=`(
cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
pwd)`
@@ -1366,7 +1372,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures iperf 3.13 to adapt to many kinds of systems.
+'configure' configures iperf 3.20+ to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1380,11 +1386,11 @@ Configuration:
--help=short display options specific to this package
--help=recursive display the short help of all the included packages
-V, --version display version information and exit
- -q, --quiet, --silent do not print \`checking ...' messages
+ -q, --quiet, --silent do not print 'checking ...' messages
--cache-file=FILE cache test results in FILE [disabled]
- -C, --config-cache alias for \`--cache-file=config.cache'
+ -C, --config-cache alias for '--cache-file=config.cache'
-n, --no-create do not create output files
- --srcdir=DIR find the sources in DIR [configure dir or \`..']
+ --srcdir=DIR find the sources in DIR [configure dir or '..']
Installation directories:
--prefix=PREFIX install architecture-independent files in PREFIX
@@ -1392,10 +1398,10 @@ Installation directories:
--exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
[PREFIX]
-By default, \`make install' will install all the files in
-\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
-an installation prefix other than \`$ac_default_prefix' using \`--prefix',
-for instance \`--prefix=\$HOME'.
+By default, 'make install' will install all the files in
+'$ac_default_prefix/bin', '$ac_default_prefix/lib' etc. You can specify
+an installation prefix other than '$ac_default_prefix' using '--prefix',
+for instance '--prefix=\$HOME'.
For better control, use the options below.
@@ -1437,7 +1443,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of iperf 3.13:";;
+ short | recursive ) echo "Configuration of iperf 3.20+:";;
esac
cat <<\_ACEOF
@@ -1450,8 +1456,13 @@ Optional Features:
--disable-silent-rules verbose build output (undo: "make V=0")
--enable-shared[=PKGS] build shared libraries [default=yes]
--enable-static[=PKGS] build static libraries [default=yes]
+ --enable-pic[=PKGS] try to use only PIC/non-PIC objects [default=use
+ both]
--enable-fast-install[=PKGS]
optimize for fast installation [default=yes]
+ --enable-aix-soname=aix|svr4|both
+ shared library versioning (aka "SONAME") variant to
+ provide on AIX, [default=aix].
--enable-dependency-tracking
do not reject slow dependency extractors
--disable-dependency-tracking
@@ -1465,14 +1476,10 @@ Optional Features:
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
- --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use
- both]
- --with-aix-soname=aix|svr4|both
- shared library versioning (aka "SONAME") variant to
- provide on AIX, [default=aix].
--with-gnu-ld assume the C compiler uses GNU ld [default=no]
--with-sysroot[=DIR] Search for dependent libraries within DIR (or the
compiler's sysroot if not specified).
+ --without-ldconfig do not run ldconfig
--without-sctp disable SCTP
--with-openssl=DIR root of the OpenSSL directory
@@ -1486,8 +1493,9 @@ Some influential environment variables:
you have headers in a nonstandard directory
LT_SYS_LIBRARY_PATH
User-defined run-time library search path.
+ CPP C preprocessor
-Use these variables to override the choices made by `configure' or to help
+Use these variables to override the choices made by 'configure' or to help
it to find libraries and programs with nonstandard names/locations.
Report bugs to .
@@ -1555,10 +1563,10 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-iperf configure 3.13
-generated by GNU Autoconf 2.71
+iperf configure 3.20+
+generated by GNU Autoconf 2.72
-Copyright (C) 2021 Free Software Foundation, Inc.
+Copyright (C) 2023 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
_ACEOF
@@ -1597,11 +1605,12 @@ printf "%s\n" "$ac_try_echo"; } >&5
} && test -s conftest.$ac_objext
then :
ac_retval=0
-else $as_nop
- printf "%s\n" "$as_me: failed program was:" >&5
+else case e in #(
+ e) printf "%s\n" "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_retval=1
+ ac_retval=1 ;;
+esac
fi
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
as_fn_set_status $ac_retval
@@ -1639,11 +1648,12 @@ printf "%s\n" "$ac_try_echo"; } >&5
}
then :
ac_retval=0
-else $as_nop
- printf "%s\n" "$as_me: failed program was:" >&5
+else case e in #(
+ e) printf "%s\n" "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_retval=1
+ ac_retval=1 ;;
+esac
fi
# Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
# created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
@@ -1667,8 +1677,8 @@ 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
+else case e in #(
+ e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$4
#include <$2>
@@ -1676,10 +1686,12 @@ _ACEOF
if ac_fn_c_try_compile "$LINENO"
then :
eval "$3=yes"
-else $as_nop
- eval "$3=no"
+else case e in #(
+ e) eval "$3=no" ;;
+esac
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
+esac
fi
eval ac_res=\$$3
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
@@ -1699,15 +1711,15 @@ 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
+else case e in #(
+ e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Define $2 to an innocuous variant, in case declares $2.
For example, HP-UX 11i declares gettimeofday. */
#define $2 innocuous_$2
/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $2 (); below. */
+ which can conflict with char $2 (void); below. */
#include
#undef $2
@@ -1718,7 +1730,7 @@ else $as_nop
#ifdef __cplusplus
extern "C"
#endif
-char $2 ();
+char $2 (void);
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
@@ -1737,11 +1749,13 @@ _ACEOF
if ac_fn_c_try_link "$LINENO"
then :
eval "$3=yes"
-else $as_nop
- eval "$3=no"
+else case e in #(
+ e) eval "$3=no" ;;
+esac
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam \
- conftest$ac_exeext conftest.$ac_ext
+ conftest$ac_exeext conftest.$ac_ext ;;
+esac
fi
eval ac_res=\$$3
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
@@ -1750,6 +1764,45 @@ printf "%s\n" "$ac_res" >&6; }
} # ac_fn_c_check_func
+# ac_fn_c_try_cpp LINENO
+# ----------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_cpp ()
+{
+ 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 case e in #(
+ e) printf "%s\n" "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1 ;;
+esac
+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_check_member LINENO AGGR MEMBER VAR INCLUDES
# ----------------------------------------------------
# Tries to find if the field MEMBER exists in type AGGR, after including
@@ -1762,8 +1815,8 @@ 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
+else case e in #(
+ e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$5
int
@@ -1779,8 +1832,8 @@ _ACEOF
if ac_fn_c_try_compile "$LINENO"
then :
eval "$4=yes"
-else $as_nop
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+else case e in #(
+ e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$5
int
@@ -1796,12 +1849,15 @@ _ACEOF
if ac_fn_c_try_compile "$LINENO"
then :
eval "$4=yes"
-else $as_nop
- eval "$4=no"
+else case e in #(
+ e) eval "$4=no" ;;
+esac
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
+esac
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
+esac
fi
eval ac_res=\$$4
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
@@ -1833,8 +1889,8 @@ 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 iperf $as_me 3.13, which was
-generated by GNU Autoconf 2.71. Invocation command line was
+It was created by iperf $as_me 3.20+, which was
+generated by GNU Autoconf 2.72. Invocation command line was
$ $0$ac_configure_args_raw
@@ -2080,10 +2136,10 @@ esac
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;}
+ || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;}
as_fn_error $? "failed to load site script $ac_site_file
-See \`config.log' for more details" "$LINENO" 5; }
+See 'config.log' for more details" "$LINENO" 5; }
fi
done
@@ -2119,9 +2175,7 @@ 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;
+static char *e (char **p, int i)
{
return p[i];
}
@@ -2135,6 +2189,21 @@ static char *f (char * (*g) (char **, int), char **p, ...)
return s;
}
+/* C89 style stringification. */
+#define noexpand_stringify(a) #a
+const char *stringified = noexpand_stringify(arbitrary+token=sequence);
+
+/* C89 style token pasting. Exercises some of the corner cases that
+ e.g. old MSVC gets wrong, but not very hard. */
+#define noexpand_concat(a,b) a##b
+#define expand_concat(a,b) noexpand_concat(a,b)
+extern int vA;
+extern int vbee;
+#define aye A
+#define bee B
+int *pvA = &expand_concat(v,aye);
+int *pvbee = &noexpand_concat(v,bee);
+
/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
function prototypes and stuff, but not \xHH hex character constants.
These do not provoke an error unfortunately, instead are silently treated
@@ -2162,16 +2231,19 @@ 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?
+/* Does the compiler advertise C99 conformance? */
#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L
# error "Compiler does not advertise C99 conformance"
#endif
+// See if C++-style comments work.
+
#include
extern int puts (const char *);
extern int printf (const char *, ...);
extern int dprintf (int, const char *, ...);
extern void *malloc (size_t);
+extern void free (void *);
// Check varargs macros. These examples are taken from C99 6.10.3.5.
// dprintf is used instead of fprintf to avoid needing to declare
@@ -2221,7 +2293,6 @@ 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)
@@ -2287,6 +2358,8 @@ ac_c_conftest_c99_main='
ia->datasize = 10;
for (int i = 0; i < ia->datasize; ++i)
ia->data[i] = i * 1.234;
+ // Work around memory leak warnings.
+ free (ia);
// Check named initializers.
struct named_init ni = {
@@ -2308,7 +2381,7 @@ ac_c_conftest_c99_main='
# Test code for whether the C compiler supports C11 (global declarations)
ac_c_conftest_c11_globals='
-// Does the compiler advertise C11 conformance?
+/* Does the compiler advertise C11 conformance? */
#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L
# error "Compiler does not advertise C11 conformance"
#endif
@@ -2500,8 +2573,9 @@ 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
+else case e in #(
+ e) as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 ;;
+esac
fi
@@ -2529,12 +2603,12 @@ for ac_var in $ac_precious_vars; do
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;}
+ { 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;}
+ { 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=: ;;
,);;
*)
@@ -2543,18 +2617,18 @@ printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
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;}
+ { 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;}
+ { 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;}
+ { 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.
@@ -2570,11 +2644,11 @@ printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;}
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: 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'
+ as_fn_error $? "run '${MAKE-make} distclean' and/or 'rm $cache_file'
and start over" "$LINENO" 5
fi
## -------------------- ##
@@ -2647,6 +2721,119 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
+# ===========================================================================
+# https://www.gnu.org/software/autoconf-archive/ax_pthread.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
+#
+# DESCRIPTION
+#
+# This macro figures out how to build C programs using POSIX threads. It
+# sets the PTHREAD_LIBS output variable to the threads library and linker
+# flags, and the PTHREAD_CFLAGS output variable to any special C compiler
+# flags that are needed. (The user can also force certain compiler
+# flags/libs to be tested by setting these environment variables.)
+#
+# Also sets PTHREAD_CC and PTHREAD_CXX to any special C compiler that is
+# needed for multi-threaded programs (defaults to the value of CC
+# respectively CXX otherwise). (This is necessary on e.g. AIX to use the
+# special cc_r/CC_r compiler alias.)
+#
+# NOTE: You are assumed to not only compile your program with these flags,
+# but also to link with them as well. For example, you might link with
+# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS
+# $PTHREAD_CXX $CXXFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS
+#
+# If you are only building threaded programs, you may wish to use these
+# variables in your default LIBS, CFLAGS, and CC:
+#
+# LIBS="$PTHREAD_LIBS $LIBS"
+# CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+# CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS"
+# CC="$PTHREAD_CC"
+# CXX="$PTHREAD_CXX"
+#
+# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant
+# has a nonstandard name, this macro defines PTHREAD_CREATE_JOINABLE to
+# that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
+#
+# Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the
+# PTHREAD_PRIO_INHERIT symbol is defined when compiling with
+# PTHREAD_CFLAGS.
+#
+# ACTION-IF-FOUND is a list of shell commands to run if a threads library
+# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it
+# is not found. If ACTION-IF-FOUND is not specified, the default action
+# will define HAVE_PTHREAD.
+#
+# Please let the authors know if this macro fails on any platform, or if
+# you have any other suggestions or comments. This macro was based on work
+# by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help
+# from M. Frigo), as well as ac_pthread and hb_pthread macros posted by
+# Alejandro Forero Cuervo to the autoconf macro repository. We are also
+# grateful for the helpful feedback of numerous users.
+#
+# Updated for Autoconf 2.68 by Daniel Richard G.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Steven G. Johnson
+# Copyright (c) 2011 Daniel Richard G.
+# Copyright (c) 2019 Marc Stevens
+#
+# 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 .
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. You
+# need not follow the terms of the GNU General Public License when using
+# or distributing such scripts, even though portions of the text of the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+#serial 31
+
+# This is what autoupdate's m4 run will expand. It fires the warning
+# (with _au_warn_XXX), outputs it into the updated configure.ac (with
+# m4_warn), and then outputs the replacement expansion. We need extra
+# quotation around the m4_warn and dnl so they will be written
+# unexpanded into the updated configure.ac.
+
+
+# This is an auxiliary macro that is also run when
+# autoupdate runs m4. It simply calls m4_warning, but
+# we need a wrapper so that each warning is emitted only
+# once. We break the quoting in m4_warning's argument in
+# order to expand this macro's arguments, not AU_DEFUN's.
+
+
+# Finally, this is the expansion that is picked up by
+# autoconf, causing NAME to expand to NEW-CODE, plus
+# (if SILENT is not "silent") a m4_warning telling the
+# maintainer to run autoupdate. We don't issue MESSAGE
+# from autoconf, because that's instructions for what
+# to do *after* running autoupdate.
+
+
# Also link binaries as static
# Check whether --enable-static-bin was given.
if test ${enable_static_bin+y}
@@ -2654,8 +2841,9 @@ then :
enableval=$enable_static_bin; enable_static=yes
enable_shared=no
enable_static_bin=yes
-else $as_nop
- :
+else case e in #(
+ e) : ;;
+esac
fi
if test x$enable_static_bin = xno; then
@@ -2686,7 +2874,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
# Initialize the automake system
-am__api_version='1.16'
+am__api_version='1.18'
@@ -2710,8 +2898,8 @@ 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
+else case e in #(
+ e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
@@ -2765,7 +2953,8 @@ esac
IFS=$as_save_IFS
rm -rf conftest.one conftest.two conftest.dir
-
+ ;;
+esac
fi
if test ${ac_cv_path_install+y}; then
INSTALL=$ac_cv_path_install
@@ -2788,6 +2977,165 @@ 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 sleep supports fractional seconds" >&5
+printf %s "checking whether sleep supports fractional seconds... " >&6; }
+if test ${am_cv_sleep_fractional_seconds+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) if sleep 0.001 2>/dev/null
+then :
+ am_cv_sleep_fractional_seconds=yes
+else case e in #(
+ e) am_cv_sleep_fractional_seconds=no ;;
+esac
+fi
+ ;;
+esac
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_sleep_fractional_seconds" >&5
+printf "%s\n" "$am_cv_sleep_fractional_seconds" >&6; }
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking filesystem timestamp resolution" >&5
+printf %s "checking filesystem timestamp resolution... " >&6; }
+if test ${am_cv_filesystem_timestamp_resolution+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) # Default to the worst case.
+am_cv_filesystem_timestamp_resolution=2
+
+# Only try to go finer than 1 sec if sleep can do it.
+# Don't try 1 sec, because if 0.01 sec and 0.1 sec don't work,
+# - 1 sec is not much of a win compared to 2 sec, and
+# - it takes 2 seconds to perform the test whether 1 sec works.
+#
+# Instead, just use the default 2s on platforms that have 1s resolution,
+# accept the extra 1s delay when using $sleep in the Automake tests, in
+# exchange for not incurring the 2s delay for running the test for all
+# packages.
+#
+am_try_resolutions=
+if test "$am_cv_sleep_fractional_seconds" = yes; then
+ # Even a millisecond often causes a bunch of false positives,
+ # so just try a hundredth of a second. The time saved between .001 and
+ # .01 is not terribly consequential.
+ am_try_resolutions="0.01 0.1 $am_try_resolutions"
+fi
+
+# In order to catch current-generation FAT out, we must *modify* files
+# that already exist; the *creation* timestamp is finer. Use names
+# that make ls -t sort them differently when they have equal
+# timestamps than when they have distinct timestamps, keeping
+# in mind that ls -t prints the *newest* file first.
+rm -f conftest.ts?
+: > conftest.ts1
+: > conftest.ts2
+: > conftest.ts3
+
+# Make sure ls -t actually works. Do 'set' in a subshell so we don't
+# clobber the current shell's arguments. (Outer-level square brackets
+# are removed by m4; they're present so that m4 does not expand
+# ; be careful, easy to get confused.)
+if (
+ set X `ls -t conftest.ts[12]` &&
+ {
+ test "$*" != "X conftest.ts1 conftest.ts2" ||
+ test "$*" != "X conftest.ts2 conftest.ts1";
+ }
+); then :; else
+ # 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".
+ printf "%s\n" ""Bad output from ls -t: \"`ls -t conftest.ts[12]`\""" >&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 $? "ls -t produces unexpected output.
+Make sure there is not a broken ls alias in your environment.
+See 'config.log' for more details" "$LINENO" 5; }
+fi
+
+for am_try_res in $am_try_resolutions; do
+ # Any one fine-grained sleep might happen to cross the boundary
+ # between two values of a coarser actual resolution, but if we do
+ # two fine-grained sleeps in a row, at least one of them will fall
+ # entirely within a coarse interval.
+ echo alpha > conftest.ts1
+ sleep $am_try_res
+ echo beta > conftest.ts2
+ sleep $am_try_res
+ echo gamma > conftest.ts3
+
+ # We assume that 'ls -t' will make use of high-resolution
+ # timestamps if the operating system supports them at all.
+ if (set X `ls -t conftest.ts?` &&
+ test "$2" = conftest.ts3 &&
+ test "$3" = conftest.ts2 &&
+ test "$4" = conftest.ts1); then
+ #
+ # Ok, ls -t worked. If we're at a resolution of 1 second, we're done,
+ # because we don't need to test make.
+ make_ok=true
+ if test $am_try_res != 1; then
+ # But if we've succeeded so far with a subsecond resolution, we
+ # have one more thing to check: make. It can happen that
+ # everything else supports the subsecond mtimes, but make doesn't;
+ # notably on macOS, which ships make 3.81 from 2006 (the last one
+ # released under GPLv2). https://bugs.gnu.org/68808
+ #
+ # We test $MAKE if it is defined in the environment, else "make".
+ # It might get overridden later, but our hope is that in practice
+ # it does not matter: it is the system "make" which is (by far)
+ # the most likely to be broken, whereas if the user overrides it,
+ # probably they did so with a better, or at least not worse, make.
+ # https://lists.gnu.org/archive/html/automake/2024-06/msg00051.html
+ #
+ # Create a Makefile (real tab character here):
+ rm -f conftest.mk
+ echo 'conftest.ts1: conftest.ts2' >conftest.mk
+ echo ' touch conftest.ts2' >>conftest.mk
+ #
+ # Now, running
+ # touch conftest.ts1; touch conftest.ts2; make
+ # should touch ts1 because ts2 is newer. This could happen by luck,
+ # but most often, it will fail if make's support is insufficient. So
+ # test for several consecutive successes.
+ #
+ # (We reuse conftest.ts[12] because we still want to modify existing
+ # files, not create new ones, per above.)
+ n=0
+ make=${MAKE-make}
+ until test $n -eq 3; do
+ echo one > conftest.ts1
+ sleep $am_try_res
+ echo two > conftest.ts2 # ts2 should now be newer than ts1
+ if $make -f conftest.mk | grep 'up to date' >/dev/null; then
+ make_ok=false
+ break # out of $n loop
+ fi
+ n=`expr $n + 1`
+ done
+ fi
+ #
+ if $make_ok; then
+ # Everything we know to check worked out, so call this resolution good.
+ am_cv_filesystem_timestamp_resolution=$am_try_res
+ break # out of $am_try_res loop
+ fi
+ # Otherwise, we'll go on to check the next resolution.
+ fi
+done
+rm -f conftest.ts?
+# (end _am_filesystem_timestamp_resolution)
+ ;;
+esac
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_filesystem_timestamp_resolution" >&5
+printf "%s\n" "$am_cv_filesystem_timestamp_resolution" >&6; }
+
+# This check should not be cached, as it may vary across builds of
+# different projects.
{ 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
@@ -2796,10 +3144,14 @@ am_lf='
'
case `pwd` in
*[\\\"\#\$\&\'\`$am_lf]*)
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
esac
case $srcdir in
*[\\\"\#\$\&\'\`$am_lf\ \ ]*)
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;;
esac
@@ -2808,49 +3160,45 @@ esac
# 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!
+am_build_env_is_sane=no
+am_has_slept=no
+rm -f conftest.file
+for am_try in 1 2; do
+ echo "timestamp, slept: $am_has_slept" > conftest.file
+ if (
+ 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
+ test "$2" = conftest.file
+ ); then
+ am_build_env_is_sane=yes
+ break
+ fi
+ # Just in case.
+ sleep "$am_cv_filesystem_timestamp_resolution"
+ am_has_slept=yes
+done
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_build_env_is_sane" >&5
+printf "%s\n" "$am_build_env_is_sane" >&6; }
+if test "$am_build_env_is_sane" = no; then
+ 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 ) &
+if test -e conftest.file || grep 'slept: no' conftest.file >/dev/null 2>&1
+then :
+
+else case e in #(
+ e) ( sleep "$am_cv_filesystem_timestamp_resolution" ) &
am_sleep_pid=$!
+ ;;
+esac
fi
rm -f conftest.file
@@ -2861,7 +3209,7 @@ test "$program_prefix" != NONE &&
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.
+# 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"`
@@ -2904,8 +3252,8 @@ 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
+else case e in #(
+ e) if test -n "$STRIP"; then
ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -2927,7 +3275,8 @@ done
done
IFS=$as_save_IFS
-fi
+fi ;;
+esac
fi
STRIP=$ac_cv_prog_STRIP
if test -n "$STRIP"; then
@@ -2949,8 +3298,8 @@ 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
+else case e in #(
+ e) 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
@@ -2972,7 +3321,8 @@ done
done
IFS=$as_save_IFS
-fi
+fi ;;
+esac
fi
ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
if test -n "$ac_ct_STRIP"; then
@@ -3008,8 +3358,8 @@ 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
+else case e in #(
+ e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
do
IFS=$as_save_IFS
@@ -3023,7 +3373,7 @@ 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 '* | \
+ *'BusyBox '* | \
'mkdir (fileutils) '4.1*)
ac_cv_path_mkdir=$as_dir$ac_prog$ac_exec_ext
break 3;;
@@ -3032,18 +3382,17 @@ do
done
done
IFS=$as_save_IFS
-
+ ;;
+esac
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"
+ # As a last resort, use plain mkdir -p,
+ # in the hope it doesn't have the bugs of ancient mkdir.
+ MKDIR_P='mkdir -p'
fi
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
@@ -3058,8 +3407,8 @@ 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
+else case e in #(
+ e) if test -n "$AWK"; then
ac_cv_prog_AWK="$AWK" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -3081,7 +3430,8 @@ done
done
IFS=$as_save_IFS
-fi
+fi ;;
+esac
fi
AWK=$ac_cv_prog_AWK
if test -n "$AWK"; then
@@ -3103,8 +3453,8 @@ 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
+else case e in #(
+ e) cat >conftest.make <<\_ACEOF
SHELL = /bin/sh
all:
@echo '@@@%%%=$(MAKE)=@@@%%%'
@@ -3116,7 +3466,8 @@ case `${MAKE-make} -f conftest.make 2>/dev/null` in
*)
eval ac_cv_prog_make_${ac_make}_set=no;;
esac
-rm -f conftest.make
+rm -f conftest.make ;;
+esac
fi
if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
@@ -3137,25 +3488,21 @@ else
fi
rmdir .tst 2>/dev/null
+AM_DEFAULT_VERBOSITY=1
# 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))
+else case e in #(
+ e) if printf "%s\n" 'TRUE=$(BAR$(V))
BAR0=false
BAR1=true
V=1
@@ -3165,19 +3512,50 @@ am__doit:
am_cv_make_support_nested_variables=yes
else
am_cv_make_support_nested_variables=no
-fi
+fi ;;
+esac
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='\'
+am__rm_f_notfound=
+if (rm -f && rm -fr && rm -rf) 2>/dev/null
+then :
+
+else case e in #(
+ e) am__rm_f_notfound='""' ;;
+esac
+fi
+
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking xargs -n works" >&5
+printf %s "checking xargs -n works... " >&6; }
+if test ${am_cv_xargs_n_works+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) if test "`echo 1 2 3 | xargs -n2 echo`" = "1 2
+3"
+then :
+ am_cv_xargs_n_works=yes
+else case e in #(
+ e) am_cv_xargs_n_works=no ;;
+esac
+fi ;;
+esac
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_xargs_n_works" >&5
+printf "%s\n" "$am_cv_xargs_n_works" >&6; }
+if test "$am_cv_xargs_n_works" = yes
+then :
+ am__xargs_n='xargs -n'
+else case e in #(
+ e) am__xargs_n='am__xargs_n () { shift; sed "s/ /\\n/g" | while read am__xargs_n_arg; do "" "$am__xargs_n_arg"; done; }'
+ ;;
+esac
+fi
+
if test "`cd $srcdir && pwd`" != "`pwd`"; then
# Use -I$(srcdir) only when $(srcdir) != ., so that make's output
# is not polluted with repeated "-I."
@@ -3200,7 +3578,7 @@ fi
# Define the identity of the package.
PACKAGE='iperf'
- VERSION='3.13'
+ VERSION='3.20+'
printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h
@@ -3238,111 +3616,160 @@ 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_tools='gnutar plaintar pax cpio none'
+
+# 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`
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether UID '$am_uid' is supported by ustar format" >&5
+printf %s "checking whether UID '$am_uid' is supported by ustar format... " >&6; }
+ if test x$am_uid = xunknown; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: ancient id detected; assuming current UID is ok, but dist-ustar might not work" >&5
+printf "%s\n" "$as_me: WARNING: ancient id detected; assuming current UID is ok, but dist-ustar might not work" >&2;}
+ elif test $am_uid -le $am_max_uid; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
+ else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+ _am_tools=none
+ fi
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether GID '$am_gid' is supported by ustar format" >&5
+printf %s "checking whether GID '$am_gid' is supported by ustar format... " >&6; }
+ if test x$gm_gid = xunknown; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: ancient id detected; assuming current GID is ok, but dist-ustar might not work" >&5
+printf "%s\n" "$as_me: WARNING: ancient id detected; assuming current GID is ok, but dist-ustar might not work" >&2;}
+ elif test $am_gid -le $am_max_gid; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
+ else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+ _am_tools=none
+ fi
-am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to create a ustar tar archive" >&5
+printf %s "checking how to create a ustar tar archive... " >&6; }
+ # 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_ustar-$_am_tools}
+ for _am_tool in $_am_tools; do
+ case $_am_tool in
+ gnutar)
+ for _am_tar in tar gnutar gtar; do
+ { echo "$as_me:$LINENO: $_am_tar --version" >&5
+ ($_am_tar --version) >&5 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && break
+ done
+ am__tar="$_am_tar --format=ustar -chf - "'"$$tardir"'
+ am__tar_="$_am_tar --format=ustar -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 ustar -w "$$tardir"'
+ am__tar_='pax -L -x ustar -w "$tardir"'
+ am__untar='pax -r'
+ ;;
+ cpio)
+ am__tar='find "$$tardir" -print | cpio -o -H ustar -L'
+ am__tar_='find "$tardir" -print | cpio -o -H ustar -L'
+ am__untar='cpio -i -H ustar -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_ustar}" && break
+ # tar/untar a dummy directory, and stop if the command works.
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ echo GrepMe > conftest.dir/file
+ { echo "$as_me:$LINENO: tardir=conftest.dir && eval $am__tar_ >conftest.tar" >&5
+ (tardir=conftest.dir && eval $am__tar_ >conftest.tar) >&5 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+ rm -rf conftest.dir
+ if test -s conftest.tar; then
+ { echo "$as_me:$LINENO: $am__untar &5
+ ($am__untar &5 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+ { echo "$as_me:$LINENO: cat conftest.dir/file" >&5
+ (cat conftest.dir/file) >&5 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+ grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+ fi
+ done
+ rm -rf conftest.dir
-# Variables for tags utilities; see am/tags.am
-if test -z "$CTAGS"; then
- CTAGS=ctags
+ if test ${am_cv_prog_tar_ustar+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) am_cv_prog_tar_ustar=$_am_tool ;;
+esac
fi
-if test -z "$ETAGS"; then
- ETAGS=etags
-fi
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_ustar" >&5
+printf "%s\n" "$am_cv_prog_tar_ustar" >&6; }
-if test -z "$CSCOPE"; then
- CSCOPE=cscope
+
+
+
+
+# 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
-# Check whether --enable-silent-rules was given.
-if test ${enable_silent_rules+y}
-then :
- enableval=$enable_silent_rules;
-fi
+AM_DEFAULT_VERBOSITY=0
-case $enable_silent_rules in # (((
- yes) AM_DEFAULT_VERBOSITY=0;;
- no) AM_DEFAULT_VERBOSITY=1;;
- *) AM_DEFAULT_VERBOSITY=0;;
-esac
-am_make=${MAKE-make}
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
-printf %s "checking whether $am_make supports nested variables... " >&6; }
-if test ${am_cv_make_support_nested_variables+y}
-then :
- printf %s "(cached) " >&6
-else $as_nop
- if printf "%s\n" 'TRUE=$(BAR$(V))
-BAR0=false
-BAR1=true
-V=1
-am__doit:
- @$(TRUE)
-.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
- am_cv_make_support_nested_variables=yes
-else
- am_cv_make_support_nested_variables=no
-fi
-fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
-printf "%s\n" "$am_cv_make_support_nested_variables" >&6; }
-if test $am_cv_make_support_nested_variables = yes; then
- AM_V='$(V)'
- AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
-else
- AM_V=$AM_DEFAULT_VERBOSITY
- AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
-fi
-AM_BACKSLASH='\'
case `pwd` in
*\ * | *\ *)
@@ -3352,8 +3779,8 @@ esac
-macro_version='2.4.7'
-macro_revision='2.4.7'
+macro_version='2.5.4'
+macro_revision='2.5.4'
@@ -3381,15 +3808,16 @@ 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
+else case e in #(
+ e) ac_build_alias=$build_alias
test "x$ac_build_alias" = x &&
ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"`
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
-
+ ;;
+esac
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
printf "%s\n" "$ac_cv_build" >&6; }
@@ -3416,14 +3844,15 @@ 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
+else case e in #(
+ e) if test "x$host_alias" = x; then
ac_cv_host=$ac_cv_build
else
ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` ||
as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5
fi
-
+ ;;
+esac
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
printf "%s\n" "$ac_cv_host" >&6; }
@@ -3600,8 +4029,8 @@ 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
+else case e in #(
+ e) if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -3623,7 +4052,8 @@ done
done
IFS=$as_save_IFS
-fi
+fi ;;
+esac
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
@@ -3645,8 +4075,8 @@ 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
+else case e in #(
+ e) if test -n "$ac_ct_CC"; then
ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -3668,7 +4098,8 @@ done
done
IFS=$as_save_IFS
-fi
+fi ;;
+esac
fi
ac_ct_CC=$ac_cv_prog_ac_ct_CC
if test -n "$ac_ct_CC"; then
@@ -3703,8 +4134,8 @@ 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
+else case e in #(
+ e) if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -3726,7 +4157,8 @@ done
done
IFS=$as_save_IFS
-fi
+fi ;;
+esac
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
@@ -3748,8 +4180,8 @@ 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
+else case e in #(
+ e) if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
ac_prog_rejected=no
@@ -3788,7 +4220,8 @@ if test $ac_prog_rejected = yes; then
ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@"
fi
fi
-fi
+fi ;;
+esac
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
@@ -3812,8 +4245,8 @@ 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
+else case e in #(
+ e) if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -3835,7 +4268,8 @@ done
done
IFS=$as_save_IFS
-fi
+fi ;;
+esac
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
@@ -3861,8 +4295,8 @@ 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
+else case e in #(
+ e) if test -n "$ac_ct_CC"; then
ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -3884,7 +4318,8 @@ done
done
IFS=$as_save_IFS
-fi
+fi ;;
+esac
fi
ac_ct_CC=$ac_cv_prog_ac_ct_CC
if test -n "$ac_ct_CC"; then
@@ -3922,8 +4357,8 @@ 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
+else case e in #(
+ e) if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -3945,7 +4380,8 @@ done
done
IFS=$as_save_IFS
-fi
+fi ;;
+esac
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
@@ -3967,8 +4403,8 @@ 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
+else case e in #(
+ e) if test -n "$ac_ct_CC"; then
ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -3990,7 +4426,8 @@ done
done
IFS=$as_save_IFS
-fi
+fi ;;
+esac
fi
ac_ct_CC=$ac_cv_prog_ac_ct_CC
if test -n "$ac_ct_CC"; then
@@ -4019,10 +4456,10 @@ 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;}
+test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;}
as_fn_error $? "no acceptable C compiler found in \$PATH
-See \`config.log' for more details" "$LINENO" 5; }
+See 'config.log' for more details" "$LINENO" 5; }
# Provide some information about the compiler.
printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
@@ -4094,8 +4531,8 @@ printf "%s\n" "$ac_try_echo"; } >&5
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'
+ # 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.
@@ -4115,7 +4552,7 @@ do
ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
fi
# We set ac_cv_exeext here because the later test for it is not
- # safe: cross compilers may not add the suffix if given an `-o'
+ # safe: cross compilers may not add the suffix if given an '-o'
# argument, so we may need to know it at that point already.
# Even if this section looks crufty: it has the advantage of
# actually working.
@@ -4126,8 +4563,9 @@ do
done
test "$ac_cv_exeext" = no && ac_cv_exeext=
-else $as_nop
- ac_file=''
+else case e in #(
+ e) ac_file='' ;;
+esac
fi
if test -z "$ac_file"
then :
@@ -4136,13 +4574,14 @@ 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;}
+{ { 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; }
+See 'config.log' for more details" "$LINENO" 5; }
+else case e in #(
+ e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; } ;;
+esac
fi
{ 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; }
@@ -4166,10 +4605,10 @@ printf "%s\n" "$ac_try_echo"; } >&5
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'.
+ # 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
@@ -4179,11 +4618,12 @@ for ac_file in conftest.exe conftest conftest.*; do
* ) 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;}
+else case e in #(
+ e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;}
as_fn_error $? "cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details" "$LINENO" 5; }
+See 'config.log' for more details" "$LINENO" 5; } ;;
+esac
fi
rm -f conftest conftest$ac_cv_exeext
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
@@ -4199,6 +4639,8 @@ int
main (void)
{
FILE *f = fopen ("conftest.out", "w");
+ if (!f)
+ return 1;
return ferror (f) || fclose (f) != 0;
;
@@ -4238,26 +4680,27 @@ printf "%s\n" "$ac_try_echo"; } >&5
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;}
+ { { 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; }
+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
+rm -f conftest.$ac_ext conftest$ac_cv_exeext \
+ conftest.o conftest.obj 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
+else case e in #(
+ e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
@@ -4289,16 +4732,18 @@ then :
break;;
esac
done
-else $as_nop
- printf "%s\n" "$as_me: failed program was:" >&5
+else case e in #(
+ e) printf "%s\n" "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-{ { 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: in '$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;}
as_fn_error $? "cannot compute suffix of object files: cannot compile
-See \`config.log' for more details" "$LINENO" 5; }
+See 'config.log' for more details" "$LINENO" 5; } ;;
+esac
fi
-rm -f conftest.$ac_cv_objext conftest.$ac_ext
+rm -f conftest.$ac_cv_objext conftest.$ac_ext ;;
+esac
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
printf "%s\n" "$ac_cv_objext" >&6; }
@@ -4309,8 +4754,8 @@ 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
+else case e in #(
+ e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
@@ -4327,12 +4772,14 @@ _ACEOF
if ac_fn_c_try_compile "$LINENO"
then :
ac_compiler_gnu=yes
-else $as_nop
- ac_compiler_gnu=no
+else case e in #(
+ e) ac_compiler_gnu=no ;;
+esac
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
ac_cv_c_compiler_gnu=$ac_compiler_gnu
-
+ ;;
+esac
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; }
@@ -4350,8 +4797,8 @@ 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
+else case e in #(
+ e) ac_save_c_werror_flag=$ac_c_werror_flag
ac_c_werror_flag=yes
ac_cv_prog_cc_g=no
CFLAGS="-g"
@@ -4369,8 +4816,8 @@ _ACEOF
if ac_fn_c_try_compile "$LINENO"
then :
ac_cv_prog_cc_g=yes
-else $as_nop
- CFLAGS=""
+else case e in #(
+ e) CFLAGS=""
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -4385,8 +4832,8 @@ _ACEOF
if ac_fn_c_try_compile "$LINENO"
then :
-else $as_nop
- ac_c_werror_flag=$ac_save_c_werror_flag
+else case e in #(
+ e) ac_c_werror_flag=$ac_save_c_werror_flag
CFLAGS="-g"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -4403,12 +4850,15 @@ 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
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
+esac
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
+esac
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
- ac_c_werror_flag=$ac_save_c_werror_flag
+ ac_c_werror_flag=$ac_save_c_werror_flag ;;
+esac
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
printf "%s\n" "$ac_cv_prog_cc_g" >&6; }
@@ -4435,8 +4885,8 @@ 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
+else case e in #(
+ e) ac_cv_prog_cc_c11=no
ac_save_CC=$CC
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -4453,25 +4903,28 @@ 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
+CC=$ac_save_CC ;;
+esac
fi
if test "x$ac_cv_prog_cc_c11" = xno
then :
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
printf "%s\n" "unsupported" >&6; }
-else $as_nop
- if test "x$ac_cv_prog_cc_c11" = x
+else case e in #(
+ e) if test "x$ac_cv_prog_cc_c11" = x
then :
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
printf "%s\n" "none needed" >&6; }
-else $as_nop
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5
+else case e in #(
+ e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5
printf "%s\n" "$ac_cv_prog_cc_c11" >&6; }
- CC="$CC $ac_cv_prog_cc_c11"
+ CC="$CC $ac_cv_prog_cc_c11" ;;
+esac
fi
ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11
- ac_prog_cc_stdc=c11
+ ac_prog_cc_stdc=c11 ;;
+esac
fi
fi
if test x$ac_prog_cc_stdc = xno
@@ -4481,8 +4934,8 @@ 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
+else case e in #(
+ e) ac_cv_prog_cc_c99=no
ac_save_CC=$CC
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -4499,25 +4952,28 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam
test "x$ac_cv_prog_cc_c99" != "xno" && break
done
rm -f conftest.$ac_ext
-CC=$ac_save_CC
+CC=$ac_save_CC ;;
+esac
fi
if test "x$ac_cv_prog_cc_c99" = xno
then :
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
printf "%s\n" "unsupported" >&6; }
-else $as_nop
- if test "x$ac_cv_prog_cc_c99" = x
+else case e in #(
+ e) if test "x$ac_cv_prog_cc_c99" = x
then :
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
printf "%s\n" "none needed" >&6; }
-else $as_nop
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5
+else case e in #(
+ e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5
printf "%s\n" "$ac_cv_prog_cc_c99" >&6; }
- CC="$CC $ac_cv_prog_cc_c99"
+ CC="$CC $ac_cv_prog_cc_c99" ;;
+esac
fi
ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99
- ac_prog_cc_stdc=c99
+ ac_prog_cc_stdc=c99 ;;
+esac
fi
fi
if test x$ac_prog_cc_stdc = xno
@@ -4527,8 +4983,8 @@ 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
+else case e in #(
+ e) ac_cv_prog_cc_c89=no
ac_save_CC=$CC
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -4545,25 +5001,28 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam
test "x$ac_cv_prog_cc_c89" != "xno" && break
done
rm -f conftest.$ac_ext
-CC=$ac_save_CC
+CC=$ac_save_CC ;;
+esac
fi
if test "x$ac_cv_prog_cc_c89" = xno
then :
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
printf "%s\n" "unsupported" >&6; }
-else $as_nop
- if test "x$ac_cv_prog_cc_c89" = x
+else case e in #(
+ e) if test "x$ac_cv_prog_cc_c89" = x
then :
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
printf "%s\n" "none needed" >&6; }
-else $as_nop
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+else case e in #(
+ e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
printf "%s\n" "$ac_cv_prog_cc_c89" >&6; }
- CC="$CC $ac_cv_prog_cc_c89"
+ CC="$CC $ac_cv_prog_cc_c89" ;;
+esac
fi
ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89
- ac_prog_cc_stdc=c89
+ ac_prog_cc_stdc=c89 ;;
+esac
fi
fi
@@ -4584,8 +5043,8 @@ 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
+else case e in #(
+ e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
@@ -4614,8 +5073,12 @@ _ACEOF
break
fi
done
- rm -f core conftest*
- unset am_i
+ # aligned with autoconf, so not including core; see bug#72225.
+ rm -f -r a.out a.exe b.out conftest.$ac_ext conftest.$ac_objext \
+ conftest.dSYM conftest1.$ac_ext conftest1.$ac_objext conftest1.dSYM \
+ conftest2.$ac_ext conftest2.$ac_objext conftest2.dSYM
+ unset am_i ;;
+esac
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; }
@@ -4641,8 +5104,8 @@ 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
+else case e in #(
+ e) 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
@@ -4729,7 +5192,7 @@ else $as_nop
# 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:
+ # When given -MP, icc 7.0 and 7.1 complain thus:
# 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
@@ -4746,7 +5209,8 @@ else $as_nop
else
am_cv_CC_dependencies_compiler_type=none
fi
-
+ ;;
+esac
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; }
@@ -4768,8 +5232,8 @@ 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/
+else case e in #(
+ e) 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
@@ -4794,9 +5258,10 @@ do
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
+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"
@@ -4831,7 +5296,8 @@ IFS=$as_save_IFS
else
ac_cv_path_SED=$SED
fi
-
+ ;;
+esac
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
printf "%s\n" "$ac_cv_path_SED" >&6; }
@@ -4856,8 +5322,8 @@ 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
+else case e in #(
+ e) if test -z "$GREP"; then
ac_path_GREP_found=false
# Loop through the user's path and test for each of PROGNAME-LIST
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -4876,9 +5342,10 @@ do
as_fn_executable_p "$ac_path_GREP" || continue
# Check for GNU ac_path_GREP and select it if it is found.
# Check for GNU $ac_path_GREP
-case `"$ac_path_GREP" --version 2>&1` in
+case `"$ac_path_GREP" --version 2>&1` in #(
*GNU*)
ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+#(
*)
ac_count=0
printf %s 0123456789 >"conftest.in"
@@ -4913,7 +5380,8 @@ IFS=$as_save_IFS
else
ac_cv_path_GREP=$GREP
fi
-
+ ;;
+esac
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
printf "%s\n" "$ac_cv_path_GREP" >&6; }
@@ -4925,8 +5393,8 @@ 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
+else case e in #(
+ e) if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
then ac_cv_path_EGREP="$GREP -E"
else
if test -z "$EGREP"; then
@@ -4948,9 +5416,10 @@ do
as_fn_executable_p "$ac_path_EGREP" || continue
# Check for GNU ac_path_EGREP and select it if it is found.
# Check for GNU $ac_path_EGREP
-case `"$ac_path_EGREP" --version 2>&1` in
+case `"$ac_path_EGREP" --version 2>&1` in #(
*GNU*)
ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+#(
*)
ac_count=0
printf %s 0123456789 >"conftest.in"
@@ -4986,20 +5455,23 @@ else
ac_cv_path_EGREP=$EGREP
fi
- fi
+ fi ;;
+esac
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"
+ EGREP_TRADITIONAL=$EGREP
+ ac_cv_path_EGREP_TRADITIONAL=$EGREP
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
printf %s "checking for fgrep... " >&6; }
if test ${ac_cv_path_FGREP+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
+else case e in #(
+ e) if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
then ac_cv_path_FGREP="$GREP -F"
else
if test -z "$FGREP"; then
@@ -5021,9 +5493,10 @@ do
as_fn_executable_p "$ac_path_FGREP" || continue
# Check for GNU ac_path_FGREP and select it if it is found.
# Check for GNU $ac_path_FGREP
-case `"$ac_path_FGREP" --version 2>&1` in
+case `"$ac_path_FGREP" --version 2>&1` in #(
*GNU*)
ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;;
+#(
*)
ac_count=0
printf %s 0123456789 >"conftest.in"
@@ -5059,7 +5532,8 @@ else
ac_cv_path_FGREP=$FGREP
fi
- fi
+ fi ;;
+esac
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5
printf "%s\n" "$ac_cv_path_FGREP" >&6; }
@@ -5090,8 +5564,9 @@ test -z "$GREP" && GREP=grep
if test ${with_gnu_ld+y}
then :
withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes
-else $as_nop
- with_gnu_ld=no
+else case e in #(
+ e) with_gnu_ld=no ;;
+esac
fi
ac_prog=ld
@@ -5100,7 +5575,7 @@ if test yes = "$GCC"; 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; }
case $host in
- *-*-mingw*)
+ *-*-mingw* | *-*-windows*)
# gcc leaves a trailing carriage return, which upsets mingw
ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
*)
@@ -5136,8 +5611,8 @@ fi
if test ${lt_cv_path_LD+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- if test -z "$LD"; then
+else case e in #(
+ e) if test -z "$LD"; then
lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
for ac_dir in $PATH; do
IFS=$lt_save_ifs
@@ -5160,7 +5635,8 @@ else $as_nop
IFS=$lt_save_ifs
else
lt_cv_path_LD=$LD # Let the user override the test with a path.
-fi
+fi ;;
+esac
fi
LD=$lt_cv_path_LD
@@ -5177,8 +5653,8 @@ printf %s "checking if the linker ($LD) is GNU ld... " >&6; }
if test ${lt_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.
+else case e in #(
+ e) # I'd rather use --version here, but apparently some GNU lds only accept -v.
case `$LD -v 2>&1 &1 &5
@@ -5205,8 +5682,8 @@ printf %s "checking for BSD- or MS-compatible name lister (nm)... " >&6; }
if test ${lt_cv_path_NM+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- if test -n "$NM"; then
+else case e in #(
+ e) if test -n "$NM"; then
# Let the user override the test.
lt_cv_path_NM=$NM
else
@@ -5227,7 +5704,7 @@ else
# Tru64's nm complains that /dev/null is an invalid object file
# MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty
case $build_os in
- mingw*) lt_bad_file=conftest.nm/nofile ;;
+ mingw* | windows*) lt_bad_file=conftest.nm/nofile ;;
*) lt_bad_file=/dev/null ;;
esac
case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in
@@ -5253,7 +5730,8 @@ else
IFS=$lt_save_ifs
done
: ${lt_cv_path_NM=no}
-fi
+fi ;;
+esac
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
printf "%s\n" "$lt_cv_path_NM" >&6; }
@@ -5274,8 +5752,8 @@ printf %s "checking for $ac_word... " >&6; }
if test ${ac_cv_prog_DUMPBIN+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- if test -n "$DUMPBIN"; then
+else case e in #(
+ e) if test -n "$DUMPBIN"; then
ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -5297,7 +5775,8 @@ done
done
IFS=$as_save_IFS
-fi
+fi ;;
+esac
fi
DUMPBIN=$ac_cv_prog_DUMPBIN
if test -n "$DUMPBIN"; then
@@ -5323,8 +5802,8 @@ printf %s "checking for $ac_word... " >&6; }
if test ${ac_cv_prog_ac_ct_DUMPBIN+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- if test -n "$ac_ct_DUMPBIN"; then
+else case e in #(
+ e) if test -n "$ac_ct_DUMPBIN"; then
ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -5346,7 +5825,8 @@ done
done
IFS=$as_save_IFS
-fi
+fi ;;
+esac
fi
ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN
if test -n "$ac_ct_DUMPBIN"; then
@@ -5400,8 +5880,8 @@ printf %s "checking the name lister ($NM) interface... " >&6; }
if test ${lt_cv_nm_interface+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- lt_cv_nm_interface="BSD nm"
+else case e in #(
+ e) lt_cv_nm_interface="BSD nm"
echo "int some_variable = 0;" > conftest.$ac_ext
(eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5)
(eval "$ac_compile" 2>conftest.err)
@@ -5414,7 +5894,8 @@ else $as_nop
if $GREP 'External.*some_variable' conftest.out > /dev/null; then
lt_cv_nm_interface="MS dumpbin"
fi
- rm -f conftest*
+ rm -f conftest* ;;
+esac
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5
printf "%s\n" "$lt_cv_nm_interface" >&6; }
@@ -5436,8 +5917,8 @@ printf %s "checking the maximum length of command line arguments... " >&6; }
if test ${lt_cv_sys_max_cmd_len+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- i=0
+else case e in #(
+ e) i=0
teststring=ABCD
case $build_os in
@@ -5449,14 +5930,14 @@ else $as_nop
lt_cv_sys_max_cmd_len=12288; # 12K is about right
;;
- gnu*)
- # Under GNU Hurd, this test is not required because there is
- # no limit to the length of command line arguments.
+ gnu* | ironclad*)
+ # Under GNU Hurd and Ironclad, this test is not required because there
+ # is no limit to the length of command line arguments.
# Libtool will interpret -1 as no limit whatsoever
lt_cv_sys_max_cmd_len=-1;
;;
- cygwin* | mingw* | cegcc*)
+ cygwin* | mingw* | windows* | cegcc*)
# On Win9x/ME, this test blows up -- it succeeds, but takes
# about 5 minutes as the teststring grows exponentially.
# Worse, since 9x/ME are not pre-emptively multitasking,
@@ -5478,7 +5959,7 @@ else $as_nop
lt_cv_sys_max_cmd_len=8192;
;;
- bitrig* | darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*)
+ darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*)
# This has been around since 386BSD, at least. Likely further.
if test -x /sbin/sysctl; then
lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
@@ -5559,7 +6040,8 @@ else $as_nop
fi
;;
esac
-
+ ;;
+esac
fi
if test -n "$lt_cv_sys_max_cmd_len"; then
@@ -5616,11 +6098,11 @@ printf %s "checking how to convert $build file names to $host format... " >&6; }
if test ${lt_cv_to_host_file_cmd+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- case $host in
+else case e in #(
+ e) case $host in
*-*-mingw* )
case $build in
- *-*-mingw* ) # actually msys
+ *-*-mingw* | *-*-windows* ) # actually msys
lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
;;
*-*-cygwin* )
@@ -5633,7 +6115,7 @@ else $as_nop
;;
*-*-cygwin* )
case $build in
- *-*-mingw* ) # actually msys
+ *-*-mingw* | *-*-windows* ) # actually msys
lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
;;
*-*-cygwin* )
@@ -5648,7 +6130,8 @@ else $as_nop
lt_cv_to_host_file_cmd=func_convert_file_noop
;;
esac
-
+ ;;
+esac
fi
to_host_file_cmd=$lt_cv_to_host_file_cmd
@@ -5664,19 +6147,20 @@ printf %s "checking how to convert $build file names to toolchain format... " >&
if test ${lt_cv_to_tool_file_cmd+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- #assume ordinary cross tools, or native build.
+else case e in #(
+ e) #assume ordinary cross tools, or native build.
lt_cv_to_tool_file_cmd=func_convert_file_noop
case $host in
- *-*-mingw* )
+ *-*-mingw* | *-*-windows* )
case $build in
- *-*-mingw* ) # actually msys
+ *-*-mingw* | *-*-windows* ) # actually msys
lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
;;
esac
;;
esac
-
+ ;;
+esac
fi
to_tool_file_cmd=$lt_cv_to_tool_file_cmd
@@ -5692,8 +6176,9 @@ printf %s "checking for $LD option to reload object files... " >&6; }
if test ${lt_cv_ld_reload_flag+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- lt_cv_ld_reload_flag='-r'
+else case e in #(
+ e) lt_cv_ld_reload_flag='-r' ;;
+esac
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5
printf "%s\n" "$lt_cv_ld_reload_flag" >&6; }
@@ -5704,7 +6189,7 @@ case $reload_flag in
esac
reload_cmds='$LD$reload_flag -o $output$reload_objs'
case $host_os in
- cygwin* | mingw* | pw32* | cegcc*)
+ cygwin* | mingw* | windows* | pw32* | cegcc*)
if test yes != "$GCC"; then
reload_cmds=false
fi
@@ -5726,16 +6211,15 @@ esac
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}file", so it can be a program name with args.
-set dummy ${ac_tool_prefix}file; ac_word=$2
+# Extract the first word of "file", so it can be a program name with args.
+set dummy file; 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_FILECMD+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- if test -n "$FILECMD"; then
+else case e in #(
+ e) if test -n "$FILECMD"; then
ac_cv_prog_FILECMD="$FILECMD" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -5749,7 +6233,7 @@ do
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_FILECMD="${ac_tool_prefix}file"
+ ac_cv_prog_FILECMD="file"
printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
@@ -5757,7 +6241,9 @@ done
done
IFS=$as_save_IFS
-fi
+ test -z "$ac_cv_prog_FILECMD" && ac_cv_prog_FILECMD=":"
+fi ;;
+esac
fi
FILECMD=$ac_cv_prog_FILECMD
if test -n "$FILECMD"; then
@@ -5769,65 +6255,6 @@ printf "%s\n" "no" >&6; }
fi
-fi
-if test -z "$ac_cv_prog_FILECMD"; then
- ac_ct_FILECMD=$FILECMD
- # Extract the first word of "file", so it can be a program name with args.
-set dummy file; 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_FILECMD+y}
-then :
- printf %s "(cached) " >&6
-else $as_nop
- if test -n "$ac_ct_FILECMD"; then
- ac_cv_prog_ac_ct_FILECMD="$ac_ct_FILECMD" # 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_FILECMD="file"
- 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_FILECMD=$ac_cv_prog_ac_ct_FILECMD
-if test -n "$ac_ct_FILECMD"; then
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_FILECMD" >&5
-printf "%s\n" "$ac_ct_FILECMD" >&6; }
-else
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
-printf "%s\n" "no" >&6; }
-fi
-
- if test "x$ac_ct_FILECMD" = x; then
- FILECMD=":"
- 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
- FILECMD=$ac_ct_FILECMD
- fi
-else
- FILECMD="$ac_cv_prog_FILECMD"
-fi
-
@@ -5842,8 +6269,8 @@ printf %s "checking for $ac_word... " >&6; }
if test ${ac_cv_prog_OBJDUMP+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- if test -n "$OBJDUMP"; then
+else case e in #(
+ e) if test -n "$OBJDUMP"; then
ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -5865,7 +6292,8 @@ done
done
IFS=$as_save_IFS
-fi
+fi ;;
+esac
fi
OBJDUMP=$ac_cv_prog_OBJDUMP
if test -n "$OBJDUMP"; then
@@ -5887,8 +6315,8 @@ printf %s "checking for $ac_word... " >&6; }
if test ${ac_cv_prog_ac_ct_OBJDUMP+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- if test -n "$ac_ct_OBJDUMP"; then
+else case e in #(
+ e) if test -n "$ac_ct_OBJDUMP"; then
ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -5910,7 +6338,8 @@ done
done
IFS=$as_save_IFS
-fi
+fi ;;
+esac
fi
ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
if test -n "$ac_ct_OBJDUMP"; then
@@ -5951,8 +6380,8 @@ printf %s "checking how to recognize dependent libraries... " >&6; }
if test ${lt_cv_deplibs_check_method+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- lt_cv_file_magic_cmd='$MAGIC_CMD'
+else case e in #(
+ e) lt_cv_file_magic_cmd='$MAGIC_CMD'
lt_cv_file_magic_test_file=
lt_cv_deplibs_check_method='unknown'
# Need to set the preceding variable on all platforms that support
@@ -5960,7 +6389,6 @@ lt_cv_deplibs_check_method='unknown'
# 'none' -- dependencies not supported.
# 'unknown' -- same as none, but documents that we really don't know.
# 'pass_all' -- all dependencies passed with no checks.
-# 'test_compile' -- check by making test program.
# 'file_magic [[regex]]' -- check by looking for files in library path
# that responds to the $file_magic_cmd with a given extended regex.
# If you have 'file' or equivalent on your system and you're not sure
@@ -5987,7 +6415,7 @@ cygwin*)
lt_cv_file_magic_cmd='func_win32_libid'
;;
-mingw* | pw32*)
+mingw* | windows* | pw32*)
# Base MSYS/MinGW do not provide the 'file' command needed by
# func_win32_libid shell function, so use a weaker test based on 'objdump',
# unless we find 'file', for example because we are cross-compiling.
@@ -5996,7 +6424,7 @@ mingw* | pw32*)
lt_cv_file_magic_cmd='func_win32_libid'
else
# Keep this pattern in sync with the one in func_win32_libid.
- lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+ lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64|pe-aarch64)'
lt_cv_file_magic_cmd='$OBJDUMP -f'
fi
;;
@@ -6069,7 +6497,11 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
lt_cv_deplibs_check_method=pass_all
;;
-netbsd*)
+*-mlibc)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+netbsd* | netbsdelf*-gnu)
if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
else
@@ -6087,7 +6519,7 @@ newos6*)
lt_cv_deplibs_check_method=pass_all
;;
-openbsd* | bitrig*)
+openbsd*)
if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
else
@@ -6103,6 +6535,10 @@ rdos*)
lt_cv_deplibs_check_method=pass_all
;;
+serenity*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
solaris*)
lt_cv_deplibs_check_method=pass_all
;;
@@ -6145,7 +6581,8 @@ os2*)
lt_cv_deplibs_check_method=pass_all
;;
esac
-
+ ;;
+esac
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
printf "%s\n" "$lt_cv_deplibs_check_method" >&6; }
@@ -6154,7 +6591,7 @@ file_magic_glob=
want_nocaseglob=no
if test "$build" = "$host"; then
case $host_os in
- mingw* | pw32*)
+ mingw* | windows* | pw32*)
if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
want_nocaseglob=yes
else
@@ -6197,8 +6634,8 @@ printf %s "checking for $ac_word... " >&6; }
if test ${ac_cv_prog_DLLTOOL+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- if test -n "$DLLTOOL"; then
+else case e in #(
+ e) if test -n "$DLLTOOL"; then
ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -6220,7 +6657,8 @@ done
done
IFS=$as_save_IFS
-fi
+fi ;;
+esac
fi
DLLTOOL=$ac_cv_prog_DLLTOOL
if test -n "$DLLTOOL"; then
@@ -6242,8 +6680,8 @@ printf %s "checking for $ac_word... " >&6; }
if test ${ac_cv_prog_ac_ct_DLLTOOL+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- if test -n "$ac_ct_DLLTOOL"; then
+else case e in #(
+ e) if test -n "$ac_ct_DLLTOOL"; then
ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -6265,7 +6703,8 @@ done
done
IFS=$as_save_IFS
-fi
+fi ;;
+esac
fi
ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
if test -n "$ac_ct_DLLTOOL"; then
@@ -6307,11 +6746,11 @@ printf %s "checking how to associate runtime and link libraries... " >&6; }
if test ${lt_cv_sharedlib_from_linklib_cmd+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- lt_cv_sharedlib_from_linklib_cmd='unknown'
+else case e in #(
+ e) lt_cv_sharedlib_from_linklib_cmd='unknown'
case $host_os in
-cygwin* | mingw* | pw32* | cegcc*)
+cygwin* | mingw* | windows* | pw32* | cegcc*)
# two different shell functions defined in ltmain.sh;
# decide which one to use based on capabilities of $DLLTOOL
case `$DLLTOOL --help 2>&1` in
@@ -6328,7 +6767,8 @@ cygwin* | mingw* | pw32* | cegcc*)
lt_cv_sharedlib_from_linklib_cmd=$ECHO
;;
esac
-
+ ;;
+esac
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
printf "%s\n" "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
@@ -6343,18 +6783,16 @@ test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
if test -n "$ac_tool_prefix"; then
- for ac_prog in ar
- 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
+ # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; 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_AR+y}
+if test ${ac_cv_prog_RANLIB+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- if test -n "$AR"; then
- ac_cv_prog_AR="$AR" # Let the user override the test.
+else case e in #(
+ e) if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
@@ -6367,7 +6805,7 @@ do
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_AR="$ac_tool_prefix$ac_prog"
+ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
@@ -6375,35 +6813,32 @@ done
done
IFS=$as_save_IFS
+fi ;;
+esac
fi
-fi
-AR=$ac_cv_prog_AR
-if test -n "$AR"; then
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
-printf "%s\n" "$AR" >&6; }
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
+printf "%s\n" "$RANLIB" >&6; }
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
fi
- test -n "$AR" && break
- done
fi
-if test -z "$AR"; then
- ac_ct_AR=$AR
- for ac_prog in ar
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
+if test -z "$ac_cv_prog_RANLIB"; then
+ ac_ct_RANLIB=$RANLIB
+ # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; 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_AR+y}
+if test ${ac_cv_prog_ac_ct_RANLIB+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- if test -n "$ac_ct_AR"; then
- ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else case e in #(
+ e) if test -n "$ac_ct_RANLIB"; then
+ ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
@@ -6416,7 +6851,7 @@ do
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_AR="$ac_prog"
+ ac_cv_prog_ac_ct_RANLIB="ranlib"
printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
@@ -6424,11 +6859,122 @@ done
done
IFS=$as_save_IFS
+fi ;;
+esac
fi
-fi
-ac_ct_AR=$ac_cv_prog_ac_ct_AR
-if test -n "$ac_ct_AR"; then
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
+printf "%s\n" "$ac_ct_RANLIB" >&6; }
+else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+fi
+
+ if test "x$ac_ct_RANLIB" = x; then
+ RANLIB=":"
+ 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
+ RANLIB=$ac_ct_RANLIB
+ fi
+else
+ RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+if test -n "$ac_tool_prefix"; then
+ for ac_prog in ar
+ 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_AR+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) if test -n "$AR"; then
+ ac_cv_prog_AR="$AR" # 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_AR="$ac_tool_prefix$ac_prog"
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi ;;
+esac
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
+printf "%s\n" "$AR" >&6; }
+else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+fi
+
+
+ test -n "$AR" && break
+ done
+fi
+if test -z "$AR"; then
+ ac_ct_AR=$AR
+ for ac_prog in ar
+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_AR+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) if test -n "$ac_ct_AR"; then
+ ac_cv_prog_ac_ct_AR="$ac_ct_AR" # 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_AR="$ac_prog"
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi ;;
+esac
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
printf "%s\n" "$ac_ct_AR" >&6; }
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
@@ -6461,7 +7007,7 @@ fi
# Use ARFLAGS variable as AR's operation code to sync the variable naming with
# Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have
-# higher priority because thats what people were doing historically (setting
+# higher priority because that's what people were doing historically (setting
# ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS
# variable obsoleted/removed.
@@ -6486,8 +7032,8 @@ printf %s "checking for archiver @FILE support... " >&6; }
if test ${lt_cv_ar_at_file+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- lt_cv_ar_at_file=no
+else case e in #(
+ e) lt_cv_ar_at_file=no
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -6524,7 +7070,8 @@ then :
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
-
+ ;;
+esac
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
printf "%s\n" "$lt_cv_ar_at_file" >&6; }
@@ -6549,8 +7096,8 @@ 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
+else case e in #(
+ e) if test -n "$STRIP"; then
ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -6572,7 +7119,8 @@ done
done
IFS=$as_save_IFS
-fi
+fi ;;
+esac
fi
STRIP=$ac_cv_prog_STRIP
if test -n "$STRIP"; then
@@ -6594,8 +7142,8 @@ 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
+else case e in #(
+ e) 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
@@ -6617,7 +7165,8 @@ done
done
IFS=$as_save_IFS
-fi
+fi ;;
+esac
fi
ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
if test -n "$ac_ct_STRIP"; then
@@ -6650,107 +7199,6 @@ test -z "$STRIP" && STRIP=:
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ranlib; 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_RANLIB+y}
-then :
- printf %s "(cached) " >&6
-else $as_nop
- if test -n "$RANLIB"; then
- ac_cv_prog_RANLIB="$RANLIB" # 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_RANLIB="${ac_tool_prefix}ranlib"
- 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
-RANLIB=$ac_cv_prog_RANLIB
-if test -n "$RANLIB"; then
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
-printf "%s\n" "$RANLIB" >&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_RANLIB"; then
- ac_ct_RANLIB=$RANLIB
- # Extract the first word of "ranlib", so it can be a program name with args.
-set dummy ranlib; 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_RANLIB+y}
-then :
- printf %s "(cached) " >&6
-else $as_nop
- if test -n "$ac_ct_RANLIB"; then
- ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # 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_RANLIB="ranlib"
- 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_RANLIB=$ac_cv_prog_ac_ct_RANLIB
-if test -n "$ac_ct_RANLIB"; then
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
-printf "%s\n" "$ac_ct_RANLIB" >&6; }
-else
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
-printf "%s\n" "no" >&6; }
-fi
-
- if test "x$ac_ct_RANLIB" = x; then
- RANLIB=":"
- 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
- RANLIB=$ac_ct_RANLIB
- fi
-else
- RANLIB="$ac_cv_prog_RANLIB"
-fi
test -z "$RANLIB" && RANLIB=:
@@ -6765,15 +7213,8 @@ old_postinstall_cmds='chmod 644 $oldlib'
old_postuninstall_cmds=
if test -n "$RANLIB"; then
- case $host_os in
- bitrig* | openbsd*)
- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
- ;;
- *)
- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
- ;;
- esac
old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
fi
case $host_os in
@@ -6837,8 +7278,8 @@ printf %s "checking command to parse $NM output from $compiler object... " >&6;
if test ${lt_cv_sys_global_symbol_pipe+y}
then :
printf %s "(cached) " >&6
-else $as_nop
-
+else case e in #(
+ e)
# These are sane defaults that work on at least a few old systems.
# [They come from Ultrix. What could be older than Ultrix?!! ;)]
@@ -6853,7 +7294,7 @@ case $host_os in
aix*)
symcode='[BCDT]'
;;
-cygwin* | mingw* | pw32* | cegcc*)
+cygwin* | mingw* | windows* | pw32* | cegcc*)
symcode='[ABCDGISTW]'
;;
hpux*)
@@ -6868,7 +7309,7 @@ osf*)
symcode='[BCDEGQRST]'
;;
solaris*)
- symcode='[BDRT]'
+ symcode='[BCDRT]'
;;
sco3.2v5*)
symcode='[DT]'
@@ -6932,7 +7373,7 @@ $lt_c_name_lib_hook\
# Handle CRLF in mingw tool chain
opt_cr=
case $build_os in
-mingw*)
+mingw* | windows*)
opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
;;
esac
@@ -6983,7 +7424,7 @@ void nm_test_func(void){}
#ifdef __cplusplus
}
#endif
-int main(){nm_test_var='a';nm_test_func();return(0);}
+int main(void){nm_test_var='a';nm_test_func();return(0);}
_LT_EOF
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
@@ -6993,11 +7434,8 @@ _LT_EOF
test $ac_status = 0; }; then
# Now try to grab the symbols.
nlist=conftest.nm
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5
- (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5
- ac_status=$?
- printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && test -s "$nlist"; then
+ $ECHO "$as_me:$LINENO: $NM conftest.$ac_objext | $lt_cv_sys_global_symbol_pipe > $nlist" >&5
+ if eval "$NM" conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist 2>&5 && test -s "$nlist"; then
# Try sorting and uniquifying the output.
if sort "$nlist" | uniq > "$nlist"T; then
mv -f "$nlist"T "$nlist"
@@ -7093,7 +7531,8 @@ _LT_EOF
lt_cv_sys_global_symbol_pipe=
fi
done
-
+ ;;
+esac
fi
if test -z "$lt_cv_sys_global_symbol_pipe"; then
@@ -7157,8 +7596,9 @@ printf %s "checking for sysroot... " >&6; }
if test ${with_sysroot+y}
then :
withval=$with_sysroot;
-else $as_nop
- with_sysroot=no
+else case e in #(
+ e) with_sysroot=no ;;
+esac
fi
@@ -7166,7 +7606,9 @@ lt_sysroot=
case $with_sysroot in #(
yes)
if test yes = "$GCC"; then
- lt_sysroot=`$CC --print-sysroot 2>/dev/null`
+ # Trim trailing / since we'll always append absolute paths and we want
+ # to avoid //, if only for less confusing output for the user.
+ lt_sysroot=`$CC --print-sysroot 2>/dev/null | $SED 's:/\+$::'`
fi
;; #(
/*)
@@ -7193,8 +7635,8 @@ printf %s "checking for a working dd... " >&6; }
if test ${ac_cv_path_lt_DD+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- printf 0123456789abcdef0123456789abcdef >conftest.i
+else case e in #(
+ e) printf 0123456789abcdef0123456789abcdef >conftest.i
cat conftest.i conftest.i >conftest2.i
: ${lt_DD:=$DD}
if test -z "$lt_DD"; then
@@ -7230,7 +7672,8 @@ else
ac_cv_path_lt_DD=$lt_DD
fi
-rm -f conftest.i conftest2.i conftest.out
+rm -f conftest.i conftest2.i conftest.out ;;
+esac
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5
printf "%s\n" "$ac_cv_path_lt_DD" >&6; }
@@ -7241,8 +7684,8 @@ printf %s "checking how to truncate binary pipes... " >&6; }
if test ${lt_cv_truncate_bin+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- printf 0123456789abcdef0123456789abcdef >conftest.i
+else case e in #(
+ e) printf 0123456789abcdef0123456789abcdef >conftest.i
cat conftest.i conftest.i >conftest2.i
lt_cv_truncate_bin=
if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then
@@ -7250,7 +7693,8 @@ if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; the
&& lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1"
fi
rm -f conftest.i conftest2.i conftest.out
-test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"
+test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" ;;
+esac
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5
printf "%s\n" "$lt_cv_truncate_bin" >&6; }
@@ -7381,7 +7825,7 @@ mips64*-*linux*)
;;
x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
-s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
+s390*-*linux*|s390*-*tpf*|sparc*-*linux*|x86_64-gnu*)
# Find out what ABI is being produced by ac_compile, and set linker
# options accordingly. Note that the listed cases only cover the
# situations where additional linker options are needed (such as when
@@ -7400,7 +7844,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
x86_64-*kfreebsd*-gnu)
LD="${LD-ld} -m elf_i386_fbsd"
;;
- x86_64-*linux*)
+ x86_64-*linux*|x86_64-gnu*)
case `$FILECMD conftest.o` in
*x86-64*)
LD="${LD-ld} -m elf32_x86_64"
@@ -7429,7 +7873,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
x86_64-*kfreebsd*-gnu)
LD="${LD-ld} -m elf_x86_64_fbsd"
;;
- x86_64-*linux*)
+ x86_64-*linux*|x86_64-gnu*)
LD="${LD-ld} -m elf_x86_64"
;;
powerpcle-*linux*)
@@ -7460,8 +7904,8 @@ printf %s "checking whether the C compiler needs -belf... " >&6; }
if test ${lt_cv_cc_needs_belf+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- ac_ext=c
+else case e in #(
+ e) 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'
@@ -7481,8 +7925,9 @@ _ACEOF
if ac_fn_c_try_link "$LINENO"
then :
lt_cv_cc_needs_belf=yes
-else $as_nop
- lt_cv_cc_needs_belf=no
+else case e in #(
+ e) lt_cv_cc_needs_belf=no ;;
+esac
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
@@ -7491,7 +7936,8 @@ 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
-
+ ;;
+esac
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5
printf "%s\n" "$lt_cv_cc_needs_belf" >&6; }
@@ -7549,8 +7995,8 @@ printf %s "checking for $ac_word... " >&6; }
if test ${ac_cv_prog_MANIFEST_TOOL+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- if test -n "$MANIFEST_TOOL"; then
+else case e in #(
+ e) if test -n "$MANIFEST_TOOL"; then
ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -7572,7 +8018,8 @@ done
done
IFS=$as_save_IFS
-fi
+fi ;;
+esac
fi
MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
if test -n "$MANIFEST_TOOL"; then
@@ -7594,8 +8041,8 @@ printf %s "checking for $ac_word... " >&6; }
if test ${ac_cv_prog_ac_ct_MANIFEST_TOOL+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- if test -n "$ac_ct_MANIFEST_TOOL"; then
+else case e in #(
+ e) if test -n "$ac_ct_MANIFEST_TOOL"; then
ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -7617,7 +8064,8 @@ done
done
IFS=$as_save_IFS
-fi
+fi ;;
+esac
fi
ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
if test -n "$ac_ct_MANIFEST_TOOL"; then
@@ -7646,22 +8094,23 @@ fi
test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
printf %s "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
-if test ${lt_cv_path_mainfest_tool+y}
+if test ${lt_cv_path_manifest_tool+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- lt_cv_path_mainfest_tool=no
+else case e in #(
+ e) lt_cv_path_manifest_tool=no
echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
$MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
cat conftest.err >&5
if $GREP 'Manifest Tool' conftest.out > /dev/null; then
- lt_cv_path_mainfest_tool=yes
+ lt_cv_path_manifest_tool=yes
fi
- rm -f conftest*
+ rm -f conftest* ;;
+esac
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
-printf "%s\n" "$lt_cv_path_mainfest_tool" >&6; }
-if test yes != "$lt_cv_path_mainfest_tool"; then
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_manifest_tool" >&5
+printf "%s\n" "$lt_cv_path_manifest_tool" >&6; }
+if test yes != "$lt_cv_path_manifest_tool"; then
MANIFEST_TOOL=:
fi
@@ -7680,8 +8129,8 @@ printf %s "checking for $ac_word... " >&6; }
if test ${ac_cv_prog_DSYMUTIL+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- if test -n "$DSYMUTIL"; then
+else case e in #(
+ e) if test -n "$DSYMUTIL"; then
ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -7703,7 +8152,8 @@ done
done
IFS=$as_save_IFS
-fi
+fi ;;
+esac
fi
DSYMUTIL=$ac_cv_prog_DSYMUTIL
if test -n "$DSYMUTIL"; then
@@ -7725,8 +8175,8 @@ printf %s "checking for $ac_word... " >&6; }
if test ${ac_cv_prog_ac_ct_DSYMUTIL+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- if test -n "$ac_ct_DSYMUTIL"; then
+else case e in #(
+ e) if test -n "$ac_ct_DSYMUTIL"; then
ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -7748,7 +8198,8 @@ done
done
IFS=$as_save_IFS
-fi
+fi ;;
+esac
fi
ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
if test -n "$ac_ct_DSYMUTIL"; then
@@ -7782,8 +8233,8 @@ printf %s "checking for $ac_word... " >&6; }
if test ${ac_cv_prog_NMEDIT+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- if test -n "$NMEDIT"; then
+else case e in #(
+ e) if test -n "$NMEDIT"; then
ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -7805,7 +8256,8 @@ done
done
IFS=$as_save_IFS
-fi
+fi ;;
+esac
fi
NMEDIT=$ac_cv_prog_NMEDIT
if test -n "$NMEDIT"; then
@@ -7827,8 +8279,8 @@ printf %s "checking for $ac_word... " >&6; }
if test ${ac_cv_prog_ac_ct_NMEDIT+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- if test -n "$ac_ct_NMEDIT"; then
+else case e in #(
+ e) if test -n "$ac_ct_NMEDIT"; then
ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -7850,7 +8302,8 @@ done
done
IFS=$as_save_IFS
-fi
+fi ;;
+esac
fi
ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT
if test -n "$ac_ct_NMEDIT"; then
@@ -7884,8 +8337,8 @@ printf %s "checking for $ac_word... " >&6; }
if test ${ac_cv_prog_LIPO+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- if test -n "$LIPO"; then
+else case e in #(
+ e) if test -n "$LIPO"; then
ac_cv_prog_LIPO="$LIPO" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -7907,7 +8360,8 @@ done
done
IFS=$as_save_IFS
-fi
+fi ;;
+esac
fi
LIPO=$ac_cv_prog_LIPO
if test -n "$LIPO"; then
@@ -7929,8 +8383,8 @@ printf %s "checking for $ac_word... " >&6; }
if test ${ac_cv_prog_ac_ct_LIPO+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- if test -n "$ac_ct_LIPO"; then
+else case e in #(
+ e) if test -n "$ac_ct_LIPO"; then
ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -7952,7 +8406,8 @@ done
done
IFS=$as_save_IFS
-fi
+fi ;;
+esac
fi
ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO
if test -n "$ac_ct_LIPO"; then
@@ -7986,8 +8441,8 @@ printf %s "checking for $ac_word... " >&6; }
if test ${ac_cv_prog_OTOOL+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- if test -n "$OTOOL"; then
+else case e in #(
+ e) if test -n "$OTOOL"; then
ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -8009,7 +8464,8 @@ done
done
IFS=$as_save_IFS
-fi
+fi ;;
+esac
fi
OTOOL=$ac_cv_prog_OTOOL
if test -n "$OTOOL"; then
@@ -8031,8 +8487,8 @@ printf %s "checking for $ac_word... " >&6; }
if test ${ac_cv_prog_ac_ct_OTOOL+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- if test -n "$ac_ct_OTOOL"; then
+else case e in #(
+ e) if test -n "$ac_ct_OTOOL"; then
ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -8054,7 +8510,8 @@ done
done
IFS=$as_save_IFS
-fi
+fi ;;
+esac
fi
ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL
if test -n "$ac_ct_OTOOL"; then
@@ -8088,8 +8545,8 @@ printf %s "checking for $ac_word... " >&6; }
if test ${ac_cv_prog_OTOOL64+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- if test -n "$OTOOL64"; then
+else case e in #(
+ e) if test -n "$OTOOL64"; then
ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -8111,7 +8568,8 @@ done
done
IFS=$as_save_IFS
-fi
+fi ;;
+esac
fi
OTOOL64=$ac_cv_prog_OTOOL64
if test -n "$OTOOL64"; then
@@ -8133,8 +8591,8 @@ printf %s "checking for $ac_word... " >&6; }
if test ${ac_cv_prog_ac_ct_OTOOL64+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- if test -n "$ac_ct_OTOOL64"; then
+else case e in #(
+ e) if test -n "$ac_ct_OTOOL64"; then
ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -8156,7 +8614,8 @@ done
done
IFS=$as_save_IFS
-fi
+fi ;;
+esac
fi
ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64
if test -n "$ac_ct_OTOOL64"; then
@@ -8213,8 +8672,8 @@ printf %s "checking for -single_module linker flag... " >&6; }
if test ${lt_cv_apple_cc_single_mod+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- lt_cv_apple_cc_single_mod=no
+else case e in #(
+ e) lt_cv_apple_cc_single_mod=no
if test -z "$LT_MULTI_MODULE"; then
# By default we will add the -single_module flag. You can override
# by either setting the environment variable LT_MULTI_MODULE
@@ -8240,18 +8699,58 @@ else $as_nop
fi
rm -rf libconftest.dylib*
rm -f conftest.*
- fi
+ fi ;;
+esac
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5
printf "%s\n" "$lt_cv_apple_cc_single_mod" >&6; }
+ # Feature test to disable chained fixups since it is not
+ # compatible with '-undefined dynamic_lookup'
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -no_fixup_chains linker flag" >&5
+printf %s "checking for -no_fixup_chains linker flag... " >&6; }
+if test ${lt_cv_support_no_fixup_chains+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) save_LDFLAGS=$LDFLAGS
+ LDFLAGS="$LDFLAGS -Wl,-no_fixup_chains"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+ lt_cv_support_no_fixup_chains=yes
+else case e in #(
+ e) lt_cv_support_no_fixup_chains=no
+ ;;
+esac
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS=$save_LDFLAGS
+
+ ;;
+esac
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_support_no_fixup_chains" >&5
+printf "%s\n" "$lt_cv_support_no_fixup_chains" >&6; }
+
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5
printf %s "checking for -exported_symbols_list linker flag... " >&6; }
if test ${lt_cv_ld_exported_symbols_list+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- lt_cv_ld_exported_symbols_list=no
+else case e in #(
+ e) lt_cv_ld_exported_symbols_list=no
save_LDFLAGS=$LDFLAGS
echo "_main" > conftest.sym
LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
@@ -8269,13 +8768,15 @@ _ACEOF
if ac_fn_c_try_link "$LINENO"
then :
lt_cv_ld_exported_symbols_list=yes
-else $as_nop
- lt_cv_ld_exported_symbols_list=no
+else case e in #(
+ e) lt_cv_ld_exported_symbols_list=no ;;
+esac
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
LDFLAGS=$save_LDFLAGS
-
+ ;;
+esac
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
printf "%s\n" "$lt_cv_ld_exported_symbols_list" >&6; }
@@ -8285,8 +8786,8 @@ printf %s "checking for -force_load linker flag... " >&6; }
if test ${lt_cv_ld_force_load+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- lt_cv_ld_force_load=no
+else case e in #(
+ e) lt_cv_ld_force_load=no
cat > conftest.c << _LT_EOF
int forced_loaded() { return 2;}
_LT_EOF
@@ -8297,7 +8798,7 @@ _LT_EOF
echo "$RANLIB libconftest.a" >&5
$RANLIB libconftest.a 2>&5
cat > conftest.c << _LT_EOF
-int main() { return 0;}
+int main(void) { return 0;}
_LT_EOF
echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5
$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
@@ -8311,7 +8812,8 @@ _LT_EOF
fi
rm -f conftest.err libconftest.a conftest conftest.c
rm -rf conftest.dSYM
-
+ ;;
+esac
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5
printf "%s\n" "$lt_cv_ld_force_load" >&6; }
@@ -8325,13 +8827,32 @@ printf "%s\n" "$lt_cv_ld_force_load" >&6; }
10.[012],*|,*powerpc*-darwin[5-8]*)
_lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
*)
- _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
+ _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup'
+ if test yes = "$lt_cv_support_no_fixup_chains"; then
+ as_fn_append _lt_dar_allow_undefined ' $wl-no_fixup_chains'
+ fi
+ ;;
esac
;;
esac
if test yes = "$lt_cv_apple_cc_single_mod"; then
_lt_dar_single_mod='$single_module'
fi
+ _lt_dar_needs_single_mod=no
+ case $host_os in
+ rhapsody* | darwin1.*)
+ _lt_dar_needs_single_mod=yes ;;
+ darwin*)
+ # When targeting Mac OS X 10.4 (darwin 8) or later,
+ # -single_module is the default and -multi_module is unsupported.
+ # The toolchain on macOS 10.14 (darwin 18) and later cannot
+ # target any OS version that needs -single_module.
+ case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+ 10.0,*-darwin[567].*|10.[0-3],*-darwin[5-9].*|10.[0-3],*-darwin1[0-7].*)
+ _lt_dar_needs_single_mod=yes ;;
+ esac
+ ;;
+ esac
if test yes = "$lt_cv_ld_exported_symbols_list"; then
_lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'
else
@@ -8451,8 +8972,9 @@ then :
IFS=$lt_save_ifs
;;
esac
-else $as_nop
- enable_shared=yes
+else case e in #(
+ e) enable_shared=yes ;;
+esac
fi
@@ -8483,8 +9005,9 @@ then :
IFS=$lt_save_ifs
;;
esac
-else $as_nop
- enable_static=yes
+else case e in #(
+ e) enable_static=yes ;;
+esac
fi
@@ -8495,28 +9018,52 @@ fi
-
-# Check whether --with-pic was given.
+ # Check whether --enable-pic was given.
+if test ${enable_pic+y}
+then :
+ enableval=$enable_pic; lt_p=${PACKAGE-default}
+ case $enableval in
+ yes|no) pic_mode=$enableval ;;
+ *)
+ pic_mode=default
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
+ for lt_pkg in $enableval; do
+ IFS=$lt_save_ifs
+ if test "X$lt_pkg" = "X$lt_p"; then
+ pic_mode=yes
+ fi
+ done
+ IFS=$lt_save_ifs
+ ;;
+ esac
+else case e in #(
+ e) # Check whether --with-pic was given.
if test ${with_pic+y}
then :
withval=$with_pic; lt_p=${PACKAGE-default}
- case $withval in
- yes|no) pic_mode=$withval ;;
- *)
- pic_mode=default
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
- for lt_pkg in $withval; do
- IFS=$lt_save_ifs
- if test "X$lt_pkg" = "X$lt_p"; then
- pic_mode=yes
- fi
- done
- IFS=$lt_save_ifs
- ;;
- esac
-else $as_nop
- pic_mode=default
+ case $withval in
+ yes|no) pic_mode=$withval ;;
+ *)
+ pic_mode=default
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
+ for lt_pkg in $withval; do
+ IFS=$lt_save_ifs
+ if test "X$lt_pkg" = "X$lt_p"; then
+ pic_mode=yes
+ fi
+ done
+ IFS=$lt_save_ifs
+ ;;
+ esac
+else case e in #(
+ e) pic_mode=default ;;
+esac
+fi
+
+ ;;
+esac
fi
@@ -8546,8 +9093,9 @@ then :
IFS=$lt_save_ifs
;;
esac
-else $as_nop
- enable_fast_install=yes
+else case e in #(
+ e) enable_fast_install=yes ;;
+esac
fi
@@ -8562,29 +9110,46 @@ case $host,$enable_shared in
power*-*-aix[5-9]*,yes)
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5
printf %s "checking which variant of shared library versioning to provide... " >&6; }
-
-# Check whether --with-aix-soname was given.
+ # Check whether --enable-aix-soname was given.
+if test ${enable_aix_soname+y}
+then :
+ enableval=$enable_aix_soname; case $enableval in
+ aix|svr4|both)
+ ;;
+ *)
+ as_fn_error $? "Unknown argument to --enable-aix-soname" "$LINENO" 5
+ ;;
+ esac
+ lt_cv_with_aix_soname=$enable_aix_soname
+else case e in #(
+ e) # Check whether --with-aix-soname was given.
if test ${with_aix_soname+y}
then :
withval=$with_aix_soname; case $withval in
- aix|svr4|both)
- ;;
- *)
- as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5
- ;;
- esac
- lt_cv_with_aix_soname=$with_aix_soname
-else $as_nop
- if test ${lt_cv_with_aix_soname+y}
+ aix|svr4|both)
+ ;;
+ *)
+ as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5
+ ;;
+ esac
+ lt_cv_with_aix_soname=$with_aix_soname
+else case e in #(
+ e) if test ${lt_cv_with_aix_soname+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- lt_cv_with_aix_soname=aix
+else case e in #(
+ e) lt_cv_with_aix_soname=aix ;;
+esac
+fi
+ ;;
+esac
fi
- with_aix_soname=$lt_cv_with_aix_soname
+ enable_aix_soname=$lt_cv_with_aix_soname ;;
+esac
fi
+ with_aix_soname=$enable_aix_soname
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5
printf "%s\n" "$with_aix_soname" >&6; }
if test aix != "$with_aix_soname"; then
@@ -8673,8 +9238,8 @@ printf %s "checking for objdir... " >&6; }
if test ${lt_cv_objdir+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- rm -f .libs 2>/dev/null
+else case e in #(
+ e) rm -f .libs 2>/dev/null
mkdir .libs 2>/dev/null
if test -d .libs; then
lt_cv_objdir=.libs
@@ -8682,7 +9247,8 @@ else
# MS-DOS does not allow filenames that begin with a dot.
lt_cv_objdir=_libs
fi
-rmdir .libs 2>/dev/null
+rmdir .libs 2>/dev/null ;;
+esac
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5
printf "%s\n" "$lt_cv_objdir" >&6; }
@@ -8743,8 +9309,8 @@ printf %s "checking for ${ac_tool_prefix}file... " >&6; }
if test ${lt_cv_path_MAGIC_CMD+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- case $MAGIC_CMD in
+else case e in #(
+ e) case $MAGIC_CMD in
[\\/*] | ?:[\\/]*)
lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
;;
@@ -8787,6 +9353,7 @@ _LT_EOF
IFS=$lt_save_ifs
MAGIC_CMD=$lt_save_MAGIC_CMD
;;
+esac ;;
esac
fi
@@ -8810,8 +9377,8 @@ printf %s "checking for file... " >&6; }
if test ${lt_cv_path_MAGIC_CMD+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- case $MAGIC_CMD in
+else case e in #(
+ e) case $MAGIC_CMD in
[\\/*] | ?:[\\/]*)
lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
;;
@@ -8854,6 +9421,7 @@ _LT_EOF
IFS=$lt_save_ifs
MAGIC_CMD=$lt_save_MAGIC_CMD
;;
+esac ;;
esac
fi
@@ -8897,7 +9465,7 @@ objext=$objext
lt_simple_compile_test_code="int some_variable = 0;"
# Code to be used in simple link tests
-lt_simple_link_test_code='int main(){return(0);}'
+lt_simple_link_test_code='int main(void){return(0);}'
@@ -8949,8 +9517,8 @@ printf %s "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
if test ${lt_cv_prog_compiler_rtti_exceptions+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- lt_cv_prog_compiler_rtti_exceptions=no
+else case e in #(
+ e) lt_cv_prog_compiler_rtti_exceptions=no
ac_outfile=conftest.$ac_objext
echo "$lt_simple_compile_test_code" > conftest.$ac_ext
lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment
@@ -8978,7 +9546,8 @@ else $as_nop
fi
fi
$RM conftest*
-
+ ;;
+esac
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
printf "%s\n" "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
@@ -9034,7 +9603,7 @@ lt_prog_compiler_static=
# PIC is the default for these OSes.
;;
- mingw* | cygwin* | pw32* | os2* | cegcc*)
+ mingw* | windows* | cygwin* | pw32* | os2* | cegcc*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
# Although the cygwin gcc ignores -fPIC, still need this for old-style
@@ -9137,7 +9706,7 @@ lt_prog_compiler_static=
esac
;;
- mingw* | cygwin* | pw32* | os2* | cegcc*)
+ mingw* | windows* | cygwin* | pw32* | os2* | cegcc*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
lt_prog_compiler_pic='-DDLL_EXPORT'
@@ -9178,6 +9747,12 @@ lt_prog_compiler_static=
lt_prog_compiler_pic='-KPIC'
lt_prog_compiler_static='-static'
;;
+ *flang* | ftn | f18* | f95*)
+ # Flang compiler.
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fPIC'
+ lt_prog_compiler_static='-static'
+ ;;
# icc used to be incompatible with GCC.
# ICC 10 doesn't accept -KPIC any more.
icc* | ifort*)
@@ -9260,6 +9835,12 @@ lt_prog_compiler_static=
lt_prog_compiler_static='-Bstatic'
;;
+ *-mlibc)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+
*nto* | *qnx*)
# QNX uses GNU C++, but need to define -shared option too, otherwise
# it will coredump.
@@ -9276,6 +9857,9 @@ lt_prog_compiler_static=
lt_prog_compiler_static='-non_shared'
;;
+ serenity*)
+ ;;
+
solaris*)
lt_prog_compiler_pic='-KPIC'
lt_prog_compiler_static='-Bstatic'
@@ -9343,8 +9927,9 @@ printf %s "checking for $compiler option to produce PIC... " >&6; }
if test ${lt_cv_prog_compiler_pic+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
+else case e in #(
+ e) lt_cv_prog_compiler_pic=$lt_prog_compiler_pic ;;
+esac
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
printf "%s\n" "$lt_cv_prog_compiler_pic" >&6; }
@@ -9359,8 +9944,8 @@ printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6;
if test ${lt_cv_prog_compiler_pic_works+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- lt_cv_prog_compiler_pic_works=no
+else case e in #(
+ e) lt_cv_prog_compiler_pic_works=no
ac_outfile=conftest.$ac_objext
echo "$lt_simple_compile_test_code" > conftest.$ac_ext
lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment
@@ -9388,7 +9973,8 @@ else $as_nop
fi
fi
$RM conftest*
-
+ ;;
+esac
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5
printf "%s\n" "$lt_cv_prog_compiler_pic_works" >&6; }
@@ -9424,8 +10010,8 @@ printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6;
if test ${lt_cv_prog_compiler_static_works+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- lt_cv_prog_compiler_static_works=no
+else case e in #(
+ e) lt_cv_prog_compiler_static_works=no
save_LDFLAGS=$LDFLAGS
LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
echo "$lt_simple_link_test_code" > conftest.$ac_ext
@@ -9446,7 +10032,8 @@ else $as_nop
fi
$RM -r conftest*
LDFLAGS=$save_LDFLAGS
-
+ ;;
+esac
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5
printf "%s\n" "$lt_cv_prog_compiler_static_works" >&6; }
@@ -9468,8 +10055,8 @@ printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
if test ${lt_cv_prog_compiler_c_o+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- lt_cv_prog_compiler_c_o=no
+else case e in #(
+ e) lt_cv_prog_compiler_c_o=no
$RM -r conftest 2>/dev/null
mkdir conftest
cd conftest
@@ -9509,7 +10096,8 @@ else $as_nop
cd ..
$RM -r conftest
$RM conftest*
-
+ ;;
+esac
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; }
@@ -9524,8 +10112,8 @@ printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
if test ${lt_cv_prog_compiler_c_o+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- lt_cv_prog_compiler_c_o=no
+else case e in #(
+ e) lt_cv_prog_compiler_c_o=no
$RM -r conftest 2>/dev/null
mkdir conftest
cd conftest
@@ -9565,7 +10153,8 @@ else $as_nop
cd ..
$RM -r conftest
$RM conftest*
-
+ ;;
+esac
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; }
@@ -9644,7 +10233,7 @@ printf %s "checking whether the $compiler linker ($LD) supports shared libraries
extract_expsyms_cmds=
case $host_os in
- cygwin* | mingw* | pw32* | cegcc*)
+ cygwin* | mingw* | windows* | pw32* | cegcc*)
# FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++ or Intel C++ Compiler.
@@ -9656,9 +10245,6 @@ printf %s "checking whether the $compiler linker ($LD) supports shared libraries
# we just hope/assume this is gcc and not c89 (= MSVC++ or ICC)
with_gnu_ld=yes
;;
- openbsd* | bitrig*)
- with_gnu_ld=no
- ;;
esac
ld_shlibs=yes
@@ -9759,7 +10345,7 @@ _LT_EOF
fi
;;
- cygwin* | mingw* | pw32* | cegcc*)
+ cygwin* | mingw* | windows* | pw32* | cegcc*)
# _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
# as there is no search path for DLLs.
hardcode_libdir_flag_spec='-L$libdir'
@@ -9769,6 +10355,7 @@ _LT_EOF
enable_shared_with_static_runtimes=yes
export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
+ file_list_spec='@'
if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
@@ -9788,7 +10375,7 @@ _LT_EOF
haiku*)
archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
- link_all_deplibs=yes
+ link_all_deplibs=no
;;
os2*)
@@ -9815,7 +10402,7 @@ _LT_EOF
cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
emximp -o $lib $output_objdir/$libname.def'
- old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+ old_archive_from_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
enable_shared_with_static_runtimes=yes
file_list_spec='@'
;;
@@ -9894,6 +10481,7 @@ _LT_EOF
case $cc_basename in
tcc*)
+ hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
export_dynamic_flag_spec='-rdynamic'
;;
xlf* | bgf* | bgxlf* | mpixlf*)
@@ -9914,7 +10502,12 @@ _LT_EOF
fi
;;
- netbsd*)
+ *-mlibc)
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+
+ netbsd* | netbsdelf*-gnu)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
wlarc=
@@ -10160,8 +10753,8 @@ else
if test ${lt_cv_aix_libpath_+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+else case e in #(
+ e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
@@ -10193,7 +10786,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \
if test -z "$lt_cv_aix_libpath_"; then
lt_cv_aix_libpath_=/usr/lib:/lib
fi
-
+ ;;
+esac
fi
aix_libpath=$lt_cv_aix_libpath_
@@ -10215,8 +10809,8 @@ else
if test ${lt_cv_aix_libpath_+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+else case e in #(
+ e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
@@ -10248,7 +10842,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \
if test -z "$lt_cv_aix_libpath_"; then
lt_cv_aix_libpath_=/usr/lib:/lib
fi
-
+ ;;
+esac
fi
aix_libpath=$lt_cv_aix_libpath_
@@ -10304,7 +10899,7 @@ fi
export_dynamic_flag_spec=-rdynamic
;;
- cygwin* | mingw* | pw32* | cegcc*)
+ cygwin* | mingw* | windows* | pw32* | cegcc*)
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++ or Intel C++ Compiler.
# hardcode_libdir_flag_spec is actually meaningless, as there is
@@ -10321,14 +10916,14 @@ fi
# Tell ltmain to make .dll files, not .so files.
shrext_cmds=.dll
# FIXME: Setting linknames here is a bad hack.
- archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
+ archive_cmds='$CC -Fe$output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then
cp "$export_symbols" "$output_objdir/$soname.def";
echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
else
$SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
fi~
- $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+ $CC -Fe$tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
linknames='
# The linker will not automatically build a static lib if we build a DLL.
# _LT_TAGVAR(old_archive_from_new_cmds, )='true'
@@ -10499,8 +11094,8 @@ printf %s "checking if $CC understands -b... " >&6; }
if test ${lt_cv_prog_compiler__b+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- lt_cv_prog_compiler__b=no
+else case e in #(
+ e) lt_cv_prog_compiler__b=no
save_LDFLAGS=$LDFLAGS
LDFLAGS="$LDFLAGS -b"
echo "$lt_simple_link_test_code" > conftest.$ac_ext
@@ -10521,7 +11116,8 @@ else $as_nop
fi
$RM -r conftest*
LDFLAGS=$save_LDFLAGS
-
+ ;;
+esac
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5
printf "%s\n" "$lt_cv_prog_compiler__b" >&6; }
@@ -10569,8 +11165,8 @@ printf %s "checking whether the $host_os linker accepts -exported_symbol... " >&
if test ${lt_cv_irix_exported_symbol+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- save_LDFLAGS=$LDFLAGS
+else case e in #(
+ e) save_LDFLAGS=$LDFLAGS
LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -10579,12 +11175,14 @@ _ACEOF
if ac_fn_c_try_link "$LINENO"
then :
lt_cv_irix_exported_symbol=yes
-else $as_nop
- lt_cv_irix_exported_symbol=no
+else case e in #(
+ e) lt_cv_irix_exported_symbol=no ;;
+esac
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
- LDFLAGS=$save_LDFLAGS
+ LDFLAGS=$save_LDFLAGS ;;
+esac
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
printf "%s\n" "$lt_cv_irix_exported_symbol" >&6; }
@@ -10608,11 +11206,15 @@ printf "%s\n" "$lt_cv_irix_exported_symbol" >&6; }
# Fabrice Bellard et al's Tiny C Compiler
ld_shlibs=yes
archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
;;
esac
;;
- netbsd*)
+ *-mlibc)
+ ;;
+
+ netbsd* | netbsdelf*-gnu)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
else
@@ -10634,7 +11236,7 @@ printf "%s\n" "$lt_cv_irix_exported_symbol" >&6; }
*nto* | *qnx*)
;;
- openbsd* | bitrig*)
+ openbsd*)
if test -f /usr/libexec/ld.so; then
hardcode_direct=yes
hardcode_shlibpath_var=no
@@ -10677,7 +11279,7 @@ printf "%s\n" "$lt_cv_irix_exported_symbol" >&6; }
cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
emximp -o $lib $output_objdir/$libname.def'
- old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+ old_archive_from_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
enable_shared_with_static_runtimes=yes
file_list_spec='@'
;;
@@ -10713,6 +11315,9 @@ printf "%s\n" "$lt_cv_irix_exported_symbol" >&6; }
hardcode_libdir_separator=:
;;
+ serenity*)
+ ;;
+
solaris*)
no_undefined_flag=' -z defs'
if test yes = "$GCC"; then
@@ -10910,8 +11515,8 @@ printf %s "checking whether -lc should be explicitly linked in... " >&6; }
if test ${lt_cv_archive_cmds_need_lc+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- $RM conftest*
+else case e in #(
+ e) $RM conftest*
echo "$lt_simple_compile_test_code" > conftest.$ac_ext
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
@@ -10947,7 +11552,8 @@ else $as_nop
cat conftest.err 1>&5
fi
$RM conftest*
-
+ ;;
+esac
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5
printf "%s\n" "$lt_cv_archive_cmds_need_lc" >&6; }
@@ -11118,7 +11724,7 @@ if test yes = "$GCC"; then
*) lt_awk_arg='/^libraries:/' ;;
esac
case $host_os in
- mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;;
+ mingw* | windows* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;;
*) lt_sed_strip_eq='s|=/|/|g' ;;
esac
lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
@@ -11176,7 +11782,7 @@ BEGIN {RS = " "; FS = "/|\n";} {
# AWK program above erroneously prepends '/' to C:/dos/paths
# for these hosts.
case $host_os in
- mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
+ mingw* | windows* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
$SED 's|/\([A-Za-z]:\)|\1|g'` ;;
esac
sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
@@ -11250,7 +11856,7 @@ aix[4-9]*)
# Unfortunately, runtime linking may impact performance, so we do
# not want this to be the default eventually. Also, we use the
# versioned .so libs for executables only if there is the -brtl
- # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
+ # linker flag in LDFLAGS as well, or --enable-aix-soname=svr4 only.
# To allow for filename-based versioning support, we need to create
# libNAME.so.V as an archive file, containing:
# *) an Import File, referring to the versioned filename of the
@@ -11344,7 +11950,7 @@ bsdi[45]*)
# libtool to hard-code these into programs
;;
-cygwin* | mingw* | pw32* | cegcc*)
+cygwin* | mingw* | windows* | pw32* | cegcc*)
version_type=windows
shrext_cmds=.dll
need_version=no
@@ -11355,15 +11961,29 @@ cygwin* | mingw* | pw32* | cegcc*)
# gcc
library_names_spec='$libname.dll.a'
# DLL is installed to $(libdir)/../bin by postinstall_cmds
- postinstall_cmds='base_file=`basename \$file`~
- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
- dldir=$destdir/`dirname \$dlpath`~
- test -d \$dldir || mkdir -p \$dldir~
- $install_prog $dir/$dlname \$dldir/$dlname~
- chmod a+x \$dldir/$dlname~
- if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
- eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
- fi'
+ # If user builds GCC with multilib enabled,
+ # it should just install on $(libdir)
+ # not on $(libdir)/../bin or 32 bits dlls would override 64 bit ones.
+ if test xyes = x"$multilib"; then
+ postinstall_cmds='base_file=`basename \$file`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ $install_prog $dir/$dlname $destdir/$dlname~
+ chmod a+x $destdir/$dlname~
+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+ eval '\''$striplib $destdir/$dlname'\'' || exit \$?;
+ fi'
+ else
+ postinstall_cmds='base_file=`basename \$file`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname~
+ chmod a+x \$dldir/$dlname~
+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+ eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+ fi'
+ fi
postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
dlpath=$dir/\$dldll~
$RM \$dlpath'
@@ -11376,7 +11996,7 @@ cygwin* | mingw* | pw32* | cegcc*)
sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"
;;
- mingw* | cegcc*)
+ mingw* | windows* | cegcc*)
# MinGW DLLs use traditional 'lib' prefix
soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
;;
@@ -11395,7 +12015,7 @@ cygwin* | mingw* | pw32* | cegcc*)
library_names_spec='$libname.dll.lib'
case $build_os in
- mingw*)
+ mingw* | windows*)
sys_lib_search_path_spec=
lt_save_ifs=$IFS
IFS=';'
@@ -11502,7 +12122,28 @@ freebsd* | dragonfly* | midnightbsd*)
need_version=yes
;;
esac
+ case $host_cpu in
+ powerpc64)
+ # On FreeBSD bi-arch platforms, a different variable is used for 32-bit
+ # binaries. See .
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int test_pointer_size[sizeof (void *) - 5];
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
shlibpath_var=LD_LIBRARY_PATH
+else case e in #(
+ e) shlibpath_var=LD_32_LIBRARY_PATH ;;
+esac
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+ ;;
+ *)
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+ esac
case $host_os in
freebsd2.*)
shlibpath_overrides_runpath=yes
@@ -11532,8 +12173,9 @@ haiku*)
soname_spec='$libname$release$shared_ext$major'
shlibpath_var=LIBRARY_PATH
shlibpath_overrides_runpath=no
- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
- hardcode_into_libs=yes
+ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib'
+ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib'
+ hardcode_into_libs=no
;;
hpux9* | hpux10* | hpux11*)
@@ -11643,7 +12285,7 @@ linux*android*)
version_type=none # Android doesn't support versioned libraries.
need_lib_prefix=no
need_version=no
- library_names_spec='$libname$release$shared_ext'
+ library_names_spec='$libname$release$shared_ext $libname$shared_ext'
soname_spec='$libname$release$shared_ext'
finish_cmds=
shlibpath_var=LD_LIBRARY_PATH
@@ -11655,8 +12297,9 @@ linux*android*)
hardcode_into_libs=yes
dynamic_linker='Android linker'
- # Don't embed -rpath directories since the linker doesn't support them.
- hardcode_libdir_flag_spec='-L$libdir'
+ # -rpath works at least for libraries that are not overridden by
+ # libraries installed in system locations.
+ hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
;;
# This must be glibc/ELF.
@@ -11674,8 +12317,8 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
if test ${lt_cv_shlibpath_overrides_runpath+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- lt_cv_shlibpath_overrides_runpath=no
+else case e in #(
+ e) lt_cv_shlibpath_overrides_runpath=no
save_LDFLAGS=$LDFLAGS
save_libdir=$libdir
eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \
@@ -11702,7 +12345,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
LDFLAGS=$save_LDFLAGS
libdir=$save_libdir
-
+ ;;
+esac
fi
shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
@@ -11712,7 +12356,7 @@ fi
# before this can be enabled.
hardcode_into_libs=yes
- # Ideally, we could use ldconfig to report *all* directores which are
+ # Ideally, we could use ldconfig to report *all* directories which are
# searched for libraries, however this is still not possible. Aside from not
# being certain /sbin/ldconfig is available, command
# 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
@@ -11732,6 +12376,18 @@ fi
dynamic_linker='GNU/Linux ld.so'
;;
+netbsdelf*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='NetBSD ld.elf_so'
+ ;;
+
netbsd*)
version_type=sunos
need_lib_prefix=no
@@ -11750,6 +12406,18 @@ netbsd*)
hardcode_into_libs=yes
;;
+*-mlibc)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ dynamic_linker='mlibc ld.so'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
newsos6)
version_type=linux # correct to gnu/linux during the next big refactor
library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
@@ -11769,7 +12437,7 @@ newsos6)
dynamic_linker='ldqnx.so'
;;
-openbsd* | bitrig*)
+openbsd*)
version_type=sunos
sys_lib_dlsearch_path_spec=/usr/lib
need_lib_prefix=no
@@ -11829,6 +12497,17 @@ rdos*)
dynamic_linker=no
;;
+serenity*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ dynamic_linker='SerenityOS LibELF'
+ ;;
+
solaris*)
version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
@@ -11926,35 +12605,525 @@ uts4*)
shlibpath_var=LD_LIBRARY_PATH
;;
-*)
- dynamic_linker=no
- ;;
-esac
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
-printf "%s\n" "$dynamic_linker" >&6; }
-test no = "$dynamic_linker" && can_build_shared=no
+emscripten*)
+ version_type=none
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext'
+ soname_spec='$libname$release$shared_ext'
+ finish_cmds=
+ dynamic_linker="Emscripten linker"
+ lt_prog_compiler_wl=
+lt_prog_compiler_pic=
+lt_prog_compiler_static=
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test yes = "$GCC"; then
- variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
- sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
-fi
-
-if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
- sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
-fi
-
-# remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
-configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
-
-# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
-func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
-
-# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
-configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
+ if test yes = "$GCC"; then
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_static='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test ia64 = "$host_cpu"; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static='-Bstatic'
+ fi
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+ m68k)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the '-m68020' flag to GCC prevents building anything better,
+ # like '-m68040'.
+ lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
+ ;;
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+
+ mingw* | windows* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ lt_prog_compiler_pic='-DDLL_EXPORT'
+ case $host_os in
+ os2*)
+ lt_prog_compiler_static='$wl-static'
+ ;;
+ esac
+ ;;
+
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ lt_prog_compiler_pic='-fno-common'
+ ;;
+
+ haiku*)
+ # PIC is the default for Haiku.
+ # The "-static" flag exists, but is broken.
+ lt_prog_compiler_static=
+ ;;
+
+ hpux*)
+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ case $host_cpu in
+ hppa*64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+ esac
+ ;;
+
+ interix[3-9]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+
+ msdosdjgpp*)
+ # Just because we use GCC doesn't mean we suddenly get shared libraries
+ # on systems that don't support them.
+ lt_prog_compiler_can_build_shared=no
+ enable_shared=no
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ lt_prog_compiler_pic='-fPIC -shared'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ lt_prog_compiler_pic=-Kconform_pic
+ fi
+ ;;
+
+ *)
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+ esac
+
+ case $cc_basename in
+ nvcc*) # Cuda Compiler Driver 2.2
+ lt_prog_compiler_wl='-Xlinker '
+ if test -n "$lt_prog_compiler_pic"; then
+ lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic"
+ fi
+ ;;
+ esac
+ else
+ # PORTME Check for flag to pass linker flags through the system compiler.
+ case $host_os in
+ aix*)
+ lt_prog_compiler_wl='-Wl,'
+ if test ia64 = "$host_cpu"; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static='-Bstatic'
+ else
+ lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ lt_prog_compiler_pic='-fno-common'
+ case $cc_basename in
+ nagfor*)
+ # NAG Fortran compiler
+ lt_prog_compiler_wl='-Wl,-Wl,,'
+ lt_prog_compiler_pic='-PIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+ esac
+ ;;
+
+ mingw* | windows* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ lt_prog_compiler_pic='-DDLL_EXPORT'
+ case $host_os in
+ os2*)
+ lt_prog_compiler_static='$wl-static'
+ ;;
+ esac
+ ;;
+
+ hpux9* | hpux10* | hpux11*)
+ lt_prog_compiler_wl='-Wl,'
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic='+Z'
+ ;;
+ esac
+ # Is there a better lt_prog_compiler_static that works with the bundled CC?
+ lt_prog_compiler_static='$wl-a ${wl}archive'
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ lt_prog_compiler_wl='-Wl,'
+ # PIC (with -KPIC) is the default.
+ lt_prog_compiler_static='-non_shared'
+ ;;
+
+ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+ case $cc_basename in
+ # old Intel for x86_64, which still supported -KPIC.
+ ecc*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+ *flang* | ftn | f18* | f95*)
+ # Flang compiler.
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+ # icc used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ icc* | ifort*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+ # Lahey Fortran 8.1.
+ lf95*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='--shared'
+ lt_prog_compiler_static='--static'
+ ;;
+ nagfor*)
+ # NAG Fortran compiler
+ lt_prog_compiler_wl='-Wl,-Wl,,'
+ lt_prog_compiler_pic='-PIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+ tcc*)
+ # Fabrice Bellard et al's Tiny C Compiler
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+ pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+ # Portland Group compilers (*not* the Pentium gcc compiler,
+ # which looks to be a dead project)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fpic'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+ ccc*)
+ lt_prog_compiler_wl='-Wl,'
+ # All Alpha code is PIC.
+ lt_prog_compiler_static='-non_shared'
+ ;;
+ xl* | bgxl* | bgf* | mpixl*)
+ # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-qpic'
+ lt_prog_compiler_static='-qstaticlink'
+ ;;
+ *)
+ case `$CC -V 2>&1 | $SED 5q` in
+ *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*)
+ # Sun Fortran 8.3 passes all unrecognized flags to the linker
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ lt_prog_compiler_wl=''
+ ;;
+ *Sun\ F* | *Sun*Fortran*)
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ lt_prog_compiler_wl='-Qoption ld '
+ ;;
+ *Sun\ C*)
+ # Sun C 5.9
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ lt_prog_compiler_wl='-Wl,'
+ ;;
+ *Intel*\ [CF]*Compiler*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+ *Portland\ Group*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fpic'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+ newsos6)
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ *-mlibc)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ lt_prog_compiler_pic='-fPIC -shared'
+ ;;
+
+ osf3* | osf4* | osf5*)
+ lt_prog_compiler_wl='-Wl,'
+ # All OSF/1 code is PIC.
+ lt_prog_compiler_static='-non_shared'
+ ;;
+
+ rdos*)
+ lt_prog_compiler_static='-non_shared'
+ ;;
+
+ serenity*)
+ ;;
+
+ solaris*)
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ case $cc_basename in
+ f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+ lt_prog_compiler_wl='-Qoption ld ';;
+ *)
+ lt_prog_compiler_wl='-Wl,';;
+ esac
+ ;;
+
+ sunos4*)
+ lt_prog_compiler_wl='-Qoption ld '
+ lt_prog_compiler_pic='-PIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ sysv4 | sysv4.2uw2* | sysv4.3*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ lt_prog_compiler_pic='-Kconform_pic'
+ lt_prog_compiler_static='-Bstatic'
+ fi
+ ;;
+
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ unicos*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_can_build_shared=no
+ ;;
+
+ uts4*)
+ lt_prog_compiler_pic='-pic'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ *)
+ lt_prog_compiler_can_build_shared=no
+ ;;
+ esac
+ fi
+
+case $host_os in
+ # For platforms that do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ lt_prog_compiler_pic=
+ ;;
+ *)
+ lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+ ;;
+esac
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+printf %s "checking for $compiler option to produce PIC... " >&6; }
+if test ${lt_cv_prog_compiler_pic+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) lt_cv_prog_compiler_pic=$lt_prog_compiler_pic ;;
+esac
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
+printf "%s\n" "$lt_cv_prog_compiler_pic" >&6; }
+lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
+printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
+if test ${lt_cv_prog_compiler_pic_works+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) lt_cv_prog_compiler_pic_works=no
+ ac_outfile=conftest.$ac_objext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_pic_works=yes
+ fi
+ fi
+ $RM conftest*
+ ;;
+esac
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5
+printf "%s\n" "$lt_cv_prog_compiler_pic_works" >&6; }
+
+if test yes = "$lt_cv_prog_compiler_pic_works"; then
+ case $lt_prog_compiler_pic in
+ "" | " "*) ;;
+ *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
+ esac
+else
+ lt_prog_compiler_pic=
+ lt_prog_compiler_can_build_shared=no
+fi
+
+fi
+
+
+
+
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
+if test ${lt_cv_prog_compiler_static_works+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) lt_cv_prog_compiler_static_works=no
+ save_LDFLAGS=$LDFLAGS
+ LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&5
+ $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_static_works=yes
+ fi
+ else
+ lt_cv_prog_compiler_static_works=yes
+ fi
+ fi
+ $RM -r conftest*
+ LDFLAGS=$save_LDFLAGS
+ ;;
+esac
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5
+printf "%s\n" "$lt_cv_prog_compiler_static_works" >&6; }
+
+if test yes = "$lt_cv_prog_compiler_static_works"; then
+ :
+else
+ lt_prog_compiler_static=
+fi
+
+
+
+='-fPIC'
+ archive_cmds='$CC -sSIDE_MODULE=2 -shared $libobjs $deplibs $compiler_flags -o $lib'
+ archive_expsym_cmds='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -sSIDE_MODULE=2 -shared $libobjs $deplibs $compiler_flags -o $lib -s EXPORTED_FUNCTIONS=@$output_objdir/$soname.expsym'
+ archive_cmds_need_lc=no
+ no_undefined_flag=
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
+printf "%s\n" "$dynamic_linker" >&6; }
+test no = "$dynamic_linker" && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test yes = "$GCC"; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
+ sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
+fi
+
+if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
+ sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
+fi
+
+# remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
+configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
+
+# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
+func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
+
+# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
+configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
@@ -12110,7 +13279,7 @@ else
lt_cv_dlopen_self=yes
;;
- mingw* | pw32* | cegcc*)
+ mingw* | windows* | pw32* | cegcc*)
lt_cv_dlopen=LoadLibrary
lt_cv_dlopen_libs=
;;
@@ -12127,16 +13296,22 @@ printf %s "checking for dlopen in -ldl... " >&6; }
if test ${ac_cv_lib_dl_dlopen+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- ac_check_lib_save_LIBS=$LIBS
+else case e in #(
+ e) ac_check_lib_save_LIBS=$LIBS
LIBS="-ldl $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 dlopen ();
+ builtin and then its argument prototype would still apply.
+ The 'extern "C"' is for builds by C++ compilers;
+ although this is not generally supported in C code supporting it here
+ has little cost and some practical benefit (sr 110532). */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen (void);
int
main (void)
{
@@ -12148,24 +13323,27 @@ _ACEOF
if ac_fn_c_try_link "$LINENO"
then :
ac_cv_lib_dl_dlopen=yes
-else $as_nop
- ac_cv_lib_dl_dlopen=no
+else case e in #(
+ e) ac_cv_lib_dl_dlopen=no ;;
+esac
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+LIBS=$ac_check_lib_save_LIBS ;;
+esac
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; }
if test "x$ac_cv_lib_dl_dlopen" = xyes
then :
lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl
-else $as_nop
-
+else case e in #(
+ e)
lt_cv_dlopen=dyld
lt_cv_dlopen_libs=
lt_cv_dlopen_self=yes
-
+ ;;
+esac
fi
;;
@@ -12183,22 +13361,28 @@ fi
if test "x$ac_cv_func_shl_load" = xyes
then :
lt_cv_dlopen=shl_load
-else $as_nop
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
+else case e in #(
+ e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
printf %s "checking for shl_load in -ldld... " >&6; }
if test ${ac_cv_lib_dld_shl_load+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- ac_check_lib_save_LIBS=$LIBS
+else case e in #(
+ e) ac_check_lib_save_LIBS=$LIBS
LIBS="-ldld $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 shl_load ();
+ builtin and then its argument prototype would still apply.
+ The 'extern "C"' is for builds by C++ compilers;
+ although this is not generally supported in C code supporting it here
+ has little cost and some practical benefit (sr 110532). */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load (void);
int
main (void)
{
@@ -12210,39 +13394,47 @@ _ACEOF
if ac_fn_c_try_link "$LINENO"
then :
ac_cv_lib_dld_shl_load=yes
-else $as_nop
- ac_cv_lib_dld_shl_load=no
+else case e in #(
+ e) ac_cv_lib_dld_shl_load=no ;;
+esac
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+LIBS=$ac_check_lib_save_LIBS ;;
+esac
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
printf "%s\n" "$ac_cv_lib_dld_shl_load" >&6; }
if test "x$ac_cv_lib_dld_shl_load" = xyes
then :
lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld
-else $as_nop
- ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
+else case e in #(
+ e) ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
if test "x$ac_cv_func_dlopen" = xyes
then :
lt_cv_dlopen=dlopen
-else $as_nop
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
+else case e in #(
+ e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
printf %s "checking for dlopen in -ldl... " >&6; }
if test ${ac_cv_lib_dl_dlopen+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- ac_check_lib_save_LIBS=$LIBS
+else case e in #(
+ e) ac_check_lib_save_LIBS=$LIBS
LIBS="-ldl $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 dlopen ();
+ builtin and then its argument prototype would still apply.
+ The 'extern "C"' is for builds by C++ compilers;
+ although this is not generally supported in C code supporting it here
+ has little cost and some practical benefit (sr 110532). */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen (void);
int
main (void)
{
@@ -12254,34 +13446,42 @@ _ACEOF
if ac_fn_c_try_link "$LINENO"
then :
ac_cv_lib_dl_dlopen=yes
-else $as_nop
- ac_cv_lib_dl_dlopen=no
+else case e in #(
+ e) ac_cv_lib_dl_dlopen=no ;;
+esac
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+LIBS=$ac_check_lib_save_LIBS ;;
+esac
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; }
if test "x$ac_cv_lib_dl_dlopen" = xyes
then :
lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl
-else $as_nop
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
+else case e in #(
+ e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
printf %s "checking for dlopen in -lsvld... " >&6; }
if test ${ac_cv_lib_svld_dlopen+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- ac_check_lib_save_LIBS=$LIBS
+else case e in #(
+ e) ac_check_lib_save_LIBS=$LIBS
LIBS="-lsvld $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 dlopen ();
+ builtin and then its argument prototype would still apply.
+ The 'extern "C"' is for builds by C++ compilers;
+ although this is not generally supported in C code supporting it here
+ has little cost and some practical benefit (sr 110532). */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen (void);
int
main (void)
{
@@ -12293,34 +13493,42 @@ _ACEOF
if ac_fn_c_try_link "$LINENO"
then :
ac_cv_lib_svld_dlopen=yes
-else $as_nop
- ac_cv_lib_svld_dlopen=no
+else case e in #(
+ e) ac_cv_lib_svld_dlopen=no ;;
+esac
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+LIBS=$ac_check_lib_save_LIBS ;;
+esac
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5
printf "%s\n" "$ac_cv_lib_svld_dlopen" >&6; }
if test "x$ac_cv_lib_svld_dlopen" = xyes
then :
lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld
-else $as_nop
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
+else case e in #(
+ e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
printf %s "checking for dld_link in -ldld... " >&6; }
if test ${ac_cv_lib_dld_dld_link+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- ac_check_lib_save_LIBS=$LIBS
+else case e in #(
+ e) ac_check_lib_save_LIBS=$LIBS
LIBS="-ldld $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 dld_link ();
+ builtin and then its argument prototype would still apply.
+ The 'extern "C"' is for builds by C++ compilers;
+ although this is not generally supported in C code supporting it here
+ has little cost and some practical benefit (sr 110532). */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dld_link (void);
int
main (void)
{
@@ -12332,12 +13540,14 @@ _ACEOF
if ac_fn_c_try_link "$LINENO"
then :
ac_cv_lib_dld_dld_link=yes
-else $as_nop
- ac_cv_lib_dld_dld_link=no
+else case e in #(
+ e) ac_cv_lib_dld_dld_link=no ;;
+esac
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+LIBS=$ac_check_lib_save_LIBS ;;
+esac
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5
printf "%s\n" "$ac_cv_lib_dld_dld_link" >&6; }
@@ -12346,19 +13556,24 @@ then :
lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld
fi
-
+ ;;
+esac
fi
-
+ ;;
+esac
fi
-
+ ;;
+esac
fi
-
+ ;;
+esac
fi
-
+ ;;
+esac
fi
;;
@@ -12386,8 +13601,8 @@ printf %s "checking whether a program can dlopen itself... " >&6; }
if test ${lt_cv_dlopen_self+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- if test yes = "$cross_compiling"; then :
+else case e in #(
+ e) if test yes = "$cross_compiling"; then :
lt_cv_dlopen_self=cross
else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
@@ -12437,11 +13652,11 @@ else
/* When -fvisibility=hidden is used, assume the code has been annotated
correspondingly for the symbols needed. */
#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
-int fnord () __attribute__((visibility("default")));
+int fnord (void) __attribute__((visibility("default")));
#endif
-int fnord () { return 42; }
-int main ()
+int fnord (void) { return 42; }
+int main (void)
{
void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
int status = $lt_dlunknown;
@@ -12481,7 +13696,8 @@ _LT_EOF
fi
rm -fr conftest*
-
+ ;;
+esac
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5
printf "%s\n" "$lt_cv_dlopen_self" >&6; }
@@ -12493,8 +13709,8 @@ printf %s "checking whether a statically linked program can dlopen itself... " >
if test ${lt_cv_dlopen_self_static+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- if test yes = "$cross_compiling"; then :
+else case e in #(
+ e) if test yes = "$cross_compiling"; then :
lt_cv_dlopen_self_static=cross
else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
@@ -12544,11 +13760,11 @@ else
/* When -fvisibility=hidden is used, assume the code has been annotated
correspondingly for the symbols needed. */
#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
-int fnord () __attribute__((visibility("default")));
+int fnord (void) __attribute__((visibility("default")));
#endif
-int fnord () { return 42; }
-int main ()
+int fnord (void) { return 42; }
+int main (void)
{
void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
int status = $lt_dlunknown;
@@ -12588,7 +13804,8 @@ _LT_EOF
fi
rm -fr conftest*
-
+ ;;
+esac
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5
printf "%s\n" "$lt_cv_dlopen_self_static" >&6; }
@@ -12756,51 +13973,380 @@ CC=$lt_save_CC
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
-printf %s "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
- # Check whether --enable-maintainer-mode was given.
-if test ${enable_maintainer_mode+y}
-then :
- enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
-else $as_nop
- USE_MAINTAINER_MODE=no
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
+printf %s "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
+ # Check whether --enable-maintainer-mode was given.
+if test ${enable_maintainer_mode+y}
+then :
+ enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
+else case e in #(
+ e) USE_MAINTAINER_MODE=no ;;
+esac
+fi
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
+printf "%s\n" "$USE_MAINTAINER_MODE" >&6; }
+ if test $USE_MAINTAINER_MODE = yes; then
+ MAINTAINER_MODE_TRUE=
+ MAINTAINER_MODE_FALSE='#'
+else
+ MAINTAINER_MODE_TRUE='#'
+ MAINTAINER_MODE_FALSE=
+fi
+
+ MAINT=$MAINTAINER_MODE_TRUE
+
+
+ac_config_headers="$ac_config_headers src/iperf_config.h"
+
+
+
+
+# Checks for tools: c compiler, ranlib (used for creating static libraries),
+# symlinks and libtool
+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 case e in #(
+ e) if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}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 ;;
+esac
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+printf "%s\n" "$CC" >&6; }
+else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "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 case e in #(
+ e) if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="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 ;;
+esac
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+printf "%s\n" "$ac_ct_CC" >&6; }
+else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+fi
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+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 case e in #(
+ e) if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}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 ;;
+esac
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+printf "%s\n" "$CC" >&6; }
+else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+fi
+
+
+ fi
+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 case e in #(
+ e) if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ ac_prog_rejected=no
+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 ;;
+esac
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+printf "%s\n" "$CC" >&6; }
+else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl.exe
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_CC+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi ;;
+esac
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+printf "%s\n" "$CC" >&6; }
+else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+fi
+
+
+ test -n "$CC" && break
+ done
+fi
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl.exe
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_CC+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi ;;
+esac
fi
-
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
-printf "%s\n" "$USE_MAINTAINER_MODE" >&6; }
- if test $USE_MAINTAINER_MODE = yes; then
- MAINTAINER_MODE_TRUE=
- MAINTAINER_MODE_FALSE='#'
+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
- MAINTAINER_MODE_TRUE='#'
- MAINTAINER_MODE_FALSE=
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
- MAINT=$MAINTAINER_MODE_TRUE
-
-
-ac_config_headers="$ac_config_headers src/iperf_config.h"
-
+ 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
-# Checks for tools: c compiler, ranlib (used for creating static libraries),
-# symlinks and libtool
-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
+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
+else case e in #(
+ e) if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -12814,7 +14360,7 @@ do
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"
+ 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
@@ -12822,7 +14368,8 @@ done
done
IFS=$as_save_IFS
-fi
+fi ;;
+esac
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
@@ -12837,15 +14384,15 @@ 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
+ # 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
+else case e in #(
+ e) if test -n "$ac_ct_CC"; then
ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -12859,7 +14406,7 @@ do
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"
+ 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
@@ -12867,7 +14414,8 @@ done
done
IFS=$as_save_IFS
-fi
+fi ;;
+esac
fi
ac_ct_CC=$ac_cv_prog_ac_ct_CC
if test -n "$ac_ct_CC"; then
@@ -12878,297 +14426,569 @@ else
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 ;;
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+fi
+
+
+test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See 'config.log' for more details" "$LINENO" 5; }
+
+# Provide some information about the compiler.
+printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion -version; do
+ { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+printf "%s\n" "$ac_try_echo"; } >&5
+ (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ sed '10a\
+... rest of stderr output deleted ...
+ 10q' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ fi
+ rm -f conftest.er1 conftest.err
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+done
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5
+printf %s "checking whether the compiler supports GNU C... " >&6; }
+if test ${ac_cv_c_compiler_gnu+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) 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 case e in #(
+ e) ac_compiler_gnu=no ;;
+esac
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+ ;;
+esac
+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 case e in #(
+ e) ac_save_c_werror_flag=$ac_c_werror_flag
+ ac_c_werror_flag=yes
+ ac_cv_prog_cc_g=no
+ CFLAGS="-g"
+ 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 case e in #(
+ e) 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 case e in #(
+ e) ac_c_werror_flag=$ac_save_c_werror_flag
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main (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 ;;
+esac
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
+esac
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+ ac_c_werror_flag=$ac_save_c_werror_flag ;;
+esac
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+printf "%s\n" "$ac_cv_prog_cc_g" >&6; }
+if test $ac_test_CFLAGS; then
+ CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+ac_prog_cc_stdc=no
+if test x$ac_prog_cc_stdc = xno
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5
+printf %s "checking for $CC option to enable C11 features... " >&6; }
+if test ${ac_cv_prog_cc_c11+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) ac_cv_prog_cc_c11=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_c_conftest_c11_program
+_ACEOF
+for ac_arg in '' -std=gnu11
+do
+ CC="$ac_save_CC $ac_arg"
+ if ac_fn_c_try_compile "$LINENO"
+then :
+ ac_cv_prog_cc_c11=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam
+ test "x$ac_cv_prog_cc_c11" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC ;;
+esac
+fi
+
+if test "x$ac_cv_prog_cc_c11" = xno
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+printf "%s\n" "unsupported" >&6; }
+else case e in #(
+ e) if test "x$ac_cv_prog_cc_c11" = x
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+printf "%s\n" "none needed" >&6; }
+else case e in #(
+ e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5
+printf "%s\n" "$ac_cv_prog_cc_c11" >&6; }
+ CC="$CC $ac_cv_prog_cc_c11" ;;
esac
- 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}
+ ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11
+ ac_prog_cc_stdc=c11 ;;
+esac
+fi
+fi
+if test x$ac_prog_cc_stdc = xno
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5
+printf %s "checking for $CC option to enable C99 features... " >&6; }
+if test ${ac_cv_prog_cc_c99+y}
then :
printf %s "(cached) " >&6
-else $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
+else case e in #(
+ e) ac_cv_prog_cc_c99=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_c_conftest_c99_program
+_ACEOF
+for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99=
do
- 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
+ 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
- done
-IFS=$as_save_IFS
-
+rm -f conftest.$ac_ext
+CC=$ac_save_CC ;;
+esac
fi
+
+if test "x$ac_cv_prog_cc_c99" = xno
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+printf "%s\n" "unsupported" >&6; }
+else case e in #(
+ e) if test "x$ac_cv_prog_cc_c99" = x
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+printf "%s\n" "none needed" >&6; }
+else case e in #(
+ e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5
+printf "%s\n" "$ac_cv_prog_cc_c99" >&6; }
+ CC="$CC $ac_cv_prog_cc_c99" ;;
+esac
fi
-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; }
+ ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99
+ ac_prog_cc_stdc=c99 ;;
+esac
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}
+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
- 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
+else case e in #(
+ e) ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_c_conftest_c89_program
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
do
- 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
+ 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
- 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
+rm -f conftest.$ac_ext
+CC=$ac_save_CC ;;
+esac
fi
+
+if test "x$ac_cv_prog_cc_c89" = xno
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+printf "%s\n" "unsupported" >&6; }
+else case e in #(
+ e) if test "x$ac_cv_prog_cc_c89" = x
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+printf "%s\n" "none needed" >&6; }
+else case e in #(
+ e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+printf "%s\n" "$ac_cv_prog_cc_c89" >&6; }
+ CC="$CC $ac_cv_prog_cc_c89" ;;
+esac
fi
+ ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89
+ ac_prog_cc_stdc=c89 ;;
+esac
fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-printf "%s\n" "$CC" >&6; }
-else
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
-printf "%s\n" "no" >&6; }
fi
+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
+
-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}
+ 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
- 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
+else case e in #(
+ e) 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
+ # aligned with autoconf, so not including core; see bug#72225.
+ rm -f -r a.out a.exe b.out conftest.$ac_ext conftest.$ac_objext \
+ conftest.dSYM conftest1.$ac_ext conftest1.$ac_objext conftest1.dSYM \
+ conftest2.$ac_ext conftest2.$ac_objext conftest2.dSYM
+ unset am_i ;;
+esac
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
-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
+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
- 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}
+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 -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
+else case e in #(
+ e) 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
-done
+ 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 thus:
+ # 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
-IFS=$as_save_IFS
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_CC_dependencies_compiler_type=none
fi
+ ;;
+esac
fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
-printf "%s\n" "$ac_ct_CC" >&6; }
+{ 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
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
-printf "%s\n" "no" >&6; }
+ am__fastdepCC_TRUE='#'
+ am__fastdepCC_FALSE=
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
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
+printf %s "checking whether ln -s works... " >&6; }
+LN_S=$as_ln_s
+if test "$LN_S" = "ln -s"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
+else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
+printf "%s\n" "no, using $LN_S" >&6; }
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; }
+# Add -Wall if we are using GCC.
+if test "x$GCC" = "xyes"; then
+ CFLAGS="$CFLAGS -Wall"
fi
+# Check for ldconfig
+# Check whether --with-ldconfig was given.
+if test ${with_ldconfig+y}
+then :
+ withval=$with_ldconfig;
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
+
+
+if test "$with_ldconfig" != no; then
+ # Extract the first word of "ldconfig", so it can be a program name with args.
+set dummy ldconfig; 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}
+if test ${ac_cv_prog_LDCONFIG+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 case e in #(
+ e) if test -n "$LDCONFIG"; then
+ ac_cv_prog_LDCONFIG="$LDCONFIG" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
@@ -13181,7 +15001,7 @@ do
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"
+ ac_cv_prog_LDCONFIG="ldconfig"
printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
@@ -13189,155 +15009,333 @@ done
done
IFS=$as_save_IFS
+ test -z "$ac_cv_prog_LDCONFIG" && ac_cv_prog_LDCONFIG="false"
+fi ;;
+esac
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; }
+LDCONFIG=$ac_cv_prog_LDCONFIG
+if test -n "$LDCONFIG"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LDCONFIG" >&5
+printf "%s\n" "$LDCONFIG" >&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=""
+
+ if test "$LDCONFIG" != false; then
+ LDCONFIG=$LDCONFIG
+
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
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: ldconfig not found; library path not updated" >&5
+printf "%s\n" "$as_me: WARNING: ldconfig not found; library path not updated" >&2;}
fi
-else
- CC="$ac_cv_prog_CC"
fi
+# Check if enable profiling
+# Check whether --enable-profiling was given.
+if test ${enable_profiling+y}
+then :
+ enableval=$enable_profiling;
fi
+ if test x$enable_profiling = xyes; then
+ ENABLE_PROFILING_TRUE=
+ ENABLE_PROFILING_FALSE='#'
+else
+ ENABLE_PROFILING_TRUE='#'
+ ENABLE_PROFILING_FALSE=
+fi
-test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "no acceptable C compiler found in \$PATH
-See \`config.log' for more details" "$LINENO" 5; }
-
-# Provide some information about the compiler.
-printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
-set X $ac_compile
-ac_compiler=$2
-for ac_option in --version -v -V -qversion -version; do
- { { ac_try="$ac_compiler $ac_option >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-printf "%s\n" "$ac_try_echo"; } >&5
- (eval "$ac_compiler $ac_option >&5") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- sed '10a\
-... rest of stderr output deleted ...
- 10q' conftest.err >conftest.er1
- cat conftest.er1 >&5
- fi
- rm -f conftest.er1 conftest.err
- printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }
-done
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5
-printf %s "checking whether the compiler supports GNU C... " >&6; }
-if test ${ac_cv_c_compiler_gnu+y}
+# Check for the math library (needed by cjson on some platforms)
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing floor" >&5
+printf %s "checking for library containing floor... " >&6; }
+if test ${ac_cv_search_floor+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+else case e in #(
+ e) ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply.
+ The 'extern "C"' is for builds by C++ compilers;
+ although this is not generally supported in C code supporting it here
+ has little cost and some practical benefit (sr 110532). */
+#ifdef __cplusplus
+extern "C"
+#endif
+char floor (void);
int
main (void)
{
-#ifndef __GNUC__
- choke me
-#endif
-
+return floor ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"
+for ac_lib in '' m
+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_compiler_gnu=yes
-else $as_nop
- ac_compiler_gnu=no
+ ac_cv_search_floor=$ac_res
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
-ac_cv_c_compiler_gnu=$ac_compiler_gnu
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+ conftest$ac_exeext
+ if test ${ac_cv_search_floor+y}
+then :
+ break
+fi
+done
+if test ${ac_cv_search_floor+y}
+then :
+else case e in #(
+ e) ac_cv_search_floor=no ;;
+esac
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
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS ;;
+esac
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_floor" >&5
+printf "%s\n" "$ac_cv_search_floor" >&6; }
+ac_res=$ac_cv_search_floor
+if test "$ac_res" != no
+then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-if test $ac_compiler_gnu = yes; then
- GCC=yes
-else
- GCC=
+else case e in #(
+ e)
+echo "floor()"
+exit 1
+ ;;
+esac
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}
+
+
+# On illumos we need -lsocket
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing socket" >&5
+printf %s "checking for library containing socket... " >&6; }
+if test ${ac_cv_search_socket+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
+else case e in #(
+ e) ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply.
+ The 'extern "C"' is for builds by C++ compilers;
+ although this is not generally supported in C code supporting it here
+ has little cost and some practical benefit (sr 110532). */
+#ifdef __cplusplus
+extern "C"
+#endif
+char socket (void);
int
main (void)
{
-
+return socket ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"
+for ac_lib in '' socket
+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_prog_cc_g=yes
-else $as_nop
- CFLAGS=""
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ ac_cv_search_socket=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+ conftest$ac_exeext
+ if test ${ac_cv_search_socket+y}
+then :
+ break
+fi
+done
+if test ${ac_cv_search_socket+y}
+then :
+
+else case e in #(
+ e) ac_cv_search_socket=no ;;
+esac
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS ;;
+esac
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_socket" >&5
+printf "%s\n" "$ac_cv_search_socket" >&6; }
+ac_res=$ac_cv_search_socket
+if test "$ac_res" != no
+then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+else case e in #(
+ e)
+echo "socket()"
+exit 1
+ ;;
+esac
+fi
+
+
+# On illumos inet_ntop in in -lnsl
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing inet_ntop" >&5
+printf %s "checking for library containing inet_ntop... " >&6; }
+if test ${ac_cv_search_inet_ntop+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply.
+ The 'extern "C"' is for builds by C++ compilers;
+ although this is not generally supported in C code supporting it here
+ has little cost and some practical benefit (sr 110532). */
+#ifdef __cplusplus
+extern "C"
+#endif
+char inet_ntop (void);
int
main (void)
{
-
+return inet_ntop ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"
+for ac_lib in '' nsl
+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_inet_ntop=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+ conftest$ac_exeext
+ if test ${ac_cv_search_inet_ntop+y}
+then :
+ break
+fi
+done
+if test ${ac_cv_search_inet_ntop+y}
then :
-else $as_nop
- ac_c_werror_flag=$ac_save_c_werror_flag
- CFLAGS="-g"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+else case e in #(
+ e) ac_cv_search_inet_ntop=no ;;
+esac
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS ;;
+esac
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_ntop" >&5
+printf "%s\n" "$ac_cv_search_inet_ntop" >&6; }
+ac_res=$ac_cv_search_inet_ntop
+if test "$ac_res" != no
+then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+else case e in #(
+ e)
+echo "inet_ntop()"
+exit 1
+ ;;
+esac
+fi
+
+
+# Checks for typedefs, structures, and compiler characteristics.
+{ 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 case e in #(
+ e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-int
-main (void)
-{
+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;
@@ -13345,171 +15343,299 @@ main (void)
_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
+ ac_cv_c_const=yes
+else case e in #(
+ e) ac_cv_c_const=no ;;
+esac
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
+esac
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
- ac_c_werror_flag=$ac_save_c_werror_flag
+{ 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
-{ 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
+
+
+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
-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}
+if test -z "$CPP"; then
+ if test ${ac_cv_prog_CPP+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
+else case e in #(
+ e) # 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. */
-$ac_c_conftest_c11_program
+#include
+ Syntax error
_ACEOF
-for ac_arg in '' -std=gnu11
-do
- CC="$ac_save_CC $ac_arg"
- if ac_fn_c_try_compile "$LINENO"
+if ac_fn_c_try_cpp "$LINENO"
then :
- ac_cv_prog_cc_c11=$ac_arg
+
+else case e in #(
+ e) # Broken: fails on valid input.
+continue ;;
+esac
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
+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 case e in #(
+ e) # Passes both tests.
+ac_preproc_ok=:
+break ;;
+esac
fi
+rm -f conftest.err conftest.i conftest.$ac_ext
-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
+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 :
- { 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"
+ break
fi
- ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11
- ac_prog_cc_stdc=c11
+
+ done
+ ac_cv_prog_CPP=$CPP
+ ;;
+esac
fi
+ CPP=$ac_cv_prog_CPP
+else
+ ac_cv_prog_CPP=$CPP
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
+{ 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. */
-$ac_c_conftest_c99_program
+#include
+ Syntax error
_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"
+if ac_fn_c_try_cpp "$LINENO"
then :
- ac_cv_prog_cc_c99=$ac_arg
+
+else case e in #(
+ e) # Broken: fails on valid input.
+continue ;;
+esac
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
+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 case e in #(
+ e) # Passes both tests.
+ac_preproc_ok=:
+break ;;
+esac
fi
+rm -f conftest.err conftest.i conftest.$ac_ext
-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
+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 :
- { 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
+
+else case e in #(
+ e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;}
+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
+See 'config.log' for more details" "$LINENO" 5; } ;;
+esac
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}
+
+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 egrep -e" >&5
+printf %s "checking for egrep -e... " >&6; }
+if test ${ac_cv_path_EGREP_TRADITIONAL+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__"
+else case e in #(
+ e) if test -z "$EGREP_TRADITIONAL"; then
+ ac_path_EGREP_TRADITIONAL_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
- 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
+ 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_EGREP_TRADITIONAL="$as_dir$ac_prog$ac_exec_ext"
+ as_fn_executable_p "$ac_path_EGREP_TRADITIONAL" || continue
+# Check for GNU ac_path_EGREP_TRADITIONAL and select it if it is found.
+ # Check for GNU $ac_path_EGREP_TRADITIONAL
+case `"$ac_path_EGREP_TRADITIONAL" --version 2>&1` in #(
+*GNU*)
+ ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" ac_path_EGREP_TRADITIONAL_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_TRADITIONAL' >> "conftest.nl"
+ "$ac_path_EGREP_TRADITIONAL" -E 'EGR(EP|AC)_TRADITIONAL$' < "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_TRADITIONAL_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL"
+ ac_path_EGREP_TRADITIONAL_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_TRADITIONAL_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_EGREP_TRADITIONAL"; then
+ :
+ fi
+else
+ ac_cv_path_EGREP_TRADITIONAL=$EGREP_TRADITIONAL
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
+ if test "$ac_cv_path_EGREP_TRADITIONAL"
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
+ ac_cv_path_EGREP_TRADITIONAL="$ac_cv_path_EGREP_TRADITIONAL -E"
+else case e in #(
+ e) if test -z "$EGREP_TRADITIONAL"; then
+ ac_path_EGREP_TRADITIONAL_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_TRADITIONAL="$as_dir$ac_prog$ac_exec_ext"
+ as_fn_executable_p "$ac_path_EGREP_TRADITIONAL" || continue
+# Check for GNU ac_path_EGREP_TRADITIONAL and select it if it is found.
+ # Check for GNU $ac_path_EGREP_TRADITIONAL
+case `"$ac_path_EGREP_TRADITIONAL" --version 2>&1` in #(
+*GNU*)
+ ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" ac_path_EGREP_TRADITIONAL_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_TRADITIONAL' >> "conftest.nl"
+ "$ac_path_EGREP_TRADITIONAL" 'EGR(EP|AC)_TRADITIONAL$' < "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_TRADITIONAL_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL"
+ ac_path_EGREP_TRADITIONAL_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_TRADITIONAL_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_EGREP_TRADITIONAL"; 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_TRADITIONAL=$EGREP_TRADITIONAL
fi
+ ;;
+esac
+fi ;;
+esac
fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP_TRADITIONAL" >&5
+printf "%s\n" "$ac_cv_path_EGREP_TRADITIONAL" >&6; }
+ EGREP_TRADITIONAL=$ac_cv_path_EGREP_TRADITIONAL
+
+
+
+
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
@@ -13517,252 +15643,277 @@ 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
+ax_pthread_ok=no
- 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}
+# We used to check for pthread.h first, but this fails if pthread.h
+# requires special compiler flags (e.g. on Tru64 or Sequent).
+# It gets checked for in the link test anyway.
+
+# First of all, check if the user has set any of the PTHREAD_LIBS,
+# etcetera environment variables, and if threads linking works using
+# them:
+if test "x$PTHREAD_CFLAGS$PTHREAD_LIBS" != "x"; then
+ ax_pthread_save_CC="$CC"
+ ax_pthread_save_CFLAGS="$CFLAGS"
+ ax_pthread_save_LIBS="$LIBS"
+ if test "x$PTHREAD_CC" != "x"
then :
- printf %s "(cached) " >&6
-else $as_nop
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ CC="$PTHREAD_CC"
+fi
+ if test "x$PTHREAD_CXX" != "x"
+then :
+ CXX="$PTHREAD_CXX"
+fi
+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+ LIBS="$PTHREAD_LIBS $LIBS"
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS" >&5
+printf %s "checking for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply.
+ The 'extern "C"' is for builds by C++ compilers;
+ although this is not generally supported in C code supporting it here
+ has little cost and some practical benefit (sr 110532). */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pthread_join (void);
int
main (void)
{
-
+return pthread_join ();
;
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"
+if ac_fn_c_try_link "$LINENO"
+then :
+ ax_pthread_ok=yes
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
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+ conftest$ac_exeext conftest.$ac_ext
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5
+printf "%s\n" "$ax_pthread_ok" >&6; }
+ if test "x$ax_pthread_ok" = "xno"; then
+ PTHREAD_LIBS=""
+ PTHREAD_CFLAGS=""
+ fi
+ CC="$ax_pthread_save_CC"
+ CFLAGS="$ax_pthread_save_CFLAGS"
+ LIBS="$ax_pthread_save_LIBS"
+fi
+
+# We must check for the threads library under a number of different
+# names; the ordering is very important because some systems
+# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
+# libraries is broken (non-POSIX).
+
+# Create a list of thread flags to try. Items with a "," contain both
+# C compiler flags (before ",") and linker flags (after ","). Other items
+# starting with a "-" are C compiler flags, and remaining items are
+# library names, except for "none" which indicates that we try without
+# any flags at all, and "pthread-config" which is a program returning
+# the flags for the Pth emulation library.
+
+ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
+
+# The ordering *is* (sometimes) important. Some notes on the
+# individual items follow:
+
+# pthreads: AIX (must check this before -lpthread)
+# none: in case threads are in libc; should be tried before -Kthread and
+# other compiler flags to prevent continual compiler warnings
+# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
+# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads), Tru64
+# (Note: HP C rejects this with "bad form for `-t' option")
+# -pthreads: Solaris/gcc (Note: HP C also rejects)
+# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
+# doesn't hurt to check since this sometimes defines pthreads and
+# -D_REENTRANT too), HP C (must be checked before -lpthread, which
+# is present but should not be used directly; and before -mthreads,
+# because the compiler interprets this as "-mt" + "-hreads")
+# -mthreads: Mingw32/gcc, Lynx/gcc
+# pthread: Linux, etcetera
+# --thread-safe: KAI C++
+# pthread-config: use pthread-config program (for GNU Pth library)
+case $host_os in
-depcc="$CC" am_compiler_list=
+ freebsd*)
-{ 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
+ # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
+ # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
- 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
+ ax_pthread_flags="-kthread lthread $ax_pthread_flags"
+ ;;
- 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
+ hpux*)
- # 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
+ # From the cc(1) man page: "[-mt] Sets various -D flags to enable
+ # multi-threading and also sets -lpthread."
- cd ..
- rm -rf conftest.dir
-else
- am_cv_CC_dependencies_compiler_type=none
-fi
+ ax_pthread_flags="-mt -pthread pthread $ax_pthread_flags"
+ ;;
-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
+ openedition*)
- 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=
+ # IBM z/OS requires a feature-test macro to be defined in order to
+ # enable POSIX threads at all, so give the user a hint if this is
+ # not set. (We don't define these ourselves, as they can affect
+ # other portions of the system API in unpredictable ways.)
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+# if !defined(_OPEN_THREADS) && !defined(_UNIX03_THREADS)
+ AX_PTHREAD_ZOS_MISSING
+# endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP_TRADITIONAL "AX_PTHREAD_ZOS_MISSING" >/dev/null 2>&1
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support." >&5
+printf "%s\n" "$as_me: WARNING: IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support." >&2;}
fi
+rm -rf conftest*
+ ;;
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ranlib; 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_RANLIB+y}
+ solaris*)
+
+ # On Solaris (at least, for some versions), libc contains stubbed
+ # (non-functional) versions of the pthreads routines, so link-based
+ # tests will erroneously succeed. (N.B.: The stubs are missing
+ # pthread_cleanup_push, or rather a function called by this macro,
+ # so we could check for that, but who knows whether they'll stub
+ # that too in a future libc.) So we'll check first for the
+ # standard Solaris way of linking pthreads (-mt -lpthread).
+
+ ax_pthread_flags="-mt,-lpthread pthread $ax_pthread_flags"
+ ;;
+esac
+
+# Are we compiling with Clang?
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC is Clang" >&5
+printf %s "checking whether $CC is Clang... " >&6; }
+if test ${ax_cv_PTHREAD_CLANG+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- if test -n "$RANLIB"; then
- ac_cv_prog_RANLIB="$RANLIB" # 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_RANLIB="${ac_tool_prefix}ranlib"
- 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
+else case e in #(
+ e) ax_cv_PTHREAD_CLANG=no
+ # Note that Autoconf sets GCC=yes for Clang as well as GCC
+ if test "x$GCC" = "xyes"; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+/* Note: Clang 2.7 lacks __clang_[a-z]+__ */
+# if defined(__clang__) && defined(__llvm__)
+ AX_PTHREAD_CC_IS_CLANG
+# endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP_TRADITIONAL "AX_PTHREAD_CC_IS_CLANG" >/dev/null 2>&1
+then :
+ ax_cv_PTHREAD_CLANG=yes
+fi
+rm -rf conftest*
+ fi
+ ;;
+esac
fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_CLANG" >&5
+printf "%s\n" "$ax_cv_PTHREAD_CLANG" >&6; }
+ax_pthread_clang="$ax_cv_PTHREAD_CLANG"
+
+
+# GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC)
+
+# Note that for GCC and Clang -pthread generally implies -lpthread,
+# except when -nostdlib is passed.
+# This is problematic using libtool to build C++ shared libraries with pthread:
+# [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25460
+# [2] https://bugzilla.redhat.com/show_bug.cgi?id=661333
+# [3] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=468555
+# To solve this, first try -pthread together with -lpthread for GCC
+
+if test "x$GCC" = "xyes"
+then :
+ ax_pthread_flags="-pthread,-lpthread -pthread -pthreads $ax_pthread_flags"
fi
-RANLIB=$ac_cv_prog_RANLIB
-if test -n "$RANLIB"; then
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
-printf "%s\n" "$RANLIB" >&6; }
-else
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
-printf "%s\n" "no" >&6; }
+
+# Clang takes -pthread (never supported any other flag), but we'll try with -lpthread first
+
+if test "x$ax_pthread_clang" = "xyes"
+then :
+ ax_pthread_flags="-pthread,-lpthread -pthread"
fi
+# The presence of a feature test macro requesting re-entrant function
+# definitions is, on some systems, a strong hint that pthreads support is
+# correctly enabled
+
+case $host_os in
+ darwin* | hpux* | linux* | osf* | solaris*)
+ ax_pthread_check_macro="_REENTRANT"
+ ;;
+
+ aix*)
+ ax_pthread_check_macro="_THREAD_SAFE"
+ ;;
+
+ *)
+ ax_pthread_check_macro="--"
+ ;;
+esac
+if test "x$ax_pthread_check_macro" = "x--"
+then :
+ ax_pthread_check_cond=0
+else case e in #(
+ e) ax_pthread_check_cond="!defined($ax_pthread_check_macro)" ;;
+esac
fi
-if test -z "$ac_cv_prog_RANLIB"; then
- ac_ct_RANLIB=$RANLIB
- # Extract the first word of "ranlib", so it can be a program name with args.
-set dummy ranlib; ac_word=$2
+
+
+if test "x$ax_pthread_ok" = "xno"; then
+for ax_pthread_try_flag in $ax_pthread_flags; do
+
+ case $ax_pthread_try_flag in
+ none)
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether pthreads work without any flags" >&5
+printf %s "checking whether pthreads work without any flags... " >&6; }
+ ;;
+
+ *,*)
+ PTHREAD_CFLAGS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\1/"`
+ PTHREAD_LIBS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\2/"`
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with \"$PTHREAD_CFLAGS\" and \"$PTHREAD_LIBS\"" >&5
+printf %s "checking whether pthreads work with \"$PTHREAD_CFLAGS\" and \"$PTHREAD_LIBS\"... " >&6; }
+ ;;
+
+ -*)
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with $ax_pthread_try_flag" >&5
+printf %s "checking whether pthreads work with $ax_pthread_try_flag... " >&6; }
+ PTHREAD_CFLAGS="$ax_pthread_try_flag"
+ ;;
+
+ pthread-config)
+ # Extract the first word of "pthread-config", so it can be a program name with args.
+set dummy pthread-config; 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_RANLIB+y}
+if test ${ac_cv_prog_ax_pthread_config+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- if test -n "$ac_ct_RANLIB"; then
- ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else case e in #(
+ e) if test -n "$ax_pthread_config"; then
+ ac_cv_prog_ax_pthread_config="$ax_pthread_config" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
@@ -13775,7 +15926,7 @@ do
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_RANLIB="ranlib"
+ ac_cv_prog_ax_pthread_config="yes"
printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
@@ -13783,348 +15934,548 @@ done
done
IFS=$as_save_IFS
+ test -z "$ac_cv_prog_ax_pthread_config" && ac_cv_prog_ax_pthread_config="no"
+fi ;;
+esac
fi
-fi
-ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
-if test -n "$ac_ct_RANLIB"; then
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
-printf "%s\n" "$ac_ct_RANLIB" >&6; }
+ax_pthread_config=$ac_cv_prog_ax_pthread_config
+if test -n "$ax_pthread_config"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_config" >&5
+printf "%s\n" "$ax_pthread_config" >&6; }
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
fi
- if test "x$ac_ct_RANLIB" = x; then
- RANLIB=":"
- 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
- RANLIB=$ac_ct_RANLIB
- fi
-else
- RANLIB="$ac_cv_prog_RANLIB"
+
+ if test "x$ax_pthread_config" = "xno"
+then :
+ continue
fi
+ PTHREAD_CFLAGS="`pthread-config --cflags`"
+ PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
+ ;;
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
-printf %s "checking whether ln -s works... " >&6; }
-LN_S=$as_ln_s
-if test "$LN_S" = "ln -s"; then
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-printf "%s\n" "yes" >&6; }
-else
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
-printf "%s\n" "no, using $LN_S" >&6; }
+ *)
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the pthreads library -l$ax_pthread_try_flag" >&5
+printf %s "checking for the pthreads library -l$ax_pthread_try_flag... " >&6; }
+ PTHREAD_LIBS="-l$ax_pthread_try_flag"
+ ;;
+ esac
+
+ ax_pthread_save_CFLAGS="$CFLAGS"
+ ax_pthread_save_LIBS="$LIBS"
+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+ LIBS="$PTHREAD_LIBS $LIBS"
+
+ # Check for various functions. We must include pthread.h,
+ # since some functions may be macros. (On the Sequent, we
+ # need a special flag -Kthread to make this header compile.)
+ # We check for pthread_join because it is in -lpthread on IRIX
+ # while pthread_create is in libc. We check for pthread_attr_init
+ # due to DEC craziness with -lpthreads. We check for
+ # pthread_cleanup_push because it is one of the few pthread
+ # functions on Solaris that doesn't have a non-functional libc stub.
+ # We try pthread_create on general principles.
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include
+# if $ax_pthread_check_cond
+# error "$ax_pthread_check_macro must be defined"
+# endif
+ static void *some_global = NULL;
+ static void routine(void *a)
+ {
+ /* To avoid any unused-parameter or
+ unused-but-set-parameter warning. */
+ some_global = a;
+ }
+ static void *start_routine(void *a) { return a; }
+int
+main (void)
+{
+pthread_t th; pthread_attr_t attr;
+ pthread_create(&th, 0, start_routine, 0);
+ pthread_join(th, 0);
+ pthread_attr_init(&attr);
+ pthread_cleanup_push(routine, 0);
+ pthread_cleanup_pop(0) /* ; */
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+ ax_pthread_ok=yes
fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+ conftest$ac_exeext conftest.$ac_ext
+ CFLAGS="$ax_pthread_save_CFLAGS"
+ LIBS="$ax_pthread_save_LIBS"
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5
+printf "%s\n" "$ax_pthread_ok" >&6; }
+ if test "x$ax_pthread_ok" = "xyes"
+then :
+ break
+fi
-# Add -Wall if we are using GCC.
-if test "x$GCC" = "xyes"; then
- CFLAGS="$CFLAGS -Wall"
+ PTHREAD_LIBS=""
+ PTHREAD_CFLAGS=""
+done
fi
-# Check if enable profiling
-# Check whether --enable-profiling was given.
-if test ${enable_profiling+y}
+
+# Clang needs special handling, because older versions handle the -pthread
+# option in a rather... idiosyncratic way
+
+if test "x$ax_pthread_clang" = "xyes"; then
+
+ # Clang takes -pthread; it has never supported any other flag
+
+ # (Note 1: This will need to be revisited if a system that Clang
+ # supports has POSIX threads in a separate library. This tends not
+ # to be the way of modern systems, but it's conceivable.)
+
+ # (Note 2: On some systems, notably Darwin, -pthread is not needed
+ # to get POSIX threads support; the API is always present and
+ # active. We could reasonably leave PTHREAD_CFLAGS empty. But
+ # -pthread does define _REENTRANT, and while the Darwin headers
+ # ignore this macro, third-party headers might not.)
+
+ # However, older versions of Clang make a point of warning the user
+ # that, in an invocation where only linking and no compilation is
+ # taking place, the -pthread option has no effect ("argument unused
+ # during compilation"). They expect -pthread to be passed in only
+ # when source code is being compiled.
+ #
+ # Problem is, this is at odds with the way Automake and most other
+ # C build frameworks function, which is that the same flags used in
+ # compilation (CFLAGS) are also used in linking. Many systems
+ # supported by AX_PTHREAD require exactly this for POSIX threads
+ # support, and in fact it is often not straightforward to specify a
+ # flag that is used only in the compilation phase and not in
+ # linking. Such a scenario is extremely rare in practice.
+ #
+ # Even though use of the -pthread flag in linking would only print
+ # a warning, this can be a nuisance for well-run software projects
+ # that build with -Werror. So if the active version of Clang has
+ # this misfeature, we search for an option to squash it.
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether Clang needs flag to prevent \"argument unused\" warning when linking with -pthread" >&5
+printf %s "checking whether Clang needs flag to prevent \"argument unused\" warning when linking with -pthread... " >&6; }
+if test ${ax_cv_PTHREAD_CLANG_NO_WARN_FLAG+y}
then :
- enableval=$enable_profiling;
+ printf %s "(cached) " >&6
+else case e in #(
+ e) ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown
+ # Create an alternate version of $ac_link that compiles and
+ # links in two steps (.c -> .o, .o -> exe) instead of one
+ # (.c -> exe), because the warning occurs only in the second
+ # step
+ ax_pthread_save_ac_link="$ac_link"
+ ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g'
+ ax_pthread_link_step=`printf "%s\n" "$ac_link" | sed "$ax_pthread_sed"`
+ ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)"
+ ax_pthread_save_CFLAGS="$CFLAGS"
+ for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do
+ if test "x$ax_pthread_try" = "xunknown"
+then :
+ break
+fi
+ CFLAGS="-Werror -Wunknown-warning-option $ax_pthread_try -pthread $ax_pthread_save_CFLAGS"
+ ac_link="$ax_pthread_save_ac_link"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int main(void){return 0;}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+ ac_link="$ax_pthread_2step_ac_link"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int main(void){return 0;}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+ break
fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+ conftest$ac_exeext conftest.$ac_ext
- if test x$enable_profiling = xyes; then
- ENABLE_PROFILING_TRUE=
- ENABLE_PROFILING_FALSE='#'
-else
- ENABLE_PROFILING_TRUE='#'
- ENABLE_PROFILING_FALSE=
fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+ conftest$ac_exeext conftest.$ac_ext
+ done
+ ac_link="$ax_pthread_save_ac_link"
+ CFLAGS="$ax_pthread_save_CFLAGS"
+ if test "x$ax_pthread_try" = "x"
+then :
+ ax_pthread_try=no
+fi
+ ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try"
+ ;;
+esac
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" >&5
+printf "%s\n" "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" >&6; }
+ case "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" in
+ no | unknown) ;;
+ *) PTHREAD_CFLAGS="$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG $PTHREAD_CFLAGS" ;;
+ esac
-# Check for the math library (needed by cjson on some platforms)
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing floor" >&5
-printf %s "checking for library containing floor... " >&6; }
-if test ${ac_cv_search_floor+y}
+fi # $ax_pthread_clang = yes
+
+
+
+# Various other checks:
+if test "x$ax_pthread_ok" = "xyes"; then
+ ax_pthread_save_CFLAGS="$CFLAGS"
+ ax_pthread_save_LIBS="$LIBS"
+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+ LIBS="$PTHREAD_LIBS $LIBS"
+
+ # Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for joinable pthread attribute" >&5
+printf %s "checking for joinable pthread attribute... " >&6; }
+if test ${ax_cv_PTHREAD_JOINABLE_ATTR+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- ac_func_search_save_LIBS=$LIBS
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+else case e in #(
+ e) ax_cv_PTHREAD_JOINABLE_ATTR=unknown
+ for ax_pthread_attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
+ 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 floor ();
+#include
int
main (void)
{
-return floor ();
+int attr = $ax_pthread_attr; return attr /* ; */
;
return 0;
}
_ACEOF
-for ac_lib in '' m
-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"
+if ac_fn_c_try_link "$LINENO"
then :
- ac_cv_search_floor=$ac_res
+ ax_cv_PTHREAD_JOINABLE_ATTR=$ax_pthread_attr; break
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam \
- conftest$ac_exeext
- if test ${ac_cv_search_floor+y}
-then :
- break
-fi
-done
-if test ${ac_cv_search_floor+y}
-then :
-
-else $as_nop
- ac_cv_search_floor=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
+ conftest$ac_exeext conftest.$ac_ext
+ done
+ ;;
+esac
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_floor" >&5
-printf "%s\n" "$ac_cv_search_floor" >&6; }
-ac_res=$ac_cv_search_floor
-if test "$ac_res" != no
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_JOINABLE_ATTR" >&5
+printf "%s\n" "$ax_cv_PTHREAD_JOINABLE_ATTR" >&6; }
+ if test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xunknown" && \
+ test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xPTHREAD_CREATE_JOINABLE" && \
+ test "x$ax_pthread_joinable_attr_defined" != "xyes"
then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-else $as_nop
+printf "%s\n" "#define PTHREAD_CREATE_JOINABLE $ax_cv_PTHREAD_JOINABLE_ATTR" >>confdefs.h
-echo "floor()"
-exit 1
+ ax_pthread_joinable_attr_defined=yes
fi
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether more special flags are required for pthreads" >&5
+printf %s "checking whether more special flags are required for pthreads... " >&6; }
+if test ${ax_cv_PTHREAD_SPECIAL_FLAGS+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) ax_cv_PTHREAD_SPECIAL_FLAGS=no
+ case $host_os in
+ solaris*)
+ ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS"
+ ;;
+ esac
+ ;;
+esac
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_SPECIAL_FLAGS" >&5
+printf "%s\n" "$ax_cv_PTHREAD_SPECIAL_FLAGS" >&6; }
+ if test "x$ax_cv_PTHREAD_SPECIAL_FLAGS" != "xno" && \
+ test "x$ax_pthread_special_flags_added" != "xyes"
+then :
+ PTHREAD_CFLAGS="$ax_cv_PTHREAD_SPECIAL_FLAGS $PTHREAD_CFLAGS"
+ ax_pthread_special_flags_added=yes
+fi
-# On illumos we need -lsocket
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing socket" >&5
-printf %s "checking for library containing socket... " >&6; }
-if test ${ac_cv_search_socket+y}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for PTHREAD_PRIO_INHERIT" >&5
+printf %s "checking for PTHREAD_PRIO_INHERIT... " >&6; }
+if test ${ax_cv_PTHREAD_PRIO_INHERIT+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- ac_func_search_save_LIBS=$LIBS
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+else case e in #(
+ e) 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 socket ();
+#include
int
main (void)
{
-return socket ();
+int i = PTHREAD_PRIO_INHERIT;
+ return i;
;
return 0;
}
_ACEOF
-for ac_lib in '' socket
+if ac_fn_c_try_link "$LINENO"
+then :
+ ax_cv_PTHREAD_PRIO_INHERIT=yes
+else case e in #(
+ e) ax_cv_PTHREAD_PRIO_INHERIT=no ;;
+esac
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+ conftest$ac_exeext conftest.$ac_ext
+ ;;
+esac
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_PRIO_INHERIT" >&5
+printf "%s\n" "$ax_cv_PTHREAD_PRIO_INHERIT" >&6; }
+ if test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes" && \
+ test "x$ax_pthread_prio_inherit_defined" != "xyes"
+then :
+
+printf "%s\n" "#define HAVE_PTHREAD_PRIO_INHERIT 1" >>confdefs.h
+
+ ax_pthread_prio_inherit_defined=yes
+
+fi
+
+ CFLAGS="$ax_pthread_save_CFLAGS"
+ LIBS="$ax_pthread_save_LIBS"
+
+ # More AIX lossage: compile with *_r variant
+ if test "x$GCC" != "xyes"; then
+ case $host_os in
+ aix*)
+ case "x/$CC" in #(
+ x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6) :
+ #handle absolute path differently from PATH based program lookup
+ case "x$CC" in #(
+ x/*) :
+
+ if as_fn_executable_p ${CC}_r
+then :
+ PTHREAD_CC="${CC}_r"
+fi
+ if test "x${CXX}" != "x"
+then :
+ if as_fn_executable_p ${CXX}_r
+then :
+ PTHREAD_CXX="${CXX}_r"
+fi
+fi
+ ;; #(
+ *) :
+
+ for ac_prog in ${CC}_r
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"
+ # 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_PTHREAD_CC+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) if test -n "$PTHREAD_CC"; then
+ ac_cv_prog_PTHREAD_CC="$PTHREAD_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_PTHREAD_CC="$ac_prog"
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi ;;
+esac
+fi
+PTHREAD_CC=$ac_cv_prog_PTHREAD_CC
+if test -n "$PTHREAD_CC"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CC" >&5
+printf "%s\n" "$PTHREAD_CC" >&6; }
+else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+fi
+
+
+ test -n "$PTHREAD_CC" && break
+done
+test -n "$PTHREAD_CC" || PTHREAD_CC="$CC"
+
+ if test "x${CXX}" != "x"
+then :
+ for ac_prog in ${CXX}_r
+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_PTHREAD_CXX+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) if test -n "$PTHREAD_CXX"; then
+ ac_cv_prog_PTHREAD_CXX="$PTHREAD_CXX" # 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_PTHREAD_CXX="$ac_prog"
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
+ break 2
fi
- if ac_fn_c_try_link "$LINENO"
-then :
- ac_cv_search_socket=$ac_res
+done
+ done
+IFS=$as_save_IFS
+
+fi ;;
+esac
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam \
- conftest$ac_exeext
- if test ${ac_cv_search_socket+y}
-then :
- break
+PTHREAD_CXX=$ac_cv_prog_PTHREAD_CXX
+if test -n "$PTHREAD_CXX"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CXX" >&5
+printf "%s\n" "$PTHREAD_CXX" >&6; }
+else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
+
+
+ test -n "$PTHREAD_CXX" && break
done
-if test ${ac_cv_search_socket+y}
-then :
+test -n "$PTHREAD_CXX" || PTHREAD_CXX="$CXX"
-else $as_nop
- ac_cv_search_socket=no
fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
+
+ ;;
+esac
+ ;; #(
+ *) :
+ ;;
+esac
+ ;;
+ esac
+ fi
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_socket" >&5
-printf "%s\n" "$ac_cv_search_socket" >&6; }
-ac_res=$ac_cv_search_socket
-if test "$ac_res" != no
-then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-else $as_nop
+test -n "$PTHREAD_CC" || PTHREAD_CC="$CC"
+test -n "$PTHREAD_CXX" || PTHREAD_CXX="$CXX"
-echo "socket()"
-exit 1
+
+
+
+
+
+# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+if test "x$ax_pthread_ok" = "xyes"; then
+
+printf "%s\n" "#define HAVE_PTHREAD 1" >>confdefs.h
+
+LIBS="$PTHREAD_LIBS $LIBS"
+CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS"
+CC="$PTHREAD_CC"
+CXX="$PTHREAD_CXX"
+
+ :
+else
+ ax_pthread_ok=no
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
-# On illumos inet_ntop in in -lnsl
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing inet_ntop" >&5
-printf %s "checking for library containing inet_ntop... " >&6; }
-if test ${ac_cv_search_inet_ntop+y}
+
+# Atomics
+ for ac_header in stdatomic.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "stdatomic.h" "ac_cv_header_stdatomic_h" "$ac_includes_default"
+if test "x$ac_cv_header_stdatomic_h" = xyes
then :
- printf %s "(cached) " >&6
-else $as_nop
- ac_func_search_save_LIBS=$LIBS
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ printf "%s\n" "#define HAVE_STDATOMIC_H 1" >>confdefs.h
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether libatomic is required" >&5
+printf %s "checking whether libatomic is required... " >&6; }
+ 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 inet_ntop ();
+#include
int
main (void)
{
-return inet_ntop ();
+atomic_uint_fast64_t i; i++;
;
return 0;
}
_ACEOF
-for ac_lib in '' nsl
-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_inet_ntop=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam \
- conftest$ac_exeext
- if test ${ac_cv_search_inet_ntop+y}
-then :
- break
-fi
-done
-if test ${ac_cv_search_inet_ntop+y}
-then :
-
-else $as_nop
- ac_cv_search_inet_ntop=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_inet_ntop" >&5
-printf "%s\n" "$ac_cv_search_inet_ntop" >&6; }
-ac_res=$ac_cv_search_inet_ntop
-if test "$ac_res" != no
-then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-
-else $as_nop
-
-echo "inet_ntop()"
-exit 1
-
-fi
-
-
-# Checks for typedefs, structures, and compiler characteristics.
-{ 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}
+if ac_fn_c_try_link "$LINENO"
then :
- printf %s "(cached) " >&6
-else $as_nop
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+else case e in #(
+ e) save_LIBS="$LIBS"
+ LIBS="$LIBS -latomic"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-
+#include
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
-
+atomic_uint_fast64_t i; i++;
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"
+if ac_fn_c_try_link "$LINENO"
then :
- ac_cv_c_const=yes
-else $as_nop
- ac_cv_c_const=no
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
+else case e in #(
+ e) as_fn_error $? "failed to find working configuration with atomics" "$LINENO" 5
+ ;;
+esac
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+ conftest$ac_exeext conftest.$ac_ext
+ ;;
+esac
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
-
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+ conftest$ac_exeext conftest.$ac_ext
fi
+done
# Check for poll.h (it's in POSIX so everyone should have it?)
ac_fn_c_check_header_compile "$LINENO" "poll.h" "ac_cv_header_poll_h" "$ac_includes_default"
@@ -14154,11 +16505,12 @@ then :
;;
esac
-else $as_nop
-
+else case e in #(
+ e)
try_sctp=true
-
+ ;;
+esac
fi
@@ -14197,15 +16549,21 @@ printf %s "checking for library containing sctp_bindx... " >&6; }
if test ${ac_cv_search_sctp_bindx+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- ac_func_search_save_LIBS=$LIBS
+else case e in #(
+ e) ac_func_search_save_LIBS=$LIBS
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-char sctp_bindx ();
+ builtin and then its argument prototype would still apply.
+ The 'extern "C"' is for builds by C++ compilers;
+ although this is not generally supported in C code supporting it here
+ has little cost and some practical benefit (sr 110532). */
+#ifdef __cplusplus
+extern "C"
+#endif
+char sctp_bindx (void);
int
main (void)
{
@@ -14236,11 +16594,13 @@ done
if test ${ac_cv_search_sctp_bindx+y}
then :
-else $as_nop
- ac_cv_search_sctp_bindx=no
+else case e in #(
+ e) ac_cv_search_sctp_bindx=no ;;
+esac
fi
rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
+LIBS=$ac_func_search_save_LIBS ;;
+esac
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_sctp_bindx" >&5
printf "%s\n" "$ac_cv_search_sctp_bindx" >&6; }
@@ -14264,8 +16624,8 @@ printf %s "checking for $2... " >&6; }
if eval test \${$3+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- eval "$3=no"
+else case e in #(
+ e) eval "$3=no"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$4
@@ -14295,12 +16655,14 @@ _ACEOF
if ac_fn_c_try_compile "$LINENO"
then :
-else $as_nop
- eval "$3=yes"
+else case e in #(
+ e) eval "$3=yes" ;;
+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
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
+esac
fi
eval ac_res=\$$3
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
@@ -14329,20 +16691,22 @@ then :
printf "%s\n" "#define HAVE_ENDIAN_H 1" >>confdefs.h
-else $as_nop
- ac_fn_c_check_header_compile "$LINENO" "sys/endian.h" "ac_cv_header_sys_endian_h" "$ac_includes_default"
+else case e in #(
+ e) ac_fn_c_check_header_compile "$LINENO" "sys/endian.h" "ac_cv_header_sys_endian_h" "$ac_includes_default"
if test "x$ac_cv_header_sys_endian_h" = xyes
then :
printf "%s\n" "#define HAVE_SYS_ENDIAN_H 1" >>confdefs.h
-else $as_nop
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Couldn't find endian.h or sys/endian.h files: doing compile-time tests." >&5
+else case e in #(
+ e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Couldn't find endian.h or sys/endian.h files: doing compile-time tests." >&5
printf "%s\n" "$as_me: WARNING: Couldn't find endian.h or sys/endian.h files: doing compile-time tests." >&2;}
-
+ ;;
+esac
fi
-
+ ;;
+esac
fi
@@ -14351,7 +16715,7 @@ if test "x$with_openssl" = "xno"; then
printf "%s\n" "$as_me: WARNING: Building without OpenSSL; disabling iperf_auth functionality. " >&2;}
else
# Check for OPENSSL support
- havs_ssl=false
+ have_ssl=false
found=false
@@ -14367,8 +16731,8 @@ then :
;;
esac
-else $as_nop
-
+else case e in #(
+ e)
# if pkg-config is installed and openssl has installed a .pc file,
# then use that information and don't search ssldirs
if test -n "$ac_tool_prefix"; then
@@ -14379,8 +16743,8 @@ printf %s "checking for $ac_word... " >&6; }
if test ${ac_cv_prog_PKG_CONFIG+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- if test -n "$PKG_CONFIG"; then
+else case e in #(
+ e) if test -n "$PKG_CONFIG"; then
ac_cv_prog_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -14402,7 +16766,8 @@ done
done
IFS=$as_save_IFS
-fi
+fi ;;
+esac
fi
PKG_CONFIG=$ac_cv_prog_PKG_CONFIG
if test -n "$PKG_CONFIG"; then
@@ -14424,8 +16789,8 @@ printf %s "checking for $ac_word... " >&6; }
if test ${ac_cv_prog_ac_ct_PKG_CONFIG+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- if test -n "$ac_ct_PKG_CONFIG"; then
+else case e in #(
+ e) if test -n "$ac_ct_PKG_CONFIG"; then
ac_cv_prog_ac_ct_PKG_CONFIG="$ac_ct_PKG_CONFIG" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -14447,7 +16812,8 @@ done
done
IFS=$as_save_IFS
-fi
+fi ;;
+esac
fi
ac_ct_PKG_CONFIG=$ac_cv_prog_ac_ct_PKG_CONFIG
if test -n "$ac_ct_PKG_CONFIG"; then
@@ -14487,7 +16853,8 @@ fi
ssldirs="/usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /usr"
fi
-
+ ;;
+esac
fi
@@ -14498,8 +16865,8 @@ fi
if ! $found; then
OPENSSL_INCLUDES=
for ssldir in $ssldirs; do
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for openssl/ssl.h in $ssldir" >&5
-printf %s "checking for openssl/ssl.h in $ssldir... " >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for include/openssl/ssl.h in $ssldir" >&5
+printf %s "checking for include/openssl/ssl.h in $ssldir... " >&6; }
if test -f "$ssldir/include/openssl/ssl.h"; then
OPENSSL_INCLUDES="-I$ssldir/include"
OPENSSL_LDFLAGS="-L$ssldir/lib"
@@ -14553,18 +16920,19 @@ printf "%s\n" "#define HAVE_SSL 1" >>confdefs.h
have_ssl=true
-else $as_nop
-
+else case e in #(
+ e)
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
if test "x$with_openssl" != "x"; 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: in '$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;}
as_fn_error $? "--with-openssl was given, but test for OpenSSL failed
-See \`config.log' for more details" "$LINENO" 5; }
+See 'config.log' for more details" "$LINENO" 5; }
fi
-
+ ;;
+esac
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
@@ -14594,8 +16962,8 @@ printf %s "checking TCP_CONGESTION socket option... " >&6; }
if test ${iperf3_cv_header_tcp_congestion+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+else case e in #(
+ e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
int
@@ -14609,50 +16977,90 @@ _ACEOF
if ac_fn_c_try_compile "$LINENO"
then :
iperf3_cv_header_tcp_congestion=yes
-else $as_nop
- iperf3_cv_header_tcp_congestion=no
+else case e in #(
+ e) iperf3_cv_header_tcp_congestion=no ;;
+esac
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
+esac
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $iperf3_cv_header_tcp_congestion" >&5
printf "%s\n" "$iperf3_cv_header_tcp_congestion" >&6; }
if test "x$iperf3_cv_header_tcp_congestion" = "xyes"; then
-printf "%s\n" "#define HAVE_TCP_CONGESTION 1" >>confdefs.h
+printf "%s\n" "#define HAVE_TCP_CONGESTION 1" >>confdefs.h
+
+fi
+
+# Check for TCP_USER_TIMEOUT sockopt (believed to be Linux 2.6.37+ only)
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking TCP_USER_TIMEOUT socket option" >&5
+printf %s "checking TCP_USER_TIMEOUT socket option... " >&6; }
+if test ${iperf3_cv_header_tcp_user_timeout+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include
+int
+main (void)
+{
+int foo = TCP_USER_TIMEOUT;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ iperf3_cv_header_tcp_user_timeout=yes
+else case e in #(
+ e) iperf3_cv_header_tcp_user_timeout=no ;;
+esac
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
+esac
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $iperf3_cv_header_tcp_user_timeout" >&5
+printf "%s\n" "$iperf3_cv_header_tcp_user_timeout" >&6; }
+if test "x$iperf3_cv_header_tcp_user_timeout" = "xyes"; then
+
+printf "%s\n" "#define HAVE_TCP_USER_TIMEOUT 1" >>confdefs.h
fi
-# Check for TCP_USER_TIMEOUT sockopt (believed to be Linux 2.6.37+ only)
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking TCP_USER_TIMEOUT socket option" >&5
-printf %s "checking TCP_USER_TIMEOUT socket option... " >&6; }
-if test ${iperf3_cv_header_tcp_user_timeout+y}
+# Check for TCP_KEEPIDLE sockopt (not clear where supported)
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking TCP_KEEPIDLE socket option" >&5
+printf %s "checking TCP_KEEPIDLE socket option... " >&6; }
+if test ${iperf3_cv_header_tcp_keepalive+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+else case e in #(
+ e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
int
main (void)
{
-int foo = TCP_USER_TIMEOUT;
+int foo = TCP_KEEPIDLE;
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"
then :
- iperf3_cv_header_tcp_user_timeout=yes
-else $as_nop
- iperf3_cv_header_tcp_user_timeout=no
+ iperf3_cv_header_tcp_keepalive=yes
+else case e in #(
+ e) iperf3_cv_header_tcp_keepalive=no ;;
+esac
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
+esac
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $iperf3_cv_header_tcp_user_timeout" >&5
-printf "%s\n" "$iperf3_cv_header_tcp_user_timeout" >&6; }
-if test "x$iperf3_cv_header_tcp_user_timeout" = "xyes"; then
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $iperf3_cv_header_tcp_keepalive" >&5
+printf "%s\n" "$iperf3_cv_header_tcp_keepalive" >&6; }
+if test "x$iperf3_cv_header_tcp_keepalive" = "xyes"; then
-printf "%s\n" "#define HAVE_TCP_USER_TIMEOUT 1" >>confdefs.h
+printf "%s\n" "#define HAVE_TCP_KEEPALIVE 1" >>confdefs.h
fi
@@ -14665,8 +17073,8 @@ printf %s "checking IPv6 flowlabel support... " >&6; }
if test ${iperf3_cv_header_flowlabel+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+else case e in #(
+ e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
#include
@@ -14681,10 +17089,12 @@ _ACEOF
if ac_fn_c_try_compile "$LINENO"
then :
iperf3_cv_header_flowlabel=yes
-else $as_nop
- iperf3_cv_header_flowlabel=no
+else case e in #(
+ e) iperf3_cv_header_flowlabel=no ;;
+esac
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
+esac
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $iperf3_cv_header_flowlabel" >&5
printf "%s\n" "$iperf3_cv_header_flowlabel" >&6; }
@@ -14702,12 +17112,12 @@ fi
for ac_func in cpuset_setaffinity sched_setaffinity SetProcessAffinityMask
do :
- as_ac_var=`printf "%s\n" "ac_cv_func_$ac_func" | $as_tr_sh`
+ as_ac_var=`printf "%s\n" "ac_cv_func_$ac_func" | sed "$as_sed_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
+#define `printf "%s\n" "HAVE_$ac_func" | sed "$as_sed_cpp"` 1
_ACEOF
printf "%s\n" "#define HAVE_CPU_AFFINITY 1" >>confdefs.h
@@ -14752,8 +17162,8 @@ printf %s "checking SO_MAX_PACING_RATE socket option... " >&6; }
if test ${iperf3_cv_header_so_max_pacing_rate+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+else case e in #(
+ e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
int
@@ -14767,10 +17177,12 @@ _ACEOF
if ac_fn_c_try_compile "$LINENO"
then :
iperf3_cv_header_so_max_pacing_rate=yes
-else $as_nop
- iperf3_cv_header_so_max_pacing_rate=no
+else case e in #(
+ e) iperf3_cv_header_so_max_pacing_rate=no ;;
+esac
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
+esac
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $iperf3_cv_header_so_max_pacing_rate" >&5
printf "%s\n" "$iperf3_cv_header_so_max_pacing_rate" >&6; }
@@ -14786,8 +17198,8 @@ printf %s "checking SO_BINDTODEVICE socket option... " >&6; }
if test ${iperf3_cv_header_so_bindtodevice+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+else case e in #(
+ e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
int
@@ -14801,10 +17213,12 @@ _ACEOF
if ac_fn_c_try_compile "$LINENO"
then :
iperf3_cv_header_so_bindtodevice=yes
-else $as_nop
- iperf3_cv_header_so_bindtodevice=no
+else case e in #(
+ e) iperf3_cv_header_so_bindtodevice=no ;;
+esac
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
+esac
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $iperf3_cv_header_so_bindtodevice" >&5
printf "%s\n" "$iperf3_cv_header_so_bindtodevice" >&6; }
@@ -14820,8 +17234,8 @@ printf %s "checking IP_MTU_DISCOVER socket option... " >&6; }
if test ${iperf3_cv_header_ip_mtu_discover+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+else case e in #(
+ e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
#include
@@ -14837,10 +17251,12 @@ _ACEOF
if ac_fn_c_try_compile "$LINENO"
then :
iperf3_cv_header_ip_mtu_discover=yes
-else $as_nop
- iperf3_cv_header_ip_mtu_discover=no
+else case e in #(
+ e) iperf3_cv_header_ip_mtu_discover=no ;;
+esac
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
+esac
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $iperf3_cv_header_ip_mtu_discover" >&5
printf "%s\n" "$iperf3_cv_header_ip_mtu_discover" >&6; }
@@ -14856,8 +17272,8 @@ printf %s "checking IP_DONTFRAG socket option... " >&6; }
if test ${iperf3_cv_header_ip_dontfrag+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+else case e in #(
+ e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
#include
@@ -14873,10 +17289,12 @@ _ACEOF
if ac_fn_c_try_compile "$LINENO"
then :
iperf3_cv_header_ip_dontfrag=yes
-else $as_nop
- iperf3_cv_header_ip_dontfrag=no
+else case e in #(
+ e) iperf3_cv_header_ip_dontfrag=no ;;
+esac
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
+esac
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $iperf3_cv_header_ip_dontfrag" >&5
printf "%s\n" "$iperf3_cv_header_ip_dontfrag" >&6; }
@@ -14892,8 +17310,8 @@ printf %s "checking IP_DONTFRAGMENT socket option... " >&6; }
if test ${iperf3_cv_header_ip_dontfragment+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+else case e in #(
+ e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
#include
@@ -14909,10 +17327,12 @@ _ACEOF
if ac_fn_c_try_compile "$LINENO"
then :
iperf3_cv_header_ip_dontfragment=yes
-else $as_nop
- iperf3_cv_header_ip_dontfragment=no
+else case e in #(
+ e) iperf3_cv_header_ip_dontfragment=no ;;
+esac
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
+esac
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $iperf3_cv_header_ip_dontfragment" >&5
printf "%s\n" "$iperf3_cv_header_ip_dontfragment" >&6; }
@@ -14928,12 +17348,13 @@ printf %s "checking any kind of DF socket option... " >&6; }
if test ${iperf3_cv_header_dontfragment+y}
then :
printf %s "(cached) " >&6
-else $as_nop
- if test "x$iperf3_cv_header_ip_mtu_discover" = "xyes" -o "x$iperf3_cv_header_ip_dontfrag" = "xyes" -o "x$iperf3_cv_header_ip_dontfragment" = "xyes"; then
+else case e in #(
+ e) if test "x$iperf3_cv_header_ip_mtu_discover" = "xyes" -o "x$iperf3_cv_header_ip_dontfrag" = "xyes" -o "x$iperf3_cv_header_ip_dontfragment" = "xyes"; then
iperf3_cv_header_dontfragment=yes
else
iperf3_cv_header_dontfragment=no
-fi
+fi ;;
+esac
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $iperf3_cv_header_dontfragment" >&5
printf "%s\n" "$iperf3_cv_header_dontfragment" >&6; }
@@ -14958,8 +17379,9 @@ ac_fn_c_check_member "$LINENO" "struct tcp_info" "tcpi_snd_wnd" "ac_cv_member_st
if test "x$ac_cv_member_struct_tcp_info_tcpi_snd_wnd" = xyes
then :
iperf3_cv_header_tcp_info_snd_wnd=yes
-else $as_nop
- iperf3_cv_header_tcp_info_snd_wnd=no
+else case e in #(
+ e) iperf3_cv_header_tcp_info_snd_wnd=no ;;
+esac
fi
@@ -14969,21 +17391,173 @@ printf "%s\n" "#define HAVE_TCP_INFO_SND_WND 1" >>confdefs.h
fi
+
+# Check for MSG_TRUNC (mostly on Linux)
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking MSG_TRUNC recv option" >&5
+printf %s "checking MSG_TRUNC recv option... " >&6; }
+if test ${iperf3_cv_header_msg_trunc+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include
+ #include
+ #include
+int
+main (void)
+{
+int foo = MSG_TRUNC;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ iperf3_cv_header_msg_trunc=yes
+else case e in #(
+ e) iperf3_cv_header_msg_trunc=no ;;
+esac
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
+esac
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $iperf3_cv_header_msg_trunc" >&5
+printf "%s\n" "$iperf3_cv_header_msg_trunc" >&6; }
+if test "x$iperf3_cv_header_msg_trunc" = "xyes"; then
+
+printf "%s\n" "#define HAVE_MSG_TRUNC 1" >>confdefs.h
+
+fi
+# Check for IPPROTO_MPTCP (Linux)
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking MPTCP protocol" >&5
+printf %s "checking MPTCP protocol... " >&6; }
+if test ${iperf3_cv_header_ipproto_mptcp+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include
+int
+main (void)
+{
+int foo = IPPROTO_MPTCP;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ iperf3_cv_header_ipproto_mptcp=yes
+else case e in #(
+ e) iperf3_cv_header_ipproto_mptcp=no ;;
+esac
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
+esac
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $iperf3_cv_header_ipproto_mptcp" >&5
+printf "%s\n" "$iperf3_cv_header_ipproto_mptcp" >&6; }
+if test "x$iperf3_cv_header_ipproto_mptcp" = "xyes"; then
+
+printf "%s\n" "#define HAVE_IPPROTO_MPTCP 1" >>confdefs.h
+
+fi
+
+# Check for UDP_SEGMENT sockopt
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking UDP_SEGMENT socket option" >&5
+printf %s "checking UDP_SEGMENT socket option... " >&6; }
+if test ${iperf3_cv_header_udp_segment+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include
+int
+main (void)
+{
+int foo = UDP_SEGMENT;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ iperf3_cv_header_udp_segment=yes
+else case e in #(
+ e) iperf3_cv_header_udp_segment=no ;;
+esac
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
+esac
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $iperf3_cv_header_udp_segment" >&5
+printf "%s\n" "$iperf3_cv_header_udp_segment" >&6; }
+if test "x$iperf3_cv_header_udp_segment" = "xyes"; then
+
+printf "%s\n" "#define HAVE_UDP_SEGMENT 1" >>confdefs.h
+
+fi
+
+# Check for UDP_GRO sockopt
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking UDP_GRO socket option" >&5
+printf %s "checking UDP_GRO socket option... " >&6; }
+if test ${iperf3_cv_header_udp_gro+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include
+int
+main (void)
+{
+int foo = UDP_GRO;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ iperf3_cv_header_udp_gro=yes
+else case e in #(
+ e) iperf3_cv_header_udp_gro=no ;;
+esac
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
+esac
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $iperf3_cv_header_udp_gro" >&5
+printf "%s\n" "$iperf3_cv_header_udp_gro" >&6; }
+if test "x$iperf3_cv_header_udp_gro" = "xyes"; then
+
+printf "%s\n" "#define HAVE_UDP_GRO 1" >>confdefs.h
+
+fi
+
# Check if we need -lrt for clock_gettime
{ 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
+else case e in #(
+ e) ac_func_search_save_LIBS=$LIBS
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-char clock_gettime ();
+ builtin and then its argument prototype would still apply.
+ The 'extern "C"' is for builds by C++ compilers;
+ although this is not generally supported in C code supporting it here
+ has little cost and some practical benefit (sr 110532). */
+#ifdef __cplusplus
+extern "C"
+#endif
+char clock_gettime (void);
int
main (void)
{
@@ -15014,11 +17588,13 @@ done
if test ${ac_cv_search_clock_gettime+y}
then :
-else $as_nop
- ac_cv_search_clock_gettime=no
+else case e in #(
+ e) ac_cv_search_clock_gettime=no ;;
+esac
fi
rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
+LIBS=$ac_func_search_save_LIBS ;;
+esac
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; }
@@ -15038,6 +17614,159 @@ then :
fi
+# Check if we need -lrt for nanosleep
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing nanosleep" >&5
+printf %s "checking for library containing nanosleep... " >&6; }
+if test ${ac_cv_search_nanosleep+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply.
+ The 'extern "C"' is for builds by C++ compilers;
+ although this is not generally supported in C code supporting it here
+ has little cost and some practical benefit (sr 110532). */
+#ifdef __cplusplus
+extern "C"
+#endif
+char nanosleep (void);
+int
+main (void)
+{
+return nanosleep ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' rt posix4
+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_nanosleep=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+ conftest$ac_exeext
+ if test ${ac_cv_search_nanosleep+y}
+then :
+ break
+fi
+done
+if test ${ac_cv_search_nanosleep+y}
+then :
+
+else case e in #(
+ e) ac_cv_search_nanosleep=no ;;
+esac
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS ;;
+esac
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_nanosleep" >&5
+printf "%s\n" "$ac_cv_search_nanosleep" >&6; }
+ac_res=$ac_cv_search_nanosleep
+if test "$ac_res" != no
+then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+# Check for nanosleep support
+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
+
+# Check if we need -lrt for clock_nanosleep
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing clock_nanosleep" >&5
+printf %s "checking for library containing clock_nanosleep... " >&6; }
+if test ${ac_cv_search_clock_nanosleep+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply.
+ The 'extern "C"' is for builds by C++ compilers;
+ although this is not generally supported in C code supporting it here
+ has little cost and some practical benefit (sr 110532). */
+#ifdef __cplusplus
+extern "C"
+#endif
+char clock_nanosleep (void);
+int
+main (void)
+{
+return clock_nanosleep ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' rt posix4
+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_nanosleep=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+ conftest$ac_exeext
+ if test ${ac_cv_search_clock_nanosleep+y}
+then :
+ break
+fi
+done
+if test ${ac_cv_search_clock_nanosleep+y}
+then :
+
+else case e in #(
+ e) ac_cv_search_clock_nanosleep=no ;;
+esac
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS ;;
+esac
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_nanosleep" >&5
+printf "%s\n" "$ac_cv_search_clock_nanosleep" >&6; }
+ac_res=$ac_cv_search_clock_nanosleep
+if test "$ac_res" != no
+then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+# Check for clock_nanosleep support
+ac_fn_c_check_func "$LINENO" "clock_nanosleep" "ac_cv_func_clock_nanosleep"
+if test "x$ac_cv_func_clock_nanosleep" = xyes
+then :
+ printf "%s\n" "#define HAVE_CLOCK_NANOSLEEP 1" >>confdefs.h
+
+fi
+
+
ac_config_files="$ac_config_files Makefile src/Makefile src/version.h examples/Makefile iperf3.spec"
cat >confcache <<\_ACEOF
@@ -15050,8 +17779,8 @@ cat >confcache <<\_ACEOF
# config.status only pays attention to the cache file if you give it
# the --recheck option to rerun configure.
#
-# `ac_cv_env_foo' variables (set or unset) will be overridden when
-# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# 'ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* 'ac_cv_foo' will be assigned the
# following values.
_ACEOF
@@ -15081,14 +17810,14 @@ printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;}
(set) 2>&1 |
case $as_nl`(ac_space=' '; set) 2>&1` in #(
*${as_nl}ac_space=\ *)
- # `set' does not quote correctly, so add quotes: double-quote
+ # 'set' does not quote correctly, so add quotes: double-quote
# substitution turns \\\\ into \\, and sed turns \\ into \.
sed -n \
"s/'/'\\\\''/g;
s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
;; #(
*)
- # `set' quotes correctly as required by POSIX, so do not add quotes.
+ # 'set' quotes correctly as required by POSIX, so do not add quotes.
sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
;;
esac |
@@ -15161,6 +17890,18 @@ printf %s "checking that generated files are newer than configure... " >&6; }
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: done" >&5
printf "%s\n" "done" >&6; }
+case $enable_silent_rules in # (((
+ yes) AM_DEFAULT_VERBOSITY=0;;
+ no) AM_DEFAULT_VERBOSITY=1;;
+esac
+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
+
if test -n "$EXEEXT"; then
am__EXEEXT_TRUE=
am__EXEEXT_FALSE='#'
@@ -15218,7 +17959,6 @@ cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
# 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
@@ -15227,12 +17967,13 @@ then :
# 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 #(
+else case e in #(
+ e) case `(set -o) 2>/dev/null` in #(
*posix*) :
set -o posix ;; #(
*) :
;;
+esac ;;
esac
fi
@@ -15304,7 +18045,7 @@ IFS=$as_save_IFS
;;
esac
-# We did not find ourselves, most probably we were run as `sh COMMAND'
+# We did not find ourselves, most probably we were run as 'sh COMMAND'
# in which case we are not to be found in the path.
if test "x$as_myself" = x; then
as_myself=$0
@@ -15333,7 +18074,6 @@ as_fn_error ()
} # as_fn_error
-
# as_fn_set_status STATUS
# -----------------------
# Set $? to STATUS, without forking.
@@ -15373,11 +18113,12 @@ then :
{
eval $1+=\$2
}'
-else $as_nop
- as_fn_append ()
+else case e in #(
+ e) as_fn_append ()
{
eval $1=\$$1\$2
- }
+ } ;;
+esac
fi # as_fn_append
# as_fn_arith ARG...
@@ -15391,11 +18132,12 @@ then :
{
as_val=$(( $* ))
}'
-else $as_nop
- as_fn_arith ()
+else case e in #(
+ e) as_fn_arith ()
{
as_val=`expr "$@" || test $? -eq 1`
- }
+ } ;;
+esac
fi # as_fn_arith
@@ -15478,9 +18220,9 @@ if (echo >conf$$.file) 2>/dev/null; then
if ln -s conf$$.file conf$$ 2>/dev/null; then
as_ln_s='ln -s'
# ... but there are two gotchas:
- # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
- # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -pR'.
+ # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable.
+ # In both cases, we have to default to 'cp -pR'.
ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
as_ln_s='cp -pR'
elif ln conf$$.file conf$$ 2>/dev/null; then
@@ -15561,10 +18303,12 @@ as_test_x='test -x'
as_executable_p=as_fn_executable_p
# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+as_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
+as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated
# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
+as_tr_sh="eval sed '$as_sed_sh'" # deprecated
exec 6>&1
@@ -15579,8 +18323,8 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by iperf $as_me 3.13, which was
-generated by GNU Autoconf 2.71. Invocation command line was
+This file was extended by iperf $as_me 3.20+, which was
+generated by GNU Autoconf 2.72. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
@@ -15612,7 +18356,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
ac_cs_usage="\
-\`$as_me' instantiates files and other configuration actions
+'$as_me' instantiates files and other configuration actions
from templates according to the current configuration. Unless the files
and actions are specified as TAGs, all are instantiated by default.
@@ -15648,11 +18392,11 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\
-iperf config.status 3.13
-configured by $0, generated by GNU Autoconf 2.71,
+iperf config.status 3.20+
+configured by $0, generated by GNU Autoconf 2.72,
with options \\"\$ac_cs_config\\"
-Copyright (C) 2021 Free Software Foundation, Inc.
+Copyright (C) 2023 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."
@@ -15714,8 +18458,8 @@ do
ac_need_defaults=false;;
--he | --h)
# Conflict between --help and --header
- as_fn_error $? "ambiguous option: \`$1'
-Try \`$0 --help' for more information.";;
+ as_fn_error $? "ambiguous option: '$1'
+Try '$0 --help' for more information.";;
--help | --hel | -h )
printf "%s\n" "$ac_cs_usage"; exit ;;
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
@@ -15723,8 +18467,8 @@ Try \`$0 --help' for more information.";;
ac_cs_silent=: ;;
# This is an error.
- -*) as_fn_error $? "unrecognized option: \`$1'
-Try \`$0 --help' for more information." ;;
+ -*) as_fn_error $? "unrecognized option: '$1'
+Try '$0 --help' for more information." ;;
*) as_fn_append ac_config_targets " $1"
ac_need_defaults=false ;;
@@ -16071,7 +18815,7 @@ do
"examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;;
"iperf3.spec") CONFIG_FILES="$CONFIG_FILES iperf3.spec" ;;
- *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+ *) as_fn_error $? "invalid argument: '$ac_config_target'" "$LINENO" 5;;
esac
done
@@ -16091,7 +18835,7 @@ fi
# creating and moving files from /tmp can sometimes cause problems.
# Hook for its removal unless debugging.
# Note that there is a small window in which the directory will not be cleaned:
-# after its creation but before its name has been assigned to `$tmp'.
+# after its creation but before its name has been assigned to '$tmp'.
$debug ||
{
tmp= ac_tmp=
@@ -16115,7 +18859,7 @@ ac_tmp=$tmp
# Set up the scripts for CONFIG_FILES section.
# No need to generate them if there are no CONFIG_FILES.
-# This happens for instance with `./config.status config.h'.
+# This happens for instance with './config.status config.h'.
if test -n "$CONFIG_FILES"; then
@@ -16273,13 +19017,13 @@ fi # test -n "$CONFIG_FILES"
# Set up the scripts for CONFIG_HEADERS section.
# No need to generate them if there are no CONFIG_HEADERS.
-# This happens for instance with `./config.status Makefile'.
+# This happens for instance with './config.status Makefile'.
if test -n "$CONFIG_HEADERS"; then
cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
BEGIN {
_ACEOF
-# Transform confdefs.h into an awk script `defines.awk', embedded as
+# Transform confdefs.h into an awk script 'defines.awk', embedded as
# here-document in config.status, that substitutes the proper values into
# config.h.in to produce config.h.
@@ -16389,7 +19133,7 @@ do
esac
case $ac_mode$ac_tag in
:[FHL]*:*);;
- :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
+ :L* | :C*:*) as_fn_error $? "invalid tag '$ac_tag'" "$LINENO" 5;;
:[FH]-) ac_tag=-:-;;
:[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
esac
@@ -16411,19 +19155,19 @@ do
-) ac_f="$ac_tmp/stdin";;
*) # Look for the file first in the build tree, then in the source tree
# (if the path is not absolute). The absolute path cannot be DOS-style,
- # because $ac_f cannot contain `:'.
+ # because $ac_f cannot contain ':'.
test -f "$ac_f" ||
case $ac_f in
[\\/$]*) false;;
*) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
esac ||
- as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+ as_fn_error 1 "cannot find input file: '$ac_f'" "$LINENO" 5;;
esac
case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
as_fn_append ac_file_inputs " '$ac_f'"
done
- # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # Let's still pretend it is 'configure' which instantiates (i.e., don't
# use $as_me), people would be surprised to read:
# /* config.h. Generated by config.status. */
configure_input='Generated from '`
@@ -16556,7 +19300,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
esac
_ACEOF
-# Neutralize VPATH when `$srcdir' = `.'.
+# Neutralize VPATH when '$srcdir' = '.'.
# Shell code in configure.ac might set extrasub.
# FIXME: do we really want to maintain this feature?
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
@@ -16587,9 +19331,9 @@ test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
{ ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
{ ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
"$ac_tmp/out"`; test -z "$ac_out"; } &&
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable 'datarootdir'
which seems to be undefined. Please make sure it is defined" >&5
-printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable 'datarootdir'
which seems to be undefined. Please make sure it is defined" >&2;}
rm -f "$ac_tmp/stdin"
@@ -16744,15 +19488,15 @@ printf "%s\n" X/"$am_mf" |
(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;}
+ { { 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; }
+See 'config.log' for more details" "$LINENO" 5; }
fi
{ am_dirpart=; unset am_dirpart;}
{ am_filepart=; unset am_filepart;}
@@ -16776,19 +19520,18 @@ See \`config.log' for more details" "$LINENO" 5; }
cat <<_LT_EOF >> "$cfgfile"
#! $SHELL
# Generated automatically by $as_me ($PACKAGE) $VERSION
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
# NOTE: Changes made to this file will be lost: look at ltmain.sh.
# Provide generalized library-building support services.
# Written by Gordon Matzigkeit, 1996
-# Copyright (C) 2014 Free Software Foundation, Inc.
+# Copyright (C) 2024 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.
# GNU Libtool is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of of the License, or
+# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# As a special exception to the GNU General Public License, if you
@@ -17169,7 +19912,7 @@ hardcode_direct=$hardcode_direct
# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
# DIR into the resulting binary and the resulting library dependency is
-# "absolute",i.e impossible to change by setting \$shlibpath_var if the
+# "absolute",i.e. impossible to change by setting \$shlibpath_var if the
# library is relocated.
hardcode_direct_absolute=$hardcode_direct_absolute
diff --git a/configure.ac b/configure.ac
index a024adf79..e36eaf3f0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
-# iperf, Copyright (c) 2014-2022, The Regents of the University of
+# iperf, Copyright (c) 2014-2026, The Regents of the University of
# California, through Lawrence Berkeley National Laboratory (subject
# to receipt of any required approvals from the U.S. Dept. of
# Energy). All rights reserved.
@@ -25,8 +25,9 @@
# Initialize the autoconf system for the specified tool, version and mailing list
AC_PREREQ([2.71])
-AC_INIT([iperf],[3.13],[https://github.com/esnet/iperf],[iperf],[https://software.es.net/iperf/])
+AC_INIT([iperf],[3.20+],[https://github.com/esnet/iperf],[iperf],[https://software.es.net/iperf/])
m4_include([config/ax_check_openssl.m4])
+m4_include([config/ax_pthread.m4])
m4_include([config/iperf_config_static_bin.m4])
AC_LANG(C)
@@ -48,15 +49,25 @@ AC_CANONICAL_HOST
# Checks for tools: c compiler, ranlib (used for creating static libraries),
# symlinks and libtool
AC_PROG_CC
-AC_PROG_RANLIB
AC_PROG_LN_S
-LT_INIT
# Add -Wall if we are using GCC.
if test "x$GCC" = "xyes"; then
CFLAGS="$CFLAGS -Wall"
fi
+# Check for ldconfig
+AC_ARG_WITH([ldconfig], AS_HELP_STRING([--without-ldconfig], [do not run ldconfig]))
+
+if test "$with_ldconfig" != no; then
+ AC_CHECK_PROG([LDCONFIG], [ldconfig], [ldconfig], [false])
+ if test "$LDCONFIG" != false; then
+ AC_SUBST([LDCONFIG], [$LDCONFIG])
+ else
+ AC_MSG_WARN([ldconfig not found; library path not updated])
+ fi
+fi
+
# Check if enable profiling
AC_ARG_ENABLE([profiling],
AS_HELP_STRING([--enable-profiling], [Enable iperf3 profiling binary]))
@@ -83,6 +94,30 @@ exit 1
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
+AX_PTHREAD(
+[AC_DEFINE([HAVE_PTHREAD],[1],[Define if you have POSIX threads libraries and header files.])
+LIBS="$PTHREAD_LIBS $LIBS"
+CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS"
+CC="$PTHREAD_CC"
+CXX="$PTHREAD_CXX"
+])
+
+# Atomics
+AC_CHECK_HEADERS([stdatomic.h],
+ [AC_MSG_CHECKING([whether libatomic is required])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[atomic_uint_fast64_t i; i++;]])],
+ [AC_MSG_RESULT([no])],
+ [save_LIBS="$LIBS"
+ LIBS="$LIBS -latomic"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[atomic_uint_fast64_t i; i++;]])],
+ [AC_MSG_RESULT([yes])],
+ [AC_MSG_ERROR([failed to find working configuration with atomics])]
+ )]
+ )],
+ []
+)
+
# Check for poll.h (it's in POSIX so everyone should have it?)
AC_CHECK_HEADERS([poll.h])
@@ -137,7 +172,7 @@ if test "x$with_openssl" = "xno"; then
AC_MSG_WARN( [Building without OpenSSL; disabling iperf_auth functionality.] )
else
# Check for OPENSSL support
- havs_ssl=false
+ have_ssl=false
AX_CHECK_OPENSSL(
[ AC_DEFINE([HAVE_SSL], [1], [OpenSSL Is Available])
have_ssl=true ],
@@ -181,6 +216,18 @@ if test "x$iperf3_cv_header_tcp_user_timeout" = "xyes"; then
AC_DEFINE([HAVE_TCP_USER_TIMEOUT], [1], [Have TCP_USER_TIMEOUT sockopt.])
fi
+# Check for TCP_KEEPIDLE sockopt (not clear where supported)
+AC_CACHE_CHECK([TCP_KEEPIDLE socket option],
+[iperf3_cv_header_tcp_keepalive],
+AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[#include ]],
+ [[int foo = TCP_KEEPIDLE;]])],
+ iperf3_cv_header_tcp_keepalive=yes,
+ iperf3_cv_header_tcp_keepalive=no))
+if test "x$iperf3_cv_header_tcp_keepalive" = "xyes"; then
+ AC_DEFINE([HAVE_TCP_KEEPALIVE], [1], [Have TCP_KEEPIDLE sockopt.])
+fi
+
# Check for IPv6 flowlabel support (believed to be Linux only)
# We check for IPV6_FLOWLABEL_MGR in even though we
# don't use that file directly (we have our own stripped-down
@@ -314,10 +361,69 @@ if test "x$iperf3_cv_header_tcp_info_snd_wnd" = "xyes"; then
AC_DEFINE([HAVE_TCP_INFO_SND_WND], [1], [Have tcpi_snd_wnd field in tcp_info.])
fi
+
+# Check for MSG_TRUNC (mostly on Linux)
+AC_CACHE_CHECK([MSG_TRUNC recv option],
+[iperf3_cv_header_msg_trunc],
+AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[#include
+ #include
+ #include ]],
+ [[int foo = MSG_TRUNC;]])],
+ iperf3_cv_header_msg_trunc=yes,
+ iperf3_cv_header_msg_trunc=no))
+if test "x$iperf3_cv_header_msg_trunc" = "xyes"; then
+ AC_DEFINE([HAVE_MSG_TRUNC], [1], [Have MSG_TRUNC recv option.])
+fi
+# Check for IPPROTO_MPTCP (Linux)
+AC_CACHE_CHECK([MPTCP protocol],
+[iperf3_cv_header_ipproto_mptcp],
+AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[#include ]],
+ [[int foo = IPPROTO_MPTCP;]])],
+ iperf3_cv_header_ipproto_mptcp=yes,
+ iperf3_cv_header_ipproto_mptcp=no))
+if test "x$iperf3_cv_header_ipproto_mptcp" = "xyes"; then
+ AC_DEFINE([HAVE_IPPROTO_MPTCP], [1], [Have MPTCP protocol.])
+fi
+
+# Check for UDP_SEGMENT sockopt
+AC_CACHE_CHECK([UDP_SEGMENT socket option],
+[iperf3_cv_header_udp_segment],
+AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[#include ]],
+ [[int foo = UDP_SEGMENT;]])],
+ iperf3_cv_header_udp_segment=yes,
+ iperf3_cv_header_udp_segment=no))
+if test "x$iperf3_cv_header_udp_segment" = "xyes"; then
+ AC_DEFINE([HAVE_UDP_SEGMENT], [1], [Have UDP_SEGMENT sockopt.])
+fi
+
+# Check for UDP_GRO sockopt
+AC_CACHE_CHECK([UDP_GRO socket option],
+[iperf3_cv_header_udp_gro],
+AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[#include ]],
+ [[int foo = UDP_GRO;]])],
+ iperf3_cv_header_udp_gro=yes,
+ iperf3_cv_header_udp_gro=no))
+if test "x$iperf3_cv_header_udp_gro" = "xyes"; then
+ AC_DEFINE([HAVE_UDP_GRO], [1], [Have UDP_GRO sockopt.])
+fi
+
# Check if we need -lrt for clock_gettime
AC_SEARCH_LIBS(clock_gettime, [rt posix4])
# Check for clock_gettime support
AC_CHECK_FUNCS([clock_gettime])
+# Check if we need -lrt for nanosleep
+AC_SEARCH_LIBS(nanosleep, [rt posix4])
+# Check for nanosleep support
+AC_CHECK_FUNCS([nanosleep])
+# Check if we need -lrt for clock_nanosleep
+AC_SEARCH_LIBS(clock_nanosleep, [rt posix4])
+# Check for clock_nanosleep support
+AC_CHECK_FUNCS([clock_nanosleep])
+
AC_CONFIG_FILES([Makefile src/Makefile src/version.h examples/Makefile iperf3.spec])
AC_OUTPUT
diff --git a/docs/_esnet/templates/navbar.html b/docs/_esnet/templates/navbar.html
index 2b100398b..d458cf2e6 100644
--- a/docs/_esnet/templates/navbar.html
+++ b/docs/_esnet/templates/navbar.html
@@ -9,8 +9,6 @@
{%- block sidebarlogo %}
-
-
{%- if logo %} {%- endif %}
{%- endblock %}
{% if theme_navbar_title -%}{{ theme_navbar_title|e }}{%- else -%}{{ project|e }}{%- endif -%}
diff --git a/docs/conf.py b/docs/conf.py
index 5ae7201f6..da13608a5 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -45,17 +45,17 @@
# General information about the project.
project = u'iperf3'
-copyright = u'2014-2023, ESnet'
+copyright = u'2014-2026, ESnet'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
-version = '3.13'
+version = '3.20'
# The full version, including alpha/beta/rc tags.
-release = '3.13'
+release = '3.20'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
@@ -128,7 +128,8 @@
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
-html_logo = "_esnet/static/ESnet_Final_Logos_All_Blue_Circle_Stamp_RGB.png"
+html_logo = "_static/esnet/ESnet_Final_Logos_All_Blue_Circle_Stamp_RGB.png"
+
# The name of an image file (within the static path) to use as favicon of the
@@ -158,7 +159,8 @@
#html_use_smartypants = True
# Custom sidebar templates, maps document names to template names.
-html_sidebars = {'index': None, 'search': None, '*': ['localtoc.html']}
+#html_sidebars = {'index': None, 'search': None, '*': ['localtoc.html']}
+html_sidebars = {'index': [], 'search': [], '**': ['localtoc.html']}
# Additional templates that should be rendered to pages, maps page names to
# template names.
diff --git a/docs/dev.rst b/docs/dev.rst
index 98548b478..2ae56da44 100644
--- a/docs/dev.rst
+++ b/docs/dev.rst
@@ -30,6 +30,9 @@ Then submit to the iperf3 issue tracker on GitHub:
https://github.com/esnet/iperf/issues
+For reporting potential security issues, please contact the developers at
+iperf@es.net.
+
**Note:** Issues submitted to the old iperf3 issue tracker on Google
Code (or comments to existing issues on the Google Code issue tracker)
will be ignored.
@@ -130,25 +133,34 @@ The developers increment the:
Release Engineering Checklist
-----------------------------
-1. Update the ``README`` and ``RELNOTES.md`` files to be accurate. Make sure
- that the "Known Issues" section of the ``README`` file and in this document
+1. Start from a clean source tree (be sure that ``git status`` emits
+ no output). Also ensure up-to-date installs of ``autoconf`` and
+ ``automake``.
+
+2. Ensure that ``README.md`` and ``LICENSE`` have correct copyright
+ dates.
+
+3. Update the ``README.md`` and ``RELNOTES.md`` files to be accurate. Make sure
+ that the "Known Issues" section of the ``README.md`` file and in this document
are up to date.
-2. Compose a release announcement. Most of the release announcement
+4. Compose a release announcement. Most of the release announcement
can be written before tagging. Usually the previous version's
announcement can be used as a starting point.
-3. Preferably starting from a clean source tree (be sure that ``git
- status`` emits no output), make the changes necessary to produce
+5. Make the changes necessary to produce
the new version, such as bumping version numbers::
vi RELNOTES.md # update version number and release date
vi configure.ac # update version parameter in AC_INIT
- vi src/iperf3.1 # update manpage revision date if needed
- vi src/libiperf.3 # update manpage revision date if needed
+ # (there should not be any "+" in artifacts)
+ vi src/iperf3.1 # update manpage revision date (only if needed)
+ vi src/libiperf.3 # update manpage revision date (only if needed)
git commit -a # commit changes to the local repository only
+ # (commit log should mention version number)
./bootstrap.sh # regenerate configure script, etc.
git commit -a # commit changes to the local repository only
+ # (commit can be simply "Regen.")
# Assuming that $VERSION is the version number to be released...
./make_release tag $VERSION # this creates a tag in the local repo
@@ -156,43 +168,60 @@ Release Engineering Checklist
These steps should be done on a platform with a relatively recent
version of autotools / libtools. Examples are MacOS / MacPorts or
- FreeBSD. The versions of these tools in CentOS 6 are somewhat
+ FreeBSD. The versions of these tools in CentOS and similar
+ distributions are somewhat
older and probably should be avoided.
- The result will be a release artifact that should be used for
- pre-testing.
+ The result will be release artifacts that should be used for
+ pre-testing. One will be a compressed tarball
+ (e.g. ``iperf-3.17.1.tar.gz``) and the other will contain SHA256
+ checksum (e.g. ``iperf-3.17.1.tar.gz.sha256``)
-4. Stage the tarball (and a file containing the SHA256 hash) to the
- download site. Currently this is located on ``downloads.es.net``.
+6. Stage the tarball (and a file containing the SHA256 hash) to the
+ download site. Currently this is located on ``downloads.es.net``
+ in the directory ``/var/www/html/pub/iperf/``.
-5. From another host, test the link in the release announcement by
+7. From another host, test the link in the release announcement by
downloading a fresh copy of the file and verifying the SHA256
checksum. Checking all other links in the release announcement is
strongly recommended as well.
-6. Also verify (with file(1)) that the tarball is actually a gzipped
+ The link to the tarball will be something of the form
+ ``https://downloads.es.net/pub/iperf/iperf-3.17.1.tar.gz``. If
+ composing a release announcement using a HTML-aware editor, verify
+ the link targets point to the correct artifacts.
+
+8. Also verify (with file(1)) that the tarball is actually a gzipped
tarball.
-7. For extra points, actually try downloading, compiling, and
- smoke-testing the results of the tarball on all supported
- platforms.
+9. Try downloading, compiling, and smoke-testing the results of the
+ tarball on all supported platforms.
-8. Plug the SHA256 checksum into the release announcement.
+10. Verify that the version string in ``iperf3 --version`` matches the
+ version number of the artifacts.
-9. PGP-sign the release announcement text using ``gpg --clearsign``.
- The signed announcement will be sent out in a subsequent emails,
- but could also be archived. Decoupling the signing from emailing
- allows a signed release announcement to be resent via email or sent
- by other, non-email means.
+11. Plug the SHA256 checksum into the release announcement.
-10. At this point, the release can and should be considered
+12. (optional) PGP-sign the release announcement text using ``gpg
+ --clearsign``. The signed announcement will be sent out in a
+ subsequent emails, but could also be archived. Decoupling the
+ signing from emailing allows a signed release announcement to be
+ resent via email or sent by other, non-email means.
+
+13. At this point, the release can and should be considered
finalized. To commit the release-engineering-related changes to
GitHub and make them public, push them out thusly::
git push # Push version changes
git push --tags # Push the new tag to the GitHub repo
-11. Send the PGP-signed release announcement to the following
+14. Update GitHub Releases with the current release notes. Start from:
+ ``https://github.com/esnet/iperf/releases/new``. Remember to
+ properly select the tag from the dropdown menu and drop
+ the artifacts into the GitHub Release. Check "Set as the latest
+ release" and (optionally) "Create a discussion for this release".
+
+15. Send the release announcement to the following
addresses. Remember to turn off signing in the MUA, if
applicable. Remember to check the source address when posting to
lists, as "closed" list will reject posting from all from
@@ -214,12 +243,15 @@ Release Engineering Checklist
sending process by sending a copy to oneself first and attempting
to verify the signature is highly encouraged.
-12. Update the iperf3 Project News section of the documentation site
+16. Announce the new release in the #iperf3 channel in ESnet Slack.
+
+17. Update the iperf3 Project News section of the documentation site
to announce the new release (see ``docs/news.rst`` and
``docs/conf.py`` in the source tree) and deploy a new build of the
- documentation to GitHub Pages.
+ documentation to GitHub Pages. Be sure to double-check version
+ numbers and copyright dates.
-13. If an update to the on-line manual page is needed, it can be
+18. If an update to the on-line manual page is needed, it can be
generated with this sequence of commands (tested on CentOS 7) and
import the result into ``invoking.rst``::
@@ -227,6 +259,19 @@ Release Engineering Checklist
export TERM
nroff -Tascii -c -man src/iperf3.1 | ul | sed 's/^/ /' > iperf3.txt
+19. Update the version number in ``configure.ac`` to some
+ post-release number (with a "+") and regenerate::
+
+ vi configure.ac # update version in AC_INIT, add "+"
+ git commit configure.ac # commit changes to local repository
+ # commit log should mention
+ # "post-release version bump"
+ ./bootstrap.sh # regenerate configure script, etc.
+ git commit -a # commit changes to local repository
+ # (commit can be simply "Regen.")
+ # test
+ git push
+
Code Authors
------------
diff --git a/docs/faq.rst b/docs/faq.rst
index 7b700269b..b203e2a8f 100644
--- a/docs/faq.rst
+++ b/docs/faq.rst
@@ -22,7 +22,14 @@ What is the history of iperf3, and what is the difference between iperf2 and ipe
current development is focused is on using UDP for latency testing, as well
as broad platform support.
- As of this writing (2017), both iperf2 and iperf3 are being actively
+ In 2023, iperf3 was modified and restructured to support
+ multi-threading, so that it uses one thread per test stream. This
+ allows it to use multiple CPU cores during tests, which in turn
+ permit it to keep up with continually increasing network link and
+ path bandwidths across the backbones of ESnet and other network
+ providers.
+
+ As of this writing (2024), both iperf2 and iperf3 are being actively
(although independently) developed. We recommend being familiar with
both tools, and use whichever tool’s features best match your needs.
@@ -30,9 +37,22 @@ What is the history of iperf3, and what is the difference between iperf2 and ipe
https://fasterdata.es.net/performance-testing/network-troubleshooting-tools/throughput-tool-comparision/
iperf3 parallel stream performance is much less than iperf2. Why?
- iperf3 is single threaded, and iperf2 is multi-threaded. We
- recommend using iperf2 for parallel streams.
- If you want to use multiple iperf3 streams use the method described `here `_.
+ Versions of iperf3 before version 3.16 were all single threaded, and
+ iperf2 is multi-threaded. This could result in a performance gap
+ because iperf3 was only able to use one CPU core on a host, which
+ turned into a bottleneck when trying to do high bitrate tests
+ (faster than about 25 Gbps).
+
+ Beginning with version 3.16, iperf3 is multi-threaded, which allows
+ it to take advantage of multiple CPU cores during a test (one thread
+ per stream). iperf3 has been observed to send and receive
+ approximately 160Gbps on a 200Gbps path in a test involving multiple
+ TCP flows, with little or no tuning.
+
+ Prior to multi-threading support in iperf3, one might need to use
+ the method described `here
+ `_
+ to achieve faster speeds.
I’m trying to use iperf3 on Windows, but having trouble. What should I do?
iperf3 is not officially supported on Windows, but iperf2 is. We
diff --git a/docs/index.rst b/docs/index.rst
index 0f4b4c6d5..20266f57f 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -22,7 +22,7 @@ original iperf. These include, for example, a zero-copy mode and
optional JSON output. Note that iperf3 is *not* backwards compatible
with the original iperf.
-Primary development for iperf3 takes place on CentOS Linux, FreeBSD,
+Primary development for iperf3 takes place on Ubuntu Linux, FreeBSD,
and macOS. At this time, these are the only officially
supported platforms, however there have been some reports of success
with OpenBSD, Android, and other Linux distributions.
diff --git a/docs/invoking.rst b/docs/invoking.rst
index 5b09463fa..f498ce05c 100644
--- a/docs/invoking.rst
+++ b/docs/invoking.rst
@@ -29,8 +29,6 @@ the executable.
IPERF3(1) User Manuals IPERF3(1)
-
-
NAME
iperf3 - perform network throughput tests
@@ -52,7 +50,7 @@ the executable.
iperf3 --server
- Note that many iperf3 parameters have both short (-s) and long
+ Note that many iperf3 parameters have both short (-s) and long
(--server) forms. In this section we will generally use the short form
of command-line flags, unless only the long form of a flag is avail-
able.
@@ -64,9 +62,9 @@ the executable.
iperf3 -s -p 5002
After the server is started, it will listen for connections from iperf3
- clients (in other words, the iperf3 program run in client mode). The
+ clients (in other words, the iperf3 program run in client mode). The
client mode can be started using the -c command-line option, which also
- requires a host to which iperf3 should connect. The host can by speci-
+ requires a host to which iperf3 should connect. The host can be speci-
fied by hostname, IPv4 literal, or IPv6 literal:
iperf3 -c iperf3.example.com
@@ -75,7 +73,7 @@ the executable.
iperf3 -c 2001:db8::1
- If the iperf3 server is running on a non-default TCP port, that port
+ If the iperf3 server is running on a non-default TCP port, that port
number needs to be specified on the client as well:
iperf3 -c iperf3.example.com -p 5002
@@ -98,26 +96,27 @@ the executable.
least one line of output per measurement interval (by default a mea-
surement interval lasts for one second, but this can be changed by the
-i option). Each line of output includes (at least) the time since the
- start of the test, amount of data transferred during the interval, and
- the average bitrate over that interval. Note that the values for each
- measurement interval are taken from the point of view of the endpoint
- process emitting that output (in other words, the output on the client
+ start of the test, amount of data transferred during the interval, and
+ the average bitrate over that interval. Note that the values for each
+ measurement interval are taken from the point of view of the endpoint
+ process emitting that output (in other words, the output on the client
shows the measurement interval data for the client.
- At the end of the test is a set of statistics that shows (at least as
- much as possible) a summary of the test as seen by both the sender and
- the receiver, with lines tagged accordingly. Recall that by default
- the client is the sender and the server is the receiver, although as
+ At the end of the test is a set of statistics that shows (at least as
+ much as possible) a summary of the test as seen by both the sender and
+ the receiver, with lines tagged accordingly. Recall that by default
+ the client is the sender and the server is the receiver, although as
indicated above, use of the -R flag will reverse these roles.
- The client can be made to retrieve the server-side output for a given
+ The client can be made to retrieve the server-side output for a given
test by specifying the --get-server-output flag.
Either the client or the server can produce its output in a JSON struc-
ture, useful for integration with other programs, by passing it the -J
- flag. Because the contents of the JSON structure are only completely
+ flag. Normally the contents of the JSON structure are only completely
known after the test has finished, no JSON output will be emitted until
- the end of the test.
+ the end of the test. By enabling line-delimited JSON multiple objects
+ will be emitted to provide a real-time parsable JSON output.
iperf3 has a (overly) large set of command-line options that can be
used to set the parameters of a test. They are given in the "GENERAL
@@ -127,355 +126,403 @@ the executable.
GENERAL OPTIONS
-p, --port n
- set server port to listen on/connect to to n (default 5201)
+ Set server port to listen on/connect to to n (default 5201)
- -f, --format
- [kmgtKMGT] format to report: Kbits/Mbits/Gbits/Tbits
+ -f, --format [kmgtKMGT]
+ Set format to report: Kbits/Mbits/Gbits/Tbits
-i, --interval n
- pause n seconds between periodic throughput reports; default is
- 1, use 0 to disable
+ Pause n seconds between periodic throughput reports; default is
+ 1, use 0 to disable.
-I, --pidfile file
- write a file with the process ID, most useful when running as a
- daemon.
+ Write a file with the process ID. This option is most useful
+ when running as a daemon.
-F, --file name
- Use a file as the source (on the sender) or sink (on the
- receiver) of data, rather than just generating random data or
- throwing it away. This feature is used for finding whether or
- not the storage subsystem is the bottleneck for file transfers.
- It does not turn iperf3 into a file transfer tool. The length,
- attributes, and in some cases contents of the received file may
- not match those of the original file.
+ Use a file as the source (on the sender) or sink (on the re-
+ ceiver) of data, rather than just generating random data or
+ throwing it away. This feature is used for finding whether or
+ not the storage subsystem is the bottleneck for file transfers.
+ It does not turn iperf3 into a file transfer tool. The length,
+ attributes, and in some cases contents of the received file may
+ not match those of the original file. This option is unavailable
+ when doing --udp tests.
-A, --affinity n/n,m
- Set the CPU affinity, if possible (Linux, FreeBSD, and Windows
- only). On both the client and server you can set the local
- affinity by using the n form of this argument (where n is a CPU
- number). In addition, on the client side you can override the
- server's affinity for just that one test, using the n,m form of
- argument. Note that when using this feature, a process will
- only be bound to a single CPU (as opposed to a set containing
+ Set the CPU affinity, if possible (Linux, FreeBSD, and Windows
+ only). On both the client and server you can set the local
+ affinity by using the n form of this argument (where n is a CPU
+ number). In addition, on the client side you can override the
+ server's affinity for just that one test, using the n,m form of
+ argument. Note that when using this feature, a process will
+ only be bound to a single CPU (as opposed to a set containing
potentially multiple CPUs).
-B, --bind host[%dev]
- bind to the specific interface associated with address host. If
+ Bind to the specific interface associated with address host. If
an optional interface is specified, it is treated as a shortcut
- for --bind-dev dev. Note that a percent sign and interface
- device name are required for IPv6 link-local address literals.
+ for --bind-dev dev. Note that a percent sign and interface de-
+ vice name are required for IPv6 link-local address literals, in
+ order to set the link-local scope.
--bind-dev dev
- bind to the specified network interface. This option uses
- SO_BINDTODEVICE, and may require root permissions. (Available
+ Bind to the specified network interface. This option uses
+ SO_BINDTODEVICE, and may require root permissions. (Available
on Linux and possibly other systems.)
-V, --verbose
- give more detailed output
+ Produce more detailed output.
-J, --json
- output in JSON format
+ Output in JSON format instead of the default human-readable out-
+ put.
+
+ --json-stream
+ Output in line-delimited JSON format instead of the default hu-
+ man-readable output. This option overrides the --json option, if
+ that option was also specified.
+
+ --json-stream-full-output
+ Output in JSON format with JSON streams enabled. This flag only
+ takes effect if the --json-stream option was also specified.
--logfile file
- send output to a log file.
+ Send output to a log file.
--forceflush
- force flushing output at every interval. Used to avoid buffer-
+ Force flushing output at every interval. Used to avoid buffer-
ing when sending output to pipe.
--timestamps[=format]
- prepend a timestamp at the start of each output line. By
- default, timestamps have the format emitted by ctime(1).
- Optionally, = followed by a format specification can be passed
- to customize the timestamps, see strftime(3). If this optional
- format is given, the = must immediately follow the --timestamps
- option with no whitespace intervening.
+ Prepend a timestamp at the start of each output line. By de-
+ fault, timestamps have the format emitted by ctime(1). Option-
+ ally, = followed by a format specification can be passed to cus-
+ tomize the timestamps, see strftime(3). If this optional format
+ is given, the = must immediately follow the --timestamps option
+ with no whitespace intervening.
--rcv-timeout #
- set idle timeout for receiving data during active tests. The
- receiver will halt a test if no data is received from the sender
- for this number of ms (default to 12000 ms, or 2 minutes).
+ Set idle timeout for receiving data during active tests. The re-
+ ceiver will halt a test if no data is received from the sender
+ for this number of ms (default to 120000 ms, or 2 minutes).
--snd-timeout #
- set timeout for unacknowledged TCP data (on both test and con-
+ Set timeout for unacknowledged TCP data (on both test and con-
trol connections) This option can be used to force a faster test
- timeout in case of a network partition during a test. The
- required parameter is specified in ms, and defaults to the sys-
- tem settings. This functionality depends on the TCP_USER_TIME-
- OUT socket option, and will not work on systems that do not sup-
- port it.
+ timeout in case of a network partition during a test. The re-
+ quired parameter is specified in ms, and defaults to the system
+ settings. This functionality depends on the TCP_USER_TIMEOUT
+ socket option, and will not work on systems that do not support
+ it.
+
+ --use-pkcs1-padding
+ This option is only meaningful when using iperf3's authentica-
+ tion features. Versions of iperf3 prior to 3.17 used PCKS1
+ padding in the RSA-encrypted credentials, which was vulnerable
+ to a side-channel attack that could reveal a server's private
+ key. Beginning with iperf-3.17, OAEP padding is used, however
+ this is a breaking change that is not compatible with older
+ iperf3 versions. Use this option to preserve the less secure,
+ but more compatible, behavior.
+
+ -m, --mptcp
+ Use the MPTCP variant for the current protocol. This only ap-
+ plies to TCP and enables MPTCP usage.
-d, --debug
- emit debugging output. Primarily (perhaps exclusively) of use
+ Emit debugging output. Primarily (perhaps exclusively) of use
to developers.
-v, --version
- show version information and quit
+ Show version information and quit.
-h, --help
- show a help synopsis
+ Show a help synopsis.
SERVER SPECIFIC OPTIONS
-s, --server
- run in server mode
+ Run in server mode.
-D, --daemon
- run the server in background as a daemon
+ Run the server in background as a daemon.
-1, --one-off
- handle one client connection, then exit. If an idle time is
- set, the server will exit after that amount of time with no con-
- nection.
+ Handle (at most) one client connection, then exit. If an idle
+ time is set, the server will exit after that amount of time with
+ no connection.
--idle-timeout n
- restart the server after n seconds in case it gets stuck. In
+ Restart the server after n seconds in case it gets stuck. In
one-off mode, this is the number of seconds the server will wait
before exiting.
- --server-bitrate-limit n[KMGT]
- set a limit on the server side, which will cause a test to abort
- if the client specifies a test of more than n bits per second,
+ --server-max-duration
+ The maximum time, in seconds, that an iperf client can run
+ against the server. When the sum of the client's time and omit
+ values exceeds the max duration set by the server or the
+ client's time value is 0, the measurement is rejected.
+
+ --server-bitrate-limit n[KMGT][/n]
+ Set a limit on the server side, which will cause a test to abort
+ if the client specifies a test of more than n bits per second,
or if the average data sent or received by the client (including
- all data streams) is greater than n bits per second. The
- default limit is zero, which implies no limit. The interval
- over which to average the data rate is 5 seconds by default, but
- can be specified by adding a '/' and a number to the bitrate
+ all data streams) is greater than n bits per second. The de-
+ fault limit is 0, which implies no limit. The interval over
+ which to average the data rate is 5 seconds by default, but can
+ be specified by adding a / character and a number to the bitrate
specifier.
--rsa-private-key-path file
- path to the RSA private key (not password-protected) used to
- decrypt authentication credentials from the client (if built
- with OpenSSL support).
+ Path to the RSA private key (not password-protected) used to de-
+ crypt authentication credentials from the client (if built with
+ OpenSSL support).
--authorized-users-path file
- path to the configuration file containing authorized users cre-
+ Path to the configuration file containing authorized users cre-
dentials to run iperf tests (if built with OpenSSL support).
The file is a comma separated list of usernames and password
hashes; more information on the structure of the file can be
found in the EXAMPLES section.
- --time-skew-thresholdsecond seconds
- time skew threshold (in seconds) between the server and client
- during the authentication process.
+ --time-skew-threshold seconds
+ Specify the allowable time skew threshold (in seconds) between
+ the server and client during the authentication process.
CLIENT SPECIFIC OPTIONS
-c, --client host[%dev]
- run in client mode, connecting to the specified server. By
- default, a test consists of sending data from the client to the
+ Run in client mode, connecting to the specified server. By de-
+ fault, a test consists of sending data from the client to the
server, unless the -R flag is specified. If an optional inter-
face is specified, it is treated as a shortcut for --bind-dev
- dev. Note that a percent sign and interface device name are
- required for IPv6 link-local address literals.
+ dev. Note that a percent sign and interface device name are re-
+ quired for IPv6 link-local address literals.
- --sctp use SCTP rather than TCP (FreeBSD and Linux)
+ --sctp Use SCTP for tests rather than TCP (FreeBSD and Linux). Note
+ that TCP communication is still used for the control connection
+ between client and server.
-u, --udp
- use UDP rather than TCP
+ Use UDP for tests rather than TCP. Note that TCP communication
+ is still used for the control connection between client and
+ server.
--connect-timeout n
- set timeout for establishing the initial control connection to
- the server, in milliseconds. The default behavior is the oper-
- ating system's timeout for TCP connection establishment. Pro-
- viding a shorter value may speed up detection of a down iperf3
+ Set timeout for establishing the initial control connection to
+ the server, in milliseconds. The default behavior is the oper-
+ ating system's timeout for TCP connection establishment. Pro-
+ viding a shorter value may speed up detection of a down iperf3
server.
-b, --bitrate n[KMGT]
- set target bitrate to n bits/sec (default 1 Mbit/sec for UDP,
- unlimited for TCP/SCTP). If there are multiple streams (-P
- flag), the throughput limit is applied separately to each
- stream. You can also add a '/' and a number to the bitrate
- specifier. This is called "burst mode". It will send the given
- number of packets without pausing, even if that temporarily
- exceeds the specified throughput limit. Setting the target
- bitrate to 0 will disable bitrate limits (particularly useful
- for UDP tests). This throughput limit is implemented internally
- inside iperf3, and is available on all platforms. Compare with
+ Set target bitrate to n bits/sec (default 1 Mbit/sec for UDP,
+ unlimited for TCP/SCTP). If there are multiple streams (-P
+ flag), the throughput limit is applied separately to each
+ stream. You can also add a '/' and a number to the bitrate
+ specifier. This is called "burst mode". It will perform the
+ given number of sends without pausing, even if that temporarily
+ exceeds the specified throughput limit. Setting the target bi-
+ trate to 0 will disable bitrate limits (particularly useful for
+ UDP tests). This throughput limit is implemented internally in-
+ side iperf3, and is available on all platforms. Compare with
the --fq-rate flag. This option replaces the --bandwidth flag,
which is now deprecated but (at least for now) still accepted.
--pacing-timer n[KMGT]
- set pacing timer interval in microseconds (default 1000
- microseconds, or 1 ms). This controls iperf3's internal pacing
- timer for the -b/--bitrate option. The timer fires at the
- interval set by this parameter. Smaller values of the pacing
+ Set pacing timer interval in microseconds (default 1000 mi-
+ croseconds, or 1 ms). This controls iperf3's internal pacing
+ timer for the -b/--bitrate option. The timer fires at the in-
+ terval set by this parameter. Smaller values of the pacing
timer parameter smooth out the traffic emitted by iperf3, but
potentially at the cost of performance due to more frequent
timer processing.
--fq-rate n[KMGT]
Set a rate to be used with fair-queueing based socket-level pac-
- ing, in bits per second. This pacing (if specified) will be in
- addition to any pacing due to iperf3's internal throughput pac-
- ing (-b/--bitrate flag), and both can be specified for the same
- test. Only available on platforms supporting the SO_MAX_PAC-
- ING_RATE socket option (currently only Linux). The default is
+ ing, in bits per second. This pacing (if specified) will be in
+ addition to any pacing due to iperf3's internal throughput pac-
+ ing (-b/--bitrate flag), and both can be specified for the same
+ test. Only available on platforms supporting the SO_MAX_PAC-
+ ING_RATE socket option (currently only Linux). The default is
no fair-queueing based pacing.
--no-fq-socket-pacing
This option is deprecated and will be removed. It is equivalent
- to specifying --fq-rate=0.
+ to specifying --fq-rate=0 .
-t, --time n
- time in seconds to transmit for (default 10 secs)
+ Set the test duration in seconds (default 10 secs). The -t , -n
+ ", and" -k options are mutually exclusive.
-n, --bytes n[KMGT]
- number of bytes to transmit (instead of -t)
+ Set the number of bytes to transmit. The -t , -n ", and" -k op-
+ tions are mutually exclusive.
-k, --blockcount n[KMGT]
- number of blocks (packets) to transmit (instead of -t or -n)
+ Set the number of blocks (packets) to transmit. The -t , -n ",
+ and" -k options are mutually exclusive.
-l, --length n[KMGT]
- length of buffer to read or write. For TCP tests, the default
- value is 128KB. In the case of UDP, iperf3 tries to dynamically
- determine a reasonable sending size based on the path MTU; if
- that cannot be determined it uses 1460 bytes as a sending size.
- For SCTP tests, the default size is 64KB.
+ Set the length of the buffer to read or write. For TCP tests,
+ the default value is 128KB. In the case of UDP, iperf3 tries to
+ dynamically determine a reasonable sending size based on the
+ path MTU; if that cannot be determined it uses 1460 bytes as a
+ sending size. For SCTP tests, the default size is 64KB.
--cport port
- bind data streams to a specific client port (for TCP and UDP
- only, default is to use an ephemeral port)
+ Bind data streams to a specific TCP or UDP client port (for TCP
+ and UDP only, default is to use an ephemeral port).
-P, --parallel n
- number of parallel client streams to run. Note that iperf3 is
- single threaded, so if you are CPU bound, this will not yield
- higher throughput.
+ Set the number of parallel client streams to run. Beginning with
+ iperf-3.16, iperf3 will spawn off a separate thread for each
+ test stream. Using multiple streams may result in higher
+ throughput than a single stream, in cases where network through-
+ put is CPU-limited.
-R, --reverse
- reverse the direction of a test, so that the server sends data
- to the client
+ Reverse the direction of a test, so that the server sends data
+ to the client.
--bidir
- test in both directions (normal and reverse), with both the
+ Test in both directions (normal and reverse), with both the
client and server sending and receiving data simultaneously
-w, --window n[KMGT]
- set socket buffer size / window size. This value gets sent to
- the server and used on that side too; on both sides this option
- sets both the sending and receiving socket buffer sizes. This
- option can be used to set (indirectly) the maximum TCP window
- size. Note that on Linux systems, the effective maximum window
- size is approximately double what is specified by this option
- (this behavior is not a bug in iperf3 but a "feature" of the
- Linux kernel, as documented by tcp(7) and socket(7)).
+ Set t he socket buffer size / window size. This value gets sent
+ to the server and used on that side too; on both sides this op-
+ tion sets both the sending and receiving socket buffer sizes.
+ This option can be used to set (indirectly) the maximum TCP win-
+ dow size. Note that on Linux systems, the effective maximum
+ window size is approximately double what is specified by this
+ option. This behavior is not a bug in iperf3 but a feature of
+ the Linux kernel, as documented by tcp(7) and socket(7)).
-M, --set-mss n
- set TCP/SCTP maximum segment size (MTU - 40 bytes)
+ Set the TCP/SCTP maximum segment size (MTU - 40 bytes).
-N, --no-delay
- set TCP/SCTP no delay, disabling Nagle's Algorithm
+ Set the TCP/SCTP no delay option, disabling Nagle's Algorithm.
-4, --version4
- only use IPv4
+ Force the use of IPv4.
-6, --version6
- only use IPv6
+ Force the use of IPv6.
-S, --tos n
- set the IP type of service. The usual prefixes for octal and hex
- can be used, i.e. 52, 064 and 0x34 all specify the same value.
+ Set the IP type of service bits. The usual prefixes for octal
+ and hex can be used, i.e. 52, 064 and 0x34 all specify the same
+ value.
--dscp dscp
- set the IP DSCP bits. Both numeric and symbolic values are
- accepted. Numeric values can be specified in decimal, octal and
- hex (see --tos above). To set both the DSCP bits and the ECN
- bits, use --tos.
+ Set the IP DSCP bits. Both numeric and symbolic values are ac-
+ cepted. Numeric values can be specified in decimal, octal and
+ hex (see --tos above).
-L, --flowlabel n
- set the IPv6 flow label (currently only supported on Linux)
+ Set the IPv6 flow label (currently only supported on Linux).
-X, --xbind name
Bind SCTP associations to a specific subset of links using
sctp_bindx(3). The --B flag will be ignored if this flag is
specified. Normally SCTP will include the protocol addresses of
- all active links on the local host when setting up an associa-
- tion. Specifying at least one --X name will disable this behav-
- iour. This flag must be specified for each link to be included
- in the association, and is supported for both iperf servers and
+ all active links on the local host when setting up an associa-
+ tion. Specifying at least one --X name will disable this behav-
+ iour. This flag must be specified for each link to be included
+ in the association, and is supported for both iperf servers and
clients (the latter are supported by passing the first --X argu-
ment to bind(2)). Hostnames are accepted as arguments and are
- resolved using getaddrinfo(3). If the --4 or --6 flags are
- specified, names which do not resolve to addresses within the
+ resolved using getaddrinfo(3). If the --4 or --6 flags are also
+ specified, names which do not resolve to addresses within the
specified protocol family will be ignored.
--nstreams n
Set number of SCTP streams.
-Z, --zerocopy
- Use a "zero copy" method of sending data, such as sendfile(2),
+ Use a "zero copy" method of sending data, such as sendfile(2),
instead of the usual write(2).
+ --skip-rx-copy
+ Ignored received packet data, using the MSG_TRUNC flag to the
+ recv(2) system call.
+
-O, --omit n
- Perform pre-test for N seconds and omit the pre-test statistics,
+ Perform pre-test for n seconds and omit the pre-test statistics,
to skip past the TCP slow-start period.
-T, --title str
- Prefix every output line with this string.
+ Prefix every output line with the string str.
--extra-data str
- Specify an extra data string field to be included in JSON out-
+ Specify an extra data string field to be included in JSON out-
put.
-C, --congestion algo
- Set the congestion control algorithm (Linux and FreeBSD only).
- An older --linux-congestion synonym for this flag is accepted
+ Set the congestion control algorithm (Linux and FreeBSD only).
+ An older --linux-congestion synonym for this flag is accepted
but is deprecated.
--get-server-output
Get the output from the server. The output format is determined
by the server (in particular, if the server was invoked with the
- --json flag, the output will be in JSON format, otherwise it
- will be in human-readable format). If the client is run with
- --json, the server output is included in a JSON object; other-
- wise it is appended at the bottom of the human-readable output.
+ --json flag, the output will be in JSON format, otherwise it
+ will be in human-readable format). If the client is run with
+ --json, the server output is included in a JSON object; other-
+ wise it is appended at the bottom of the human-readable output.
+ Note that the server output is available only if the test com-
+ pletes, not if it is interrupted.
--udp-counters-64bit
Use 64-bit counters in UDP test packets. The use of this option
- can help prevent counter overflows during long or high-bitrate
- UDP tests. Both client and server need to be running at least
- version 3.1 for this option to work. It may become the default
+ can help prevent counter overflows during long or high-bitrate
+ UDP tests. Both client and server need to be running at least
+ version 3.1 for this option to work. It may become the default
behavior at some point in the future.
--repeating-payload
- Use repeating pattern in payload, instead of random bytes. The
- same payload is used in iperf2 (ASCII '0..9' repeating). It
- might help to test and reveal problems in networking gear with
- hardware compression (including some WiFi access points), where
- iperf2 and iperf3 perform differently, just based on payload
- entropy.
+ Use repeating pattern in payload, instead of random bytes. The
+ same payload is used in iperf2 (ASCII '0..9' repeating). It
+ might help to test and reveal problems in networking gear with
+ hardware compression (including some WiFi access points), where
+ iperf2 and iperf3 perform differently, just based on payload en-
+ tropy.
--dont-fragment
Set the IPv4 Don't Fragment (DF) bit on outgoing packets. Only
applicable to tests doing UDP over IPv4.
--username username
- username to use for authentication to the iperf server (if built
- with OpenSSL support). The password will be prompted for inter-
- actively when the test is run. Note, the password to use can
+ Specify username to use for authentication to the iperf server
+ (if built with OpenSSL support). The password will be prompted
+ for interactively when the test is run. Note the password can
also be specified via the IPERF3_PASSWORD environment variable.
If this variable is present, the password prompt will be
skipped.
--rsa-public-key-path file
- path to the RSA public key used to encrypt authentication cre-
- dentials (if built with OpenSSL support)
+ Set path to the RSA public key used to encrypt authentication
+ credentials (if built with OpenSSL support).
EXAMPLES
Authentication - RSA Keypair
The authentication feature of iperf3 requires an RSA public keypair.
The public key is used to encrypt the authentication token containing
- the user credentials, while the private key is used to decrypt the
- authentication token. The private key must be in PEM format and addi-
+ the user credentials, while the private key is used to decrypt the au-
+ thentication token. The private key must be in PEM format and addi-
tionally must not have a password set. The public key must be in PEM
format and use SubjectPrefixKeyInfo encoding. An example of a set of
UNIX/Linux commands using OpenSSL to generate a correctly-formed key-
pair follows:
- > openssl genrsa -des3 -out private.pem 2048
- > openssl rsa -in private.pem -outform PEM -pubout -out public.pem
- > openssl rsa -in private.pem -out private_not_protected.pem -out-
- form PEM
+ > openssl genrsa -des3 -out private.pem 2048
+ > openssl rsa -in private.pem -outform PEM -pubout -out pub-
+ lic.pem
+ > openssl rsa -in private.pem -out private_not_protected.pem \
+ -outform PEM
After these commands, the public key will be contained in the file pub-
lic.pem and the private key will be contained in the file pri-
@@ -490,16 +537,16 @@ the executable.
character). An example of commands to generate the password hash on a
UNIX/Linux system is given below:
- > S_USER=mario S_PASSWD=rossi
- > echo -n "{$S_USER}$S_PASSWD" | sha256sum | awk '{ print $1 }'
+ > S_USER=mario S_PASSWD=rossi
+ > echo -n "{$S_USER}$S_PASSWD" | sha256sum | awk '{ print $1 }'
An example of a password file (with an entry corresponding to the above
username and password) is given below:
- > cat credentials.csv
- # file format: username,sha256
- mario,bf7a49a846d44b454a5d11e7acfaf13d138bbe0b7483aa3e050879700572709b
-
+ > cat credentials.csv
+ # file format: username,sha256
+ mario,bf7a49a846d44b454a5d11e7ac-
+ faf13d138bbe0b7483aa3e050879700572709b
AUTHORS
A list of the contributors to iperf3 can be found within the documenta-
@@ -509,10 +556,7 @@ the executable.
SEE ALSO
libiperf(3), https://software.es.net/iperf
-
-
- ESnet September 2022 IPERF3(1)
-
+ ESnet November 2025 IPERF3(1)
The iperf3 manual page will typically be installed in manual
section 1.
diff --git a/docs/news.rst b/docs/news.rst
index be69696f2..269f6f489 100644
--- a/docs/news.rst
+++ b/docs/news.rst
@@ -1,6 +1,113 @@
iperf3 Project News
===================
+2025-11-14: iperf-3.20 released
+--------------------------------
+
+| URL: https://downloads.es.net/pub/iperf/iperf-3.20.tar.gz
+| SHA256: ``3acc572d1ecca4e0b20359c7bf0132ddc80d982efeee20c86f6726a9a6094388``
+
+iperf-3.20 fixes a number of bugs and also adds some minor
+enhancements. More details on the changes can be found in the release
+notes.
+
+2025-07-25: iperf-3.19.1 released
+----------------------------------
+
+| URL: https://downloads.es.net/pub/iperf/iperf-3.19.1.tar.gz
+| SHA256: ``dc63f89ec581ea99f8b558d8eb35109de06383010db5a1906c208a562ba0c270``
+
+iperf-3.19.1 is a security fix release to address three issues
+reported by Han Lee of Apple Information Security. More information
+can be found in the release notes.
+
+2025-05-16: iperf-3.19 released
+--------------------------------
+
+| URL: https://downloads.es.net/pub/iperf/iperf-3.19.tar.gz
+| SHA256: ``040161da1555ec7411a9d81191049830ef37717d429a94ee6cf0842618e0e29c``
+
+iperf-3.19 includes support for MP-TCPv1 under Linux, keepalives on
+the control connection, support for the MSG_TRUNC receive option, and
+a number of minor bug fixes. The release notes contain more
+information on the changes.
+
+
+2024-12-13: iperf-3.18 released
+--------------------------------
+
+| URL: https://downloads.es.net/pub/iperf/iperf-3.18.tar.gz
+| SHA256: ``c0618175514331e766522500e20c94bfb293b4424eb27d7207fb427b88d20bab``
+
+iperf-3.18 includes fixes for several bugs, including one that could
+cause an iperf3 server to crash if fed malformed data on the control
+connection. The release notes contain more information on the bug and
+the fix.
+
+
+2024-05-13: iperf-3.17.1 released
+----------------------------------
+
+| URL: https://downloads.es.net/pub/iperf/iperf-3.17.1.tar.gz
+| SHA256: ``84404ca8431b595e86c473d8f23d8bb102810001f15feaf610effd3b318788aa``
+
+iperf-3.17.1 fixes some issues with version numbers in various
+places. It is otherwise identical to iperf-3.17.
+
+
+2024-05-10: iperf-3.17 released
+--------------------------------
+| URL: https://downloads.es.net/pub/iperf/iperf-3.17.tar.gz
+| SHA256: ``077ede831b11b733ecf8b273abd97f9630fd7448d3ec1eaa789f396d82c8c943``
+
+iperf 3.17 contains a fix for a minor security vulnerability related
+to iperf3's authentication feature and its use of RSA-encrypted
+credentials. The release notes contain more
+details on this breaking change, and how to revert to older, less
+secure behavior if needed for backward compatibility with older
+versions of iperf3.
+
+This version also contains a new streaming JSON output format (enabled
+with the --json-stream) option, and a number of other bug fixes.
+
+2023-12-01: iperf-3.16 released
+--------------------------------
+| URL: https://downloads.es.net/pub/iperf/iperf-3.16.tar.gz
+| SHA256: ``cc740c6bbea104398cc3e466befc515a25896ec85e44a662d5f4a767b9cf713e``
+
+iperf 3.16 uses multiple threads to serve parallel tests for improved
+throughput on high-speed links. It also includes support for
+OpenSSL 3. More details are provided in the release notes.
+
+2023-09-14: iperf-3.15 released
+--------------------------------
+| URL: https://downloads.es.net/pub/iperf/iperf-3.15.tar.gz
+| SHA256: ``bdb77c11f72bce90214883159577fa24412013e62b2083cf5f54391d79b1d8ff``
+
+iperf 3.15 fixes that could cause an iperf3 server process to hang
+waiting for input on the control connection. For more information,
+please see:
+
+https://downloads.es.net/pub/iperf/esnet-secadv-2023-0002.txt.asc
+
+This version of iperf3 also includes several other minor bug fixes,
+which are summarized in the release notes.
+
+2023-07-07: iperf-3.14 released
+--------------------------------
+| URL: https://downloads.es.net/pub/iperf/iperf-3.14.tar.gz
+| SHA256: ``723fcc430a027bc6952628fa2a3ac77584a1d0bd328275e573fc9b206c155004``
+
+iperf 3.14 fixes a memory allocation hazard that allowed a remote user
+to crash an iperf3 process (server or client).
+
+More information on this specific fix can be found at:
+
+https://downloads.es.net/pub/iperf/esnet-secadv-2023-0001.txt.asc
+
+This version of iperf3 also includes a number of minor bug fixes,
+which are summarized in the release notes.
+
2023-02-16: iperf-3.13 released
----------------------------------
| URL: https://downloads.es.net/pub/iperf/iperf-3.13.tar.gz
diff --git a/docs/obtaining.rst b/docs/obtaining.rst
index 8a83cda7b..3414822f5 100644
--- a/docs/obtaining.rst
+++ b/docs/obtaining.rst
@@ -16,7 +16,7 @@ of binary packages for various operating systems and distributions:
* Fedora / RedHat Linux / CentOS / Rocky: `iperf3
`_ and
`iperf3-devel
- `_ in Fedora
19 and 20 and in Fedora EPEL 5, 6, and 7. iperf3 is included as a
part of RedHat Enterprise Linux 7.4 and later (as well as CentOS 7.4
and later, and all versions of Rocky Linux), and can generally be
@@ -31,6 +31,8 @@ of binary packages for various operating systems and distributions:
locations, including ` `_
(`discussion thread
`_).
+* Android: iperf3 binaries for Android can be found in several
+ locations, including ` `_.
Source Distributions
--------------------
@@ -72,7 +74,7 @@ GitHub using:
``git clone https://github.com/esnet/iperf.git``
-Primary development for iperf3 takes place on CentOS 7 Linux, FreeBSD 11,
-and macOS 10.12. At this time, these are the only officially supported
+Primary development for iperf3 takes place on Ubuntu Linux, FreeBSD,
+and macOS. At this time, these are the only officially supported
platforms, however there have been some reports of success with
NetBSD, OpenBSD, Windows, Solaris, Android, and iOS.
diff --git a/examples/Makefile.in b/examples/Makefile.in
index 93898c070..448884043 100644
--- a/examples/Makefile.in
+++ b/examples/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.5 from Makefile.am.
+# Makefile.in generated by automake 1.18.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2021 Free Software Foundation, Inc.
+# Copyright (C) 1994-2025 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -70,6 +70,8 @@ am__make_running_with_option = \
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))
+am__rm_f = rm -f $(am__rm_f_notfound)
+am__rm_rf = rm -rf $(am__rm_f_notfound)
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
@@ -92,6 +94,7 @@ noinst_PROGRAMS = mic$(EXEEXT) mis$(EXEEXT)
subdir = examples
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/config/ax_check_openssl.m4 \
+ $(top_srcdir)/config/ax_pthread.m4 \
$(top_srcdir)/config/iperf_config_static_bin.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -191,6 +194,7 @@ AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CSCOPE = @CSCOPE@
CTAGS = @CTAGS@
@@ -215,6 +219,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
+LDCONFIG = @LDCONFIG@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
@@ -245,6 +250,10 @@ PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
+PTHREAD_CC = @PTHREAD_CC@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_CXX = @PTHREAD_CXX@
+PTHREAD_LIBS = @PTHREAD_LIBS@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
@@ -261,8 +270,11 @@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
+am__rm_f_notfound = @am__rm_f_notfound@
am__tar = @am__tar@
am__untar = @am__untar@
+am__xargs_n = @am__xargs_n@
+ax_pthread_config = @ax_pthread_config@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
@@ -348,13 +360,8 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
$(am__aclocal_m4_deps):
clean-noinstPROGRAMS:
- @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
- echo " rm -f" $$list; \
- rm -f $$list || exit $$?; \
- test -n "$(EXEEXT)" || exit 0; \
- list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
- echo " rm -f" $$list; \
- rm -f $$list
+ $(am__rm_f) $(noinst_PROGRAMS)
+ test -z "$(EXEEXT)" || $(am__rm_f) $(noinst_PROGRAMS:$(EXEEXT)=)
mic$(EXEEXT): $(mic_OBJECTS) $(mic_DEPENDENCIES) $(EXTRA_mic_DEPENDENCIES)
@rm -f mic$(EXEEXT)
@@ -375,7 +382,7 @@ distclean-compile:
$(am__depfiles_remade):
@$(MKDIR_P) $(@D)
- @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+ @: >>$@
am--depfiles: $(am__depfiles_remade)
@@ -485,6 +492,7 @@ cscopelist-am: $(am__tagged_files)
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
@@ -546,8 +554,8 @@ mostlyclean-generic:
clean-generic:
distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+ -$(am__rm_f) $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@@ -558,7 +566,7 @@ clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
mostlyclean-am
distclean: distclean-am
- -rm -f ./$(DEPDIR)/mic-mic.Po
+ -rm -f ./$(DEPDIR)/mic-mic.Po
-rm -f ./$(DEPDIR)/mis-mis.Po
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
@@ -605,7 +613,7 @@ install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
- -rm -f ./$(DEPDIR)/mic-mic.Po
+ -rm -f ./$(DEPDIR)/mic-mic.Po
-rm -f ./$(DEPDIR)/mis-mis.Po
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
@@ -647,3 +655,10 @@ uninstall-am:
# 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:
+
+# Tell GNU make to disable its built-in pattern rules.
+%:: %,v
+%:: RCS/%,v
+%:: RCS/%
+%:: s.%
+%:: SCCS/s.%
diff --git a/examples/mic.c b/examples/mic.c
index 17fd7b2f9..6e2403f60 100644
--- a/examples/mic.c
+++ b/examples/mic.c
@@ -4,9 +4,7 @@
#include
#include
#include
-#ifdef HAVE_STDINT_H
#include
-#endif
#include
diff --git a/examples/mis.c b/examples/mis.c
index 8090c13d9..315b9e8ed 100644
--- a/examples/mis.c
+++ b/examples/mis.c
@@ -4,9 +4,7 @@
#include
#include
#include
-#ifdef HAVE_STDINT_H
#include
-#endif
#include
diff --git a/make_release b/make_release
index 54c43f0b9..ef805808f 100755
--- a/make_release
+++ b/make_release
@@ -21,7 +21,7 @@ echo dirname $dirname
do_tag ()
{
- git tag -s -m "tagging $tag" "$tag"
+ git tag -m "tagging $tag" "$tag"
}
do_tar ()
diff --git a/src/Makefile.am b/src/Makefile.am
index 11d3e175d..f2ae68335 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -33,6 +33,8 @@ libiperf_la_SOURCES = \
iperf_util.h \
iperf_time.c \
iperf_time.h \
+ iperf_pthread.c \
+ iperf_pthread.h \
dscp.c \
net.c \
net.h \
@@ -100,3 +102,6 @@ TESTS = \
t_auth
dist_man_MANS = iperf3.1 libiperf.3
+
+install-exec-hook:
+ if test -n "$(LDCONFIG)"; then $(LDCONFIG) || true; fi
diff --git a/src/Makefile.in b/src/Makefile.in
index 91c9b156e..8e6d82ffc 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.5 from Makefile.am.
+# Makefile.in generated by automake 1.18.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2021 Free Software Foundation, Inc.
+# Copyright (C) 1994-2025 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -72,6 +72,8 @@ am__make_running_with_option = \
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))
+am__rm_f = rm -f $(am__rm_f_notfound)
+am__rm_rf = rm -rf $(am__rm_f_notfound)
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
@@ -103,6 +105,7 @@ TESTS = t_timer$(EXEEXT) t_units$(EXEEXT) t_uuid$(EXEEXT) \
subdir = src
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/config/ax_check_openssl.m4 \
+ $(top_srcdir)/config/ax_pthread.m4 \
$(top_srcdir)/config/iperf_config_static_bin.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -139,18 +142,17 @@ 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; }; \
+ { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+ $(am__cd) "$$dir" && echo $$files | $(am__xargs_n) 40 $(am__rm_f); }; \
}
LTLIBRARIES = $(lib_LTLIBRARIES)
libiperf_la_LIBADD =
am_libiperf_la_OBJECTS = cjson.lo iperf_api.lo iperf_error.lo \
iperf_auth.lo iperf_client_api.lo iperf_locale.lo \
iperf_server_api.lo iperf_tcp.lo iperf_udp.lo iperf_sctp.lo \
- iperf_util.lo iperf_time.lo dscp.lo net.lo tcp_info.lo \
- timer.lo units.lo
+ iperf_util.lo iperf_time.lo iperf_pthread.lo dscp.lo net.lo \
+ tcp_info.lo timer.lo units.lo
libiperf_la_OBJECTS = $(am_libiperf_la_OBJECTS)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
@@ -167,9 +169,9 @@ am__iperf3_profile_SOURCES_DIST = main.c cjson.c cjson.h flowlabel.h \
iperf_auth.c iperf_client_api.c iperf_locale.c iperf_locale.h \
iperf_server_api.c iperf_tcp.c iperf_tcp.h iperf_udp.c \
iperf_udp.h iperf_sctp.c iperf_sctp.h iperf_util.c \
- iperf_util.h iperf_time.c iperf_time.h dscp.c net.c net.h \
- portable_endian.h queue.h tcp_info.c timer.c timer.h units.c \
- units.h version.h
+ iperf_util.h iperf_time.c iperf_time.h iperf_pthread.c \
+ iperf_pthread.h dscp.c net.c net.h portable_endian.h queue.h \
+ tcp_info.c timer.c timer.h units.c units.h version.h
am__objects_1 = iperf3_profile-cjson.$(OBJEXT) \
iperf3_profile-iperf_api.$(OBJEXT) \
iperf3_profile-iperf_error.$(OBJEXT) \
@@ -182,6 +184,7 @@ am__objects_1 = iperf3_profile-cjson.$(OBJEXT) \
iperf3_profile-iperf_sctp.$(OBJEXT) \
iperf3_profile-iperf_util.$(OBJEXT) \
iperf3_profile-iperf_time.$(OBJEXT) \
+ iperf3_profile-iperf_pthread.$(OBJEXT) \
iperf3_profile-dscp.$(OBJEXT) iperf3_profile-net.$(OBJEXT) \
iperf3_profile-tcp_info.$(OBJEXT) \
iperf3_profile-timer.$(OBJEXT) iperf3_profile-units.$(OBJEXT)
@@ -247,6 +250,7 @@ am__depfiles_remade = ./$(DEPDIR)/cjson.Plo ./$(DEPDIR)/dscp.Plo \
./$(DEPDIR)/iperf3_profile-iperf_client_api.Po \
./$(DEPDIR)/iperf3_profile-iperf_error.Po \
./$(DEPDIR)/iperf3_profile-iperf_locale.Po \
+ ./$(DEPDIR)/iperf3_profile-iperf_pthread.Po \
./$(DEPDIR)/iperf3_profile-iperf_sctp.Po \
./$(DEPDIR)/iperf3_profile-iperf_server_api.Po \
./$(DEPDIR)/iperf3_profile-iperf_tcp.Po \
@@ -260,14 +264,14 @@ am__depfiles_remade = ./$(DEPDIR)/cjson.Plo ./$(DEPDIR)/dscp.Plo \
./$(DEPDIR)/iperf3_profile-units.Po ./$(DEPDIR)/iperf_api.Plo \
./$(DEPDIR)/iperf_auth.Plo ./$(DEPDIR)/iperf_client_api.Plo \
./$(DEPDIR)/iperf_error.Plo ./$(DEPDIR)/iperf_locale.Plo \
- ./$(DEPDIR)/iperf_sctp.Plo ./$(DEPDIR)/iperf_server_api.Plo \
- ./$(DEPDIR)/iperf_tcp.Plo ./$(DEPDIR)/iperf_time.Plo \
- ./$(DEPDIR)/iperf_udp.Plo ./$(DEPDIR)/iperf_util.Plo \
- ./$(DEPDIR)/net.Plo ./$(DEPDIR)/t_api-t_api.Po \
- ./$(DEPDIR)/t_auth-t_auth.Po ./$(DEPDIR)/t_timer-t_timer.Po \
- ./$(DEPDIR)/t_units-t_units.Po ./$(DEPDIR)/t_uuid-t_uuid.Po \
- ./$(DEPDIR)/tcp_info.Plo ./$(DEPDIR)/timer.Plo \
- ./$(DEPDIR)/units.Plo
+ ./$(DEPDIR)/iperf_pthread.Plo ./$(DEPDIR)/iperf_sctp.Plo \
+ ./$(DEPDIR)/iperf_server_api.Plo ./$(DEPDIR)/iperf_tcp.Plo \
+ ./$(DEPDIR)/iperf_time.Plo ./$(DEPDIR)/iperf_udp.Plo \
+ ./$(DEPDIR)/iperf_util.Plo ./$(DEPDIR)/net.Plo \
+ ./$(DEPDIR)/t_api-t_api.Po ./$(DEPDIR)/t_auth-t_auth.Po \
+ ./$(DEPDIR)/t_timer-t_timer.Po ./$(DEPDIR)/t_units-t_units.Po \
+ ./$(DEPDIR)/t_uuid-t_uuid.Po ./$(DEPDIR)/tcp_info.Plo \
+ ./$(DEPDIR)/timer.Plo ./$(DEPDIR)/units.Plo
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@@ -430,12 +434,13 @@ 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" \
+ $$am__collect_skipped_logs \
--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
+# 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).
@@ -454,6 +459,11 @@ if test -f "./$$f"; then dir=./; \
elif test -f "$$f"; then dir=; \
else dir="$(srcdir)/"; fi; \
tst=$$dir$$f; log='$@'; \
+if test -n '$(IGNORE_SKIPPED_LOGS)'; then \
+ am__collect_skipped_logs='--collect-skipped-logs no'; \
+else \
+ am__collect_skipped_logs=''; \
+fi; \
if test -n '$(DISABLE_HARD_ERRORS)'; then \
am__enable_hard_errors=no; \
else \
@@ -517,6 +527,7 @@ AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CSCOPE = @CSCOPE@
CTAGS = @CTAGS@
@@ -541,6 +552,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
+LDCONFIG = @LDCONFIG@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
@@ -571,6 +583,10 @@ PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
+PTHREAD_CC = @PTHREAD_CC@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_CXX = @PTHREAD_CXX@
+PTHREAD_LIBS = @PTHREAD_LIBS@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
@@ -587,8 +603,11 @@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
+am__rm_f_notfound = @am__rm_f_notfound@
am__tar = @am__tar@
am__untar = @am__untar@
+am__xargs_n = @am__xargs_n@
+ax_pthread_config = @ax_pthread_config@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
@@ -658,6 +677,8 @@ libiperf_la_SOURCES = \
iperf_util.h \
iperf_time.c \
iperf_time.h \
+ iperf_pthread.c \
+ iperf_pthread.h \
dscp.c \
net.c \
net.h \
@@ -749,12 +770,12 @@ iperf_config.h: stamp-h1
@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1
stamp-h1: $(srcdir)/iperf_config.h.in $(top_builddir)/config.status
- @rm -f stamp-h1
- cd $(top_builddir) && $(SHELL) ./config.status src/iperf_config.h
+ $(AM_V_at)rm -f stamp-h1
+ $(AM_V_GEN)cd $(top_builddir) && $(SHELL) ./config.status src/iperf_config.h
$(srcdir)/iperf_config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
- ($(am__cd) $(top_srcdir) && $(AUTOHEADER))
- rm -f stamp-h1
- touch $@
+ $(AM_V_GEN)($(am__cd) $(top_srcdir) && $(AUTOHEADER))
+ $(AM_V_at)rm -f stamp-h1
+ $(AM_V_at)touch $@
distclean-hdr:
-rm -f iperf_config.h stamp-h1
@@ -799,25 +820,15 @@ uninstall-binPROGRAMS:
`; \
test -n "$$list" || exit 0; \
echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
- cd "$(DESTDIR)$(bindir)" && rm -f $$files
+ cd "$(DESTDIR)$(bindir)" && $(am__rm_f) $$files
clean-binPROGRAMS:
- @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
- echo " rm -f" $$list; \
- rm -f $$list || exit $$?; \
- test -n "$(EXEEXT)" || exit 0; \
- list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
- echo " rm -f" $$list; \
- rm -f $$list
+ $(am__rm_f) $(bin_PROGRAMS)
+ test -z "$(EXEEXT)" || $(am__rm_f) $(bin_PROGRAMS:$(EXEEXT)=)
clean-noinstPROGRAMS:
- @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
- echo " rm -f" $$list; \
- rm -f $$list || exit $$?; \
- test -n "$(EXEEXT)" || exit 0; \
- list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
- echo " rm -f" $$list; \
- rm -f $$list
+ $(am__rm_f) $(noinst_PROGRAMS)
+ test -z "$(EXEEXT)" || $(am__rm_f) $(noinst_PROGRAMS:$(EXEEXT)=)
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
@$(NORMAL_INSTALL)
@@ -844,15 +855,13 @@ uninstall-libLTLIBRARIES:
done
clean-libLTLIBRARIES:
- -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
+ -$(am__rm_f) $(lib_LTLIBRARIES)
@list='$(lib_LTLIBRARIES)'; \
locs=`for p in $$list; do echo $$p; done | \
sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
sort -u`; \
- test -z "$$locs" || { \
- echo rm -f $${locs}; \
- rm -f $${locs}; \
- }
+ echo rm -f $${locs}; \
+ $(am__rm_f) $${locs}
libiperf.la: $(libiperf_la_OBJECTS) $(libiperf_la_DEPENDENCIES) $(EXTRA_libiperf_la_DEPENDENCIES)
$(AM_V_CCLD)$(LINK) -rpath $(libdir) $(libiperf_la_OBJECTS) $(libiperf_la_LIBADD) $(LIBS)
@@ -901,6 +910,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iperf3_profile-iperf_client_api.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iperf3_profile-iperf_error.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iperf3_profile-iperf_locale.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iperf3_profile-iperf_pthread.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iperf3_profile-iperf_sctp.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iperf3_profile-iperf_server_api.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iperf3_profile-iperf_tcp.Po@am__quote@ # am--include-marker
@@ -917,6 +927,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iperf_client_api.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iperf_error.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iperf_locale.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iperf_pthread.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iperf_sctp.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iperf_server_api.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iperf_tcp.Plo@am__quote@ # am--include-marker
@@ -935,7 +946,7 @@ distclean-compile:
$(am__depfiles_remade):
@$(MKDIR_P) $(@D)
- @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+ @: >>$@
am--depfiles: $(am__depfiles_remade)
@@ -1156,6 +1167,20 @@ iperf3_profile-iperf_time.obj: iperf_time.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(iperf3_profile_CFLAGS) $(CFLAGS) -c -o iperf3_profile-iperf_time.obj `if test -f 'iperf_time.c'; then $(CYGPATH_W) 'iperf_time.c'; else $(CYGPATH_W) '$(srcdir)/iperf_time.c'; fi`
+iperf3_profile-iperf_pthread.o: iperf_pthread.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(iperf3_profile_CFLAGS) $(CFLAGS) -MT iperf3_profile-iperf_pthread.o -MD -MP -MF $(DEPDIR)/iperf3_profile-iperf_pthread.Tpo -c -o iperf3_profile-iperf_pthread.o `test -f 'iperf_pthread.c' || echo '$(srcdir)/'`iperf_pthread.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/iperf3_profile-iperf_pthread.Tpo $(DEPDIR)/iperf3_profile-iperf_pthread.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='iperf_pthread.c' object='iperf3_profile-iperf_pthread.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(iperf3_profile_CFLAGS) $(CFLAGS) -c -o iperf3_profile-iperf_pthread.o `test -f 'iperf_pthread.c' || echo '$(srcdir)/'`iperf_pthread.c
+
+iperf3_profile-iperf_pthread.obj: iperf_pthread.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(iperf3_profile_CFLAGS) $(CFLAGS) -MT iperf3_profile-iperf_pthread.obj -MD -MP -MF $(DEPDIR)/iperf3_profile-iperf_pthread.Tpo -c -o iperf3_profile-iperf_pthread.obj `if test -f 'iperf_pthread.c'; then $(CYGPATH_W) 'iperf_pthread.c'; else $(CYGPATH_W) '$(srcdir)/iperf_pthread.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/iperf3_profile-iperf_pthread.Tpo $(DEPDIR)/iperf3_profile-iperf_pthread.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='iperf_pthread.c' object='iperf3_profile-iperf_pthread.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(iperf3_profile_CFLAGS) $(CFLAGS) -c -o iperf3_profile-iperf_pthread.obj `if test -f 'iperf_pthread.c'; then $(CYGPATH_W) 'iperf_pthread.c'; else $(CYGPATH_W) '$(srcdir)/iperf_pthread.c'; fi`
+
iperf3_profile-dscp.o: dscp.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(iperf3_profile_CFLAGS) $(CFLAGS) -MT iperf3_profile-dscp.o -MD -MP -MF $(DEPDIR)/iperf3_profile-dscp.Tpo -c -o iperf3_profile-dscp.o `test -f 'dscp.c' || echo '$(srcdir)/'`dscp.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/iperf3_profile-dscp.Tpo $(DEPDIR)/iperf3_profile-dscp.Po
@@ -1474,7 +1499,6 @@ distclean-tags:
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"; }; \
@@ -1550,10 +1574,37 @@ $(TEST_SUITE_LOG): $(TEST_LOGS)
result_count $$1 "XPASS:" $$xpass "$$red"; \
result_count $$1 "ERROR:" $$error "$$mgn"; \
}; \
+ output_system_information () \
+ { \
+ echo; \
+ { uname -a | $(AWK) '{ \
+ printf "System information (uname -a):"; \
+ for (i = 1; i < NF; ++i) \
+ { \
+ if (i != 2) \
+ printf " %s", $$i; \
+ } \
+ printf "\n"; \
+}'; } 2>&1; \
+ if test -r /etc/os-release; then \
+ echo "Distribution information (/etc/os-release):"; \
+ sed 8q /etc/os-release; \
+ elif test -r /etc/issue; then \
+ echo "Distribution information (/etc/issue):"; \
+ cat /etc/issue; \
+ fi; \
+ }; \
+ please_report () \
+ { \
+echo "Some test(s) failed. Please report this to $(PACKAGE_BUGREPORT),"; \
+echo "together with the test-suite.log file (gzipped) and your system"; \
+echo "information. Thanks."; \
+ }; \
{ \
echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \
$(am__rst_title); \
create_testsuite_report --no-color; \
+ output_system_information; \
echo; \
echo ".. contents:: :depth: 2"; \
echo; \
@@ -1573,26 +1624,25 @@ $(TEST_SUITE_LOG): $(TEST_LOGS)
create_testsuite_report --maybe-color; \
echo "$$col$$br$$std"; \
if $$success; then :; else \
- echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \
+ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG) for debugging.$${std}";\
if test -n "$(PACKAGE_BUGREPORT)"; then \
- echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \
+ please_report | sed -e "s/^/$${col}/" -e s/'$$'/"$${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)
+ @$(am__rm_f) $(RECHECK_LOGS)
+ @$(am__rm_f) $(RECHECK_LOGS:.log=.trs)
+ @$(am__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`; \
+ log_list=`echo $$log_list`; \
$(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \
exit $$?;
recheck: all
- @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+ @$(am__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; \
@@ -1651,6 +1701,7 @@ t_auth.log: t_auth$(EXEEXT)
@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
@@ -1715,15 +1766,15 @@ install-strip:
"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)
+ -$(am__rm_f) $(TEST_LOGS)
+ -$(am__rm_f) $(TEST_LOGS:.log=.trs)
+ -$(am__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)
+ -$(am__rm_f) $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@@ -1734,7 +1785,7 @@ clean-am: clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \
clean-libtool clean-noinstPROGRAMS mostlyclean-am
distclean: distclean-am
- -rm -f ./$(DEPDIR)/cjson.Plo
+ -rm -f ./$(DEPDIR)/cjson.Plo
-rm -f ./$(DEPDIR)/dscp.Plo
-rm -f ./$(DEPDIR)/iperf3-main.Po
-rm -f ./$(DEPDIR)/iperf3_profile-cjson.Po
@@ -1744,6 +1795,7 @@ distclean: distclean-am
-rm -f ./$(DEPDIR)/iperf3_profile-iperf_client_api.Po
-rm -f ./$(DEPDIR)/iperf3_profile-iperf_error.Po
-rm -f ./$(DEPDIR)/iperf3_profile-iperf_locale.Po
+ -rm -f ./$(DEPDIR)/iperf3_profile-iperf_pthread.Po
-rm -f ./$(DEPDIR)/iperf3_profile-iperf_sctp.Po
-rm -f ./$(DEPDIR)/iperf3_profile-iperf_server_api.Po
-rm -f ./$(DEPDIR)/iperf3_profile-iperf_tcp.Po
@@ -1760,6 +1812,7 @@ distclean: distclean-am
-rm -f ./$(DEPDIR)/iperf_client_api.Plo
-rm -f ./$(DEPDIR)/iperf_error.Plo
-rm -f ./$(DEPDIR)/iperf_locale.Plo
+ -rm -f ./$(DEPDIR)/iperf_pthread.Plo
-rm -f ./$(DEPDIR)/iperf_sctp.Plo
-rm -f ./$(DEPDIR)/iperf_server_api.Plo
-rm -f ./$(DEPDIR)/iperf_tcp.Plo
@@ -1798,7 +1851,8 @@ install-dvi: install-dvi-am
install-dvi-am:
install-exec-am: install-binPROGRAMS install-libLTLIBRARIES
-
+ @$(NORMAL_INSTALL)
+ $(MAKE) $(AM_MAKEFLAGS) install-exec-hook
install-html: install-html-am
install-html-am:
@@ -1820,7 +1874,7 @@ install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
- -rm -f ./$(DEPDIR)/cjson.Plo
+ -rm -f ./$(DEPDIR)/cjson.Plo
-rm -f ./$(DEPDIR)/dscp.Plo
-rm -f ./$(DEPDIR)/iperf3-main.Po
-rm -f ./$(DEPDIR)/iperf3_profile-cjson.Po
@@ -1830,6 +1884,7 @@ maintainer-clean: maintainer-clean-am
-rm -f ./$(DEPDIR)/iperf3_profile-iperf_client_api.Po
-rm -f ./$(DEPDIR)/iperf3_profile-iperf_error.Po
-rm -f ./$(DEPDIR)/iperf3_profile-iperf_locale.Po
+ -rm -f ./$(DEPDIR)/iperf3_profile-iperf_pthread.Po
-rm -f ./$(DEPDIR)/iperf3_profile-iperf_sctp.Po
-rm -f ./$(DEPDIR)/iperf3_profile-iperf_server_api.Po
-rm -f ./$(DEPDIR)/iperf3_profile-iperf_tcp.Po
@@ -1846,6 +1901,7 @@ maintainer-clean: maintainer-clean-am
-rm -f ./$(DEPDIR)/iperf_client_api.Plo
-rm -f ./$(DEPDIR)/iperf_error.Plo
-rm -f ./$(DEPDIR)/iperf_locale.Plo
+ -rm -f ./$(DEPDIR)/iperf_pthread.Plo
-rm -f ./$(DEPDIR)/iperf_sctp.Plo
-rm -f ./$(DEPDIR)/iperf_server_api.Plo
-rm -f ./$(DEPDIR)/iperf_tcp.Plo
@@ -1882,7 +1938,7 @@ uninstall-am: uninstall-binPROGRAMS uninstall-includeHEADERS \
uninstall-man: uninstall-man1 uninstall-man3
-.MAKE: all check-am install-am install-strip
+.MAKE: all check-am install-am install-exec-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \
check-am clean clean-binPROGRAMS clean-generic \
@@ -1892,7 +1948,7 @@ uninstall-man: uninstall-man1 uninstall-man3
distclean-tags distdir dvi dvi-am html html-am info info-am \
install install-am install-binPROGRAMS install-data \
install-data-am install-dvi install-dvi-am install-exec \
- install-exec-am install-html install-html-am \
+ install-exec-am install-exec-hook install-html install-html-am \
install-includeHEADERS install-info install-info-am \
install-libLTLIBRARIES install-man install-man1 install-man3 \
install-pdf install-pdf-am install-ps install-ps-am \
@@ -1907,6 +1963,16 @@ uninstall-man: uninstall-man1 uninstall-man3
.PRECIOUS: Makefile
+install-exec-hook:
+ if test -n "$(LDCONFIG)"; then $(LDCONFIG) || true; fi
+
# 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:
+
+# Tell GNU make to disable its built-in pattern rules.
+%:: %,v
+%:: RCS/%,v
+%:: RCS/%
+%:: s.%
+%:: SCCS/s.%
diff --git a/src/cjson.c b/src/cjson.c
index ed8c3fda6..46495f4a6 100644
--- a/src/cjson.c
+++ b/src/cjson.c
@@ -45,9 +45,8 @@
#include
#include
#include
-#ifdef HAVE_STDINT_H
#include
-#endif
+#include
#include
#ifdef ENABLE_LOCALES
@@ -90,18 +89,6 @@
#endif
#endif
-#if defined(HAVE_INTTYPES_H)
-# include
-#else
-# ifndef PRIu64
-# if sizeof(long) == 8
-# define PRIu64 "lu"
-# else
-# define PRIu64 "llu"
-# endif
-# endif
-#endif
-
typedef struct {
const unsigned char *json;
size_t position;
@@ -134,7 +121,7 @@ CJSON_PUBLIC(double) cJSON_GetNumberValue(const cJSON * const item)
{
if (!cJSON_IsNumber(item))
{
- return (double) NAN;
+ return (double) NAN; // cppcheck-suppress invalidFunctionArg
}
return item->valuedouble;
@@ -588,7 +575,7 @@ static cJSON_bool print_number(const cJSON * const item, printbuffer * const out
}
else if(d == (double)item->valueint)
{
- length = sprintf((char*)number_buffer, "%" PRIu64, item->valueint);
+ length = sprintf((char*)number_buffer, "%" PRId64, item->valueint);
}
else
{
diff --git a/src/cjson.h b/src/cjson.h
index 52da40dc3..706869762 100644
--- a/src/cjson.h
+++ b/src/cjson.h
@@ -23,9 +23,7 @@
#ifndef cJSON__h
#define cJSON__h
-#ifdef HAVE_STDINT_H
#include
-#endif
#ifdef __cplusplus
extern "C"
@@ -115,7 +113,7 @@ typedef struct cJSON
/* The type of the item, as above. */
int type;
- /* The item's string, if type==cJSON_String and type == cJSON_Raw */
+ /* The item's string, if type==cJSON_String and type == cJSON_Raw */
char *valuestring;
/* writing to valueint is DEPRECATED, use cJSON_SetNumberValue instead */
int64_t valueint;
diff --git a/src/iperf.h b/src/iperf.h
index e010c2d29..142384ad1 100644
--- a/src/iperf.h
+++ b/src/iperf.h
@@ -1,5 +1,5 @@
/*
- * iperf, Copyright (c) 2014-2020, The Regents of the University of
+ * iperf, Copyright (c) 2014-2020, 2023, The Regents of the University of
* California, through Lawrence Berkeley National Laboratory (subject
* to receipt of any required approvals from the U.S. Dept. of
* Energy). All rights reserved.
@@ -31,9 +31,8 @@
#include
#include
-#ifdef HAVE_STDINT_H
#include
-#endif
+#include
#include
#include
#ifndef _GNU_SOURCE
@@ -51,47 +50,62 @@
#include
#endif /* HAVE_CPUSET_SETAFFINITY */
-#if defined(HAVE_INTTYPES_H)
-# include
-#else
-# ifndef PRIu64
-# if sizeof(long) == 8
-# define PRIu64 "lu"
-# else
-# define PRIu64 "llu"
-# endif
-# endif
-#endif
-
#include "timer.h"
#include "queue.h"
#include "cjson.h"
#include "iperf_time.h"
+#include "portable_endian.h"
#if defined(HAVE_SSL)
#include
#include
#endif // HAVE_SSL
+#include "iperf_pthread.h"
+
+/*
+ * Atomic types highly desired, but if not, we approximate what we need
+ * with normal integers and warn.
+ */
+#ifdef HAVE_STDATOMIC_H
+#include
+#else
+#warning "No available."
+typedef uint64_t atomic_uint_fast64_t;
+#endif // HAVE_STDATOMIC_H
+
#if !defined(__IPERF_API_H)
-typedef uint64_t iperf_size_t;
+typedef uint_fast64_t iperf_size_t;
+typedef atomic_uint_fast64_t atomic_iperf_size_t;
#endif // __IPERF_API_H
+#if (defined(__vxworks)) || (defined(__VXWORKS__))
+typedef unsigned int uint
+#endif // __vxworks or __VXWORKS__
+
+struct iperf_sctp_info
+{
+ long rtt;
+ long pmtu;
+ uint32_t wnd;
+ uint32_t cwnd;
+};
+
struct iperf_interval_results
{
- iperf_size_t bytes_transferred; /* bytes transferred in this interval */
+ atomic_iperf_size_t bytes_transferred; /* bytes transferred in this interval */
struct iperf_time interval_start_time;
struct iperf_time interval_end_time;
float interval_duration;
/* for UDP */
- int interval_packet_count;
- int interval_outoforder_packets;
- int interval_cnt_error;
- int packet_count;
+ int64_t interval_packet_count;
+ int64_t interval_outoforder_packets;
+ int64_t interval_cnt_error;
+ int64_t packet_count;
double jitter;
- int outoforder_packets;
- int cnt_error;
+ int64_t outoforder_packets;
+ int64_t cnt_error;
int omitted;
#if (defined(linux) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)) && \
@@ -101,6 +115,9 @@ struct iperf_interval_results
/* Just placeholders, never accessed. */
char *tcpInfo;
#endif
+#if defined(HAVE_SCTP_H)
+ struct iperf_sctp_info sctp_info;
+#endif /* HAVE_SCTP_H */
long interval_retrans;
long snd_cwnd;
long snd_wnd;
@@ -109,17 +126,19 @@ struct iperf_interval_results
long rtt;
long rttvar;
long pmtu;
+ long reorder;
};
struct iperf_stream_result
{
- iperf_size_t bytes_received;
- iperf_size_t bytes_sent;
- iperf_size_t bytes_received_this_interval;
- iperf_size_t bytes_sent_this_interval;
- iperf_size_t bytes_sent_omit;
+ atomic_iperf_size_t bytes_received;
+ atomic_iperf_size_t bytes_sent;
+ atomic_iperf_size_t bytes_received_this_interval;
+ atomic_iperf_size_t bytes_sent_this_interval;
+ atomic_iperf_size_t bytes_sent_omit;
long stream_prev_total_retrans;
long stream_retrans;
+ long stream_reorder;
long stream_max_rtt;
long stream_min_rtt;
long stream_sum_rtt;
@@ -163,10 +182,21 @@ struct iperf_settings
char *client_password;
EVP_PKEY *client_rsa_pubkey;
#endif // HAVE_SSL
+ int skip_rx_copy; /* Whether to ignore received messages data, using MSG_TRUNC option */
int connect_timeout; /* socket connection timeout, in ms */
int idle_timeout; /* server idle time timeout */
unsigned int snd_timeout; /* Timeout for sending tcp messages in active mode, in us */
struct iperf_time rcv_timeout; /* Timeout for receiving messages in active mode, in us */
+ int cntl_ka; /* Use Control TCP connection Keepalive */
+ int cntl_ka_keepidle; /* Control TCP connection Keepalive idle time (TCP_KEEPIDLE) */
+ int cntl_ka_interval; /* Control TCP connection Keepalive interval between retries (TCP_KEEPINTV) */
+ int cntl_ka_count; /* Control TCP connection Keepalive number of retries (TCP_KEEPCNT) */
+ /* GSO/GRO fields always present to allow client-server negotiation regardless of local support */
+ int gso;
+ int gso_dg_size;
+ int gso_bf_size;
+ int gro;
+ int gro_bf_size;
};
struct iperf_test;
@@ -175,6 +205,10 @@ struct iperf_stream
{
struct iperf_test* test;
+ pthread_t thr;
+ int thread_created;
+ int done;
+
/* configurable members */
int local_port;
int remote_port;
@@ -199,15 +233,16 @@ struct iperf_stream
* for udp measurements - This can be a structure outside stream, and
* stream can have a pointer to this
*/
- int packet_count;
- int peer_packet_count;
- int omitted_packet_count;
+ int64_t packet_count;
+ int64_t peer_packet_count;
+ int64_t peer_omitted_packet_count;
+ int64_t omitted_packet_count;
double jitter;
double prev_transit;
- int outoforder_packets;
- int omitted_outoforder_packets;
- int cnt_error;
- int omitted_cnt_error;
+ int64_t outoforder_packets;
+ int64_t omitted_outoforder_packets;
+ int64_t cnt_error;
+ int64_t omitted_cnt_error;
uint64_t target;
struct sockaddr_storage local_addr;
@@ -266,6 +301,8 @@ enum debug_level {
struct iperf_test
{
+ pthread_mutex_t print_mutex;
+
char role; /* 'c' lient or 's' erver */
enum iperf_mode mode;
int sender_has_retransmits;
@@ -281,6 +318,7 @@ struct iperf_test
int server_port;
int omit; /* duration of omit period (-O flag) */
int duration; /* total duration of test (-t flag) */
+ int max_server_duration; /* maximum possible duration of test as enforced by the server (--max-server-duration flag) */
char *diskfile_name; /* -F option */
int affinity, server_affinity; /* -A option */
#if defined(HAVE_CPUSET_SETAFFINITY)
@@ -307,6 +345,7 @@ struct iperf_test
char *server_authorized_users;
EVP_PKEY *server_rsa_private_key;
int server_skew_threshold;
+ int use_pkcs1_padding;
#endif // HAVE_SSL
/* boolean variables for Options */
@@ -317,6 +356,10 @@ struct iperf_test
int bidirectional; /* --bidirectional */
int verbose; /* -V option - verbose mode */
int json_output; /* -J option - JSON output */
+ int json_stream; /* --json-stream */
+ int json_stream_full_output; /* --json-stream-full-output */
+ void (*json_callback) (struct iperf_test *, char *); /* allow user apps to receive the
+ JSON strings,instead of writing them to the output file */
int zerocopy; /* -Z option - use sendfile */
int debug; /* -d option - enable debug */
enum debug_level debug_level; /* -d option option - level of debug messages to show */
@@ -327,6 +370,7 @@ struct iperf_test
int repeating_payload; /* --repeating-payload */
int timestamps; /* --timestamps */
char *timestamp_format;
+ int mptcp; /* -m, --mptcp */
char *json_output_string; /* rendered JSON output if json_output is set */
/* Select related parameters */
@@ -351,11 +395,11 @@ struct iperf_test
int num_streams; /* total streams in the test (-P) */
- iperf_size_t bytes_sent;
- iperf_size_t blocks_sent;
+ atomic_iperf_size_t bytes_sent;
+ atomic_iperf_size_t blocks_sent;
- iperf_size_t bytes_received;
- iperf_size_t blocks_received;
+ atomic_iperf_size_t bytes_received;
+ atomic_iperf_size_t blocks_received;
iperf_size_t bitrate_limit_stats_count; /* Number of stats periods accumulated for server's total bitrate average */
iperf_size_t *bitrate_limit_intervals_traffic_bytes; /* Pointer to a cyclic array that includes the last interval's bytes transferred */
@@ -411,6 +455,8 @@ struct iperf_test
#define UDP_BUFFER_EXTRA 1024
+#define MAX_PARAMS_JSON_STRING 8 * 1024
+
/* constants for command line arg sanity checks */
#define MB (1024 * 1024)
#define MAX_TCP_BUFFER (512 * MB)
@@ -422,8 +468,9 @@ struct iperf_test
#define MIN_INTERVAL 0.1
#define MAX_INTERVAL 60.0
#define MAX_TIME 86400
+#define MAX_OMIT_TIME 600
#define MAX_BURST 1000
-#define MAX_MSS (9 * 1024)
+#define MAX_MSS (32 * 1024 - 1)
#define MAX_STREAMS 128
#define TIMESTAMP_FORMAT "%c "
@@ -431,11 +478,21 @@ struct iperf_test
extern int gerror; /* error value from getaddrinfo(3), for use in internal error handling */
/* UDP "connect" message and reply (textual value for Wireshark, etc. readability - legacy was numeric) */
+
+#if BYTE_ORDER == BIG_ENDIAN
+#define UDP_CONNECT_MSG 0x39383736
+#define UDP_CONNECT_REPLY 0x36373839
+#define LEGACY_UDP_CONNECT_REPLY 0xb168de3a
+#else
#define UDP_CONNECT_MSG 0x36373839 // "6789" - legacy value was 123456789
#define UDP_CONNECT_REPLY 0x39383736 // "9876" - legacy value was 987654321
#define LEGACY_UDP_CONNECT_REPLY 987654321 // Old servers may still reply with the legacy value
+#endif
/* In Reverse mode, maximum number of packets to wait for "accept" response - to handle out of order packets */
#define MAX_REVERSE_OUT_OF_ORDER_PACKETS 2
+#define GSO_BF_MAX_SIZE MAX_UDP_BLOCKSIZE
+#define GRO_BF_MAX_SIZE MAX_UDP_BLOCKSIZE
+
#endif /* !__IPERF_H */
diff --git a/src/iperf3.1 b/src/iperf3.1
index b76bd8795..33c0b3cf7 100644
--- a/src/iperf3.1
+++ b/src/iperf3.1
@@ -1,4 +1,4 @@
-.TH IPERF3 1 "September 2022" ESnet "User Manuals"
+.TH IPERF3 1 "November 2025" ESnet "User Manuals"
.SH NAME
iperf3 \- perform network throughput tests
.SH SYNOPSIS
@@ -43,7 +43,7 @@ iperf3 clients (in other words, the iperf3 program run in client
mode).
The client mode can be started using the -c command-line option,
which also requires a host to which iperf3 should connect.
-The host can by specified by hostname, IPv4 literal, or IPv6 literal:
+The host can be specified by hostname, IPv4 literal, or IPv6 literal:
.IP
\fCiperf3 -c iperf3.example.com\fR
.IP
@@ -96,9 +96,11 @@ test by specifying the --get-server-output flag.
Either the client or the server can produce its output in a JSON
structure, useful for integration with other programs, by passing it
the -J flag.
-Because the contents of the JSON structure are only completely known
+Normally the contents of the JSON structure are only completely known
after the test has finished, no JSON output will be emitted until the
end of the test.
+By enabling line-delimited JSON multiple objects will be emitted to
+provide a real-time parsable JSON output.
.PP
iperf3 has a (overly) large set of command-line options that can be
used to set the parameters of a test.
@@ -108,17 +110,18 @@ viewed by running iperf3 with the -h flag.
.SH "GENERAL OPTIONS"
.TP
.BR -p ", " --port " \fIn\fR"
-set server port to listen on/connect to to \fIn\fR (default 5201)
+Set server port to listen on/connect to to \fIn\fR (default 5201)
.TP
-.BR -f ", " --format " "
-[kmgtKMGT] format to report: Kbits/Mbits/Gbits/Tbits
+.BR -f ", " --format " [kmgtKMGT]"
+Set format to report: Kbits/Mbits/Gbits/Tbits
.TP
.BR -i ", " --interval " \fIn\fR"
-pause \fIn\fR seconds between periodic throughput reports;
-default is 1, use 0 to disable
+Pause \fIn\fR seconds between periodic throughput reports;
+default is 1, use 0 to disable.
.TP
.BR -I ", " --pidfile " \fIfile\fR"
-write a file with the process ID, most useful when running as a daemon.
+Write a file with the process ID.
+This option is most useful when running as a daemon.
.TP
.BR -F ", " --file " \fIname\fR"
Use a file as the source (on the sender) or sink (on the receiver) of
@@ -127,7 +130,10 @@ This feature is used for finding whether or not the storage subsystem
is the bottleneck for file transfers.
It does not turn iperf3 into a file transfer tool.
The length, attributes, and in some cases contents of the received
-file may not match those of the original file.
+file may not match those of the original file. This option is
+unavailable when doing
+.B --udp
+tests.
.TP
.BR -A ", " --affinity " \fIn/n,m\fR"
Set the CPU affinity, if possible (Linux, FreeBSD, and Windows only).
@@ -141,31 +147,46 @@ to a single CPU (as opposed to a set containing potentially multiple
CPUs).
.TP
.BR -B ", " --bind " \fIhost\fR[\fB%\fIdev\fR]"
-bind to the specific interface associated with address \fIhost\fR.
+Bind to the specific interface associated with address \fIhost\fR.
If an optional interface is specified, it is treated as a shortcut
for \fB--bind-dev \fIdev\fR.
-Note that a percent sign and interface device name are required for IPv6 link-local address literals.
+Note that a percent sign and interface device name are required for
+IPv6 link-local address literals, in order to set the link-local
+scope.
.TP
.BR --bind-dev " \fIdev\fR"
-bind to the specified network interface.
+Bind to the specified network interface.
This option uses SO_BINDTODEVICE, and may require root permissions.
(Available on Linux and possibly other systems.)
.TP
.BR -V ", " --verbose " "
-give more detailed output
+Produce more detailed output.
.TP
.BR -J ", " --json " "
-output in JSON format
+Output in JSON format instead of the default human-readable
+output.
+.TP
+.BR --json-stream " "
+Output in line-delimited JSON format instead of the default
+human-readable output. This option overrides the
+.B --json
+option, if that option was also specified.
+.TP
+.BR --json-stream-full-output " "
+Output in JSON format with JSON streams enabled. This flag only takes
+effect if the
+.B --json-stream
+option was also specified.
.TP
.BR --logfile " \fIfile\fR"
-send output to a log file.
+Send output to a log file.
.TP
.BR --forceflush " "
-force flushing output at every interval.
+Force flushing output at every interval.
Used to avoid buffering when sending output to pipe.
.TP
.BR --timestamps "[\fB=\fIformat\fR]"
-prepend a timestamp at the start of each output line.
+Prepend a timestamp at the start of each output line.
By default, timestamps have the format emitted by
.BR ctime ( 1 ).
Optionally, \fC=\fR followed by
@@ -176,87 +197,113 @@ If this optional format is given, the \fC=\fR must immediately
follow the \fB--timestamps\fR option with no whitespace intervening.
.TP
.BR --rcv-timeout " \fI#\fR"
-set idle timeout for receiving data during active tests. The receiver
+Set idle timeout for receiving data during active tests. The receiver
will halt a test if no data is received from the sender for this
-number of ms (default to 12000 ms, or 2 minutes).
+number of ms (default to 120000 ms, or 2 minutes).
.TP
.BR --snd-timeout " \fI#\fR"
-set timeout for unacknowledged TCP data (on both test and control
+Set timeout for unacknowledged TCP data (on both test and control
connections) This option can be used to force a faster test timeout
in case of a network partition during a test. The required
parameter is specified in ms, and defaults to the system settings.
This functionality depends on the TCP_USER_TIMEOUT socket option, and
will not work on systems that do not support it.
.TP
+.BR --use-pkcs1-padding
+This option is only meaningful when using iperf3's authentication
+features. Versions of iperf3 prior to 3.17 used PCKS1 padding in the
+RSA-encrypted credentials, which was vulnerable to a side-channel
+attack that could reveal a server's private key. Beginning with
+iperf-3.17, OAEP padding is used, however this is a breaking change
+that is not compatible with older iperf3 versions. Use this option to
+preserve the less secure, but more compatible, behavior.
+.TP
+.BR -m ", " --mptcp " "
+Use the MPTCP variant for the current protocol. This only applies to
+TCP and enables MPTCP usage.
+.TP
.BR -d ", " --debug " "
-emit debugging output.
+Emit debugging output.
Primarily (perhaps exclusively) of use to developers.
.TP
.BR -v ", " --version " "
-show version information and quit
+Show version information and quit.
.TP
.BR -h ", " --help " "
-show a help synopsis
+Show a help synopsis.
.SH "SERVER SPECIFIC OPTIONS"
.TP
.BR -s ", " --server " "
-run in server mode
+Run in server mode.
.TP
.BR -D ", " --daemon " "
-run the server in background as a daemon
+Run the server in background as a daemon.
.TP
.BR -1 ", " --one-off
-handle one client connection, then exit. If an idle time is set, the
-server will exit after that amount of time with no connection.
+Handle (at most) one client connection, then exit.
+If an idle time is set, the server will exit after that amount of time
+with no connection.
.TP
.BR --idle-timeout " \fIn\fR"
-restart the server after \fIn\fR seconds in case it gets stuck. In
-one-off mode, this is the number of seconds the server will wait
+Restart the server after \fIn\fR seconds in case it gets stuck.
+In one-off mode, this is the number of seconds the server will wait
before exiting.
.TP
-.BR --server-bitrate-limit " \fIn\fR[KMGT]"
-set a limit on the server side, which will cause a test to abort if
+.BR --server-max-duration " \fIn\fR"
+The maximum time, in seconds, that an iperf client can run against the server.
+When the sum of the client's time and omit values exceeds the max duration set by the server
+or the client's time value is 0, the measurement is rejected.
+.TP
+.BR --server-bitrate-limit " \fIn\fR[KMGT][/\fCn\fR]"
+Set a limit on the server side, which will cause a test to abort if
the client specifies a test of more than \fIn\fR bits per second, or
if the average data sent or received by the client (including all data
streams) is greater than \fIn\fR bits per second. The default limit
-is zero, which implies no limit. The interval over which to average
-the data rate is 5 seconds by default, but can be specified by adding
-a '/' and a number to the bitrate specifier.
+is 0, which implies no limit. The interval over which to average the
+data rate is 5 seconds by default, but can be specified by adding a
+.B
+/
+character and a number to the bitrate specifier.
.TP
.BR --rsa-private-key-path " \fIfile\fR"
-path to the RSA private key (not password-protected) used to decrypt
+Path to the RSA private key (not password-protected) used to decrypt
authentication credentials from the client (if built with OpenSSL
support).
.TP
.BR --authorized-users-path " \fIfile\fR"
-path to the configuration file containing authorized users credentials to run
-iperf tests (if built with OpenSSL support).
-The file is a comma separated list of usernames and password hashes;
-more information on the structure of the file can be found in the
-EXAMPLES section.
-.TP
-.BR --time-skew-threshold second " \fIseconds\fR"
-time skew threshold (in seconds) between the server and client
-during the authentication process.
+Path to the configuration file containing authorized users credentials
+to run iperf tests (if built with OpenSSL support). The file is a
+comma separated list of usernames and password hashes; more
+information on the structure of the file can be found in the EXAMPLES
+section.
+.TP
+.BR --time-skew-threshold " \fIseconds\fR"
+Specify the allowable time skew threshold (in seconds) between the
+server and client during the authentication process.
.SH "CLIENT SPECIFIC OPTIONS"
.TP
.BR -c ", " --client " \fIhost\fR[\fB%\fIdev\fR]"
-run in client mode, connecting to the specified server.
+Run in client mode, connecting to the specified server.
By default, a test consists of sending data from the client to the
server, unless the \-R flag is specified.
If an optional interface is specified, it is treated as a shortcut
for \fB--bind-dev \fIdev\fR.
-Note that a percent sign and interface device name are required for IPv6 link-local address literals.
+Note that a percent sign and interface device name are required for
+IPv6 link-local address literals.
.TP
.BR --sctp
-use SCTP rather than TCP (FreeBSD and Linux)
+Use SCTP for tests rather than TCP (FreeBSD and Linux).
+Note that TCP communication is still used for the control connection
+between client and server.
.TP
.BR -u ", " --udp
-use UDP rather than TCP
+Use UDP for tests rather than TCP.
+Note that TCP communication is still used for the control connection
+between client and server.
.TP
.BR --connect-timeout " \fIn\fR"
-set timeout for establishing the initial control connection to the
+Set timeout for establishing the initial control connection to the
server, in milliseconds.
The default behavior is the operating system's timeout for TCP
connection establishment.
@@ -264,24 +311,29 @@ Providing a shorter value may speed up detection of a down iperf3
server.
.TP
.BR -b ", " --bitrate " \fIn\fR[KMGT]"
-set target bitrate to \fIn\fR bits/sec (default 1 Mbit/sec for UDP,
+Set target bitrate to \fIn\fR bits/sec (default 1 Mbit/sec for UDP,
unlimited for TCP/SCTP).
If there are multiple streams (\-P flag), the throughput limit is applied
separately to each stream.
You can also add a '/' and a number to the bitrate specifier.
This is called "burst mode".
-It will send the given number of packets without pausing, even if that
+It will perform the given number of sends without pausing,
+even if that
temporarily exceeds the specified throughput limit.
Setting the target bitrate to 0 will disable bitrate limits
(particularly useful for UDP tests).
This throughput limit is implemented internally inside iperf3, and is
available on all platforms.
-Compare with the \--fq-rate flag.
-This option replaces the \--bandwidth flag, which is now deprecated
+Compare with the
+.B --fq-rate
+flag.
+This option replaces the
+.B --bandwidth
+flag, which is now deprecated
but (at least for now) still accepted.
.TP
.BR --pacing-timer " \fIn\fR[KMGT]"
-set pacing timer interval in microseconds (default 1000 microseconds,
+Set pacing timer interval in microseconds (default 1000 microseconds,
or 1 ms).
This controls iperf3's internal pacing timer for the \-b/\--bitrate
option.
@@ -302,72 +354,99 @@ The default is no fair-queueing based pacing.
.TP
.BR --no-fq-socket-pacing
This option is deprecated and will be removed.
-It is equivalent to specifying --fq-rate=0.
+It is equivalent to specifying
+.BR
+--fq-rate=0 .
.TP
.BR -t ", " --time " \fIn\fR"
-time in seconds to transmit for (default 10 secs)
+Set the test duration in seconds (default 10 secs).
+The
+.BR
+-t , -n ", and" -k
+options are mutually exclusive.
.TP
.BR -n ", " --bytes " \fIn\fR[KMGT]"
-number of bytes to transmit (instead of \-t)
+Set the number of bytes to transmit.
+The
+.BR
+-t , -n ", and" -k
+options are mutually exclusive.
.TP
.BR -k ", " --blockcount " \fIn\fR[KMGT]"
-number of blocks (packets) to transmit (instead of \-t or \-n)
+Set the number of blocks (packets) to transmit.
+The
+.BR
+-t , -n ", and" -k
+options are mutually exclusive.
.TP
.BR -l ", " --length " \fIn\fR[KMGT]"
-length of buffer to read or write. For TCP tests, the default value
-is 128KB.
+Set the length of the buffer to read or write. For TCP tests, the
+default value is 128KB.
In the case of UDP, iperf3 tries to dynamically determine a reasonable
sending size based on the path MTU; if that cannot be determined it
uses 1460 bytes as a sending size.
For SCTP tests, the default size is 64KB.
.TP
.BR --cport " \fIport\fR"
-bind data streams to a specific client port (for TCP and UDP only,
-default is to use an ephemeral port)
+Bind data streams to a specific TCP or UDP client port (for TCP
+and UDP only, default is to use an ephemeral port).
.TP
.BR -P ", " --parallel " \fIn\fR"
-number of parallel client streams to run. Note that iperf3 is single threaded, so if you are CPU bound, this will not yield higher throughput.
+Set the number of parallel client streams to run. Beginning with
+iperf-3.16, iperf3 will spawn off a separate thread for each test
+stream.
+Using multiple streams may result in higher throughput than a
+single stream, in cases where network throughput is CPU-limited.
.TP
.BR -R ", " --reverse
-reverse the direction of a test, so that the server sends data to the
-client
+Reverse the direction of a test, so that the server sends data to the
+client.
.TP
.BR --bidir
-test in both directions (normal and reverse), with both the client and
+Test in both directions (normal and reverse), with both the client and
server sending and receiving data simultaneously
.TP
.BR -w ", " --window " \fIn\fR[KMGT]"
-set socket buffer size / window size.
-This value gets sent to the server and used on that side too; on both
-sides this option sets both the sending and receiving socket buffer sizes.
-This option can be used to set (indirectly) the maximum TCP window size.
-Note that on Linux systems, the effective maximum window size is approximately
-double what is specified by this option (this behavior is not a bug in iperf3
-but a "feature" of the Linux kernel, as documented by tcp(7) and socket(7)).
+Set t he socket buffer size / window size.
+This value gets sent to the server and used on that side too;
+on both sides this option sets both the sending and receiving
+socket buffer sizes.
+This option can be used to set (indirectly) the maximum TCP window
+size.
+Note that on Linux systems, the effective maximum window size is
+approximately
+double what is specified by this option.
+This behavior is not a bug in iperf3 but a feature of the
+Linux kernel, as documented by
+.BR tcp ( 7 )
+and
+.BR socket ( 7 )).
.TP
.BR -M ", " --set-mss " \fIn\fR"
-set TCP/SCTP maximum segment size (MTU - 40 bytes)
+Set the TCP/SCTP maximum segment size (MTU - 40 bytes).
.TP
.BR -N ", " --no-delay " "
-set TCP/SCTP no delay, disabling Nagle's Algorithm
+Set the TCP/SCTP no delay option, disabling Nagle's Algorithm.
.TP
.BR -4 ", " --version4 " "
-only use IPv4
+Force the use of IPv4.
.TP
.BR -6 ", " --version6 " "
-only use IPv6
+Force the use of IPv6.
.TP
.BR -S ", " --tos " \fIn\fR"
-set the IP type of service. The usual prefixes for octal and hex can be used,
+Set the IP type of service bits.
+The usual prefixes for octal and hex can be used,
i.e. 52, 064 and 0x34 all specify the same value.
.TP
.BR "--dscp " \fIdscp\fR
-set the IP DSCP bits. Both numeric and symbolic values are accepted. Numeric
-values can be specified in decimal, octal and hex (see --tos above). To set
-both the DSCP bits and the ECN bits, use --tos.
+Set the IP DSCP bits. Both numeric and symbolic values are accepted. Numeric
+values can be specified in decimal, octal and hex (see
+.B --tos
+above).
.TP
.BR -L ", " --flowlabel " \fIn\fR"
-set the IPv6 flow label (currently only supported on Linux)
+Set the IPv6 flow label (currently only supported on Linux).
.TP
.BR -X ", " --xbind " \fIname\fR"
Bind SCTP associations to a specific subset of links using sctp_bindx(3).
@@ -380,7 +459,11 @@ association, and is supported for both iperf servers and clients
(the latter are supported by passing the first \fB--X\fR argument to bind(2)).
Hostnames are accepted as arguments and are resolved using
getaddrinfo(3).
-If the \fB--4\fR or \fB--6\fR flags are specified, names
+If the
+.B --4
+or
+.B --6
+flags are also specified, names
which do not resolve to addresses within the
specified protocol family will be ignored.
.TP
@@ -391,12 +474,19 @@ Set number of SCTP streams.
Use a "zero copy" method of sending data, such as sendfile(2),
instead of the usual write(2).
.TP
+.BR --skip-rx-copy
+Ignored received packet data, using the MSG_TRUNC flag to the
+recv(2) system call.
+.TP
.BR -O ", " --omit " \fIn\fR"
-Perform pre-test for N seconds and omit the pre-test statistics, to skip past the TCP slow-start
+Perform pre-test for
+.I n
+seconds and omit the pre-test statistics, to skip past the TCP slow-start
period.
.TP
.BR -T ", " --title " \fIstr\fR"
-Prefix every output line with this string.
+Prefix every output line with the string
+.IR str .
.TP
.BR --extra-data " \fIstr\fR"
Specify an extra data string field to be included in JSON output.
@@ -407,14 +497,15 @@ older
.B --linux-congestion
synonym for this flag is accepted but is deprecated.
.TP
-.BR "--get-server-output"
+.BR --get-server-output
Get the output from the server.
The output format is determined by the server (in particular, if the
server was invoked with the \fB--json\fR flag, the output will be in
JSON format, otherwise it will be in human-readable format).
If the client is run with \fB--json\fR, the server output is included
in a JSON object; otherwise it is appended at the bottom of the
-human-readable output.
+human-readable output. Note that the server output is available only
+if the test completes, not if it is interrupted.
.TP
.BR --udp-counters-64bit
Use 64-bit counters in UDP test packets.
@@ -423,6 +514,17 @@ or high-bitrate UDP tests. Both client and server need to be running
at least version 3.1 for this option to work. It may become the
default behavior at some point in the future.
.TP
+.BR --gsro
+Enable UDP Generic Segmentation Offload (GSO) on the sender and
+Generic Receive Offload (GRO) on the receiver, where supported by
+the operating system and network hardware (currently Linux only).
+GSO allows the network stack to aggregate multiple UDP datagrams
+into larger packets, improving throughput and reducing CPU overhead.
+This is a client-only option; the client communicates the GSO/GRO
+settings to the server automatically.
+This feature is disabled by default and must be explicitly enabled
+with this flag.
+.TP
.BR --repeating-payload
Use repeating pattern in payload, instead of random bytes.
The same payload is used in iperf2 (ASCII '0..9' repeating).
@@ -435,15 +537,17 @@ Set the IPv4 Don't Fragment (DF) bit on outgoing packets.
Only applicable to tests doing UDP over IPv4.
.TP
.BR --username " \fIusername\fR"
-username to use for authentication to the iperf server (if built with
-OpenSSL support).
-The password will be prompted for interactively when the test is run. Note,
-the password to use can also be specified via the IPERF3_PASSWORD environment
-variable. If this variable is present, the password prompt will be skipped.
+Specify username to use for authentication to the iperf server
+(if built with OpenSSL support).
+The password will be prompted for interactively when the test is run.
+Note the password can also be specified via the IPERF3_PASSWORD
+environment variable. If this variable is present, the password
+prompt will be skipped.
.TP
.BR --rsa-public-key-path " \fIfile\fR"
-path to the RSA public key used to encrypt authentication credentials
-(if built with OpenSSL support)
+Set path to the RSA public key used to encrypt authentication
+credentials
+(if built with OpenSSL support).
.SH EXAMPLES
.SS "Authentication - RSA Keypair"
@@ -455,15 +559,15 @@ password set.
The public key must be in PEM format and use SubjectPrefixKeyInfo encoding.
An example of a set of UNIX/Linux commands using OpenSSL
to generate a correctly-formed keypair follows:
-.sp 1
-.in +.5i
-> openssl genrsa -des3 -out private.pem 2048
+.IP
+\fC> openssl genrsa -des3 -out private.pem 2048\fR
.sp 0
-> openssl rsa -in private.pem -outform PEM -pubout -out public.pem
+\fC> openssl rsa -in private.pem -outform PEM -pubout -out public.pem\fR
.sp 0
-> openssl rsa -in private.pem -out private_not_protected.pem -outform PEM
-.in -.5i
-.sp 1
+\fC> openssl rsa -in private.pem -out private_not_protected.pem \\ \fR
+.sp 0
+\fC -outform PEM\fR
+.PP
After these commands, the public key will be contained in the file
public.pem and the private key will be contained in the file
private_not_protected.pem.
@@ -477,25 +581,21 @@ The file can also contain commented lines (starting with the \fC#\fR
character).
An example of commands to generate the password hash on a UNIX/Linux system
is given below:
-.sp 1
-.in +.5i
-> S_USER=mario S_PASSWD=rossi
+.IP
+\fC> S_USER=mario S_PASSWD=rossi\fR
.sp 0
-> echo -n "{$S_USER}$S_PASSWD" | sha256sum | awk '{ print $1 }'
-.in -.5i
-.sp 1
+\fC> echo -n "{$S_USER}$S_PASSWD" | sha256sum | awk '{ print $1 }'\fR
+.PP
An example of a password file (with an entry corresponding to the
above username and password) is given below:
+.IP
+\fC> cat credentials.csv\fR
+.in -.5i
.sp 0
-.in +.5i
-> cat credentials.csv
-.sp 0
-# file format: username,sha256
+\fC# file format: username,sha256\fR
.sp 0
-mario,bf7a49a846d44b454a5d11e7acfaf13d138bbe0b7483aa3e050879700572709b
-.in -.5i
-.sp 1
-
+\fCmario,bf7a49a846d44b454a5d11e7acfaf13d138bbe0b7483aa3e050879700572709b\fR
+.in +.5i
.SH AUTHORS
A list of the contributors to iperf3 can be found within the
documentation located at
diff --git a/src/iperf_api.c b/src/iperf_api.c
index a441734d0..8f344b62b 100644
--- a/src/iperf_api.c
+++ b/src/iperf_api.c
@@ -1,5 +1,5 @@
/*
- * iperf, Copyright (c) 2014-2022, The Regents of the University of
+ * iperf, Copyright (c) 2014-2026, The Regents of the University of
* California, through Lawrence Berkeley National Laboratory (subject
* to receipt of any required approvals from the U.S. Dept. of
* Energy). All rights reserved.
@@ -46,16 +46,13 @@
#include
#include
#include
-#ifdef HAVE_STDINT_H
#include
-#endif
#include
#include
#include
#include
#include
#include
-#include
#include
#if defined(HAVE_CPUSET_SETAFFINITY)
@@ -74,8 +71,9 @@
#include "net.h"
#include "iperf.h"
#include "iperf_api.h"
-#include "iperf_udp.h"
#include "iperf_tcp.h"
+#include "iperf_time.h"
+#include "iperf_udp.h"
#if defined(HAVE_SCTP_H)
#include "iperf_sctp.h"
#endif /* HAVE_SCTP_H */
@@ -101,7 +99,8 @@ static int diskfile_send(struct iperf_stream *sp);
static int diskfile_recv(struct iperf_stream *sp);
static int JSON_write(int fd, cJSON *json);
static void print_interval_results(struct iperf_test *test, struct iperf_stream *sp, cJSON *json_interval_streams);
-static cJSON *JSON_read(int fd);
+static cJSON *JSON_read(int fd, int max_size);
+static int JSONStream_Output(struct iperf_test *test, const char* event_name, cJSON* obj);
/*************************** Print usage functions ****************************/
@@ -326,6 +325,12 @@ iperf_get_test_json_output_string(struct iperf_test *ipt)
return ipt->json_output_string;
}
+int
+iperf_get_test_json_stream(struct iperf_test *ipt)
+{
+ return ipt->json_stream;
+}
+
int
iperf_get_test_zerocopy(struct iperf_test *ipt)
{
@@ -476,6 +481,10 @@ iperf_set_test_stats_interval(struct iperf_test *ipt, double stats_interval)
void
iperf_set_test_state(struct iperf_test *ipt, signed char state)
{
+ if (ipt->debug_level >= DEBUG_LEVEL_INFO) {
+ iperf_printf(ipt, "State change: State set to %d-%s (from %d-%s)\n",
+ state, state_to_text(state), ipt->state, state_to_text(ipt->state));
+ }
ipt->state = state;
}
@@ -593,6 +602,30 @@ iperf_set_mapped_v4(struct iperf_test *ipt, const int val)
ipt->mapped_v4 = val;
}
+void
+iperf_set_on_new_stream_callback(struct iperf_test* ipt, void (*callback)(struct iperf_stream *))
+{
+ ipt->on_new_stream = callback;
+}
+
+void
+iperf_set_on_test_start_callback(struct iperf_test* ipt, void (*callback)(struct iperf_test *))
+{
+ ipt->on_test_start = callback;
+}
+
+void
+iperf_set_on_test_connect_callback(struct iperf_test* ipt, void (*callback)(struct iperf_test *))
+{
+ ipt->on_connect = callback;
+}
+
+void
+iperf_set_on_test_finish_callback(struct iperf_test* ipt, void (*callback)(struct iperf_test *))
+{
+ ipt->on_test_finish = callback;
+}
+
static void
check_sender_has_retransmits(struct iperf_test *ipt)
{
@@ -658,6 +691,24 @@ iperf_set_test_json_output(struct iperf_test *ipt, int json_output)
ipt->json_output = json_output;
}
+void
+iperf_set_test_json_stream(struct iperf_test *ipt, int json_stream)
+{
+ ipt->json_stream = json_stream;
+}
+
+void
+iperf_set_test_json_stream_full_output( struct iperf_test* ipt, int json_stream_full_output )
+{
+ ipt->json_stream_full_output = json_stream_full_output;
+}
+
+void
+iperf_set_test_json_callback(struct iperf_test *ipt, void (*callback)(struct iperf_test *, char *))
+{
+ ipt->json_callback = callback;
+}
+
int
iperf_has_zerocopy( void )
{
@@ -701,6 +752,12 @@ iperf_set_test_client_rsa_pubkey(struct iperf_test *ipt, const char *client_rsa_
ipt->settings->client_rsa_pubkey = load_pubkey_from_base64(client_rsa_pubkey_base64);
}
+void
+iperf_set_test_client_rsa_pubkey_from_file(struct iperf_test *ipt, const char *client_rsa_pubkey_file)
+{
+ ipt->settings->client_rsa_pubkey = load_pubkey_from_file(client_rsa_pubkey_file);
+}
+
void
iperf_set_test_server_authorized_users(struct iperf_test *ipt, const char *server_authorized_users)
{
@@ -718,6 +775,12 @@ iperf_set_test_server_rsa_privkey(struct iperf_test *ipt, const char *server_rsa
{
ipt->server_rsa_private_key = load_privkey_from_base64(server_rsa_privkey_base64);
}
+
+void
+iperf_set_test_server_rsa_privkey_from_file(struct iperf_test *ipt, const char *server_rsa_privkey_file)
+{
+ ipt->server_rsa_private_key = load_privkey_from_file(server_rsa_privkey_file);
+}
#endif // HAVE_SSL
void
@@ -857,7 +920,7 @@ void
iperf_on_test_start(struct iperf_test *test)
{
if (test->json_output) {
- cJSON_AddItemToObject(test->json_start, "test_start", iperf_json_printf("protocol: %s num_streams: %d blksize: %d omit: %d duration: %d bytes: %d blocks: %d reverse: %d tos: %d target_bitrate: %d bidir: %d fqrate: %d", test->protocol->name, (int64_t) test->num_streams, (int64_t) test->settings->blksize, (int64_t) test->omit, (int64_t) test->duration, (int64_t) test->settings->bytes, (int64_t) test->settings->blocks, test->reverse?(int64_t)1:(int64_t)0, (int64_t) test->settings->tos, (int64_t) test->settings->rate, (int64_t) test->bidirectional, (uint64_t) test->settings->fqrate));
+ cJSON_AddItemToObject(test->json_start, "test_start", iperf_json_printf("protocol: %s num_streams: %d blksize: %d omit: %d duration: %d bytes: %d blocks: %d reverse: %d tos: %d target_bitrate: %d bidir: %d fqrate: %d interval: %f gso: %d gro: %d", test->protocol->name, (int64_t) test->num_streams, (int64_t) test->settings->blksize, (int64_t) test->omit, (int64_t) test->duration, (int64_t) test->settings->bytes, (int64_t) test->settings->blocks, test->reverse?(int64_t)1:(int64_t)0, (int64_t) test->settings->tos, (int64_t) test->settings->rate, (int64_t) test->bidirectional, (uint64_t) test->settings->fqrate, test->stats_interval, (uint64_t) test->settings->gso, (uint64_t) test->settings->gro));
} else {
if (test->verbose) {
if (test->settings->bytes)
@@ -868,8 +931,12 @@ iperf_on_test_start(struct iperf_test *test)
iperf_printf(test, test_start_time, test->protocol->name, test->num_streams, test->settings->blksize, test->omit, test->duration, test->settings->tos);
}
}
+ if (test->json_stream) {
+ JSONStream_Output(test, "start", test->json_start);
+ }
}
+
/* This converts an IPv6 string address from IPv4-mapped format into regular
** old IPv4 format, which is easier on the eyes of network veterans.
**
@@ -895,7 +962,6 @@ mapped_v4_to_regular_v4(char *str)
void
iperf_on_connect(struct iperf_test *test)
{
- time_t now_secs;
const char* rfc1123_fmt = "%a, %d %b %Y %H:%M:%S %Z";
char now_str[100];
char ipr[INET6_ADDRSTRLEN];
@@ -904,11 +970,17 @@ iperf_on_connect(struct iperf_test *test)
struct sockaddr_in *sa_inP;
struct sockaddr_in6 *sa_in6P;
socklen_t len;
+ struct iperf_time now;
+ time_t now_secs;
+ unsigned long long now_millisecs;
+
+ iperf_time_now_wallclock(&now);
+ now_millisecs = (time_t) iperf_time_in_usecs(&now) / 1000;
+ now_secs = (time_t) (now_millisecs / 1000);
- now_secs = time((time_t*) 0);
(void) strftime(now_str, sizeof(now_str), rfc1123_fmt, gmtime(&now_secs));
if (test->json_output)
- cJSON_AddItemToObject(test->json_start, "timestamp", iperf_json_printf("time: %s timesecs: %d", now_str, (int64_t) now_secs));
+ cJSON_AddItemToObject(test->json_start, "timestamp", iperf_json_printf("time: %s timesecs: %d timemillisecs: %d", now_str, (int64_t) now_secs, now_millisecs));
else if (test->verbose)
iperf_printf(test, report_time, now_str);
@@ -1034,13 +1106,16 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv)
{"one-off", no_argument, NULL, '1'},
{"verbose", no_argument, NULL, 'V'},
{"json", no_argument, NULL, 'J'},
+ {"json-stream", no_argument, NULL, OPT_JSON_STREAM},
+ {"json-stream-full-output", no_argument, NULL, OPT_JSON_STREAM_FULL_OUTPUT},
{"version", no_argument, NULL, 'v'},
{"server", no_argument, NULL, 's'},
{"client", required_argument, NULL, 'c'},
{"udp", no_argument, NULL, 'u'},
{"bitrate", required_argument, NULL, 'b'},
{"bandwidth", required_argument, NULL, 'b'},
- {"server-bitrate-limit", required_argument, NULL, OPT_SERVER_BITRATE_LIMIT},
+ {"server-bitrate-limit", required_argument, NULL, OPT_SERVER_BITRATE_LIMIT},
+ {"server-max-duration", required_argument, NULL, OPT_SERVER_MAX_DURATION},
{"time", required_argument, NULL, 't'},
{"bytes", required_argument, NULL, 'n'},
{"blockcount", required_argument, NULL, 'k'},
@@ -1091,12 +1166,16 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv)
#if defined(HAVE_DONT_FRAGMENT)
{"dont-fragment", no_argument, NULL, OPT_DONT_FRAGMENT},
#endif /* HAVE_DONT_FRAGMENT */
+#if defined(HAVE_MSG_TRUNC)
+ {"skip-rx-copy", no_argument, NULL, OPT_SKIP_RX_COPY},
+#endif /* HAVE_MSG_TRUNC */
#if defined(HAVE_SSL)
{"username", required_argument, NULL, OPT_CLIENT_USERNAME},
{"rsa-public-key-path", required_argument, NULL, OPT_CLIENT_RSA_PUBLIC_KEY},
{"rsa-private-key-path", required_argument, NULL, OPT_SERVER_RSA_PRIVATE_KEY},
{"authorized-users-path", required_argument, NULL, OPT_SERVER_AUTHORIZED_USERS},
{"time-skew-threshold", required_argument, NULL, OPT_SERVER_SKEW_THRESHOLD},
+ {"use-pkcs1-padding", no_argument, NULL, OPT_USE_PKCS1_PADDING},
#endif /* HAVE_SSL */
{"fq-rate", required_argument, NULL, OPT_FQ_RATE},
{"pacing-timer", required_argument, NULL, OPT_PACING_TIMER},
@@ -1104,6 +1183,13 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv)
{"idle-timeout", required_argument, NULL, OPT_IDLE_TIMEOUT},
{"rcv-timeout", required_argument, NULL, OPT_RCV_TIMEOUT},
{"snd-timeout", required_argument, NULL, OPT_SND_TIMEOUT},
+#if defined(HAVE_TCP_KEEPALIVE)
+ {"cntl-ka", optional_argument, NULL, OPT_CNTL_KA},
+#endif /* HAVE_TCP_KEEPALIVE */
+#if defined(HAVE_IPPROTO_MPTCP)
+ {"mptcp", no_argument, NULL, 'm'},
+#endif
+ {"gsro", no_argument, NULL, OPT_GSRO},
{"debug", optional_argument, NULL, 'd'},
{"help", no_argument, NULL, 'h'},
{NULL, 0, NULL, 0}
@@ -1117,6 +1203,9 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv)
char* comma;
#endif /* HAVE_CPU_AFFINITY */
char* slash;
+#if defined(HAVE_TCP_KEEPALIVE)
+ char* slash2;
+#endif /* HAVE_TCP_KEEPALIVE */
char *p, *p1;
struct xbind_entry *xbe;
double farg;
@@ -1124,11 +1213,13 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv)
blksize = 0;
server_flag = client_flag = rate_flag = duration_flag = rcv_timeout_flag = snd_timeout_flag =0;
+ int gsro_flag = 0;
#if defined(HAVE_SSL)
char *client_username = NULL, *client_rsa_public_key = NULL, *server_rsa_private_key = NULL;
+ FILE *ptr_file;
#endif /* HAVE_SSL */
- while ((flag = getopt_long(argc, argv, "p:f:i:D1VJvsc:ub:t:n:k:l:P:Rw:B:M:N46S:L:ZO:F:A:T:C:dI:hX:", longopts, NULL)) != -1) {
+ while ((flag = getopt_long(argc, argv, "p:f:i:D1VJvsc:ub:t:n:k:l:P:Rw:B:M:N46S:L:ZO:F:A:T:C:dI:mhX:", longopts, NULL)) != -1) {
switch (flag) {
case 'p':
portno = atoi(optarg);
@@ -1182,6 +1273,13 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv)
case 'J':
test->json_output = 1;
break;
+ case OPT_JSON_STREAM:
+ test->json_output = 1;
+ test->json_stream = 1;
+ break;
+ case OPT_JSON_STREAM_FULL_OUTPUT:
+ test->json_stream_full_output = 1;
+ break;
case 'v':
printf("%s (cJSON %s)\n%s\n%s\n", version, cJSON_Version(), get_system_info(),
get_optional_features());
@@ -1193,7 +1291,7 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv)
}
iperf_set_test_role(test, 's');
break;
- case 'c':
+ case 'c': {
if (test->role == 's') {
i_errno = IESERVCLIENT;
return -1;
@@ -1201,18 +1299,22 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv)
iperf_set_test_role(test, 'c');
iperf_set_test_server_hostname(test, optarg);
- if (iperf_parse_hostname(test, optarg, &p, &p1)) {
+ char *arg = strdup(optarg);
+ if (iperf_parse_hostname(test, arg, &p, &p1)) {
#if defined(HAVE_SO_BINDTODEVICE)
/* Get rid of the hostname we saved earlier. */
free(iperf_get_test_server_hostname(test));
iperf_set_test_server_hostname(test, p);
iperf_set_test_bind_dev(test, p1);
#else /* HAVE_SO_BINDTODEVICE */
+ free(arg);
i_errno = IEBINDDEVNOSUPPORT;
return -1;
#endif /* HAVE_SO_BINDTODEVICE */
}
+ free(arg);
break;
+ }
case 'u':
set_protocol(test, Pudp);
client_flag = 1;
@@ -1230,6 +1332,9 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv)
case OPT_NUMSTREAMS:
#if defined(linux) || defined(__FreeBSD__)
test->settings->num_ostreams = unit_atoi(optarg);
+ if (i_errno != 0) {
+ return -1;
+ }
client_flag = 1;
#else /* linux */
i_errno = IEUNIMP;
@@ -1248,6 +1353,9 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv)
}
}
test->settings->rate = unit_atof_rate(optarg);
+ if (i_errno != 0) {
+ return -1;
+ }
rate_flag = 1;
client_flag = 1;
break;
@@ -1264,11 +1372,14 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv)
}
}
test->settings->bitrate_limit = unit_atof_rate(optarg);
+ if (i_errno != 0) {
+ return -1;
+ }
server_flag = 1;
break;
case 't':
test->duration = atoi(optarg);
- if (test->duration > MAX_TIME) {
+ if (test->duration > MAX_TIME || test->duration < 0) {
i_errno = IEDURATION;
return -1;
}
@@ -1277,14 +1388,23 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv)
break;
case 'n':
test->settings->bytes = unit_atoi(optarg);
+ if (i_errno != 0) {
+ return -1;
+ }
client_flag = 1;
break;
case 'k':
test->settings->blocks = unit_atoi(optarg);
+ if (i_errno != 0) {
+ return -1;
+ }
client_flag = 1;
break;
case 'l':
blksize = unit_atoi(optarg);
+ if (i_errno != 0) {
+ return -1;
+ }
client_flag = 1;
break;
case 'P':
@@ -1316,6 +1436,9 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv)
// Do sanity checks as double-precision floating point
// to avoid possible integer overflows.
farg = unit_atof(optarg);
+ if (i_errno != 0) {
+ return -1;
+ }
if (farg > (double) MAX_TCP_BUFFER) {
i_errno = IEBUFSIZE;
return -1;
@@ -1324,21 +1447,25 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv)
client_flag = 1;
break;
- case 'B':
+ case 'B': {
iperf_set_test_bind_address(test, optarg);
- if (iperf_parse_hostname(test, optarg, &p, &p1)) {
+ char *arg = strdup(optarg);
+ if (iperf_parse_hostname(test, arg, &p, &p1)) {
#if defined(HAVE_SO_BINDTODEVICE)
/* Get rid of the hostname we saved earlier. */
free(iperf_get_test_bind_address(test));
iperf_set_test_bind_address(test, p);
iperf_set_test_bind_dev(test, p1);
#else /* HAVE_SO_BINDTODEVICE */
+ free(arg);
i_errno = IEBINDDEVNOSUPPORT;
return -1;
#endif /* HAVE_SO_BINDTODEVICE */
}
+ free(arg);
break;
+ }
#if defined (HAVE_SO_BINDTODEVICE)
case OPT_BIND_DEV:
iperf_set_test_bind_dev(test, optarg);
@@ -1443,7 +1570,7 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv)
break;
case 'O':
test->omit = atoi(optarg);
- if (test->omit < 0 || test->omit > 60) {
+ if (test->omit < 0 || test->omit > MAX_OMIT_TIME) {
i_errno = IEOMIT;
return -1;
}
@@ -1460,6 +1587,14 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv)
}
server_flag = 1;
break;
+ case OPT_SERVER_MAX_DURATION:
+ test->max_server_duration = atoi(optarg);
+ if (test->max_server_duration < 0 || test->max_server_duration > MAX_TIME) {
+ i_errno = IEDURATION;
+ return -1;
+ }
+ server_flag = 1;
+ break;
case OPT_RCV_TIMEOUT:
rcv_timeout_in = atoi(optarg);
if (rcv_timeout_in < MIN_NO_MSG_RCVD_TIMEOUT || rcv_timeout_in > MAX_TIME * SEC_TO_mS) {
@@ -1480,6 +1615,39 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv)
snd_timeout_flag = 1;
break;
#endif /* HAVE_TCP_USER_TIMEOUT */
+#if defined (HAVE_TCP_KEEPALIVE)
+ case OPT_CNTL_KA:
+ test->settings->cntl_ka = 1;
+ if (optarg) {
+ slash = strchr(optarg, '/');
+ if (slash) {
+ *slash = '\0';
+ ++slash;
+ slash2 = strchr(slash, '/');
+ if (slash2) {
+ *slash2 = '\0';
+ ++slash2;
+ if (strlen(slash2) > 0) {
+ test->settings->cntl_ka_count = atoi(slash2);
+ }
+ }
+ if (strlen(slash) > 0) {
+ test->settings->cntl_ka_interval = atoi(slash);
+ }
+ }
+ if (strlen(optarg) > 0) {
+ test->settings->cntl_ka_keepidle = atoi(optarg);
+ }
+ }
+ // Seems that at least in Windows WSL2, TCP keepalive retries full interval must be
+ // smaller than the idle interval. Otherwise, the keepalive message is sent only once.
+ if (test->settings->cntl_ka_keepidle &&
+ test->settings->cntl_ka_keepidle <= (test->settings->cntl_ka_count * test->settings->cntl_ka_interval)) {
+ i_errno = IECNTLKA;
+ return -1;
+ }
+ break;
+#endif /* HAVE_TCP_KEEPALIVE */
case 'A':
#if defined(HAVE_CPU_AFFINITY)
test->affinity = strtol(optarg, &endptr, 0);
@@ -1539,6 +1707,7 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv)
break;
case OPT_UDP_COUNTERS_64BIT:
test->udp_counters_64bit = 1;
+ client_flag = 1;
break;
case OPT_NO_FQ_SOCKET_PACING:
#if defined(HAVE_SO_MAX_PACING_RATE)
@@ -1553,6 +1722,9 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv)
case OPT_FQ_RATE:
#if defined(HAVE_SO_MAX_PACING_RATE)
test->settings->fqrate = unit_atof_rate(optarg);
+ if (i_errno != 0) {
+ return -1;
+ }
client_flag = 1;
#else /* HAVE_SO_MAX_PACING_RATE */
i_errno = IEUNIMP;
@@ -1568,12 +1740,15 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv)
#if defined(HAVE_SSL)
case OPT_CLIENT_USERNAME:
client_username = strdup(optarg);
+ client_flag = 1;
break;
case OPT_CLIENT_RSA_PUBLIC_KEY:
client_rsa_public_key = strdup(optarg);
+ client_flag = 1;
break;
case OPT_SERVER_RSA_PRIVATE_KEY:
server_rsa_private_key = strdup(optarg);
+ server_flag = 1;
break;
case OPT_SERVER_AUTHORIZED_USERS:
test->server_authorized_users = strdup(optarg);
@@ -1584,16 +1759,46 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv)
i_errno = IESKEWTHRESHOLD;
return -1;
}
+ server_flag = 1;
break;
+ case OPT_USE_PKCS1_PADDING:
+ test->use_pkcs1_padding = 1;
+ server_flag = 1;
+ break;
#endif /* HAVE_SSL */
+#if defined(HAVE_MSG_TRUNC)
+ case OPT_SKIP_RX_COPY:
+ test->settings->skip_rx_copy = 1;
+ client_flag = 1;
+ break;
+#endif /* HAVE_MSG_TRUNC */
case OPT_PACING_TIMER:
test->settings->pacing_timer = unit_atoi(optarg);
+ if (i_errno != 0) {
+ return -1;
+ }
client_flag = 1;
break;
case OPT_CONNECT_TIMEOUT:
test->settings->connect_timeout = unit_atoi(optarg);
+ if (i_errno != 0) {
+ return -1;
+ }
client_flag = 1;
break;
+#if defined(HAVE_IPPROTO_MPTCP)
+ case 'm':
+ set_protocol(test, Ptcp);
+ test->mptcp = 1;
+ break;
+#endif
+ case OPT_GSRO:
+ /* Enable GSO/GRO which is disabled by default */
+ /* Flag is available regardless of local support to allow client to request server to use it */
+ gsro_flag = 1;
+ test->settings->gso = 1;
+ test->settings->gro = 1;
+ break;
case 'h':
usage_long(stdout);
exit(0);
@@ -1613,6 +1818,21 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv)
i_errno = IECLIENTONLY;
return -1;
}
+ if (test->role == 's' && gsro_flag) {
+ i_errno = IECLIENTONLY;
+ return -1;
+ }
+
+ /* Show platform support warnings only after confirming we're in client mode */
+ if (gsro_flag) {
+#if !defined(HAVE_UDP_SEGMENT) && !defined(HAVE_UDP_GRO)
+ warning("--gsro requested but UDP GSO/GRO not supported on this client; will only be enabled on server if supported");
+#elif !defined(HAVE_UDP_SEGMENT)
+ warning("--gsro requested but UDP GSO not supported on this client; will be enabled on server if supported");
+#elif !defined(HAVE_UDP_GRO)
+ warning("--gsro requested but UDP GRO not supported on this client; will be enabled on server if supported");
+#endif
+ }
#if defined(HAVE_SSL)
@@ -1660,7 +1880,18 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv)
!(server_rsa_private_key && test->server_authorized_users)) {
i_errno = IESETSERVERAUTH;
return -1;
- } else if (test->role == 's' && server_rsa_private_key) {
+ }
+
+ if (test->role == 's' && test->server_authorized_users) {
+ ptr_file =fopen(test->server_authorized_users, "r");
+ if (!ptr_file) {
+ i_errno = IESERVERAUTHUSERS;
+ return -1;
+ }
+ fclose(ptr_file);
+ }
+
+ if (test->role == 's' && server_rsa_private_key) {
test->server_rsa_private_key = load_privkey_from_file(server_rsa_private_key);
if (test->server_rsa_private_key == NULL){
iperf_err(test, "%s\n", ERR_error_string(ERR_get_error(), NULL));
@@ -1678,8 +1909,12 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv)
#endif //HAVE_SSL
- // File cannot be transferred using UDP because of the UDP packets header (packet number, etc.)
- if(test->role == 'c' && test->diskfile_name != (char*) 0 && test->protocol->id == Pudp) {
+ /*
+ * File cannot be transferred using UDP because of the UDP packets
+ * header (packet number, etc.). Specifying Pudp here implies this is
+ * on the client side.
+ */
+ if (test->diskfile_name != (char*) 0 && test->protocol->id == Pudp) {
i_errno = IEUDPFILETRANSFER;
return -1;
}
@@ -1703,6 +1938,18 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv)
i_errno = IEUDPBLOCKSIZE;
return -1;
}
+
+ if (test->protocol->id == Pudp && test->settings->gso) {
+ test->settings->gso_dg_size = blksize;
+ /* use the multiple of datagram size for the best efficiency. */
+ if (test->settings->gso_dg_size > 0) {
+ test->settings->gso_bf_size = (test->settings->gso_bf_size / test->settings->gso_dg_size) * test->settings->gso_dg_size;
+ } else {
+ /* If gso_dg_size is 0 (unlimited bandwidth), use default UDP datagram size */
+ test->settings->gso_dg_size = DEFAULT_UDP_BLKSIZE;
+ }
+ }
+
test->settings->blksize = blksize;
if (!rate_flag)
@@ -1802,7 +2049,7 @@ int
iperf_set_send_state(struct iperf_test *test, signed char state)
{
if (test->ctrl_sck >= 0) {
- test->state = state;
+ iperf_set_test_state(test, state);
if (Nwrite(test->ctrl_sck, (char*) &state, sizeof(state), Ptcp) < 0) {
i_errno = IESENDMESSAGE;
return -1;
@@ -1817,19 +2064,73 @@ iperf_check_throttle(struct iperf_stream *sp, struct iperf_time *nowP)
struct iperf_time temp_time;
double seconds;
uint64_t bits_per_second;
+ int64_t missing_rate;
+ uint64_t bits_sent;
+
+#if defined(HAVE_CLOCK_NANOSLEEP) || defined(HAVE_NANOSLEEP)
+ struct timespec nanosleep_time;
+ int64_t time_to_green_light, delta_bits;
+ int ret;
+#endif /* HAVE_CLOCK_NANOSLEEP || HAVE_NANOSLEEP) */
+#if defined(HAVE_CLOCK_NANOSLEEP)
+ int64_t ns;
+#endif /* HAVE_CLOCK_NANOSLEEP */
if (sp->test->done || sp->test->settings->rate == 0)
return;
iperf_time_diff(&sp->result->start_time_fixed, nowP, &temp_time);
seconds = iperf_time_in_secs(&temp_time);
- bits_per_second = sp->result->bytes_sent * 8 / seconds;
- if (bits_per_second < sp->test->settings->rate) {
+ bits_sent = sp->result->bytes_sent * 8;
+ bits_per_second = bits_sent / seconds;
+ missing_rate = sp->test->settings->rate - bits_per_second;
+
+ if (missing_rate > 0) {
sp->green_light = 1;
- FD_SET(sp->socket, &sp->test->write_set);
} else {
sp->green_light = 0;
- FD_CLR(sp->socket, &sp->test->write_set);
}
+
+#if defined(HAVE_CLOCK_NANOSLEEP) || defined(HAVE_NANOSLEEP)
+ // If estimated time to next send is large enough, sleep instead of just CPU looping until green light is set
+ if (missing_rate < 0) {
+ delta_bits = bits_sent - (seconds * sp->test->settings->rate);
+ // Calculate time until next data send is required
+ time_to_green_light = (SEC_TO_NS * delta_bits / sp->test->settings->rate);
+ // Whether should wait before next send
+ if (time_to_green_light >= 0) {
+#if defined(HAVE_CLOCK_NANOSLEEP)
+ if (clock_gettime(CLOCK_MONOTONIC, &nanosleep_time) == 0) {
+ // Calculate absolute end of sleep time
+ ns = nanosleep_time.tv_nsec + time_to_green_light;
+ if (ns < SEC_TO_NS) {
+ nanosleep_time.tv_nsec = ns;
+ } else {
+ nanosleep_time.tv_sec += ns / SEC_TO_NS;
+ nanosleep_time.tv_nsec = ns % SEC_TO_NS;
+ }
+ // Sleep until average baud rate reaches the target value
+ while((ret = clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, &nanosleep_time, NULL)) == EINTR);
+ if (ret == 0) {
+ sp->green_light = 1;
+ }
+ }
+
+#else /* HAVE_NANOSLEEP */
+ nanosleep_time.tv_sec = 0;
+ // Sleep until average baud rate reaches the target value or interrupt / error
+ do {
+ // nansleep() time should be less than 1 sec
+ nanosleep_time.tv_nsec = (time_to_green_light >= SEC_TO_NS) ? SEC_TO_NS - 1 : time_to_green_light;
+ time_to_green_light -= nanosleep_time.tv_nsec;
+ ret = nanosleep(&nanosleep_time, NULL);
+ } while (ret == 0 && time_to_green_light > 0);
+ if (ret == 0) {
+ sp->green_light = 1;
+ }
+#endif /* HAVE_CLOCK_NANOSLEEP else HAVE_NANOSLEEP */
+ }
+ }
+#endif /* HAVE_CLOCK_NANOSLEEP || HAVE_NANOSLEEP */
}
/* Verify that average traffic is not greater than the specified limit */
@@ -1844,7 +2145,7 @@ iperf_check_total_rate(struct iperf_test *test, iperf_size_t last_interval_bytes
if (test->done || test->settings->bitrate_limit == 0) // Continue only if check should be done
return;
- /* Add last inetrval's transferred bytes to the array */
+ /* Add last interval's transferred bytes to the array */
if (++test->bitrate_limit_last_interval_index >= test->settings->bitrate_limit_stats_per_interval)
test->bitrate_limit_last_interval_index = 0;
test->bitrate_limit_intervals_traffic_bytes[test->bitrate_limit_last_interval_index] = last_interval_bytes_transferred;
@@ -1855,7 +2156,7 @@ iperf_check_total_rate(struct iperf_test *test, iperf_size_t last_interval_bytes
return;
/* Calculating total bytes traffic to be averaged */
- for (total_bytes = 0, i = 0; i < test->settings->bitrate_limit_stats_per_interval; i++) {
+ for (i = 0, total_bytes = 0; i < test->settings->bitrate_limit_stats_per_interval; i++) {
total_bytes += test->bitrate_limit_intervals_traffic_bytes[i];
}
@@ -1873,12 +2174,15 @@ iperf_check_total_rate(struct iperf_test *test, iperf_size_t last_interval_bytes
}
int
-iperf_send(struct iperf_test *test, fd_set *write_setP)
+iperf_send_mt(struct iperf_stream *sp)
{
- register int multisend, r, streams_active;
- register struct iperf_stream *sp;
+ register int multisend, r, message_sent;
+ register struct iperf_test *test = sp->test;
struct iperf_time now;
- int no_throttle_check;
+ int throttle_check_per_message;
+#if defined(HAVE_CLOCK_NANOSLEEP) || defined(HAVE_NANOSLEEP)
+ int throttle_check;
+#endif /* HAVE_CLOCK_NANOSLEEP, HAVE_NANOSLEEP */
/* Can we do multisend mode? */
if (test->settings->burst != 0)
@@ -1889,67 +2193,74 @@ iperf_send(struct iperf_test *test, fd_set *write_setP)
multisend = 1; /* nope */
/* Should bitrate throttle be checked for every send */
- no_throttle_check = test->settings->rate != 0 && test->settings->burst == 0;
-
- for (; multisend > 0; --multisend) {
- if (no_throttle_check)
- iperf_time_now(&now);
- streams_active = 0;
- SLIST_FOREACH(sp, &test->streams, streams) {
- if ((sp->green_light && sp->sender &&
- (write_setP == NULL || FD_ISSET(sp->socket, write_setP)))) {
+#if defined(HAVE_CLOCK_NANOSLEEP) || defined(HAVE_NANOSLEEP)
+ if (test->settings->rate != 0) {
+ throttle_check = 1;
+ if (test->settings->burst == 0)
+ throttle_check_per_message = 1;
+ else
+ throttle_check_per_message = 0;
+ } else {
+ throttle_check = 0;
+ throttle_check_per_message = 0;
+ }
+#else /* !HAVE_CLOCK_NANOSLEEP && !HAVE_NANOSLEEP */
+ throttle_check_per_message = test->settings->rate != 0 && test->settings->burst == 0;
+#endif /* HAVE_CLOCK_NANOSLEEP, HAVE_NANOSLEEP */
+
+ for (message_sent = 0; sp->green_light && multisend > 0; --multisend) {
+ // XXX If we hit one of these ending conditions maybe
+ // want to stop even trying to send something?
if (multisend > 1 && test->settings->bytes != 0 && test->bytes_sent >= test->settings->bytes)
break;
if (multisend > 1 && test->settings->blocks != 0 && test->blocks_sent >= test->settings->blocks)
break;
- if ((r = sp->snd(sp)) < 0) {
- if (r == NET_SOFTERROR)
- break;
- i_errno = IESTREAMWRITE;
- return r;
- }
- streams_active = 1;
- test->bytes_sent += r;
- if (!sp->pending_size)
- ++test->blocks_sent;
- if (no_throttle_check)
- iperf_check_throttle(sp, &now);
- }
- }
- if (!streams_active)
- break;
- }
- if (!no_throttle_check) { /* Throttle check if was not checked for each send */
+ if ((r = sp->snd(sp)) < 0) {
+ if (r == NET_SOFTERROR)
+ break;
+ i_errno = IESTREAMWRITE;
+ return r;
+ }
+ test->bytes_sent += r;
+ if (!sp->pending_size)
+ ++test->blocks_sent;
+ if (throttle_check_per_message) {
+ if (message_sent == 0)
+ iperf_time_now(&now);
+ iperf_check_throttle(sp, &now);
+ }
+ message_sent = 1;
+ }
+#if defined(HAVE_CLOCK_NANOSLEEP) || defined(HAVE_NANOSLEEP)
+ /* Should check if green light can be set, as pacing timer is not supported in this case */
+ if (throttle_check && (!throttle_check_per_message || message_sent == 0)) {
+#else /* !HAVE_CLOCK_NANOSLEEP && !HAVE_NANOSLEEP */
+ if (!throttle_check_per_message || message_sent == 0) { /* Throttle check if was not checked for each send */
+#endif /* HAVE_CLOCK_NANOSLEEP, HAVE_NANOSLEEP */
iperf_time_now(&now);
- SLIST_FOREACH(sp, &test->streams, streams)
- if (sp->sender)
- iperf_check_throttle(sp, &now);
+ iperf_check_throttle(sp, &now);
}
- if (write_setP != NULL)
- SLIST_FOREACH(sp, &test->streams, streams)
- if (FD_ISSET(sp->socket, write_setP))
- FD_CLR(sp->socket, write_setP);
-
return 0;
}
int
-iperf_recv(struct iperf_test *test, fd_set *read_setP)
+iperf_recv_mt(struct iperf_stream *sp)
{
int r;
- struct iperf_stream *sp;
+ struct iperf_test *test = sp->test;
- SLIST_FOREACH(sp, &test->streams, streams) {
- if (FD_ISSET(sp->socket, read_setP) && !sp->sender) {
if ((r = sp->rcv(sp)) < 0) {
i_errno = IESTREAMREAD;
return r;
}
- test->bytes_received += r;
- ++test->blocks_received;
- FD_CLR(sp->socket, read_setP);
- }
- }
+
+ /* Collect statistics only if receive did not timeout (e.g. `Nread()` may timeout).
+ * This is also important for `--rcv-timeout` to work properly.
+ */
+ if (r > 0) {
+ test->bytes_received += r;
+ ++test->blocks_received;
+ }
return 0;
}
@@ -1980,39 +2291,15 @@ iperf_init_test(struct iperf_test *test)
return 0;
}
-static void
-send_timer_proc(TimerClientData client_data, struct iperf_time *nowP)
-{
- struct iperf_stream *sp = client_data.p;
-
- /* All we do here is set or clear the flag saying that this stream may
- ** be sent to. The actual sending gets done in the send proc, after
- ** checking the flag.
- */
- iperf_check_throttle(sp, nowP);
-}
int
iperf_create_send_timers(struct iperf_test * test)
{
- struct iperf_time now;
+ // Note: No times for the multi-thread versions
struct iperf_stream *sp;
- TimerClientData cd;
- if (iperf_time_now(&now) < 0) {
- i_errno = IEINITTEST;
- return -1;
- }
SLIST_FOREACH(sp, &test->streams, streams) {
sp->green_light = 1;
- if (test->settings->rate != 0 && sp->sender) {
- cd.p = sp;
- sp->send_timer = tmr_create(NULL, send_timer_proc, cd, test->settings->pacing_timer, 1);
- if (sp->send_timer == NULL) {
- i_errno = IEINITTEST;
- return -1;
- }
- }
}
return 0;
}
@@ -2026,21 +2313,21 @@ int test_is_authorized(struct iperf_test *test){
if (test->settings->authtoken){
char *username = NULL, *password = NULL;
time_t ts;
- int rc = decode_auth_setting(test->debug, test->settings->authtoken, test->server_rsa_private_key, &username, &password, &ts);
+ int rc = decode_auth_setting(test->debug, test->settings->authtoken, test->server_rsa_private_key, &username, &password, &ts, test->use_pkcs1_padding);
if (rc) {
return -1;
}
int ret = check_authentication(username, password, ts, test->server_authorized_users, test->server_skew_threshold);
if (ret == 0){
if (test->debug) {
- iperf_printf(test, report_authentication_succeeded, username, ts);
+ iperf_printf(test, report_authentication_succeeded, username, (uint64_t)ts);
}
free(username);
free(password);
return 0;
} else {
if (test->debug) {
- iperf_printf(test, report_authentication_failed, ret, username, ts);
+ iperf_printf(test, report_authentication_failed, ret, username, (uint64_t)ts);
}
free(username);
free(password);
@@ -2069,8 +2356,21 @@ iperf_exchange_parameters(struct iperf_test *test)
} else {
- if (get_parameters(test) < 0)
+ if (get_parameters(test) < 0) {
+ if (iperf_set_send_state(test, SERVER_ERROR) != 0)
+ return -1;
+ err = htonl(i_errno);
+ if (Nwrite(test->ctrl_sck, (char*) &err, sizeof(err), Ptcp) < 0) {
+ i_errno = IECTRLWRITE;
+ return -1;
+ }
+ err = htonl(errno);
+ if (Nwrite(test->ctrl_sck, (char*) &err, sizeof(err), Ptcp) < 0) {
+ i_errno = IECTRLWRITE;
+ return -1;
+ }
return -1;
+ }
#if defined(HAVE_SSL)
if (test_is_authorized(test) < 0){
@@ -2082,12 +2382,17 @@ iperf_exchange_parameters(struct iperf_test *test)
i_errno = IECTRLWRITE;
return -1;
}
+ err = htonl(errno);
+ if (Nwrite(test->ctrl_sck, (char*) &err, sizeof(err), Ptcp) < 0) {
+ i_errno = IECTRLWRITE;
+ return -1;
+ }
return -1;
}
#endif //HAVE_SSL
if ((s = test->protocol->listen(test)) < 0) {
- if (iperf_set_send_state(test, SERVER_ERROR) != 0)
+ if (iperf_set_send_state(test, SERVER_ERROR) != 0)
return -1;
err = htonl(i_errno);
if (Nwrite(test->ctrl_sck, (char*) &err, sizeof(err), Ptcp) < 0) {
@@ -2172,6 +2477,10 @@ send_parameters(struct iperf_test *test)
cJSON_AddTrueToObject(j, "reverse");
if (test->bidirectional)
cJSON_AddTrueToObject(j, "bidirectional");
+#if defined(HAVE_IPPROTO_MPTCP)
+ if (test->mptcp)
+ cJSON_AddTrueToObject(j, "mptcp");
+#endif
if (test->settings->socket_bufsize)
cJSON_AddNumberToObject(j, "window", test->settings->socket_bufsize);
if (test->settings->blksize)
@@ -2184,6 +2493,16 @@ send_parameters(struct iperf_test *test)
cJSON_AddNumberToObject(j, "pacing_timer", test->settings->pacing_timer);
if (test->settings->burst)
cJSON_AddNumberToObject(j, "burst", test->settings->burst);
+
+ /* Send UDP GSO/GRO settings from client to server */
+ /* Always send these fields to allow server to use GSO/GRO even if client doesn't support it */
+ if (test->protocol->id == Pudp) {
+ cJSON_AddNumberToObject(j, "gso", test->settings->gso);
+ cJSON_AddNumberToObject(j, "gso_dg_size", test->settings->gso_dg_size);
+ cJSON_AddNumberToObject(j, "gso_bf_size", test->settings->gso_bf_size);
+ cJSON_AddNumberToObject(j, "gro", test->settings->gro);
+ cJSON_AddNumberToObject(j, "gro_bf_size", test->settings->gro_bf_size);
+ }
if (test->settings->tos)
cJSON_AddNumberToObject(j, "TOS", test->settings->tos);
if (test->settings->flowlabel)
@@ -2211,7 +2530,7 @@ send_parameters(struct iperf_test *test)
#if defined(HAVE_SSL)
/* Send authentication parameters */
if (test->settings->client_username && test->settings->client_password && test->settings->client_rsa_pubkey){
- int rc = encode_auth_setting(test->settings->client_username, test->settings->client_password, test->settings->client_rsa_pubkey, &test->settings->authtoken);
+ int rc = encode_auth_setting(test->settings->client_username, test->settings->client_password, test->settings->client_rsa_pubkey, &test->settings->authtoken, test->use_pkcs1_padding);
if (rc) {
cJSON_Delete(j);
@@ -2222,6 +2541,8 @@ send_parameters(struct iperf_test *test)
cJSON_AddStringToObject(j, "authtoken", test->settings->authtoken);
}
#endif // HAVE_SSL
+ if (test->settings->skip_rx_copy)
+ cJSON_AddNumberToObject(j, "skip_rx_copy", test->settings->skip_rx_copy);
cJSON_AddStringToObject(j, "client_version", IPERF_VERSION);
if (test->debug) {
@@ -2248,7 +2569,7 @@ get_parameters(struct iperf_test *test)
cJSON *j;
cJSON *j_p;
- j = JSON_read(test->ctrl_sck);
+ j = JSON_read(test->ctrl_sck, MAX_PARAMS_JSON_STRING);
if (j == NULL) {
i_errno = IERECVPARAMS;
r = -1;
@@ -2260,79 +2581,140 @@ get_parameters(struct iperf_test *test)
cJSON_free(str);
}
- if ((j_p = cJSON_GetObjectItem(j, "tcp")) != NULL)
+ if ((j_p = iperf_cJSON_GetObjectItemType(j, "tcp", cJSON_True)) != NULL)
set_protocol(test, Ptcp);
- if ((j_p = cJSON_GetObjectItem(j, "udp")) != NULL)
- set_protocol(test, Pudp);
- if ((j_p = cJSON_GetObjectItem(j, "sctp")) != NULL)
+ if ((j_p = iperf_cJSON_GetObjectItemType(j, "udp", cJSON_True)) != NULL) {
+ /* Disallow UDP transfers if we already are to/from a file */
+ if (test->diskfile_name != NULL) {
+ i_errno = IEUDPFILETRANSFER;
+ r = -1;
+ }
+ else {
+ /* Not to/from a file, set UDP protocol as intended*/
+ set_protocol(test, Pudp);
+ }
+ }
+ if ((j_p = iperf_cJSON_GetObjectItemType(j, "sctp", cJSON_True)) != NULL)
set_protocol(test, Psctp);
- if ((j_p = cJSON_GetObjectItem(j, "omit")) != NULL)
+ if ((j_p = iperf_cJSON_GetObjectItemType(j, "omit", cJSON_Number)) != NULL)
test->omit = j_p->valueint;
- if ((j_p = cJSON_GetObjectItem(j, "server_affinity")) != NULL)
+ if ((j_p = iperf_cJSON_GetObjectItemType(j, "server_affinity", cJSON_Number)) != NULL)
test->server_affinity = j_p->valueint;
- if ((j_p = cJSON_GetObjectItem(j, "time")) != NULL)
+ if ((j_p = iperf_cJSON_GetObjectItemType(j, "time", cJSON_Number)) != NULL)
test->duration = j_p->valueint;
test->settings->bytes = 0;
- if ((j_p = cJSON_GetObjectItem(j, "num")) != NULL)
+ if ((j_p = iperf_cJSON_GetObjectItemType(j, "num", cJSON_Number)) != NULL)
test->settings->bytes = j_p->valueint;
test->settings->blocks = 0;
- if ((j_p = cJSON_GetObjectItem(j, "blockcount")) != NULL)
+ if ((j_p = iperf_cJSON_GetObjectItemType(j, "blockcount", cJSON_Number)) != NULL)
test->settings->blocks = j_p->valueint;
- if ((j_p = cJSON_GetObjectItem(j, "MSS")) != NULL)
+ if ((j_p = iperf_cJSON_GetObjectItemType(j, "MSS", cJSON_Number)) != NULL)
test->settings->mss = j_p->valueint;
- if ((j_p = cJSON_GetObjectItem(j, "nodelay")) != NULL)
+ if ((j_p = iperf_cJSON_GetObjectItemType(j, "nodelay", cJSON_True)) != NULL)
test->no_delay = 1;
- if ((j_p = cJSON_GetObjectItem(j, "parallel")) != NULL)
+ if ((j_p = iperf_cJSON_GetObjectItemType(j, "parallel", cJSON_Number)) != NULL)
test->num_streams = j_p->valueint;
- if ((j_p = cJSON_GetObjectItem(j, "reverse")) != NULL)
+ if ((j_p = iperf_cJSON_GetObjectItemType(j, "reverse", cJSON_True)) != NULL)
iperf_set_test_reverse(test, 1);
- if ((j_p = cJSON_GetObjectItem(j, "bidirectional")) != NULL)
+ if ((j_p = iperf_cJSON_GetObjectItemType(j, "bidirectional", cJSON_True)) != NULL)
iperf_set_test_bidirectional(test, 1);
- if ((j_p = cJSON_GetObjectItem(j, "window")) != NULL)
+#if defined(HAVE_IPPROTO_MPTCP)
+ if ((j_p = iperf_cJSON_GetObjectItemType(j, "mptcp", cJSON_True)) != NULL)
+ test->mptcp = 1;
+#endif
+ if ((j_p = iperf_cJSON_GetObjectItemType(j, "window", cJSON_Number)) != NULL)
test->settings->socket_bufsize = j_p->valueint;
- if ((j_p = cJSON_GetObjectItem(j, "len")) != NULL)
+ if ((j_p = iperf_cJSON_GetObjectItemType(j, "len", cJSON_Number)) != NULL)
test->settings->blksize = j_p->valueint;
- if ((j_p = cJSON_GetObjectItem(j, "bandwidth")) != NULL)
+
+ /* Accept UDP GSO/GRO settings provided by the client */
+ /* Always accept these fields to allow server to use GSO/GRO based on its own support */
+ if ((j_p = iperf_cJSON_GetObjectItemType(j, "gso", cJSON_Number)) != NULL)
+ test->settings->gso = j_p->valueint;
+ if ((j_p = iperf_cJSON_GetObjectItemType(j, "gso_dg_size", cJSON_Number)) != NULL)
+ test->settings->gso_dg_size = j_p->valueint;
+ if ((j_p = iperf_cJSON_GetObjectItemType(j, "gso_bf_size", cJSON_Number)) != NULL)
+ test->settings->gso_bf_size = j_p->valueint;
+
+ /* Backward-compatibility: If client didn't send GSO params, derive from blksize. */
+ if (test->protocol->id == Pudp && test->settings->gso == 1 && test->settings->gso_dg_size == 0) {
+ test->settings->gso_dg_size = test->settings->blksize;
+ if (test->settings->gso_dg_size > 0) {
+ test->settings->gso_bf_size = (test->settings->gso_bf_size / test->settings->gso_dg_size) * test->settings->gso_dg_size;
+ } else {
+ test->settings->gso_dg_size = DEFAULT_UDP_BLKSIZE;
+ }
+ }
+
+ if ((j_p = iperf_cJSON_GetObjectItemType(j, "gro", cJSON_Number)) != NULL)
+ test->settings->gro = j_p->valueint;
+ if ((j_p = iperf_cJSON_GetObjectItemType(j, "gro_bf_size", cJSON_Number)) != NULL)
+ test->settings->gro_bf_size = j_p->valueint;
+
+ if ((j_p = iperf_cJSON_GetObjectItemType(j, "bandwidth", cJSON_Number)) != NULL)
test->settings->rate = j_p->valueint;
- if ((j_p = cJSON_GetObjectItem(j, "fqrate")) != NULL)
+ if ((j_p = iperf_cJSON_GetObjectItemType(j, "fqrate", cJSON_Number)) != NULL)
test->settings->fqrate = j_p->valueint;
- if ((j_p = cJSON_GetObjectItem(j, "pacing_timer")) != NULL)
+ if ((j_p = iperf_cJSON_GetObjectItemType(j, "pacing_timer", cJSON_Number)) != NULL)
test->settings->pacing_timer = j_p->valueint;
- if ((j_p = cJSON_GetObjectItem(j, "burst")) != NULL)
+ if ((j_p = iperf_cJSON_GetObjectItemType(j, "burst", cJSON_Number)) != NULL)
test->settings->burst = j_p->valueint;
- if ((j_p = cJSON_GetObjectItem(j, "TOS")) != NULL)
+ if ((j_p = iperf_cJSON_GetObjectItemType(j, "TOS", cJSON_Number)) != NULL)
test->settings->tos = j_p->valueint;
- if ((j_p = cJSON_GetObjectItem(j, "flowlabel")) != NULL)
+ if ((j_p = iperf_cJSON_GetObjectItemType(j, "flowlabel", cJSON_Number)) != NULL)
test->settings->flowlabel = j_p->valueint;
- if ((j_p = cJSON_GetObjectItem(j, "title")) != NULL)
+ if ((j_p = iperf_cJSON_GetObjectItemType(j, "title", cJSON_String)) != NULL)
test->title = strdup(j_p->valuestring);
- if ((j_p = cJSON_GetObjectItem(j, "extra_data")) != NULL)
+ if ((j_p = iperf_cJSON_GetObjectItemType(j, "extra_data", cJSON_String)) != NULL)
test->extra_data = strdup(j_p->valuestring);
- if ((j_p = cJSON_GetObjectItem(j, "congestion")) != NULL)
+ if ((j_p = iperf_cJSON_GetObjectItemType(j, "congestion", cJSON_String)) != NULL)
test->congestion = strdup(j_p->valuestring);
- if ((j_p = cJSON_GetObjectItem(j, "congestion_used")) != NULL)
+ if ((j_p = iperf_cJSON_GetObjectItemType(j, "congestion_used", cJSON_String)) != NULL)
test->congestion_used = strdup(j_p->valuestring);
- if ((j_p = cJSON_GetObjectItem(j, "get_server_output")) != NULL)
+ if ((j_p = iperf_cJSON_GetObjectItemType(j, "get_server_output", cJSON_Number)) != NULL)
iperf_set_test_get_server_output(test, 1);
- if ((j_p = cJSON_GetObjectItem(j, "udp_counters_64bit")) != NULL)
+ if ((j_p = iperf_cJSON_GetObjectItemType(j, "udp_counters_64bit", cJSON_Number)) != NULL)
iperf_set_test_udp_counters_64bit(test, 1);
- if ((j_p = cJSON_GetObjectItem(j, "repeating_payload")) != NULL)
+ if ((j_p = iperf_cJSON_GetObjectItemType(j, "repeating_payload", cJSON_Number)) != NULL)
test->repeating_payload = 1;
- if ((j_p = cJSON_GetObjectItem(j, "zerocopy")) != NULL)
+ if ((j_p = iperf_cJSON_GetObjectItemType(j, "zerocopy", cJSON_Number)) != NULL)
test->zerocopy = j_p->valueint;
#if defined(HAVE_DONT_FRAGMENT)
- if ((j_p = cJSON_GetObjectItem(j, "dont_fragment")) != NULL)
+ if ((j_p = iperf_cJSON_GetObjectItemType(j, "dont_fragment", cJSON_Number)) != NULL)
test->settings->dont_fragment = j_p->valueint;
#endif /* HAVE_DONT_FRAGMENT */
#if defined(HAVE_SSL)
- if ((j_p = cJSON_GetObjectItem(j, "authtoken")) != NULL)
+ if ((j_p = iperf_cJSON_GetObjectItemType(j, "authtoken", cJSON_String)) != NULL)
test->settings->authtoken = strdup(j_p->valuestring);
#endif //HAVE_SSL
+ if ((j_p = cJSON_GetObjectItem(j, "skip_rx_copy")) != NULL)
+ test->settings->skip_rx_copy = j_p->valueint;
if (test->mode && test->protocol->id == Ptcp && has_tcpinfo_retransmits())
test->sender_has_retransmits = 1;
if (test->settings->rate)
cJSON_AddNumberToObject(test->json_start, "target_bitrate", test->settings->rate);
cJSON_Delete(j);
+
+ /* Ensure that the client does not request to run longer than the server's configured max */
+ if ((test->max_server_duration > 0) && (((test->duration + test->omit) > test->max_server_duration) || (test->duration == 0))) {
+ i_errno = IEMAXSERVERTESTDURATIONEXCEEDED;
+ r = -1;
+ }
+
+
+ /* Ensure that total requested data rate is not above the server's limit */
+ iperf_size_t total_requested_rate = test->num_streams * test->settings->rate * (test->mode == BIDIRECTIONAL? 2 : 1);
+ if (test->settings->bitrate_limit && total_requested_rate > test->settings->bitrate_limit) {
+ i_errno = IETOTALRATE;
+ r = -1;
+ }
+
+ total_requested_rate = test->num_streams * test->settings->fqrate * (test->mode == BIDIRECTIONAL? 2 : 1);
+ if (test->settings->bitrate_limit && total_requested_rate > test->settings->bitrate_limit) {
+ i_errno = IETOTALRATE;
+ r = -1;
+ }
+
}
return r;
}
@@ -2418,7 +2800,9 @@ send_results(struct iperf_test *test)
cJSON_AddNumberToObject(j_stream, "retransmits", retransmits);
cJSON_AddNumberToObject(j_stream, "jitter", sp->jitter);
cJSON_AddNumberToObject(j_stream, "errors", sp->cnt_error);
+ cJSON_AddNumberToObject(j_stream, "omitted_errors", sp->omitted_cnt_error);
cJSON_AddNumberToObject(j_stream, "packets", sp->packet_count);
+ cJSON_AddNumberToObject(j_stream, "omitted_packets", sp->omitted_packet_count);
iperf_time_diff(&sp->result->start_time, &sp->result->start_time, &temp_time);
start_time = iperf_time_in_secs(&temp_time);
@@ -2465,24 +2849,27 @@ get_results(struct iperf_test *test)
cJSON *j_retransmits;
cJSON *j_jitter;
cJSON *j_errors;
+ cJSON *j_omitted_errors;
cJSON *j_packets;
+ cJSON *j_omitted_packets;
cJSON *j_server_output;
cJSON *j_start_time, *j_end_time;
- int sid, cerror, pcount;
+ int sid;
+ int64_t cerror, pcount, omitted_cerror, omitted_pcount;
double jitter;
iperf_size_t bytes_transferred;
int retransmits;
struct iperf_stream *sp;
- j = JSON_read(test->ctrl_sck);
+ j = JSON_read(test->ctrl_sck, 0);
if (j == NULL) {
i_errno = IERECVRESULTS;
r = -1;
} else {
- j_cpu_util_total = cJSON_GetObjectItem(j, "cpu_util_total");
- j_cpu_util_user = cJSON_GetObjectItem(j, "cpu_util_user");
- j_cpu_util_system = cJSON_GetObjectItem(j, "cpu_util_system");
- j_sender_has_retransmits = cJSON_GetObjectItem(j, "sender_has_retransmits");
+ j_cpu_util_total = iperf_cJSON_GetObjectItemType(j, "cpu_util_total", cJSON_Number);
+ j_cpu_util_user = iperf_cJSON_GetObjectItemType(j, "cpu_util_user", cJSON_Number);
+ j_cpu_util_system = iperf_cJSON_GetObjectItemType(j, "cpu_util_system", cJSON_Number);
+ j_sender_has_retransmits = iperf_cJSON_GetObjectItemType(j, "sender_has_retransmits", cJSON_Number);
if (j_cpu_util_total == NULL || j_cpu_util_user == NULL || j_cpu_util_system == NULL || j_sender_has_retransmits == NULL) {
i_errno = IERECVRESULTS;
r = -1;
@@ -2504,7 +2891,7 @@ get_results(struct iperf_test *test)
else if ( test->mode == BIDIRECTIONAL )
test->other_side_has_retransmits = result_has_retransmits;
- j_streams = cJSON_GetObjectItem(j, "streams");
+ j_streams = iperf_cJSON_GetObjectItemType(j, "streams", cJSON_Array);
if (j_streams == NULL) {
i_errno = IERECVRESULTS;
r = -1;
@@ -2516,17 +2903,23 @@ get_results(struct iperf_test *test)
i_errno = IERECVRESULTS;
r = -1;
} else {
- j_id = cJSON_GetObjectItem(j_stream, "id");
- j_bytes = cJSON_GetObjectItem(j_stream, "bytes");
- j_retransmits = cJSON_GetObjectItem(j_stream, "retransmits");
- j_jitter = cJSON_GetObjectItem(j_stream, "jitter");
- j_errors = cJSON_GetObjectItem(j_stream, "errors");
- j_packets = cJSON_GetObjectItem(j_stream, "packets");
- j_start_time = cJSON_GetObjectItem(j_stream, "start_time");
- j_end_time = cJSON_GetObjectItem(j_stream, "end_time");
+ j_id = iperf_cJSON_GetObjectItemType(j_stream, "id", cJSON_Number);
+ j_bytes = iperf_cJSON_GetObjectItemType(j_stream, "bytes", cJSON_Number);
+ j_retransmits = iperf_cJSON_GetObjectItemType(j_stream, "retransmits", cJSON_Number);
+ j_jitter = iperf_cJSON_GetObjectItemType(j_stream, "jitter", cJSON_Number);
+ j_errors = iperf_cJSON_GetObjectItemType(j_stream, "errors", cJSON_Number);
+ j_omitted_errors = iperf_cJSON_GetObjectItemType(j_stream, "omitted_errors", cJSON_Number);
+ j_packets = iperf_cJSON_GetObjectItemType(j_stream, "packets", cJSON_Number);
+ j_omitted_packets = iperf_cJSON_GetObjectItemType(j_stream, "omitted_packets", cJSON_Number);
+ j_start_time = iperf_cJSON_GetObjectItemType(j_stream, "start_time", cJSON_Number);
+ j_end_time = iperf_cJSON_GetObjectItemType(j_stream, "end_time", cJSON_Number);
if (j_id == NULL || j_bytes == NULL || j_retransmits == NULL || j_jitter == NULL || j_errors == NULL || j_packets == NULL) {
i_errno = IERECVRESULTS;
r = -1;
+ } else if ( (j_omitted_errors == NULL && j_omitted_packets != NULL) || (j_omitted_errors != NULL && j_omitted_packets == NULL) ) {
+ /* For backward compatibility allow to not receive "omitted" statistics */
+ i_errno = IERECVRESULTS;
+ r = -1;
} else {
sid = j_id->valueint;
bytes_transferred = j_bytes->valueint;
@@ -2534,6 +2927,10 @@ get_results(struct iperf_test *test)
jitter = j_jitter->valuedouble;
cerror = j_errors->valueint;
pcount = j_packets->valueint;
+ if (j_omitted_packets != NULL) {
+ omitted_cerror = j_omitted_errors->valueint;
+ omitted_pcount = j_omitted_packets->valueint;
+ }
SLIST_FOREACH(sp, &test->streams, streams)
if (sp->id == sid) break;
if (sp == NULL) {
@@ -2545,6 +2942,18 @@ get_results(struct iperf_test *test)
sp->cnt_error = cerror;
sp->peer_packet_count = pcount;
sp->result->bytes_received = bytes_transferred;
+ if (j_omitted_packets != NULL) {
+ sp->omitted_cnt_error = omitted_cerror;
+ sp->peer_omitted_packet_count = omitted_pcount;
+ } else {
+ sp->peer_omitted_packet_count = sp->omitted_packet_count;
+ if (sp->peer_omitted_packet_count > 0) {
+ /* -1 indicates unknown error count since it includes the omitted count */
+ sp->omitted_cnt_error = (sp->cnt_error > 0) ? -1 : 0;
+ } else {
+ sp->omitted_cnt_error = sp->cnt_error;
+ }
+ }
/*
* We have to handle the possibility that
* start_time and end_time might not be
@@ -2564,6 +2973,11 @@ get_results(struct iperf_test *test)
sp->peer_packet_count = pcount;
sp->result->bytes_sent = bytes_transferred;
sp->result->stream_retrans = retransmits;
+ if (j_omitted_packets != NULL) {
+ sp->peer_omitted_packet_count = omitted_pcount;
+ } else {
+ sp->peer_omitted_packet_count = sp->peer_packet_count;
+ }
if (j_start_time && j_end_time) {
sp->result->sender_time = j_end_time->valuedouble - j_start_time->valuedouble;
}
@@ -2587,7 +3001,7 @@ get_results(struct iperf_test *test)
}
else {
/* No JSON, look for textual output. Make a copy of the text for later. */
- j_server_output = cJSON_GetObjectItem(j, "server_output_text");
+ j_server_output = iperf_cJSON_GetObjectItemType(j, "server_output_text", cJSON_String);
if (j_server_output != NULL) {
test->server_output_text = strdup(j_server_output->valuestring);
}
@@ -2596,7 +3010,7 @@ get_results(struct iperf_test *test)
}
}
- j_remote_congestion_used = cJSON_GetObjectItem(j, "congestion_used");
+ j_remote_congestion_used = iperf_cJSON_GetObjectItemType(j, "congestion_used", cJSON_String);
if (j_remote_congestion_used != NULL) {
test->remote_congestion_used = strdup(j_remote_congestion_used->valuestring);
}
@@ -2635,44 +3049,98 @@ JSON_write(int fd, cJSON *json)
/*************************************************************/
static cJSON *
-JSON_read(int fd)
+JSON_read(int fd, int max_size)
{
uint32_t hsize, nsize;
+ size_t strsize;
char *str;
cJSON *json = NULL;
int rc;
+ char msg_buf[WARN_STR_LEN * 2];
/*
* Read a four-byte integer, which is the length of the JSON to follow.
* Then read the JSON into a buffer and parse it. Return a parsed JSON
* structure, NULL if there was an error.
*/
- if (Nread(fd, (char*) &nsize, sizeof(nsize), Ptcp) >= 0) {
- hsize = ntohl(nsize);
- /* Allocate a buffer to hold the JSON */
- str = (char *) calloc(sizeof(char), hsize+1); /* +1 for trailing null */
- if (str != NULL) {
- rc = Nread(fd, str, hsize, Ptcp);
- if (rc >= 0) {
- /*
- * We should be reading in the number of bytes corresponding to the
- * length in that 4-byte integer. If we don't the socket might have
- * prematurely closed. Only do the JSON parsing if we got the
- * correct number of bytes.
- */
- if (rc == hsize) {
- json = cJSON_Parse(str);
- }
- else {
- printf("WARNING: Size of data read does not correspond to offered length\n");
- }
- }
+ rc = Nread(fd, (char*) &nsize, sizeof(nsize), Ptcp);
+ if (rc == sizeof(nsize)) {
+ hsize = ntohl(nsize);
+ if (hsize > 0 && (max_size == 0 || hsize <= max_size)) {
+ /* Allocate a buffer to hold the JSON */
+ strsize = hsize + 1; /* +1 for trailing NULL */
+ if (strsize) {
+ str = (char *) calloc(sizeof(char), strsize);
+ if (str != NULL) {
+ rc = Nread(fd, str, hsize, Ptcp);
+ if (rc >= 0) {
+ /*
+ * We should be reading in the number of bytes corresponding to the
+ * length in that 4-byte integer. If we don't the socket might have
+ * prematurely closed. Only do the JSON parsing if we got the
+ * correct number of bytes.
+ */
+ if (rc == hsize) {
+ json = cJSON_Parse(str);
+ }
+ else {
+ snprintf(msg_buf, sizeof(msg_buf), "JSON size of data read does not correspond to offered length - expected %d bytes but received %d; errno=%d", hsize, rc, errno);
+ warning(msg_buf);
+ }
+ }
+ else {
+ snprintf(msg_buf, sizeof(msg_buf), "JSON data read failed; errno=%d", errno);
+ warning(msg_buf);
+ }
+ free(str);
+ }
+ }
}
- free(str);
+ else {
+ snprintf(msg_buf, sizeof(msg_buf), "JSON data length overflow - %d bytes JSON size is not allowed", hsize);
+ warning(msg_buf);
+ }
+ }
+ else {
+ snprintf(msg_buf, sizeof(msg_buf), "Failed to read JSON data size - read returned %d; errno=%d", rc, errno);
+ warning(msg_buf);
}
return json;
}
+/*************************************************************/
+/**
+ * JSONStream_Output - outputs an obj as event without disturbing it
+ */
+
+static int
+JSONStream_Output(struct iperf_test * test, const char * event_name, cJSON * obj)
+{
+ cJSON *event = cJSON_CreateObject();
+ if (!event)
+ return -1;
+ cJSON_AddStringToObject(event, "event", event_name);
+ cJSON_AddItemReferenceToObject(event, "data", obj);
+ char *str = cJSON_PrintUnformatted(event);
+ if (str == NULL)
+ return -1;
+ if (test->json_callback != NULL) {
+ (test->json_callback)(test, str);
+ } else {
+ if (pthread_mutex_lock(&(test->print_mutex)) != 0) {
+ perror("iperf_json_finish: pthread_mutex_lock");
+ }
+ fprintf(test->outfile, "%s\n", str);
+ if (pthread_mutex_unlock(&(test->print_mutex)) != 0) {
+ perror("iperf_json_finish: pthread_mutex_unlock");
+ }
+ }
+ iflush(test);
+ cJSON_free(str);
+ cJSON_Delete(event);
+ return 0;
+}
+
/*************************************************************/
/**
* add_to_interval_list -- adds new interval to the interval_list
@@ -2683,6 +3151,14 @@ add_to_interval_list(struct iperf_stream_result * rp, struct iperf_interval_resu
{
struct iperf_interval_results *irp;
+ /* Only the last interval result is needed, so removing last old entry to reduce memory consumption */
+ if (!TAILQ_EMPTY(&rp->interval_results) &&
+ (irp = TAILQ_LAST(&rp->interval_results, irlisthead)) != NULL
+ ) {
+ TAILQ_REMOVE(&rp->interval_results, irp, irlistentries);
+ free(irp);
+ }
+
irp = (struct iperf_interval_results *) malloc(sizeof(struct iperf_interval_results));
memcpy(irp, new, sizeof(struct iperf_interval_results));
TAILQ_INSERT_TAIL(&rp->interval_results, irp, irlistentries);
@@ -2732,6 +3208,7 @@ struct iperf_test *
iperf_new_test()
{
struct iperf_test *test;
+ int rc;
test = (struct iperf_test *) malloc(sizeof(struct iperf_test));
if (!test) {
@@ -2741,6 +3218,21 @@ iperf_new_test()
/* initialize everything to zero */
memset(test, 0, sizeof(struct iperf_test));
+ /* Initialize mutex for printing output */
+ pthread_mutexattr_t mutexattr;
+ pthread_mutexattr_init(&mutexattr);
+ rc = pthread_mutexattr_settype(&mutexattr, PTHREAD_MUTEX_ERRORCHECK);
+ if (rc != 0) {
+ errno = rc;
+ perror("iperf_new_test: pthread_mutexattr_settype");
+ }
+
+ if (pthread_mutex_init(&(test->print_mutex), &mutexattr) != 0) {
+ perror("iperf_new_test: pthread_mutex_init");
+ }
+
+ pthread_mutexattr_destroy(&mutexattr);
+
test->settings = (struct iperf_settings *) malloc(sizeof(struct iperf_settings));
if (!test->settings) {
free(test);
@@ -2756,7 +3248,7 @@ iperf_new_test()
i_errno = IENEWTEST;
return NULL;
}
- memset(test->bitrate_limit_intervals_traffic_bytes, 0, sizeof(sizeof(iperf_size_t) * MAX_INTERVAL));
+ memset(test->bitrate_limit_intervals_traffic_bytes, 0, sizeof(iperf_size_t) * MAX_INTERVAL);
/* By default all output goes to stdout */
test->outfile = stdout;
@@ -2832,6 +3324,12 @@ iperf_defaults(struct iperf_test *testp)
testp->settings->fqrate = 0;
testp->settings->pacing_timer = DEFAULT_PACING_TIMER;
testp->settings->burst = 0;
+ /* Always initialize GSO/GRO fields to allow client-server negotiation */
+ testp->settings->gso = 0; /* Disable GSO by default, enabled via --gsro */
+ testp->settings->gso_dg_size = 0;
+ testp->settings->gso_bf_size = GSO_BF_MAX_SIZE;
+ testp->settings->gro = 0; /* Disable GRO by default, enabled via --gsro */
+ testp->settings->gro_bf_size = GRO_BF_MAX_SIZE;
testp->settings->mss = 0;
testp->settings->bytes = 0;
testp->settings->blocks = 0;
@@ -2839,6 +3337,14 @@ iperf_defaults(struct iperf_test *testp)
testp->settings->rcv_timeout.secs = DEFAULT_NO_MSG_RCVD_TIMEOUT / SEC_TO_mS;
testp->settings->rcv_timeout.usecs = (DEFAULT_NO_MSG_RCVD_TIMEOUT % SEC_TO_mS) * mS_TO_US;
testp->zerocopy = 0;
+ testp->settings->skip_rx_copy = 0;
+ testp->settings->cntl_ka = 0;
+ testp->settings->cntl_ka_keepidle = 0;
+ testp->settings->cntl_ka_interval = 0;
+ testp->settings->cntl_ka_count = 0;
+
+ testp->json_callback = NULL;
+
memset(testp->cookie, 0, COOKIE_SIZE);
@@ -2994,6 +3500,14 @@ iperf_free_test(struct iperf_test *test)
free(prot);
}
+ /* Destroy print mutex. iperf_printf() doesn't work after this point */
+ int rc;
+ rc = pthread_mutex_destroy(&(test->print_mutex));
+ if (rc != 0) {
+ errno = rc;
+ perror("iperf_free_test: pthread_mutex_destroy");
+ }
+
if (test->logfile) {
free(test->logfile);
test->logfile = NULL;
@@ -3077,6 +3591,9 @@ iperf_reset_test(struct iperf_test *test)
SLIST_INIT(&test->streams);
+ if (test->congestion)
+ free(test->congestion);
+ test->congestion = NULL;
if (test->remote_congestion_used)
free(test->remote_congestion_used);
test->remote_congestion_used = NULL;
@@ -3122,11 +3639,17 @@ iperf_reset_test(struct iperf_test *test)
test->settings->socket_bufsize = 0;
test->settings->blksize = DEFAULT_TCP_BLKSIZE;
test->settings->rate = 0;
+ test->settings->fqrate = 0;
test->settings->burst = 0;
test->settings->mss = 0;
test->settings->tos = 0;
+ /* Always initialize GSO/GRO fields */
+ test->settings->gso_dg_size = 0;
+ test->settings->gso_bf_size = GSO_BF_MAX_SIZE;
+ test->settings->gro_bf_size = GRO_BF_MAX_SIZE;
test->settings->dont_fragment = 0;
test->zerocopy = 0;
+ test->settings->skip_rx_copy = 0;
#if defined(HAVE_SSL)
if (test->settings->authtoken) {
@@ -3217,8 +3740,14 @@ iperf_stats_callback(struct iperf_test *test)
struct iperf_interval_results *irp, temp;
struct iperf_time temp_time;
iperf_size_t total_interval_bytes_transferred = 0;
+#if defined(HAVE_SCTP_H)
+ struct iperf_sctp_info sctp_info;
+#endif /* HAVE_SCTP_H */
temp.omitted = test->omitting;
+ temp.rtt = 0;
+ temp.rttvar = 0;
+ temp.pmtu = 0;
SLIST_FOREACH(sp, &test->streams, streams) {
rp = sp->result;
temp.bytes_transferred = sp->sender ? rp->bytes_sent_this_interval : rp->bytes_received_this_interval;
@@ -3269,6 +3798,8 @@ iperf_stats_callback(struct iperf_test *test)
temp.rttvar = get_rttvar(&temp);
temp.pmtu = get_pmtu(&temp);
+ temp.reorder = get_reorder(&temp);
+ rp->stream_reorder = temp.reorder;
}
}
} else {
@@ -3286,6 +3817,36 @@ iperf_stats_callback(struct iperf_test *test)
temp.outoforder_packets = sp->outoforder_packets;
temp.cnt_error = sp->cnt_error;
}
+
+#if defined(HAVE_SCTP_H)
+ if (test->protocol->id == Psctp) {
+ if (iperf_sctp_get_info(sp, &sctp_info) >= 0) {;
+ temp.pmtu = sctp_info.pmtu;
+ temp.rtt = sctp_info.rtt;
+ temp.snd_cwnd = sctp_info.cwnd;
+ temp.snd_wnd = sctp_info.wnd;
+ if (temp.snd_cwnd > rp->stream_max_snd_cwnd) {
+ rp->stream_max_snd_cwnd = temp.snd_cwnd;
+ }
+ if (temp.snd_wnd > rp->stream_max_snd_wnd) {
+ rp->stream_max_snd_wnd = temp.snd_wnd;
+ }
+ if (temp.rtt >= 0) {
+ temp.rtt = sctp_info.rtt;
+ if (temp.rtt > rp->stream_max_rtt) {
+ rp->stream_max_rtt = temp.rtt;
+ }
+ if (rp->stream_min_rtt == 0 ||
+ temp.rtt < rp->stream_min_rtt) {
+ rp->stream_min_rtt = temp.rtt;
+ }
+ rp->stream_sum_rtt += temp.rtt;
+ rp->stream_count_rtt++;
+ }
+ }
+ }
+#endif /* HAVE_SCTP_H */
+
add_to_interval_list(rp, &temp);
rp->bytes_sent_this_interval = rp->bytes_received_this_interval = 0;
}
@@ -3313,6 +3874,7 @@ iperf_print_intermediate(struct iperf_test *test)
int lower_mode, upper_mode;
int current_mode;
+ int discard_json;
/*
* Due to timing oddities, there can be cases, especially on the
@@ -3358,11 +3920,22 @@ iperf_print_intermediate(struct iperf_test *test)
return;
}
+ /*
+ * When we use streamed json, we don't actually need to keep the interval
+ * results around unless we're the server and the client requested the server output.
+ *
+ * This avoids unneeded memory build up for long sessions.
+ *
+ * The user can still opt in for all measurement data via the --json-stream-full-output option.
+ */
+ discard_json = test->json_stream == 1 && !test->json_stream_full_output && !(test->role == 's' && test->get_server_output);
+
if (test->json_output) {
json_interval = cJSON_CreateObject();
if (json_interval == NULL)
return;
- cJSON_AddItemToArray(test->json_intervals, json_interval);
+ if (!discard_json)
+ cJSON_AddItemToArray(test->json_intervals, json_interval);
json_interval_streams = cJSON_CreateArray();
if (json_interval_streams == NULL)
return;
@@ -3403,10 +3976,10 @@ iperf_print_intermediate(struct iperf_test *test)
iperf_size_t bytes = 0;
double bandwidth;
- int retransmits = 0;
+ int64_t retransmits = 0;
double start_time, end_time;
- int total_packets = 0, lost_packets = 0;
+ int64_t total_packets = 0, lost_packets = 0;
double avg_jitter = 0.0, lost_percent;
int stream_must_be_sender = current_mode * current_mode;
@@ -3415,7 +3988,7 @@ iperf_print_intermediate(struct iperf_test *test)
/* Print stream role just for bidirectional mode. */
if (test->mode == BIDIRECTIONAL) {
- sprintf(mbuf, "[%s-%s]", stream_must_be_sender?"TX":"RX", test->role == 'c'?"C":"S");
+ snprintf(mbuf, sizeof(mbuf), "[%s-%s]", stream_must_be_sender?"TX":"RX", test->role == 'c'?"C":"S");
} else {
mbuf[0] = '\0';
zbuf[0] = '\0';
@@ -3479,7 +4052,7 @@ iperf_print_intermediate(struct iperf_test *test)
if (test->sender_has_retransmits == 1 && stream_must_be_sender) {
/* Interval sum, TCP with retransmits. */
if (test->json_output)
- cJSON_AddItemToObject(json_interval, sum_name, iperf_json_printf("start: %f end: %f seconds: %f bytes: %d bits_per_second: %f retransmits: %d omitted: %b sender: %b", (double) start_time, (double) end_time, (double) irp->interval_duration, (int64_t) bytes, bandwidth * 8, (int64_t) retransmits, irp->omitted, stream_must_be_sender)); /* XXX irp->omitted or test->omitting? */
+ cJSON_AddItemToObject(json_interval, sum_name, iperf_json_printf("start: %f end: %f seconds: %f bytes: %d bits_per_second: %f retransmits: %d omitted: %b sender: %b", (double) start_time, (double) end_time, (double) irp->interval_duration, (int64_t) bytes, bandwidth * 8, retransmits, irp->omitted, stream_must_be_sender)); /* XXX irp->omitted or test->omitting? */
else
iperf_printf(test, report_sum_bw_retrans_format, mbuf, start_time, end_time, ubuf, nbuf, retransmits, irp->omitted?report_omitted:""); /* XXX irp->omitted or test->omitting? */
} else {
@@ -3513,6 +4086,11 @@ iperf_print_intermediate(struct iperf_test *test)
}
}
}
+
+ if (test->json_stream)
+ JSONStream_Output(test, "interval", json_interval);
+ if (discard_json)
+ cJSON_Delete(json_interval);
}
/**
@@ -3588,10 +4166,11 @@ iperf_print_results(struct iperf_test *test)
for (current_mode = lower_mode; current_mode <= upper_mode; ++current_mode) {
cJSON *json_summary_stream = NULL;
- int total_retransmits = 0;
- int total_packets = 0, lost_packets = 0;
- int sender_packet_count = 0, receiver_packet_count = 0; /* for this stream, this interval */
- int sender_total_packets = 0, receiver_total_packets = 0; /* running total */
+ int64_t total_retransmits = 0;
+ int64_t total_packets = 0, lost_packets = 0;
+ int64_t sender_packet_count = 0, receiver_packet_count = 0; /* for this stream, this interval */
+ int64_t sender_omitted_packet_count = 0, receiver_omitted_packet_count = 0; /* for this stream, this interval */
+ int64_t sender_total_packets = 0, receiver_total_packets = 0; /* running total */
char ubuf[UNIT_LEN];
char nbuf[UNIT_LEN];
struct stat sb;
@@ -3601,7 +4180,7 @@ iperf_print_results(struct iperf_test *test)
iperf_size_t bytes_received, total_received = 0;
double start_time, end_time = 0.0, avg_jitter = 0.0, lost_percent = 0.0;
double sender_time = 0.0, receiver_time = 0.0;
- struct iperf_time temp_time;
+ struct iperf_time temp_time;
double bandwidth;
char mbuf[UNIT_LEN];
@@ -3611,7 +4190,7 @@ iperf_print_results(struct iperf_test *test)
/* Print stream role just for bidirectional mode. */
if (test->mode == BIDIRECTIONAL) {
- sprintf(mbuf, "[%s-%s]", stream_must_be_sender?"TX":"RX", test->role == 'c'?"C":"S");
+ snprintf(mbuf, sizeof(mbuf), "[%s-%s]", stream_must_be_sender?"TX":"RX", test->role == 'c'?"C":"S");
} else {
mbuf[0] = '\0';
}
@@ -3639,8 +4218,8 @@ iperf_print_results(struct iperf_test *test)
*/
if (sp) {
- iperf_time_diff(&sp->result->start_time, &sp->result->end_time, &temp_time);
- end_time = iperf_time_in_secs(&temp_time);
+ iperf_time_diff(&sp->result->start_time, &sp->result->end_time, &temp_time);
+ end_time = iperf_time_in_secs(&temp_time);
if (sp->sender) {
sp->result->sender_time = end_time;
if (sp->result->receiver_time == 0.0) {
@@ -3671,11 +4250,15 @@ iperf_print_results(struct iperf_test *test)
if (sp->sender) {
sender_packet_count = sp->packet_count;
+ sender_omitted_packet_count = sp->omitted_packet_count;
receiver_packet_count = sp->peer_packet_count;
+ receiver_omitted_packet_count = sp->peer_omitted_packet_count;
}
else {
sender_packet_count = sp->peer_packet_count;
+ sender_omitted_packet_count = sp->peer_omitted_packet_count;
receiver_packet_count = sp->packet_count;
+ receiver_omitted_packet_count = sp->omitted_packet_count;
}
if (test->protocol->id == Ptcp || test->protocol->id == Psctp) {
@@ -3687,11 +4270,13 @@ iperf_print_results(struct iperf_test *test)
* Running total of the total number of packets. Use the sender packet count if we
* have it, otherwise use the receiver packet count.
*/
- int packet_count = sender_packet_count ? sender_packet_count : receiver_packet_count;
+ int64_t packet_count = sender_packet_count ? sender_packet_count : receiver_packet_count;
total_packets += (packet_count - sp->omitted_packet_count);
- sender_total_packets += (sender_packet_count - sp->omitted_packet_count);
- receiver_total_packets += (receiver_packet_count - sp->omitted_packet_count);
- lost_packets += (sp->cnt_error - sp->omitted_cnt_error);
+ sender_total_packets += (sender_packet_count - sender_omitted_packet_count);
+ receiver_total_packets += (receiver_packet_count - receiver_omitted_packet_count);
+ lost_packets += sp->cnt_error;
+ if (sp->omitted_cnt_error > -1)
+ lost_packets -= sp->omitted_cnt_error;
avg_jitter += sp->jitter;
}
@@ -3704,10 +4289,10 @@ iperf_print_results(struct iperf_test *test)
}
unit_snprintf(nbuf, UNIT_LEN, bandwidth, test->settings->unit_format);
if (test->protocol->id == Ptcp || test->protocol->id == Psctp) {
- if (test->sender_has_retransmits) {
+ if (test->sender_has_retransmits || test->protocol->id == Psctp) {
/* Sender summary, TCP and SCTP with retransmits. */
if (test->json_output)
- cJSON_AddItemToObject(json_summary_stream, "sender", iperf_json_printf("socket: %d start: %f end: %f seconds: %f bytes: %d bits_per_second: %f retransmits: %d max_snd_cwnd: %d max_snd_wnd: %d max_rtt: %d min_rtt: %d mean_rtt: %d sender: %b", (int64_t) sp->socket, (double) start_time, (double) sender_time, (double) sender_time, (int64_t) bytes_sent, bandwidth * 8, (int64_t) sp->result->stream_retrans, (int64_t) sp->result->stream_max_snd_cwnd, (int64_t) sp->result->stream_max_snd_wnd, (int64_t) sp->result->stream_max_rtt, (int64_t) sp->result->stream_min_rtt, (int64_t) ((sp->result->stream_count_rtt == 0) ? 0 : sp->result->stream_sum_rtt / sp->result->stream_count_rtt), stream_must_be_sender));
+ cJSON_AddItemToObject(json_summary_stream, report_sender, iperf_json_printf("socket: %d start: %f end: %f seconds: %f bytes: %d bits_per_second: %f retransmits: %d reorder: %d max_snd_cwnd: %d max_snd_wnd: %d max_rtt: %d min_rtt: %d mean_rtt: %d sender: %b", (int64_t) sp->socket, (double) start_time, (double) sender_time, (double) sender_time, (int64_t) bytes_sent, bandwidth * 8, (int64_t) sp->result->stream_retrans, (int64_t) sp->result->stream_reorder, (int64_t) sp->result->stream_max_snd_cwnd, (int64_t) sp->result->stream_max_snd_wnd, (int64_t) sp->result->stream_max_rtt, (int64_t) sp->result->stream_min_rtt, (int64_t) ((sp->result->stream_count_rtt == 0) ? 0 : sp->result->stream_sum_rtt / sp->result->stream_count_rtt), stream_must_be_sender));
else
if (test->role == 's' && !sp->sender) {
if (test->verbose)
@@ -3719,7 +4304,7 @@ iperf_print_results(struct iperf_test *test)
} else {
/* Sender summary, TCP and SCTP without retransmits. */
if (test->json_output)
- cJSON_AddItemToObject(json_summary_stream, "sender", iperf_json_printf("socket: %d start: %f end: %f seconds: %f bytes: %d bits_per_second: %f sender: %b", (int64_t) sp->socket, (double) start_time, (double) sender_time, (double) sender_time, (int64_t) bytes_sent, bandwidth * 8, stream_must_be_sender));
+ cJSON_AddItemToObject(json_summary_stream, report_sender, iperf_json_printf("socket: %d start: %f end: %f seconds: %f bytes: %d bits_per_second: %f sender: %b", (int64_t) sp->socket, (double) start_time, (double) sender_time, (double) sender_time, (int64_t) bytes_sent, bandwidth * 8, stream_must_be_sender));
else
if (test->role == 's' && !sp->sender) {
if (test->verbose)
@@ -3731,15 +4316,15 @@ iperf_print_results(struct iperf_test *test)
}
} else {
/* Sender summary, UDP. */
- if (sender_packet_count - sp->omitted_packet_count > 0) {
- lost_percent = 100.0 * (sp->cnt_error - sp->omitted_cnt_error) / (sender_packet_count - sp->omitted_packet_count);
+ if (sender_packet_count - sender_omitted_packet_count > 0) {
+ lost_percent = 100.0 * (sp->cnt_error - sp->omitted_cnt_error) / (sender_packet_count - sender_omitted_packet_count);
}
else {
lost_percent = 0.0;
}
if (test->json_output) {
/*
- * For hysterical raisins, we only emit one JSON
+ * For historical reasons, we only emit one JSON
* object for the UDP summary, and it contains
* information for both the sender and receiver
* side.
@@ -3754,7 +4339,7 @@ iperf_print_results(struct iperf_test *test)
* is the case, then use the receiver's count of packets
* instead.
*/
- int packet_count = sender_packet_count ? sender_packet_count : receiver_packet_count;
+ int64_t packet_count = sender_packet_count ? sender_packet_count : receiver_packet_count;
cJSON_AddItemToObject(json_summary_stream, "udp", iperf_json_printf("socket: %d start: %f end: %f seconds: %f bytes: %d bits_per_second: %f jitter_ms: %f lost_packets: %d packets: %d lost_percent: %f out_of_order: %d sender: %b", (int64_t) sp->socket, (double) start_time, (double) sender_time, (double) sender_time, (int64_t) bytes_sent, bandwidth * 8, (double) sp->jitter * 1000.0, (int64_t) (sp->cnt_error - sp->omitted_cnt_error), (int64_t) (packet_count - sp->omitted_packet_count), (double) lost_percent, (int64_t) (sp->outoforder_packets - sp->omitted_outoforder_packets), stream_must_be_sender));
}
else {
@@ -3770,7 +4355,7 @@ iperf_print_results(struct iperf_test *test)
iperf_printf(test, report_sender_not_available_format, sp->socket);
}
else {
- iperf_printf(test, report_bw_udp_format, sp->socket, mbuf, start_time, sender_time, ubuf, nbuf, 0.0, 0, (sender_packet_count - sp->omitted_packet_count), (double) 0, report_sender);
+ iperf_printf(test, report_bw_udp_format, sp->socket, mbuf, start_time, sender_time, ubuf, nbuf, 0.0, (int64_t) 0, (sender_packet_count - sender_omitted_packet_count), (double) 0, report_sender);
}
if ((sp->outoforder_packets - sp->omitted_outoforder_packets) > 0)
iperf_printf(test, report_sum_outoforder, mbuf, start_time, sender_time, (sp->outoforder_packets - sp->omitted_outoforder_packets));
@@ -3810,7 +4395,7 @@ iperf_print_results(struct iperf_test *test)
if (test->protocol->id == Ptcp || test->protocol->id == Psctp) {
/* Receiver summary, TCP and SCTP */
if (test->json_output)
- cJSON_AddItemToObject(json_summary_stream, "receiver", iperf_json_printf("socket: %d start: %f end: %f seconds: %f bytes: %d bits_per_second: %f sender: %b", (int64_t) sp->socket, (double) start_time, (double) receiver_time, (double) end_time, (int64_t) bytes_received, bandwidth * 8, stream_must_be_sender));
+ cJSON_AddItemToObject(json_summary_stream, report_receiver, iperf_json_printf("socket: %d start: %f end: %f seconds: %f bytes: %d bits_per_second: %f sender: %b", (int64_t) sp->socket, (double) start_time, (double) receiver_time, (double) end_time, (int64_t) bytes_received, bandwidth * 8, stream_must_be_sender));
else
if (test->role == 's' && sp->sender) {
if (test->verbose)
@@ -3827,8 +4412,8 @@ iperf_print_results(struct iperf_test *test)
* data here.
*/
if (! test->json_output) {
- if (receiver_packet_count - sp->omitted_packet_count > 0) {
- lost_percent = 100.0 * (sp->cnt_error - sp->omitted_cnt_error) / (receiver_packet_count - sp->omitted_packet_count);
+ if (receiver_packet_count - receiver_omitted_packet_count > 0 && sp->omitted_cnt_error > -1) {
+ lost_percent = 100.0 * (sp->cnt_error - sp->omitted_cnt_error) / (receiver_packet_count - receiver_omitted_packet_count);
}
else {
lost_percent = 0.0;
@@ -3839,7 +4424,11 @@ iperf_print_results(struct iperf_test *test)
iperf_printf(test, report_receiver_not_available_format, sp->socket);
}
else {
- iperf_printf(test, report_bw_udp_format, sp->socket, mbuf, start_time, receiver_time, ubuf, nbuf, sp->jitter * 1000.0, (sp->cnt_error - sp->omitted_cnt_error), (receiver_packet_count - sp->omitted_packet_count), lost_percent, report_receiver);
+ if (sp->omitted_cnt_error > -1) {
+ iperf_printf(test, report_bw_udp_format, sp->socket, mbuf, start_time, receiver_time, ubuf, nbuf, sp->jitter * 1000.0, (sp->cnt_error - sp->omitted_cnt_error), (receiver_packet_count - receiver_omitted_packet_count), lost_percent, report_receiver);
+ } else {
+ iperf_printf(test, report_bw_udp_format_no_omitted_error, sp->socket, mbuf, start_time, receiver_time, ubuf, nbuf, sp->jitter * 1000.0, (receiver_packet_count - receiver_omitted_packet_count), report_receiver);
+ }
}
}
}
@@ -3940,13 +4529,16 @@ iperf_print_results(struct iperf_test *test)
* ambiguities between the sender and receiver.
*/
cJSON_AddItemToObject(test->json_end, sum_name, iperf_json_printf("start: %f end: %f seconds: %f bytes: %d bits_per_second: %f jitter_ms: %f lost_packets: %d packets: %d lost_percent: %f sender: %b", (double) start_time, (double) receiver_time, (double) receiver_time, (int64_t) total_sent, bandwidth * 8, (double) avg_jitter * 1000.0, (int64_t) lost_packets, (int64_t) total_packets, (double) lost_percent, stream_must_be_sender));
+
+ double sent_bandwidth = sender_time > 0 ? ((double) total_sent * 8 / sender_time) : 0.0;
+ double recv_bandwidth = receiver_time > 0 ? ((double) total_received * 8 / receiver_time) : 0.0;
/*
* Separate sum_sent and sum_received structures.
* Using these structures to get the most complete
* information about UDP transfer.
*/
- cJSON_AddItemToObject(test->json_end, sum_sent_name, iperf_json_printf("start: %f end: %f seconds: %f bytes: %d bits_per_second: %f jitter_ms: %f lost_packets: %d packets: %d lost_percent: %f sender: %b", (double) start_time, (double) sender_time, (double) sender_time, (int64_t) total_sent, (double) total_sent * 8 / sender_time, (double) 0.0, (int64_t) 0, (int64_t) sender_total_packets, (double) 0.0, 1));
- cJSON_AddItemToObject(test->json_end, sum_received_name, iperf_json_printf("start: %f end: %f seconds: %f bytes: %d bits_per_second: %f jitter_ms: %f lost_packets: %d packets: %d lost_percent: %f sender: %b", (double) start_time, (double) receiver_time, (double) receiver_time, (int64_t) total_received, (double) total_received * 8 / receiver_time, (double) avg_jitter * 1000.0, (int64_t) lost_packets, (int64_t) receiver_total_packets, (double) lost_percent, 0));
+ cJSON_AddItemToObject(test->json_end, sum_sent_name, iperf_json_printf("start: %f end: %f seconds: %f bytes: %d bits_per_second: %f jitter_ms: %f lost_packets: %d packets: %d lost_percent: %f sender: %b", (double) start_time, (double) sender_time, (double) sender_time, (int64_t) total_sent, sent_bandwidth, (double) 0.0, (int64_t) 0, (int64_t) sender_total_packets, (double) 0.0, 1));
+ cJSON_AddItemToObject(test->json_end, sum_received_name, iperf_json_printf("start: %f end: %f seconds: %f bytes: %d bits_per_second: %f jitter_ms: %f lost_packets: %d packets: %d lost_percent: %f sender: %b", (double) start_time, (double) receiver_time, (double) receiver_time, (int64_t) total_received, recv_bandwidth, (double) avg_jitter * 1000.0, (int64_t) lost_packets, (int64_t) receiver_total_packets, (double) lost_percent, 0));
} else {
/*
* On the client we have both sender and receiver overall summary
@@ -3955,7 +4547,7 @@ iperf_print_results(struct iperf_test *test)
*/
if (! (test->role == 's' && !stream_must_be_sender) ) {
unit_snprintf(ubuf, UNIT_LEN, (double) total_sent, 'A');
- iperf_printf(test, report_sum_bw_udp_format, mbuf, start_time, sender_time, ubuf, nbuf, 0.0, 0, sender_total_packets, 0.0, "sender");
+ iperf_printf(test, report_sum_bw_udp_format, mbuf, start_time, sender_time, ubuf, nbuf, 0.0, (int64_t) 0, sender_total_packets, 0.0, report_sender);
}
if (! (test->role == 's' && stream_must_be_sender) ) {
@@ -3968,7 +4560,7 @@ iperf_print_results(struct iperf_test *test)
bandwidth = 0.0;
}
unit_snprintf(nbuf, UNIT_LEN, bandwidth, test->settings->unit_format);
- iperf_printf(test, report_sum_bw_udp_format, mbuf, start_time, receiver_time, ubuf, nbuf, avg_jitter * 1000.0, lost_packets, receiver_total_packets, lost_percent, "receiver");
+ iperf_printf(test, report_sum_bw_udp_format, mbuf, start_time, receiver_time, ubuf, nbuf, avg_jitter * 1000.0, lost_packets, receiver_total_packets, lost_percent, report_receiver);
}
}
}
@@ -4033,6 +4625,7 @@ iperf_print_results(struct iperf_test *test)
}
if (test->server_output_text) {
iperf_printf(test, "\nServer output:\n%s\n", test->server_output_text);
+ free(test->server_output_text);
test->server_output_text = NULL;
}
}
@@ -4089,7 +4682,7 @@ print_interval_results(struct iperf_test *test, struct iperf_stream *sp, cJSON *
double bandwidth, lost_percent;
if (test->mode == BIDIRECTIONAL) {
- sprintf(mbuf, "[%s-%s]", sp->sender?"TX":"RX", test->role == 'c'?"C":"S");
+ snprintf(mbuf, sizeof(mbuf), "[%s-%s]", sp->sender?"TX":"RX", test->role == 'c'?"C":"S");
} else {
mbuf[0] = '\0';
zbuf[0] = '\0';
@@ -4151,10 +4744,10 @@ print_interval_results(struct iperf_test *test, struct iperf_stream *sp, cJSON *
et = iperf_time_in_secs(&temp_time);
if (test->protocol->id == Ptcp || test->protocol->id == Psctp) {
- if (test->sender_has_retransmits == 1 && sp->sender) {
+ if ((test->sender_has_retransmits == 1 || test->protocol->id == Psctp) && sp->sender) {
/* Interval, TCP with retransmits. */
if (test->json_output)
- cJSON_AddItemToArray(json_interval_streams, iperf_json_printf("socket: %d start: %f end: %f seconds: %f bytes: %d bits_per_second: %f retransmits: %d snd_cwnd: %d snd_wnd: %d rtt: %d rttvar: %d pmtu: %d omitted: %b sender: %b", (int64_t) sp->socket, (double) st, (double) et, (double) irp->interval_duration, (int64_t) irp->bytes_transferred, bandwidth * 8, (int64_t) irp->interval_retrans, (int64_t) irp->snd_cwnd, (int64_t) irp->snd_wnd, (int64_t) irp->rtt, (int64_t) irp->rttvar, (int64_t) irp->pmtu, irp->omitted, sp->sender));
+ cJSON_AddItemToArray(json_interval_streams, iperf_json_printf("socket: %d start: %f end: %f seconds: %f bytes: %d bits_per_second: %f retransmits: %d snd_cwnd: %d snd_wnd: %d rtt: %d rttvar: %d pmtu: %d reorder: %d omitted: %b sender: %b", (int64_t) sp->socket, (double) st, (double) et, (double) irp->interval_duration, (int64_t) irp->bytes_transferred, bandwidth * 8, (int64_t) irp->interval_retrans, (int64_t) irp->snd_cwnd, (int64_t) irp->snd_wnd, (int64_t) irp->rtt, (int64_t) irp->rttvar, (int64_t) irp->pmtu, (int64_t) irp->reorder, irp->omitted, sp->sender));
else {
unit_snprintf(cbuf, UNIT_LEN, irp->snd_cwnd, 'A');
iperf_printf(test, report_bw_retrans_cwnd_format, sp->socket, mbuf, st, et, ubuf, nbuf, irp->interval_retrans, cbuf, irp->omitted?report_omitted:"");
@@ -4218,6 +4811,7 @@ iperf_new_stream(struct iperf_test *test, int s, int sender)
{
struct iperf_stream *sp;
int ret = 0;
+ int size;
char template[1024];
if (test->tmp_template) {
@@ -4276,13 +4870,20 @@ iperf_new_stream(struct iperf_test *test, int s, int sender)
free(sp);
return NULL;
}
- if (ftruncate(sp->buffer_fd, test->settings->blksize) < 0) {
+ size = test->settings->blksize;
+ if (test->protocol->id == Pudp && test->settings->gso && (size < test->settings->gso_bf_size))
+ size = test->settings->gso_bf_size;
+ if (test->protocol->id == Pudp && test->settings->gro && (size < test->settings->gro_bf_size))
+ size = test->settings->gro_bf_size;
+ if (sp->test->debug)
+ printf("Buffer %d bytes\n", size);
+ if (ftruncate(sp->buffer_fd, size) < 0) {
i_errno = IECREATESTREAM;
free(sp->result);
free(sp);
return NULL;
}
- sp->buffer = (char *) mmap(NULL, test->settings->blksize, PROT_READ|PROT_WRITE, MAP_PRIVATE, sp->buffer_fd, 0);
+ sp->buffer = (char *) mmap(NULL, size, PROT_READ|PROT_WRITE, MAP_SHARED, sp->buffer_fd, 0);
if (sp->buffer == MAP_FAILED) {
i_errno = IECREATESTREAM;
free(sp->result);
@@ -4445,12 +5046,15 @@ iperf_add_stream(struct iperf_test *test, struct iperf_stream *sp)
// and changing it would break multi-stream tests between old
// and new iperf3 versions.
i = 2;
+ prev = NULL;
SLIST_FOREACH(n, &test->streams, streams) {
prev = n;
++i;
}
- SLIST_INSERT_AFTER(prev, sp, streams);
- sp->id = i;
+ if (prev) {
+ SLIST_INSERT_AFTER(prev, sp, streams);
+ sp->id = i;
+ }
}
}
@@ -4564,8 +5168,10 @@ iperf_catch_sigend(void (*handler)(int))
* before cleaning up and exiting.
*/
void
-iperf_got_sigend(struct iperf_test *test)
+iperf_got_sigend(struct iperf_test *test, int sig)
{
+ int exit_normal;
+
/*
* If we're the client, or if we're a server and running a test,
* then dump out the accumulated stats so far.
@@ -4576,18 +5182,36 @@ iperf_got_sigend(struct iperf_test *test)
test->done = 1;
cpu_util(test->cpu_util);
test->stats_callback(test);
- test->state = DISPLAY_RESULTS; /* change local state only */
+ iperf_set_test_state(test, DISPLAY_RESULTS); /* change local state only */
if (test->on_test_finish)
test->on_test_finish(test);
test->reporter_callback(test);
}
if (test->ctrl_sck >= 0) {
- test->state = (test->role == 'c') ? CLIENT_TERMINATE : SERVER_TERMINATE;
+ iperf_set_test_state(test, (test->role == 'c') ? CLIENT_TERMINATE : SERVER_TERMINATE);
(void) Nwrite(test->ctrl_sck, (char*) &test->state, sizeof(signed char), Ptcp);
}
i_errno = (test->role == 'c') ? IECLIENTTERM : IESERVERTERM;
- iperf_errexit(test, "interrupt - %s", iperf_strerror(i_errno));
+
+ exit_normal = 0;
+#ifdef SIGTERM
+ if (sig == SIGTERM)
+ exit_normal = 1;
+#endif
+#ifdef SIGINT
+ if (sig == SIGINT)
+ exit_normal = 1;
+#endif
+#ifdef SIGHUP
+ if (sig == SIGHUP)
+ exit_normal = 1;
+#endif
+ if (exit_normal) {
+ iperf_signormalexit(test, "interrupt - %s by signal %s(%d)", iperf_strerror(i_errno), strsignal(sig), sig);
+ } else {
+ iperf_errexit(test, "interrupt - %s by signal %s(%d)", iperf_strerror(i_errno), strsignal(sig), sig);
+ }
}
/* Try to write a PID file if requested, return -1 on an error. */
@@ -4609,7 +5233,15 @@ iperf_create_pidfile(struct iperf_test *test)
if (pid > 0) {
/* See if the process exists. */
+#if (defined(__vxworks)) || (defined(__VXWORKS__))
+#if (defined(_WRS_KERNEL)) && (defined(_WRS_CONFIG_LP64))
+ if (kill((_Vx_TASK_ID)pid, 0) == 0) {
+#else
+ if (kill(pid, 0) == 0) {
+#endif // _WRS_KERNEL and _WRS_CONFIG_LP64
+#else
if (kill(pid, 0) == 0) {
+#endif // __vxworks or __VXWORKS__
/*
* Make sure not to try to delete existing PID file by
* scribbling over the pathname we'd use to refer to it.
@@ -4621,6 +5253,7 @@ iperf_create_pidfile(struct iperf_test *test)
}
}
}
+ (void)close(fd);
}
/*
@@ -4683,30 +5316,73 @@ iperf_json_start(struct iperf_test *test)
int
iperf_json_finish(struct iperf_test *test)
{
- if (test->title)
- cJSON_AddStringToObject(test->json_top, "title", test->title);
- if (test->extra_data)
- cJSON_AddStringToObject(test->json_top, "extra_data", test->extra_data);
- /* Include server output */
- if (test->json_server_output) {
- cJSON_AddItemToObject(test->json_top, "server_output_json", test->json_server_output);
- }
- if (test->server_output_text) {
- cJSON_AddStringToObject(test->json_top, "server_output_text", test->server_output_text);
+ if (test->json_top) {
+ if (test->title) {
+ cJSON_AddStringToObject(test->json_top, "title", test->title);
+ }
+ if (test->extra_data) {
+ cJSON_AddStringToObject(test->json_top, "extra_data", test->extra_data);
+ }
+ /* Include server output */
+ if (test->json_server_output) {
+ cJSON_AddItemToObject(test->json_top, "server_output_json", test->json_server_output);
+ }
+ if (test->server_output_text) {
+ cJSON_AddStringToObject(test->json_top, "server_output_text", test->server_output_text);
+ }
+
+ int print_full_json = 1;
+
+ /* --json-stream, so we print various individual objects */
+ if (test->json_stream) {
+ cJSON *error = iperf_cJSON_GetObjectItemType(test->json_top, "error", cJSON_String);
+ if (error) {
+ JSONStream_Output(test, "error", error);
+ }
+ if (test->json_server_output) {
+ JSONStream_Output(test, "server_output_json", test->json_server_output);
+ }
+ if (test->server_output_text) {
+ JSONStream_Output(test, "server_output_text", cJSON_CreateString(test->server_output_text));
+ }
+ JSONStream_Output(test, "end", test->json_end);
+
+ if (!test->json_stream_full_output)
+ print_full_json = 0;
+ }
+ /* Original --json output, single monolithic object */
+ if (print_full_json) {
+ /*
+ * Get ASCII rendering of JSON structure. Then make our
+ * own copy of it and return the storage that cJSON
+ * allocated on our behalf. We keep our own copy
+ * around.
+ */
+ char *str = cJSON_Print(test->json_top);
+ if (str == NULL) {
+ return -1;
+ }
+ test->json_output_string = strdup(str);
+ cJSON_free(str);
+ if (test->json_output_string == NULL) {
+ return -1;
+ }
+ if (test->json_callback != NULL) {
+ (test->json_callback)(test, test->json_output_string);
+ } else {
+ if (pthread_mutex_lock(&(test->print_mutex)) != 0) {
+ perror("iperf_json_finish: pthread_mutex_lock");
+ }
+ fprintf(test->outfile, "%s\n", test->json_output_string);
+ if (pthread_mutex_unlock(&(test->print_mutex)) != 0) {
+ perror("iperf_json_finish: pthread_mutex_unlock");
+ }
+ iflush(test);
+ }
+ }
+ cJSON_Delete(test->json_top);
}
- // Get ASCII rendering of JSON structure. Then make our
- // own copy of it and return the storage that cJSON allocated
- // on our behalf. We keep our own copy around.
- char *str = cJSON_Print(test->json_top);
- if (str == NULL)
- return -1;
- test->json_output_string = strdup(str);
- cJSON_free(str);
- if (test->json_output_string == NULL)
- return -1;
- fprintf(test->outfile, "%s\n", test->json_output_string);
- iflush(test);
- cJSON_Delete(test->json_top);
+
test->json_top = test->json_start = test->json_connected = test->json_intervals = test->json_server_output = test->json_end = NULL;
return 0;
}
@@ -4811,6 +5487,10 @@ iperf_printf(struct iperf_test *test, const char* format, ...)
struct tm *ltm = NULL;
char *ct = NULL;
+ if (pthread_mutex_lock(&(test->print_mutex)) != 0) {
+ perror("iperf_print: pthread_mutex_lock");
+ }
+
/* Timestamp if requested */
if (iperf_get_test_timestamps(test)) {
time(&now);
@@ -4834,28 +5514,36 @@ iperf_printf(struct iperf_test *test, const char* format, ...)
if (test->role == 'c') {
if (ct) {
r0 = fprintf(test->outfile, "%s", ct);
- if (r0 < 0)
- return r0;
+ if (r0 < 0) {
+ r = r0;
+ goto bottom;
+ }
r += r0;
}
if (test->title) {
r0 = fprintf(test->outfile, "%s: ", test->title);
- if (r0 < 0)
- return r0;
+ if (r0 < 0) {
+ r = r0;
+ goto bottom;
+ }
r += r0;
}
va_start(argp, format);
r0 = vfprintf(test->outfile, format, argp);
va_end(argp);
- if (r0 < 0)
- return r0;
+ if (r0 < 0) {
+ r = r0;
+ goto bottom;
+ }
r += r0;
}
else if (test->role == 's') {
if (ct) {
r0 = snprintf(linebuffer, sizeof(linebuffer), "%s", ct);
- if (r0 < 0)
- return r0;
+ if (r0 < 0) {
+ r = r0;
+ goto bottom;
+ }
r += r0;
}
/* Should always be true as long as sizeof(ct) < sizeof(linebuffer) */
@@ -4863,8 +5551,10 @@ iperf_printf(struct iperf_test *test, const char* format, ...)
va_start(argp, format);
r0 = vsnprintf(linebuffer + r, sizeof(linebuffer) - r, format, argp);
va_end(argp);
- if (r0 < 0)
- return r0;
+ if (r0 < 0) {
+ r = r0;
+ goto bottom;
+ }
r += r0;
}
fprintf(test->outfile, "%s", linebuffer);
@@ -4875,11 +5565,113 @@ iperf_printf(struct iperf_test *test, const char* format, ...)
TAILQ_INSERT_TAIL(&(test->server_output_list), l, textlineentries);
}
}
+
+ bottom:
+ if (pthread_mutex_unlock(&(test->print_mutex)) != 0) {
+ perror("iperf_print: pthread_mutex_unlock");
+ }
+
return r;
}
int
iflush(struct iperf_test *test)
{
- return fflush(test->outfile);
+ int rc2;
+
+ int rc;
+ rc = pthread_mutex_lock(&(test->print_mutex));
+ if (rc != 0) {
+ errno = rc;
+ perror("iflush: pthread_mutex_lock");
+ }
+
+ rc2 = fflush(test->outfile);
+
+ rc = pthread_mutex_unlock(&(test->print_mutex));
+ if (rc != 0) {
+ errno = rc;
+ perror("iflush: pthread_mutex_unlock");
+ }
+
+ return rc2;
+}
+
+#if defined (HAVE_TCP_KEEPALIVE)
+// Set Control Connection TCP Keepalive (especially useful for long UDP test sessions)
+int
+iperf_set_control_keepalive(struct iperf_test *test)
+{
+ int opt, kaidle, kainterval, kacount;
+ socklen_t len;
+
+ if (test->settings->cntl_ka) {
+ // Set keepalive using system defaults
+ opt = 1;
+ if (setsockopt(test->ctrl_sck, SOL_SOCKET, SO_KEEPALIVE, (char *) &opt, sizeof(opt))) {
+ i_errno = IESETCNTLKA;
+ return -1;
+ }
+
+ // Get default values when not specified
+ if ((kaidle = test->settings->cntl_ka_keepidle) == 0) {
+ len = sizeof(kaidle);
+ if (getsockopt(test->ctrl_sck, IPPROTO_TCP, TCP_KEEPIDLE, (char *) &kaidle, &len)) {
+ i_errno = IESETCNTLKAINTERVAL;
+ return -1;
+ }
+ }
+ if ((kainterval = test->settings->cntl_ka_interval) == 0) {
+ len = sizeof(kainterval);
+ if (getsockopt(test->ctrl_sck, IPPROTO_TCP, TCP_KEEPINTVL, (char *) &kainterval, &len)) {
+ i_errno = IESETCNTLKAINTERVAL;
+ return -1;
+ }
+ }
+ if ((kacount = test->settings->cntl_ka_count) == 0) {
+ len = sizeof(kacount);
+ if (getsockopt(test->ctrl_sck, IPPROTO_TCP, TCP_KEEPCNT, (char *) &kacount, &len)) {
+ i_errno = IESETCNTLKACOUNT;
+ return -1;
+ }
+ }
+
+ // Seems that at least in Windows WSL2, TCP keepalive retries full interval must be
+ // smaller than the idle interval. Otherwise, the keepalive message is sent only once.
+ if (test->settings->cntl_ka_keepidle) {
+ if (test->settings->cntl_ka_keepidle <= (kainterval * kacount)) {
+ iperf_err(test, "Keepalive Idle time (%d) should be greater than Retries-interval (%d) times Retries-count (%d)", kaidle, kainterval, kacount);
+ i_errno = IECNTLKA;
+ return -1;
+ }
+ }
+
+ // Set keep alive values when specified
+ if ((opt = test->settings->cntl_ka_keepidle)) {
+ if (setsockopt(test->ctrl_sck, IPPROTO_TCP, TCP_KEEPIDLE, (char *) &opt, sizeof(opt))) {
+ i_errno = IESETCNTLKAKEEPIDLE;
+ return -1;
+ }
+ }
+ if ((opt = test->settings->cntl_ka_interval)) {
+ if (setsockopt(test->ctrl_sck, IPPROTO_TCP, TCP_KEEPINTVL, (char *) &opt, sizeof(opt))) {
+ i_errno = IESETCNTLKAINTERVAL;
+ return -1;
+ }
+ }
+ if ((opt = test->settings->cntl_ka_count)) {
+ if (setsockopt(test->ctrl_sck, IPPROTO_TCP, TCP_KEEPCNT, (char *) &opt, sizeof(opt))) {
+ i_errno = IESETCNTLKACOUNT;
+ return -1;
+ }
+ }
+
+ if (test->verbose) {
+ printf("Control connection TCP Keepalive TCP_KEEPIDLE/TCP_KEEPINTVL/TCP_KEEPCNT are set to %d/%d/%d\n",
+ kaidle, kainterval, kacount);
+ }
+ }
+
+ return 0;
}
+#endif //HAVE_TCP_KEEPALIVE
diff --git a/src/iperf_api.h b/src/iperf_api.h
index 171006aeb..ff8003e96 100644
--- a/src/iperf_api.h
+++ b/src/iperf_api.h
@@ -1,5 +1,5 @@
/*
- * iperf, Copyright (c) 2014-2022, The Regents of the University of
+ * iperf, Copyright (c) 2014-2025, The Regents of the University of
* California, through Lawrence Berkeley National Laboratory (subject
* to receipt of any required approvals from the U.S. Dept. of
* Energy). All rights reserved.
@@ -30,14 +30,23 @@
#include
#include
#include
+#include
#include
-#ifdef HAVE_STDINT_H
#include
-#endif
#ifdef __cplusplus
extern "C" { /* open extern "C" */
#endif
+/*
+ * Atomic types highly desired, but if not, we approximate what we need
+ * with normal integers and warn.
+ */
+#ifdef HAVE_STDATOMIC_H
+#include
+#else
+#warning "No available"
+typedef u_int64_t atomic_uint_fast64_t;
+#endif // HAVE_STDATOMIC_H
struct iperf_test;
struct iperf_stream_result;
@@ -46,7 +55,8 @@ struct iperf_stream;
struct iperf_time;
#if !defined(__IPERF_H)
-typedef uint64_t iperf_size_t;
+typedef uint_fast64_t iperf_size_t;
+typedef atomic_uint_fast64_t atomic_iperf_size_t;
#endif // __IPERF_H
/* default settings */
@@ -89,7 +99,14 @@ typedef uint64_t iperf_size_t;
#define OPT_IDLE_TIMEOUT 25
#define OPT_DONT_FRAGMENT 26
#define OPT_RCV_TIMEOUT 27
-#define OPT_SND_TIMEOUT 28
+#define OPT_JSON_STREAM 28
+#define OPT_SND_TIMEOUT 29
+#define OPT_USE_PKCS1_PADDING 30
+#define OPT_CNTL_KA 31
+#define OPT_SKIP_RX_COPY 32
+#define OPT_JSON_STREAM_FULL_OUTPUT 33
+#define OPT_SERVER_MAX_DURATION 34
+#define OPT_GSRO 35
/* states */
#define TEST_START 1
@@ -140,6 +157,8 @@ char* iperf_get_test_template( struct iperf_test* ipt );
int iperf_get_test_protocol_id( struct iperf_test* ipt );
int iperf_get_test_json_output( struct iperf_test* ipt );
char* iperf_get_test_json_output_string ( struct iperf_test* ipt );
+int iperf_get_test_json_stream( struct iperf_test* ipt );
+int iperf_get_test_json_stream_full_output( struct iperf_test* ipt );
int iperf_get_test_zerocopy( struct iperf_test* ipt );
int iperf_get_test_get_server_output( struct iperf_test* ipt );
char iperf_get_test_unit_format(struct iperf_test *ipt);
@@ -184,6 +203,9 @@ void iperf_set_test_server_hostname( struct iperf_test* ipt, const char* server_
void iperf_set_test_template( struct iperf_test *ipt, const char *tmp_template );
void iperf_set_test_reverse( struct iperf_test* ipt, int reverse );
void iperf_set_test_json_output( struct iperf_test* ipt, int json_output );
+void iperf_set_test_json_stream( struct iperf_test* ipt, int json_stream );
+void iperf_set_test_json_stream_full_output( struct iperf_test* ipt, int json_stream_full_output );
+void iperf_set_test_json_callback(struct iperf_test *ipt, void (*callback)(struct iperf_test *, char *));
int iperf_has_zerocopy( void );
void iperf_set_test_zerocopy( struct iperf_test* ipt, int zerocopy );
void iperf_set_test_get_server_output( struct iperf_test* ipt, int get_server_output );
@@ -200,14 +222,20 @@ void iperf_set_dont_fragment( struct iperf_test* ipt, int dont_fragment );
void iperf_set_test_congestion_control(struct iperf_test* ipt, char* cc);
void iperf_set_test_mss(struct iperf_test* ipt, int mss);
void iperf_set_mapped_v4(struct iperf_test* ipt, const int val);
+void iperf_set_on_new_stream_callback(struct iperf_test* ipt, void (*callback)(struct iperf_stream *));
+void iperf_set_on_test_start_callback(struct iperf_test* ipt, void (*callback)(struct iperf_test *));
+void iperf_set_on_test_connect_callback(struct iperf_test* ipt, void (*callback)(struct iperf_test *));
+void iperf_set_on_test_finish_callback(struct iperf_test* ipt, void (*callback)(struct iperf_test *));
#if defined(HAVE_SSL)
void iperf_set_test_client_username(struct iperf_test *ipt, const char *client_username);
void iperf_set_test_client_password(struct iperf_test *ipt, const char *client_password);
void iperf_set_test_client_rsa_pubkey(struct iperf_test *ipt, const char *client_rsa_pubkey_base64);
+void iperf_set_test_client_rsa_pubkey_from_file(struct iperf_test *ipt, const char *client_rsa_pubkey_file);
void iperf_set_test_server_authorized_users(struct iperf_test *ipt, const char *server_authorized_users);
void iperf_set_test_server_skew_threshold(struct iperf_test *ipt, int server_skew_threshold);
void iperf_set_test_server_rsa_privkey(struct iperf_test *ipt, const char *server_rsa_privkey_base64);
+void iperf_set_test_server_rsa_privkey_from_file(struct iperf_test *ipt, const char *server_rsa_privkey_file);
#endif // HAVE_SSL
void iperf_set_test_connect_timeout(struct iperf_test *ipt, int ct);
@@ -226,7 +254,7 @@ void add_to_interval_list(struct iperf_stream_result * rp, struct iperf_int
/**
* connect_msg -- displays connection message
- * denoting senfer/receiver details
+ * denoting sender/receiver details
*
*/
void connect_msg(struct iperf_stream * sp);
@@ -292,6 +320,14 @@ void iperf_free_stream(struct iperf_stream * sp);
*/
int iperf_common_sockopts(struct iperf_test *, int s);
+#if defined (HAVE_TCP_KEEPALIVE)
+/**
+ * iperf_set_control_keepalive -- set control connection TCP keepalive
+ *
+ */
+int iperf_set_control_keepalive(struct iperf_test *test);
+#endif //HAVE_TCP_KEEPALIVE
+
int has_tcpinfo(void);
int has_tcpinfo_retransmits(void);
void save_tcpinfo(struct iperf_stream *sp, struct iperf_interval_results *irp);
@@ -301,15 +337,15 @@ long get_snd_wnd(struct iperf_interval_results *irp);
long get_rtt(struct iperf_interval_results *irp);
long get_rttvar(struct iperf_interval_results *irp);
long get_pmtu(struct iperf_interval_results *irp);
+long get_reorder(struct iperf_interval_results *irp);
void print_tcpinfo(struct iperf_test *test);
-void build_tcpinfo_message(struct iperf_interval_results *r, char *message);
int iperf_set_send_state(struct iperf_test *test, signed char state);
void iperf_check_throttle(struct iperf_stream *sp, struct iperf_time *nowP);
-int iperf_send(struct iperf_test *, fd_set *) /* __attribute__((hot)) */;
-int iperf_recv(struct iperf_test *, fd_set *);
+int iperf_send_mt(struct iperf_stream *) /* __attribute__((hot)) */;
+int iperf_recv_mt(struct iperf_stream *);
void iperf_catch_sigend(void (*handler)(int));
-void iperf_got_sigend(struct iperf_test *test) __attribute__ ((noreturn));
+void iperf_got_sigend(struct iperf_test *test, int sig) __attribute__ ((noreturn));
void usage(void);
void usage_long(FILE * f);
void warning(const char *);
@@ -363,8 +399,11 @@ int iflush(struct iperf_test *test);
/* Error routines. */
void iperf_err(struct iperf_test *test, const char *format, ...) __attribute__ ((format(printf,2,3)));
void iperf_errexit(struct iperf_test *test, const char *format, ...) __attribute__ ((format(printf,2,3),noreturn));
+void iperf_signormalexit(struct iperf_test *test, const char *format, ...) __attribute__ ((format(printf,2,3),noreturn));
+void iperf_exit(struct iperf_test *test, int exit_code, const char *format, va_list argp) __attribute__ ((noreturn));
char *iperf_strerror(int);
extern int i_errno;
+extern const char *errarg;
enum {
IENONE = 0, // No error
/* Parameter errors */
@@ -402,6 +441,10 @@ enum {
IERVRSONLYRCVTIMEOUT = 32, // Client receive timeout is valid only in reverse mode
IESNDTIMEOUT = 33, // Illegal message send timeout
IEUDPFILETRANSFER = 34, // Cannot transfer file using UDP
+ IESERVERAUTHUSERS = 35, // Cannot access authorized users file
+ IECNTLKA = 36, // Control connection Keepalive period should be larger than the full retry period (interval * count)
+ IEMAXSERVERTESTDURATIONEXCEEDED = 37, // Client's duration exceeds server's maximum duration
+ IEUNITVAL = 38, // Invalid unit value or suffix
/* Test errors */
IENEWTEST = 100, // Unable to create a new test (check perror)
IEINITTEST = 101, // Test initialization failed (check perror)
@@ -452,12 +495,22 @@ enum {
IEBINDDEVNOSUPPORT = 146, // `ip%%dev` is not supported as system does not support bind to device
IEHOSTDEV = 147, // host device name (ip%%) is supported (and required) only for IPv6 link-local address
IESETUSERTIMEOUT = 148, // Unable to set TCP USER_TIMEOUT (check perror)
+ IEPTHREADCREATE=150, // Unable to create thread (check perror)
+ IEPTHREADCANCEL=151, // Unable to cancel thread (check perror)
+ IEPTHREADJOIN=152, // Unable to join thread (check perror)
+ IEPTHREADATTRINIT=153, // Unable to initialize thread attribute (check perror)
+ IEPTHREADATTRDESTROY=154, // Unable to destroy thread attribute (check perror)
+ IESETCNTLKA = 155, // Unable to set socket keepalive (SO_KEEPALIVE) option
+ IESETCNTLKAKEEPIDLE = 156, // Unable to set socket keepalive TCP period (TCP_KEEPIDLE) option
+ IESETCNTLKAINTERVAL = 157, // Unable to set/get socket keepalive TCP retry interval (TCP_KEEPINTVL) option
+ IESETCNTLKACOUNT = 158, // Unable to set/get socket keepalive TCP number of retries (TCP_KEEPCNT) option
+ IEPTHREADSIGMASK=159, // Unable to initialize sub thread signal mask (check perror)
/* Stream errors */
IECREATESTREAM = 200, // Unable to create a new stream (check herror/perror)
IEINITSTREAM = 201, // Unable to initialize stream (check herror/perror)
IESTREAMLISTEN = 202, // Unable to start stream listener (check perror)
IESTREAMCONNECT = 203, // Unable to connect stream (check herror/perror)
- IESTREAMACCEPT = 204, // Unable to accepte stream connection (check perror)
+ IESTREAMACCEPT = 204, // Unable to accept stream connection (check perror)
IESTREAMWRITE = 205, // Unable to write to stream socket (check perror)
IESTREAMREAD = 206, // Unable to read from stream (check perror)
IESTREAMCLOSE = 207, // Stream has closed unexpectedly
diff --git a/src/iperf_auth.c b/src/iperf_auth.c
index 595f730c8..4c38fa938 100644
--- a/src/iperf_auth.c
+++ b/src/iperf_auth.c
@@ -1,5 +1,5 @@
/*
- * iperf, Copyright (c) 2014-2020, The Regents of the University of
+ * iperf, Copyright (c) 2014-2023, The Regents of the University of
* California, through Lawrence Berkeley National Laboratory (subject
* to receipt of any required approvals from the U.S. Dept. of
* Energy). All rights reserved.
@@ -28,7 +28,6 @@
#include "iperf_config.h"
#include
-#include
#include
#include
/* FreeBSD needs _WITH_GETLINE to enable the getline() declaration */
@@ -46,20 +45,22 @@
#include
#include
#include
+#if OPENSSL_VERSION_MAJOR >= 3
+#include
+#include
+#endif
const char *auth_text_format = "user: %s\npwd: %s\nts: %"PRId64;
void sha256(const char *string, char outputBuffer[65])
{
unsigned char hash[SHA256_DIGEST_LENGTH];
- SHA256_CTX sha256;
- SHA256_Init(&sha256);
- SHA256_Update(&sha256, string, strlen(string));
- SHA256_Final(hash, &sha256);
+
+ SHA256((const unsigned char *) string, strlen(string), hash);
int i = 0;
for(i = 0; i < SHA256_DIGEST_LENGTH; i++)
{
- sprintf(outputBuffer + (i * 2), "%02x", hash[i]);
+ snprintf(outputBuffer + (i * 2), 3, "%02x", hash[i]);
}
outputBuffer[64] = 0;
}
@@ -73,7 +74,7 @@ int check_authentication(const char *username, const char *password, const time_
char passwordHash[65];
char salted[strlen(username) + strlen(password) + 3];
- sprintf(salted, "{%s}%s", username, password);
+ snprintf(salted, sizeof(salted), "{%s}%s", username, password);
sha256(&salted[0], passwordHash);
char *s_username, *s_password;
@@ -129,9 +130,9 @@ int Base64Encode(const unsigned char* buffer, const size_t length, char** b64tex
size_t calcDecodeLength(const char* b64input) { //Calculates the length of a decoded string
size_t len = strlen(b64input), padding = 0;
- if (b64input[len-1] == '=' && b64input[len-2] == '=') //last two chars are =
+ if (len >= 2 && b64input[len-1] == '=' && b64input[len-2] == '=') //last two chars are =
padding = 2;
- else if (b64input[len-1] == '=') //last char is =
+ else if (len >= 1 && b64input[len-1] == '=') //last char is =
padding = 1;
return (len*3)/4 - padding;
@@ -150,7 +151,6 @@ int Base64Decode(const char* b64message, unsigned char** buffer, size_t* length)
BIO_set_flags(bio, BIO_FLAGS_BASE64_NO_NL); //Do not use newlines to flush buffer
*length = BIO_read(bio, *buffer, strlen(b64message));
- assert(*length == decodeLen); //length should equal decodeLen, else something went horribly wrong
BIO_free_all(bio);
return (0); //success
@@ -228,61 +228,137 @@ int test_load_private_key_from_file(const char *file){
return 0;
}
-int encrypt_rsa_message(const char *plaintext, EVP_PKEY *public_key, unsigned char **encryptedtext) {
+int encrypt_rsa_message(const char *plaintext, EVP_PKEY *public_key, unsigned char **encryptedtext, int use_pkcs1_padding) {
+#if OPENSSL_VERSION_MAJOR >= 3
+ EVP_PKEY_CTX *ctx;
+#else
RSA *rsa = NULL;
- unsigned char *rsa_buffer = NULL, pad = RSA_PKCS1_PADDING;
- int keysize, encryptedtext_len, rsa_buffer_len;
-
+#endif
+ unsigned char *rsa_buffer = NULL;
+ size_t encryptedtext_len = 0, plaintext_len = 0;
+ int rsa_buffer_len, output_buffer_len;
+
+#if OPENSSL_VERSION_MAJOR >= 3
+ int rc;
+ ctx = EVP_PKEY_CTX_new_from_pkey(NULL, public_key, "");
+ /* See evp_pkey_rsa(7) and provider-keymgmt(7) */
+ rc = EVP_PKEY_get_int_param(public_key, OSSL_PKEY_PARAM_MAX_SIZE, &output_buffer_len);
+ if (!rc) {
+ goto errreturn;
+ }
+#else
rsa = EVP_PKEY_get1_RSA(public_key);
- keysize = RSA_size(rsa);
-
- rsa_buffer = OPENSSL_malloc(keysize * 2);
- *encryptedtext = (unsigned char*)OPENSSL_malloc(keysize);
+ output_buffer_len = RSA_size(rsa);
+#endif
+ plaintext_len = strlen(plaintext);
+ if (plaintext_len > output_buffer_len) {
+ fprintf(stderr, "Plaintext of size %zd truncated to %d; data is lost.\n", plaintext_len, output_buffer_len);
+ }
+ rsa_buffer = OPENSSL_malloc(output_buffer_len);
+ *encryptedtext = (unsigned char*)OPENSSL_malloc(output_buffer_len);
+ encryptedtext_len = output_buffer_len;
- BIO *bioBuff = BIO_new_mem_buf((void*)plaintext, (int)strlen(plaintext));
- rsa_buffer_len = BIO_read(bioBuff, rsa_buffer, keysize * 2);
- encryptedtext_len = RSA_public_encrypt(rsa_buffer_len, rsa_buffer, *encryptedtext, rsa, pad);
+ BIO *bioBuff = BIO_new_mem_buf((void*)plaintext, (int)plaintext_len);
+ rsa_buffer_len = BIO_read(bioBuff, rsa_buffer, plaintext_len);
+ int padding = RSA_PKCS1_OAEP_PADDING;
+ if (use_pkcs1_padding){
+ padding = RSA_PKCS1_PADDING;
+ }
+#if OPENSSL_VERSION_MAJOR >= 3
+ EVP_PKEY_encrypt_init(ctx);
+ EVP_PKEY_CTX_set_rsa_padding(ctx, padding);
+
+ EVP_PKEY_encrypt(ctx, *encryptedtext, &encryptedtext_len, rsa_buffer, rsa_buffer_len);
+ EVP_PKEY_CTX_free(ctx);
+#else
+ encryptedtext_len = RSA_public_encrypt(rsa_buffer_len, rsa_buffer, *encryptedtext, rsa, padding);
RSA_free(rsa);
+#endif
+
OPENSSL_free(rsa_buffer);
BIO_free(bioBuff);
- if (encryptedtext_len < 0) {
- /* We probably shouldn't be printing stuff like this */
- fprintf(stderr, "%s\n", ERR_error_string(ERR_get_error(), NULL));
+ if (encryptedtext_len <= 0) {
+ goto errreturn;
}
return encryptedtext_len;
+
+ errreturn:
+ fprintf(stderr, "%s\n", ERR_error_string(ERR_get_error(), NULL));
+ return 0;
}
-int decrypt_rsa_message(const unsigned char *encryptedtext, const int encryptedtext_len, EVP_PKEY *private_key, unsigned char **plaintext) {
+int decrypt_rsa_message(const unsigned char *encryptedtext, const int encryptedtext_len, EVP_PKEY *private_key, unsigned char **plaintext, int use_pkcs1_padding) {
+ int ret =0;
+#if OPENSSL_VERSION_MAJOR >= 3
+ EVP_PKEY_CTX *ctx;
+#else
RSA *rsa = NULL;
- unsigned char *rsa_buffer = NULL, pad = RSA_PKCS1_PADDING;
- int plaintext_len, rsa_buffer_len, keysize;
-
+#endif
+ unsigned char *rsa_buffer = NULL;
+ size_t plaintext_len = 0;
+ int rsa_buffer_len, output_buffer_len;
+
+#if OPENSSL_VERSION_MAJOR >= 3
+ int rc;
+ ctx = EVP_PKEY_CTX_new_from_pkey(NULL, private_key, "");
+ /* See evp_pkey_rsa(7) and provider-keymgmt(7) */
+ rc = EVP_PKEY_get_int_param(private_key, OSSL_PKEY_PARAM_MAX_SIZE, &output_buffer_len);
+ if (!rc) {
+ goto errreturn;
+ }
+#else
rsa = EVP_PKEY_get1_RSA(private_key);
-
- keysize = RSA_size(rsa);
- rsa_buffer = OPENSSL_malloc(keysize * 2);
- *plaintext = (unsigned char*)OPENSSL_malloc(keysize);
+ output_buffer_len = RSA_size(rsa);
+#endif
+ if (encryptedtext_len > output_buffer_len) {
+ fprintf(stderr, "Encrypted text of size %d truncated to %d; likely invalid input.\n", encryptedtext_len, output_buffer_len);
+ }
+ rsa_buffer = OPENSSL_malloc(output_buffer_len);
+ // Note: +1 for NULL
+ *plaintext = (unsigned char*)OPENSSL_malloc(output_buffer_len + 1);
BIO *bioBuff = BIO_new_mem_buf((void*)encryptedtext, encryptedtext_len);
- rsa_buffer_len = BIO_read(bioBuff, rsa_buffer, keysize * 2);
- plaintext_len = RSA_private_decrypt(rsa_buffer_len, rsa_buffer, *plaintext, rsa, pad);
+ rsa_buffer_len = BIO_read(bioBuff, rsa_buffer, encryptedtext_len);
+
+ int padding = RSA_PKCS1_OAEP_PADDING;
+ if (use_pkcs1_padding){
+ padding = RSA_PKCS1_PADDING;
+ }
+#if OPENSSL_VERSION_MAJOR >= 3
+
+ plaintext_len = output_buffer_len;
+ EVP_PKEY_decrypt_init(ctx);
+ ret = EVP_PKEY_CTX_set_rsa_padding(ctx, padding);
+ if (ret < 0){
+ goto errreturn;
+ }
+ ret = EVP_PKEY_decrypt(ctx, *plaintext, &plaintext_len, rsa_buffer, rsa_buffer_len);
+ EVP_PKEY_CTX_free(ctx);
+#else
+ plaintext_len = RSA_private_decrypt(rsa_buffer_len, rsa_buffer, *plaintext, rsa, padding);
RSA_free(rsa);
+#endif
+
OPENSSL_free(rsa_buffer);
BIO_free(bioBuff);
- if (plaintext_len < 0) {
- /* We probably shouldn't be printing stuff like this */
- fprintf(stderr, "%s\n", ERR_error_string(ERR_get_error(), NULL));
+ /* Treat a decryption error as an empty string. */
+ if (plaintext_len <= 0) {
+ plaintext_len = 0;
}
return plaintext_len;
+
+ errreturn:
+ fprintf(stderr, "%s\n", ERR_error_string(ERR_get_error(), NULL));
+ return 0;
}
-int encode_auth_setting(const char *username, const char *password, EVP_PKEY *public_key, char **authtoken){
+int encode_auth_setting(const char *username, const char *password, EVP_PKEY *public_key, char **authtoken, int use_pkcs1_padding){
time_t t = time(NULL);
time_t utc_seconds = mktime(localtime(&t));
@@ -299,7 +375,7 @@ int encode_auth_setting(const char *username, const char *password, EVP_PKEY *pu
unsigned char *encrypted = NULL;
int encrypted_len;
- encrypted_len = encrypt_rsa_message(text, public_key, &encrypted);
+ encrypted_len = encrypt_rsa_message(text, public_key, &encrypted, use_pkcs1_padding);
free(text);
if (encrypted_len < 0) {
return -1;
@@ -310,34 +386,38 @@ int encode_auth_setting(const char *username, const char *password, EVP_PKEY *pu
return (0); //success
}
-int decode_auth_setting(int enable_debug, const char *authtoken, EVP_PKEY *private_key, char **username, char **password, time_t *ts){
+int decode_auth_setting(int enable_debug, const char *authtoken, EVP_PKEY *private_key, char **username, char **password, time_t *ts, int use_pkcs1_padding){
unsigned char *encrypted_b64 = NULL;
size_t encrypted_len_b64;
- int64_t utc_seconds;
+ int64_t utc_seconds =0;
Base64Decode(authtoken, &encrypted_b64, &encrypted_len_b64);
unsigned char *plaintext = NULL;
int plaintext_len;
- plaintext_len = decrypt_rsa_message(encrypted_b64, encrypted_len_b64, private_key, &plaintext);
+ plaintext_len = decrypt_rsa_message(encrypted_b64, encrypted_len_b64, private_key, &plaintext, use_pkcs1_padding);
free(encrypted_b64);
- if (plaintext_len < 0) {
+ if (plaintext_len <= 0) {
return -1;
}
+
plaintext[plaintext_len] = '\0';
char *s_username, *s_password;
s_username = (char *) calloc(plaintext_len, sizeof(char));
if (s_username == NULL) {
+ OPENSSL_free(plaintext);
return -1;
}
s_password = (char *) calloc(plaintext_len, sizeof(char));
if (s_password == NULL) {
+ OPENSSL_free(plaintext);
free(s_username);
return -1;
}
int rc = sscanf((char *) plaintext, auth_text_format, s_username, s_password, &utc_seconds);
if (rc != 3) {
+ OPENSSL_free(plaintext);
free(s_password);
free(s_username);
return -1;
diff --git a/src/iperf_auth.h b/src/iperf_auth.h
index ffadbf3e5..eedd45abd 100644
--- a/src/iperf_auth.h
+++ b/src/iperf_auth.h
@@ -35,7 +35,7 @@ EVP_PKEY *load_pubkey_from_file(const char *file);
EVP_PKEY *load_pubkey_from_base64(const char *buffer);
EVP_PKEY *load_privkey_from_file(const char *file);
EVP_PKEY *load_privkey_from_base64(const char *buffer);
-int encode_auth_setting(const char *username, const char *password, EVP_PKEY *public_key, char **authtoken);
-int decode_auth_setting(int enable_debug, const char *authtoken, EVP_PKEY *private_key, char **username, char **password, time_t *ts);
+int encode_auth_setting(const char *username, const char *password, EVP_PKEY *public_key, char **authtoken, int use_pkcs1_padding);
+int decode_auth_setting(int enable_debug, const char *authtoken, EVP_PKEY *private_key, char **username, char **password, time_t *ts, int use_pkcs1_padding);
int check_authentication(const char *username, const char *password, const time_t ts, const char *filename, int skew_threshold);
ssize_t iperf_getpass (char **lineptr, size_t *n, FILE *stream);
diff --git a/src/iperf_client_api.c b/src/iperf_client_api.c
index 583306880..d8a79d125 100644
--- a/src/iperf_client_api.c
+++ b/src/iperf_client_api.c
@@ -1,5 +1,5 @@
/*
- * iperf, Copyright (c) 2014-2022, The Regents of the University of
+ * iperf, Copyright (c) 2014-2023, The Regents of the University of
* California, through Lawrence Berkeley National Laboratory (subject
* to receipt of any required approvals from the U.S. Dept. of
* Energy). All rights reserved.
@@ -36,6 +36,7 @@
#include
#include
#include
+#include
#include "iperf.h"
#include "iperf_api.h"
@@ -51,6 +52,50 @@
#endif /* TCP_CA_NAME_MAX */
#endif /* HAVE_TCP_CONGESTION */
+void *
+iperf_client_worker_run(void *s) {
+ struct iperf_stream *sp = (struct iperf_stream *) s;
+ struct iperf_test *test = sp->test;
+
+ /* Blocking signal to make sure that signal will be handled by main thread */
+ sigset_t set;
+ sigemptyset(&set);
+#ifdef SIGTERM
+ sigaddset(&set, SIGTERM);
+#endif
+#ifdef SIGHUP
+ sigaddset(&set, SIGHUP);
+#endif
+#ifdef SIGINT
+ sigaddset(&set, SIGINT);
+#endif
+ if (pthread_sigmask(SIG_BLOCK, &set, NULL) != 0) {
+ i_errno = IEPTHREADSIGMASK;
+ goto cleanup_and_fail;
+ }
+
+ /* Allow this thread to be cancelled even if it's in a syscall */
+ pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
+ pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
+
+ while (! (test->done) && ! (sp->done)) {
+ if (sp->sender) {
+ if (iperf_send_mt(sp) < 0) {
+ goto cleanup_and_fail;
+ }
+ }
+ else {
+ if (iperf_recv_mt(sp) < 0) {
+ goto cleanup_and_fail;
+ }
+ }
+ }
+ return NULL;
+
+ cleanup_and_fail:
+ return NULL;
+}
+
int
iperf_create_streams(struct iperf_test *test, int sender)
{
@@ -103,6 +148,11 @@ iperf_create_streams(struct iperf_test *test, int sender)
i_errno = IESETCONGESTION;
return -1;
}
+ if (test->congestion_used) {
+ if (test->debug)
+ printf("Overriding existing congestion algorithm: %s\n", test->congestion_used);
+ free(test->congestion_used);
+ }
// Set actual used congestion alg, or set to unknown if could not get it
if (rc < 0)
test->congestion_used = strdup("unknown");
@@ -115,12 +165,6 @@ iperf_create_streams(struct iperf_test *test, int sender)
}
#endif /* HAVE_TCP_CONGESTION */
- if (sender)
- FD_SET(s, &test->write_set);
- else
- FD_SET(s, &test->read_set);
- if (s > test->max_fd) test->max_fd = s;
-
sp = iperf_new_stream(test, s, sender);
if (!sp)
return -1;
@@ -267,6 +311,11 @@ iperf_handle_message_client(struct iperf_test *test)
i_errno = IEINITTEST;
return -1;
}
+
+ if (test->debug_level >= DEBUG_LEVEL_INFO) {
+ iperf_printf(test, "Reading new State from the Server - current state is %d-%s\n", test->state, state_to_text(test->state));
+ }
+
/*!!! Why is this read() and not Nread()? */
if ((rval = read(test->ctrl_sck, (char*) &test->state, sizeof(signed char))) <= 0) {
if (rval == 0) {
@@ -278,6 +327,10 @@ iperf_handle_message_client(struct iperf_test *test)
}
}
+ if (test->debug_level >= DEBUG_LEVEL_INFO) {
+ iperf_printf(test, "State change: client received and changed State to %d-%s\n", test->state, state_to_text(test->state));
+ }
+
switch (test->state) {
case PARAM_EXCHANGE:
if (iperf_exchange_parameters(test) < 0)
@@ -391,11 +444,17 @@ iperf_connect(struct iperf_test *test)
return -1;
}
+#if defined (HAVE_TCP_KEEPALIVE)
+ // Set Control Connection TCP Keepalive (especially useful for long UDP test sessions)
+ if (iperf_set_control_keepalive(test) < 0)
+ return -1;
+#endif //HAVE_TCP_KEEPALIVE
+
#if defined(HAVE_TCP_USER_TIMEOUT)
if ((opt = test->settings->snd_timeout)) {
if (setsockopt(test->ctrl_sck, IPPROTO_TCP, TCP_USER_TIMEOUT, &opt, sizeof(opt)) < 0) {
- i_errno = IESETUSERTIMEOUT;
- return -1;
+ i_errno = IESETUSERTIMEOUT;
+ return -1;
}
}
#endif /* HAVE_TCP_USER_TIMEOUT */
@@ -457,6 +516,17 @@ iperf_connect(struct iperf_test *test)
printf("Setting UDP block size to %d\n", test->settings->blksize);
}
}
+ /* Initialize GSO parameters when --gsro is used */
+ if (test->settings->gso) {
+ test->settings->gso_dg_size = test->settings->blksize;
+ /* use the multiple of datagram size for the best efficiency. */
+ if (test->settings->gso_dg_size > 0) {
+ test->settings->gso_bf_size = (test->settings->gso_bf_size / test->settings->gso_dg_size) * test->settings->gso_dg_size;
+ } else {
+ /* If gso_dg_size is 0 (unlimited bandwidth), use default UDP datagram size */
+ test->settings->gso_dg_size = DEFAULT_UDP_BLKSIZE;
+ }
+ }
/*
* Regardless of whether explicitly or implicitly set, if the
@@ -519,9 +589,11 @@ iperf_run_client(struct iperf_test * test)
struct iperf_time last_receive_time;
struct iperf_time diff_time;
struct timeval used_timeout;
+ iperf_size_t last_receive_blocks;
int64_t t_usecs;
int64_t timeout_us;
int64_t rcv_timeout_us;
+ int i_errno_save;
if (NULL == test)
{
@@ -562,6 +634,9 @@ iperf_run_client(struct iperf_test * test)
else
rcv_timeout_us = 0;
+ iperf_time_now(&last_receive_time); // Initialize last time something was received
+ last_receive_blocks = 0;
+
startup = 1;
while (test->state != IPERF_DONE) {
memcpy(&read_set, &test->read_set, sizeof(fd_set));
@@ -577,6 +652,10 @@ iperf_run_client(struct iperf_test * test)
used_timeout.tv_usec = timeout->tv_usec;
timeout_us = (timeout->tv_sec * SEC_TO_US) + timeout->tv_usec;
}
+ /* Cap the maximum select timeout at 1 second */
+ if (timeout_us > SEC_TO_US) {
+ timeout_us = SEC_TO_US;
+ }
if (timeout_us < 0 || timeout_us > rcv_timeout_us) {
used_timeout.tv_sec = test->settings->rcv_timeout.secs;
used_timeout.tv_usec = test->settings->rcv_timeout.usecs;
@@ -584,28 +663,49 @@ iperf_run_client(struct iperf_test * test)
timeout = &used_timeout;
}
+#if (defined(__vxworks)) || (defined(__VXWORKS__))
+ if (timeout != NULL && timeout->tv_sec == 0 && timeout->tv_usec == 0) {
+ taskDelay (1);
+ }
+
+ result = select(test->max_fd + 1,
+ &read_set,
+ (test->state == TEST_RUNNING && !test->reverse) ? &write_set : NULL,
+ NULL,
+ timeout);
+#else
result = select(test->max_fd + 1, &read_set, &write_set, NULL, timeout);
+#endif // __vxworks or __VXWORKS__
if (result < 0 && errno != EINTR) {
i_errno = IESELECT;
goto cleanup_and_fail;
} else if (result == 0 && test->state == TEST_RUNNING && rcv_timeout_us > 0) {
- // If nothing was received in non-reverse running state then probably something got stack -
- // either client, server or network, and test should be terminated.
+ /*
+ * If nothing was received in non-reverse running state
+ * then probably something got stuck - either client,
+ * server or network, and test should be terminated./
+ */
iperf_time_now(&now);
if (iperf_time_diff(&now, &last_receive_time, &diff_time) == 0) {
t_usecs = iperf_time_in_usecs(&diff_time);
if (t_usecs > rcv_timeout_us) {
- i_errno = IENOMSG;
- goto cleanup_and_fail;
+ /* Idle timeout if no new blocks received */
+ if (test->blocks_received == last_receive_blocks) {
+ i_errno = IENOMSG;
+ goto cleanup_and_fail;
+ }
}
}
}
+ /* See if the test is making progress */
+ if (test->blocks_received > last_receive_blocks) {
+ last_receive_blocks = test->blocks_received;
+ last_receive_time = now;
+ }
+
if (result > 0) {
- if (rcv_timeout_us > 0) {
- iperf_time_now(&last_receive_time);
- }
if (FD_ISSET(test->ctrl_sck, &read_set)) {
if (iperf_handle_message_client(test) < 0) {
goto cleanup_and_fail;
@@ -620,31 +720,32 @@ iperf_run_client(struct iperf_test * test)
if (startup) {
startup = 0;
- // Set non-blocking for non-UDP tests
- if (test->protocol->id != Pudp) {
- SLIST_FOREACH(sp, &test->streams, streams) {
- setnonblocking(sp->socket, 1);
- }
- }
- }
-
-
- if (test->mode == BIDIRECTIONAL)
- {
- if (iperf_send(test, &write_set) < 0)
- goto cleanup_and_fail;
- if (iperf_recv(test, &read_set) < 0)
- goto cleanup_and_fail;
- } else if (test->mode == SENDER) {
- // Regular mode. Client sends.
- if (iperf_send(test, &write_set) < 0)
+ /* Create and spin up threads */
+ pthread_attr_t attr;
+ if (pthread_attr_init(&attr) != 0) {
+ i_errno = IEPTHREADATTRINIT;
goto cleanup_and_fail;
- } else {
- // Reverse mode. Client receives.
- if (iperf_recv(test, &read_set) < 0)
+ }
+
+ SLIST_FOREACH(sp, &test->streams, streams) {
+ if (pthread_create(&(sp->thr), &attr, &iperf_client_worker_run, sp) != 0) {
+ i_errno = IEPTHREADCREATE;
+ goto cleanup_and_fail;
+ }
+ sp->thread_created = 1;
+ if (test->debug_level >= DEBUG_LEVEL_INFO) {
+ iperf_printf(test, "Thread FD %d created\n", sp->socket);
+ }
+ }
+ if (test->debug_level >= DEBUG_LEVEL_INFO) {
+ iperf_printf(test, "All threads created\n");
+ }
+ if (pthread_attr_destroy(&attr) != 0) {
+ i_errno = IEPTHREADATTRDESTROY;
goto cleanup_and_fail;
- }
+ }
+ }
/* Run the timers. */
iperf_time_now(&now);
@@ -665,12 +766,36 @@ iperf_run_client(struct iperf_test * test)
(test->settings->blocks != 0 && (test->blocks_sent >= test->settings->blocks ||
test->blocks_received >= test->settings->blocks)))) {
- // Unset non-blocking for non-UDP tests
- if (test->protocol->id != Pudp) {
- SLIST_FOREACH(sp, &test->streams, streams) {
- setnonblocking(sp->socket, 0);
- }
- }
+ /* Cancel outstanding sender threads */
+ SLIST_FOREACH(sp, &test->streams, streams) {
+ if (sp->sender) {
+ int rc;
+ sp->done = 1;
+ if (sp->thread_created == 1) {
+ rc = pthread_cancel(sp->thr);
+ if (rc != 0 && rc != ESRCH) {
+ i_errno = IEPTHREADCANCEL;
+ errno = rc;
+ iperf_err(test, "sender cancel in pthread_cancel - %s", iperf_strerror(i_errno));
+ goto cleanup_and_fail;
+ }
+ rc = pthread_join(sp->thr, NULL);
+ if (rc != 0 && rc != ESRCH) {
+ i_errno = IEPTHREADJOIN;
+ errno = rc;
+ iperf_err(test, "sender cancel in pthread_join - %s", iperf_strerror(i_errno));
+ goto cleanup_and_fail;
+ }
+ if (test->debug_level >= DEBUG_LEVEL_INFO) {
+ iperf_printf(test, "Thread FD %d stopped\n", sp->socket);
+ }
+ sp->thread_created = 0;
+ }
+ }
+ }
+ if (test->debug_level >= DEBUG_LEVEL_INFO) {
+ iperf_printf(test, "Sender threads stopped\n");
+ }
/* Yes, done! Send TEST_END. */
test->done = 1;
@@ -680,15 +805,37 @@ iperf_run_client(struct iperf_test * test)
goto cleanup_and_fail;
}
}
- // If we're in reverse mode, continue draining the data
- // connection(s) even if test is over. This prevents a
- // deadlock where the server side fills up its pipe(s)
- // and gets blocked, so it can't receive state changes
- // from the client side.
- else if (test->mode == RECEIVER && test->state == TEST_END) {
- if (iperf_recv(test, &read_set) < 0)
- goto cleanup_and_fail;
- }
+ }
+
+ /* Cancel outstanding receiver threads */
+ SLIST_FOREACH(sp, &test->streams, streams) {
+ if (!sp->sender) {
+ int rc;
+ sp->done = 1;
+ if (sp->thread_created == 1) {
+ rc = pthread_cancel(sp->thr);
+ if (rc != 0 && rc != ESRCH) {
+ i_errno = IEPTHREADCANCEL;
+ errno = rc;
+ iperf_err(test, "receiver cancel in pthread_cancel - %s", iperf_strerror(i_errno));
+ goto cleanup_and_fail;
+ }
+ rc = pthread_join(sp->thr, NULL);
+ if (rc != 0 && rc != ESRCH) {
+ i_errno = IEPTHREADJOIN;
+ errno = rc;
+ iperf_err(test, "receiver cancel in pthread_join - %s", iperf_strerror(i_errno));
+ goto cleanup_and_fail;
+ }
+ if (test->debug_level >= DEBUG_LEVEL_INFO) {
+ iperf_printf(test, "Thread FD %d stopped\n", sp->socket);
+ }
+ sp->thread_created = 0;
+ }
+ }
+ }
+ if (test->debug_level >= DEBUG_LEVEL_INFO) {
+ iperf_printf(test, "Receiver threads stopped\n");
}
if (test->json_output) {
@@ -704,14 +851,42 @@ iperf_run_client(struct iperf_test * test)
return 0;
cleanup_and_fail:
+ /* Cancel all outstanding threads */
+ i_errno_save = i_errno;
+ SLIST_FOREACH(sp, &test->streams, streams) {
+ if (sp->done) {
+ continue;
+ }
+ sp->done = 1;
+ int rc;
+ if (sp->thread_created == 1) {
+ rc = pthread_cancel(sp->thr);
+ if (rc != 0 && rc != ESRCH) {
+ i_errno = IEPTHREADCANCEL;
+ errno = rc;
+ iperf_err(test, "cleanup_and_fail in pthread_cancel - %s", iperf_strerror(i_errno));
+ }
+ rc = pthread_join(sp->thr, NULL);
+ if (rc != 0 && rc != ESRCH) {
+ i_errno = IEPTHREADJOIN;
+ errno = rc;
+ iperf_err(test, "cleanup_and_fail in pthread_join - %s", iperf_strerror(i_errno));
+ }
+ if (test->debug_level >= DEBUG_LEVEL_INFO) {
+ iperf_printf(test, "Thread FD %d stopped\n", sp->socket);
+ }
+ sp->thread_created = 0;
+ }
+ }
+ if (test->debug_level >= DEBUG_LEVEL_INFO) {
+ iperf_printf(test, "All threads stopped\n");
+ }
+ i_errno = i_errno_save;
+
iperf_client_end(test);
if (test->json_output) {
cJSON_AddStringToObject(test->json_top, "error", iperf_strerror(i_errno));
iperf_json_finish(test);
- iflush(test);
- // Return 0 and not -1 since all terminating function were done here.
- // Also prevents error message logging outside the already closed JSON output.
- return 0;
}
iflush(test);
return -1;
diff --git a/src/iperf_config.h.in b/src/iperf_config.h.in
index 883107901..fa22a17e0 100644
--- a/src/iperf_config.h.in
+++ b/src/iperf_config.h.in
@@ -1,15 +1,18 @@
/* src/iperf_config.h.in. Generated from configure.ac by autoheader. */
-/* Define to 1 if you have the `clock_gettime' function. */
+/* Define to 1 if you have the 'clock_gettime' function. */
#undef HAVE_CLOCK_GETTIME
-/* Define to 1 if you have the `cpuset_setaffinity' function. */
+/* Define to 1 if you have the 'clock_nanosleep' function. */
+#undef HAVE_CLOCK_NANOSLEEP
+
+/* Define to 1 if you have the 'cpuset_setaffinity' function. */
#undef HAVE_CPUSET_SETAFFINITY
/* Have CPU affinity support. */
#undef HAVE_CPU_AFFINITY
-/* Define to 1 if you have the `daemon' function. */
+/* Define to 1 if you have the 'daemon' function. */
#undef HAVE_DAEMON
/* Define to 1 if you have the header file. */
@@ -24,12 +27,15 @@
/* Have IPv6 flowlabel support. */
#undef HAVE_FLOWLABEL
-/* Define to 1 if you have the `getline' function. */
+/* Define to 1 if you have the 'getline' function. */
#undef HAVE_GETLINE
/* Define to 1 if you have the header file. */
#undef HAVE_INTTYPES_H
+/* Have MPTCP protocol. */
+#undef HAVE_IPPROTO_MPTCP
+
/* Have IP_DONTFRAG sockopt. */
#undef HAVE_IP_DONTFRAG
@@ -42,22 +48,34 @@
/* Define to 1 if you have the header file. */
#undef HAVE_LINUX_TCP_H
+/* Have MSG_TRUNC recv option. */
+#undef HAVE_MSG_TRUNC
+
+/* Define to 1 if you have the 'nanosleep' function. */
+#undef HAVE_NANOSLEEP
+
/* Define to 1 if you have the header file. */
#undef HAVE_NETINET_SCTP_H
/* Define to 1 if you have the header file. */
#undef HAVE_POLL_H
-/* Define to 1 if you have the `sched_setaffinity' function. */
+/* Define if you have POSIX threads libraries and header files. */
+#undef HAVE_PTHREAD
+
+/* Have PTHREAD_PRIO_INHERIT. */
+#undef HAVE_PTHREAD_PRIO_INHERIT
+
+/* Define to 1 if you have the 'sched_setaffinity' function. */
#undef HAVE_SCHED_SETAFFINITY
/* Have SCTP support. */
#undef HAVE_SCTP_H
-/* Define to 1 if you have the `sendfile' function. */
+/* Define to 1 if you have the 'sendfile' function. */
#undef HAVE_SENDFILE
-/* Define to 1 if you have the `SetProcessAffinityMask' function. */
+/* Define to 1 if you have the 'SetProcessAffinityMask' function. */
#undef HAVE_SETPROCESSAFFINITYMASK
/* Have SO_BINDTODEVICE sockopt. */
@@ -69,6 +87,9 @@
/* OpenSSL Is Available */
#undef HAVE_SSL
+/* Define to 1 if you have the header file. */
+#undef HAVE_STDATOMIC_H
+
/* Define to 1 if you have the header file. */
#undef HAVE_STDINT_H
@@ -84,7 +105,7 @@
/* Define to 1 if you have the header file. */
#undef HAVE_STRING_H
-/* Define to 1 if the system has the type `struct sctp_assoc_value'. */
+/* Define to 1 if the system has the type 'struct sctp_assoc_value'. */
#undef HAVE_STRUCT_SCTP_ASSOC_VALUE
/* Define to 1 if you have the header file. */
@@ -105,9 +126,18 @@
/* Have tcpi_snd_wnd field in tcp_info. */
#undef HAVE_TCP_INFO_SND_WND
+/* Have TCP_KEEPIDLE sockopt. */
+#undef HAVE_TCP_KEEPALIVE
+
/* Have TCP_USER_TIMEOUT sockopt. */
#undef HAVE_TCP_USER_TIMEOUT
+/* Have UDP_GRO sockopt. */
+#undef HAVE_UDP_GRO
+
+/* Have UDP_SEGMENT sockopt. */
+#undef HAVE_UDP_SEGMENT
+
/* Define to 1 if you have the header file. */
#undef HAVE_UNISTD_H
@@ -135,7 +165,11 @@
/* 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
+/* Define to necessary symbol if this constant uses a non-standard name on
+ your system. */
+#undef PTHREAD_CREATE_JOINABLE
+
+/* Define to 1 if all of the C89 standard headers exist (not just the ones
required in a freestanding environment). This macro is provided for
backward compatibility; new code need not use it. */
#undef STDC_HEADERS
@@ -143,5 +177,5 @@
/* Version number of package */
#undef VERSION
-/* Define to empty if `const' does not conform to ANSI C. */
+/* Define to empty if 'const' does not conform to ANSI C. */
#undef const
diff --git a/src/iperf_error.c b/src/iperf_error.c
index 13e9c1511..1f5177bca 100644
--- a/src/iperf_error.c
+++ b/src/iperf_error.c
@@ -60,7 +60,11 @@ iperf_err(struct iperf_test *test, const char *format, ...)
if (test != NULL && test->json_output && test->json_top != NULL)
cJSON_AddStringToObject(test->json_top, "error", str);
else {
- if (test && test->outfile && test->outfile != stdout) {
+ if (test != NULL && pthread_mutex_lock(&(test->print_mutex)) != 0) {
+ perror("iperf_err: pthread_mutex_lock");
+ }
+
+ if (test != NULL && test->outfile != NULL && test->outfile != stdout) {
if (ct) {
fprintf(test->outfile, "%s", ct);
}
@@ -72,15 +76,39 @@ iperf_err(struct iperf_test *test, const char *format, ...)
}
fprintf(stderr, "iperf3: %s\n", str);
}
+
+ if (test != NULL && pthread_mutex_unlock(&(test->print_mutex)) != 0) {
+ perror("iperf_err: pthread_mutex_unlock");
+ }
+
}
va_end(argp);
}
-/* Do a printf to stderr or log file as appropriate, then exit. */
+/* Do a printf to stderr or log file as appropriate, then exit(0). */
+void
+iperf_signormalexit(struct iperf_test *test, const char *format, ...)
+{
+ va_list argp;
+
+ va_start(argp, format);
+ iperf_exit(test, 0, format, argp);
+}
+
+/* Do a printf to stderr or log file as appropriate, then exit(1). */
void
iperf_errexit(struct iperf_test *test, const char *format, ...)
{
va_list argp;
+
+ va_start(argp, format);
+ iperf_exit(test, 1, format, argp);
+}
+
+/* Do a printf to stderr or log file as appropriate, then exit. */
+void
+iperf_exit(struct iperf_test *test, int exit_code, const char *format, va_list argp)
+{
char str[1000];
time_t now;
struct tm *ltm = NULL;
@@ -90,16 +118,21 @@ iperf_errexit(struct iperf_test *test, const char *format, ...)
if (test != NULL && test->timestamps) {
time(&now);
ltm = localtime(&now);
- strftime(iperf_timestrerr, sizeof(iperf_timestrerr), "%c ", ltm);
+ strftime(iperf_timestrerr, sizeof(iperf_timestrerr), iperf_get_test_timestamp_format(test), ltm);
ct = iperf_timestrerr;
}
- va_start(argp, format);
vsnprintf(str, sizeof(str), format, argp);
- if (test != NULL && test->json_output && test->json_top != NULL) {
- cJSON_AddStringToObject(test->json_top, "error", str);
+ if (test != NULL && test->json_output) {
+ if (test->json_top != NULL) {
+ cJSON_AddStringToObject(test->json_top, "error", str);
+ }
iperf_json_finish(test);
- } else
+ } else {
+ if (test != NULL && pthread_mutex_lock(&(test->print_mutex)) != 0) {
+ perror("iperf_errexit: pthread_mutex_lock");
+ }
+
if (test && test->outfile && test->outfile != stdout) {
if (ct) {
fprintf(test->outfile, "%s", ct);
@@ -112,13 +145,20 @@ iperf_errexit(struct iperf_test *test, const char *format, ...)
}
fprintf(stderr, "iperf3: %s\n", str);
}
+
+ if (test != NULL && pthread_mutex_unlock(&(test->print_mutex)) != 0) {
+ perror("iperf_errexit: pthread_mutex_unlock");
+ }
+ }
+
va_end(argp);
if (test)
iperf_delete_pidfile(test);
- exit(1);
+ exit(exit_code);
}
-int i_errno;
+int i_errno = 0;
+const char *errarg = NULL;
char *
iperf_strerror(int int_errno)
@@ -147,7 +187,7 @@ iperf_strerror(int int_errno)
snprintf(errstr, len, "some option you are trying to set is client only");
break;
case IEDURATION:
- snprintf(errstr, len, "test duration too long (maximum = %d seconds)", MAX_TIME);
+ snprintf(errstr, len, "test duration valid values are 0 to %d seconds", MAX_TIME);
break;
case IENUMSTREAMS:
snprintf(errstr, len, "number of parallel streams too large (maximum = %d)", MAX_STREAMS);
@@ -161,7 +201,7 @@ iperf_strerror(int int_errno)
case IEINTERVAL:
snprintf(errstr, len, "invalid report interval (min = %g, max = %g seconds)", MIN_INTERVAL, MAX_INTERVAL);
break;
- case IEBIND: /* UNUSED */
+ case IEBIND: /* UNUSED */
snprintf(errstr, len, "--bind must be specified to use --cport");
break;
case IEUDPBLOCKSIZE:
@@ -176,12 +216,15 @@ iperf_strerror(int int_errno)
case IESETSERVERAUTH:
snprintf(errstr, len, "you must specify a path to a valid RSA private key and a user credential file");
break;
- case IEBADFORMAT:
- snprintf(errstr, len, "bad format specifier (valid formats are in the set [kmgtKMGT])");
- break;
- case IEBADPORT:
- snprintf(errstr, len, "port number must be between 1 and 65535 inclusive");
- break;
+ case IESERVERAUTHUSERS:
+ snprintf(errstr, len, "cannot access authorized users file");
+ break;
+ case IEBADFORMAT:
+ snprintf(errstr, len, "bad format specifier (valid formats are in the set [kmgtKMGT])");
+ break;
+ case IEBADPORT:
+ snprintf(errstr, len, "port number must be between 1 and 65535 inclusive");
+ break;
case IEMSS:
snprintf(errstr, len, "TCP MSS too large (maximum = %d bytes)", MAX_MSS);
break;
@@ -189,7 +232,7 @@ iperf_strerror(int int_errno)
snprintf(errstr, len, "this OS does not support sendfile");
break;
case IEOMIT:
- snprintf(errstr, len, "bogus value for --omit");
+ snprintf(errstr, len, "bogus value for --omit (maximum = %d seconds)", MAX_OMIT_TIME);
break;
case IEUNIMP:
snprintf(errstr, len, "an option you are trying to set is not implemented yet");
@@ -204,13 +247,13 @@ iperf_strerror(int int_errno)
case IEENDCONDITIONS:
snprintf(errstr, len, "only one test end condition (-t, -n, -k) may be specified");
break;
- case IELOGFILE:
- snprintf(errstr, len, "unable to open log file");
- perr = 1;
- break;
- case IENOSCTP:
- snprintf(errstr, len, "no SCTP support available");
- break;
+ case IELOGFILE:
+ snprintf(errstr, len, "unable to open log file");
+ perr = 1;
+ break;
+ case IENOSCTP:
+ snprintf(errstr, len, "no SCTP support available");
+ break;
case IENEWTEST:
snprintf(errstr, len, "unable to create a new test");
perr = 1;
@@ -224,13 +267,13 @@ iperf_strerror(int int_errno)
break;
case IELISTEN:
snprintf(errstr, len, "unable to start listener for connections");
- herr = 1;
+ herr = 1;
perr = 1;
break;
case IECONNECT:
snprintf(errstr, len, "unable to connect to server - server may have stopped running or use a different port, firewall issue, etc.");
perr = 1;
- herr = 1;
+ herr = 1;
break;
case IEACCEPT:
snprintf(errstr, len, "unable to accept connection from client");
@@ -353,14 +396,17 @@ iperf_strerror(int int_errno)
case IEUDPFILETRANSFER:
snprintf(errstr, len, "cannot transfer file using UDP");
break;
+ case IEUNITVAL:
+ snprintf(errstr, len, "invalid unit value or suffix: '%s'", errarg);
+ break;
case IERVRSONLYRCVTIMEOUT:
snprintf(errstr, len, "client receive timeout is valid only in receiving mode");
perr = 1;
break;
- case IEDAEMON:
- snprintf(errstr, len, "unable to become a daemon");
- perr = 1;
- break;
+ case IEDAEMON:
+ snprintf(errstr, len, "unable to become a daemon");
+ perr = 1;
+ break;
case IECREATESTREAM:
snprintf(errstr, len, "unable to create a new stream");
herr = 1;
@@ -373,7 +419,7 @@ iperf_strerror(int int_errno)
break;
case IESTREAMLISTEN:
snprintf(errstr, len, "unable to start stream listener");
- herr = 1;
+ herr = 1;
perr = 1;
break;
case IESTREAMCONNECT:
@@ -411,14 +457,14 @@ iperf_strerror(int int_errno)
snprintf(errstr, len, "unable to set TCP_CONGESTION: "
"Supplied congestion control algorithm not supported on this host");
break;
- case IEPIDFILE:
+ case IEPIDFILE:
snprintf(errstr, len, "unable to write PID file");
perr = 1;
break;
- case IEV6ONLY:
- snprintf(errstr, len, "Unable to set/reset IPV6_V6ONLY");
- perr = 1;
- break;
+ case IEV6ONLY:
+ snprintf(errstr, len, "Unable to set/reset IPV6_V6ONLY");
+ perr = 1;
+ break;
case IESETSCTPDISABLEFRAG:
snprintf(errstr, len, "unable to set SCTP_DISABLE_FRAGMENTS");
perr = 1;
@@ -427,48 +473,96 @@ iperf_strerror(int int_errno)
snprintf(errstr, len, "unable to set SCTP_INIT num of SCTP streams\n");
perr = 1;
break;
- case IESETPACING:
- snprintf(errstr, len, "unable to set socket pacing");
- perr = 1;
- break;
- case IESETBUF2:
- snprintf(errstr, len, "socket buffer size not set correctly");
- break;
- case IEREVERSEBIDIR:
- snprintf(errstr, len, "cannot be both reverse and bidirectional");
+ case IESETPACING:
+ snprintf(errstr, len, "unable to set socket pacing");
+ perr = 1;
+ break;
+ case IESETBUF2:
+ snprintf(errstr, len, "socket buffer size not set correctly");
+ break;
+ case IEREVERSEBIDIR:
+ snprintf(errstr, len, "cannot be both reverse and bidirectional");
+ break;
+ case IETOTALRATE:
+ snprintf(errstr, len, "total required bandwidth is larger than server limit");
break;
- case IETOTALRATE:
- snprintf(errstr, len, "total required bandwidth is larger than server limit");
+ case IETOTALINTERVAL:
+ snprintf(errstr, len, "invalid time interval for calculating average data rate");
break;
- case IESKEWTHRESHOLD:
- snprintf(errstr, len, "skew threshold must be a positive number");
+ case IESKEWTHRESHOLD:
+ snprintf(errstr, len, "skew threshold must be a positive number");
break;
- case IEIDLETIMEOUT:
- snprintf(errstr, len, "idle timeout parameter is not positive or larger than allowed limit");
+ case IEIDLETIMEOUT:
+ snprintf(errstr, len, "idle timeout parameter is not positive or larger than allowed limit");
break;
- case IEBINDDEV:
- snprintf(errstr, len, "Unable to bind-to-device (check perror, maybe permissions?)");
+ case IEBINDDEV:
+ snprintf(errstr, len, "Unable to bind-to-device (check perror, maybe permissions?)");
break;
- case IEBINDDEVNOSUPPORT:
- snprintf(errstr, len, "`%%` is not supported as system does not support bind to device");
+ case IEBINDDEVNOSUPPORT:
+ snprintf(errstr, len, "`%%` is not supported as system does not support bind to device");
break;
- case IEHOSTDEV:
- snprintf(errstr, len, "host device name (ip%%) is supported (and required) only for IPv6 link-local address");
- break;
- case IENOMSG:
- snprintf(errstr, len, "idle timeout for receiving data");
+ case IEHOSTDEV:
+ snprintf(errstr, len, "host device name (ip%%) is supported (and required) only for IPv6 link-local address");
break;
- case IESETDONTFRAGMENT:
- snprintf(errstr, len, "unable to set IP Do-Not-Fragment flag");
+ case IENOMSG:
+ snprintf(errstr, len, "idle timeout for receiving data");
+ break;
+ case IESETDONTFRAGMENT:
+ snprintf(errstr, len, "unable to set IP Do-Not-Fragment flag");
break;
case IESETUSERTIMEOUT:
snprintf(errstr, len, "unable to set TCP USER_TIMEOUT");
perr = 1;
break;
- default:
- snprintf(errstr, len, "int_errno=%d", int_errno);
- perr = 1;
- break;
+ case IEPTHREADCREATE:
+ snprintf(errstr, len, "unable to create thread");
+ perr = 1;
+ break;
+ case IEPTHREADCANCEL:
+ snprintf(errstr, len, "unable to cancel thread");
+ perr = 1;
+ break;
+ case IEPTHREADJOIN:
+ snprintf(errstr, len, "unable to join thread");
+ perr = 1;
+ break;
+ case IEPTHREADATTRINIT:
+ snprintf(errstr, len, "unable to create thread attributes");
+ perr = 1;
+ break;
+ case IEPTHREADSIGMASK:
+ snprintf(errstr, len, "unable to change mask of blocked signals");
+ break;
+ case IEPTHREADATTRDESTROY:
+ snprintf(errstr, len, "unable to destroy thread attributes");
+ break;
+ case IECNTLKA:
+ snprintf(errstr, len, "control connection Keepalive period should be larger than the full retry period (interval * count)");
+ perr = 1;
+ break;
+ case IESETCNTLKA:
+ snprintf(errstr, len, "unable to set socket keepalive (SO_KEEPALIVE) option");
+ perr = 1;
+ break;
+ case IESETCNTLKAKEEPIDLE:
+ snprintf(errstr, len, "unable to set socket keepalive TCP period (TCP_KEEPIDLE) option");
+ perr = 1;
+ break;
+ case IESETCNTLKAINTERVAL:
+ snprintf(errstr, len, "unable to set/get socket keepalive TCP retry interval (TCP_KEEPINTVL) option");
+ perr = 1;
+ break;
+ case IESETCNTLKACOUNT:
+ snprintf(errstr, len, "unable to set/get socket keepalive TCP number of retries (TCP_KEEPCNT) option");
+ perr = 1;
+ break;
+ case IEMAXSERVERTESTDURATIONEXCEEDED:
+ snprintf(errstr, len, "client's requested duration exceeds the server's maximum permitted limit");
+ break;
+ default:
+ snprintf(errstr, len, "int_errno=%d", int_errno);
+ perr = 1;
+ break;
}
/* Append the result of strerror() or gai_strerror() if appropriate */
diff --git a/src/iperf_locale.c b/src/iperf_locale.c
index 62e3bc441..5d795e3d7 100644
--- a/src/iperf_locale.c
+++ b/src/iperf_locale.c
@@ -59,7 +59,7 @@
* 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 CONTIBUTORS OR COPYRIGHT
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE
@@ -81,6 +81,8 @@
#include "version.h"
+#include
+
#ifdef __cplusplus
extern "C"
{
@@ -103,7 +105,8 @@ const char usage_longstr[] = "Usage: iperf3 [-s|-c host] [options]\n"
" -I, --pidfile file write PID file\n"
" -F, --file name xmit/recv the specified file\n"
#if defined(HAVE_CPU_AFFINITY)
- " -A, --affinity n/n,m set CPU affinity\n"
+ " -A, --affinity n[,m] set CPU affinity core number to n (the core the process will use)\n"
+ " (optional Client only m - the Server's core number for this test)\n"
#endif /* HAVE_CPU_AFFINITY */
#if defined(HAVE_SO_BINDTODEVICE)
" -B, --bind [%%] bind to the interface associated with the address \n"
@@ -114,6 +117,8 @@ const char usage_longstr[] = "Usage: iperf3 [-s|-c host] [options]\n"
#endif /* HAVE_SO_BINDTODEVICE */
" -V, --verbose more detailed output\n"
" -J, --json output in JSON format\n"
+ " --json-stream output in line-delimited JSON format\n"
+ " --json-stream-full-output output in JSON format with JSON streams enabled\n"
" --logfile f send output to a log file\n"
" --forceflush force flushing output at every interval\n"
" --timestamps<=format> emit a timestamp at the start of each output line\n"
@@ -124,8 +129,15 @@ const char usage_longstr[] = "Usage: iperf3 [-s|-c host] [options]\n"
" --snd-timeout # timeout for unacknowledged TCP data\n"
" (in ms, default is system settings)\n"
#endif /* HAVE_TCP_USER_TIMEOUT */
+#if defined(HAVE_TCP_KEEPALIVE)
+ " --cntl-ka[=#/#/#] use control connection TCP keepalive - KEEPIDLE/KEEPINTV/KEEPCNT\n"
+ " each value is optional with system settings default\n"
+#endif //HAVE_TCP_KEEPALIVE
+#if defined(HAVE_IPPROTO_MPTCP)
+ " -m, --mptcp use MPTCP rather than plain TCP\n"
+#endif
" -d, --debug[=#] emit debugging output\n"
- " (optional optional \"=\" and debug level: 1-4. Default is 4 - all messages)\n"
+ " (optional \"=\" and debug level: 1-4. Default is 4 - all messages)\n"
" -v, --version show version information and quit\n"
" -h, --help show this message and quit\n"
"Server specific:\n"
@@ -137,6 +149,7 @@ const char usage_longstr[] = "Usage: iperf3 [-s|-c host] [options]\n"
" total data rate. Default is 5 seconds)\n"
" --idle-timeout # restart idle server after # seconds in case it\n"
" got stuck (default - no timeout)\n"
+ " --server-max-duration # max time, in seconds, that an iperf test can run against the server\n"
#if defined(HAVE_SSL)
" --rsa-private-key-path path to the RSA private key used to decrypt\n"
" authentication credentials\n"
@@ -144,6 +157,7 @@ const char usage_longstr[] = "Usage: iperf3 [-s|-c host] [options]\n"
" credentials\n"
" --time-skew-threshold time skew threshold (in seconds) between the server\n"
" and client during the authentication process\n"
+ " --use-pkcs1-padding use pkcs1 padding at your own risk\n"
#endif //HAVE_SSL
"Client specific:\n"
" -c, --client [%%] run in client mode, connecting to \n"
@@ -158,14 +172,17 @@ const char usage_longstr[] = "Usage: iperf3 [-s|-c host] [options]\n"
" -b, --bitrate #[KMG][/#] target bitrate in bits/sec (0 for unlimited)\n"
" (default %d Mbit/sec for UDP, unlimited for TCP)\n"
" (optional slash and packet count for burst mode)\n"
- " --pacing-timer #[KMG] set the timing for pacing, in microseconds (default %d)\n"
+ " --pacing-timer #[KMG] set the Server timing for pacing, in microseconds (default %d)\n"
+ " (deprecated - for servers using older versions backward compatibility)\n"
#if defined(HAVE_SO_MAX_PACING_RATE)
" --fq-rate #[KMG] enable fair-queuing based socket pacing in\n"
" bits/sec (Linux only)\n"
#endif
" -t, --time # time in seconds to transmit for (default %d secs)\n"
- " -n, --bytes #[KMG] number of bytes to transmit (instead of -t)\n"
- " -k, --blockcount #[KMG] number of blocks (packets) to transmit (instead of -t or -n)\n"
+ " -n, --bytes #[KMG] transmit until the end of the interval when the client sent or received\n"
+ " (per direction) at least this number of bytes (instead of -t or -k)\n"
+ " -k, --blockcount #[KMG] transmit until the end of the interval when the client sent or received\n"
+ " (per direction) at least this number of blocks (instead of -t or -n)\n"
" -l, --length #[KMG] length of buffer to read or write\n"
" (default %d KB for TCP, dynamic or %d for UDP)\n"
" --cport bind to a specific client port (TCP and UDP, default: ephemeral port)\n"
@@ -194,11 +211,15 @@ const char usage_longstr[] = "Usage: iperf3 [-s|-c host] [options]\n"
" -L, --flowlabel N set the IPv6 flow label (only supported on Linux)\n"
#endif /* HAVE_FLOWLABEL */
" -Z, --zerocopy use a 'zero copy' method of sending data\n"
+#if defined(HAVE_MSG_TRUNC)
+ " --skip-rx-copy ignore received messages using MSG_TRUNC option\n"
+#endif /* HAVE_MSG_TRUNC */
" -O, --omit N perform pre-test for N seconds and omit the pre-test statistics\n"
" -T, --title str prefix every output line with this string\n"
" --extra-data str data string to include in client and server JSON\n"
" --get-server-output get results from server\n"
" --udp-counters-64bit use 64-bit counters in UDP test packets\n"
+ " --gsro enable UDP GSO/GRO on both client and server (client-only option)\n"
" --repeating-payload use repeating pattern in payload, instead of\n"
" randomized payload (like in iperf2)\n"
#if defined(HAVE_DONT_FRAGMENT)
@@ -287,10 +308,10 @@ const char test_start_time[] =
"Starting Test: protocol: %s, %d streams, %d byte blocks, omitting %d seconds, %d second test, tos %d\n";
const char test_start_bytes[] =
-"Starting Test: protocol: %s, %d streams, %d byte blocks, omitting %d seconds, %llu bytes to send, tos %d\n";
+"Starting Test: protocol: %s, %d streams, %d byte blocks, omitting %d seconds, %"PRIuFAST64" bytes to send, tos %d\n";
const char test_start_blocks[] =
-"Starting Test: protocol: %s, %d streams, %d byte blocks, omitting %d seconds, %d blocks to send, tos %d\n";
+"Starting Test: protocol: %s, %d streams, %d byte blocks, omitting %d seconds, %"PRIuFAST64" blocks to send, tos %d\n";
/* -------------------------------------------------------------------
@@ -304,10 +325,10 @@ const char report_connecting[] =
"Connecting to host %s, port %d\n";
const char report_authentication_succeeded[] =
-"Authentication succeeded for user '%s' ts %ld\n";
+"Authentication succeeded for user '%s' ts %" PRIu64 "\n";
const char report_authentication_failed[] =
-"Authentication failed with return code %d for user '%s' ts %ld\n";
+"Authentication failed with return code %d for user '%s' ts %" PRIu64 "\n";
const char report_reverse[] =
"Reverse mode, remote host %s is sending\n";
@@ -376,16 +397,19 @@ const char report_bw_format[] =
"[%3d]%s %6.2f-%-6.2f sec %ss %ss/sec %s\n";
const char report_bw_retrans_format[] =
-"[%3d]%s %6.2f-%-6.2f sec %ss %ss/sec %3u %s\n";
+"[%3d]%s %6.2f-%-6.2f sec %ss %ss/sec %3ld %s\n";
const char report_bw_retrans_cwnd_format[] =
-"[%3d]%s %6.2f-%-6.2f sec %ss %ss/sec %3u %ss %s\n";
+"[%3d]%s %6.2f-%-6.2f sec %ss %ss/sec %3ld %ss %s\n";
const char report_bw_udp_format[] =
-"[%3d]%s %6.2f-%-6.2f sec %ss %ss/sec %5.3f ms %d/%d (%.2g%%) %s\n";
+"[%3d]%s %6.2f-%-6.2f sec %ss %ss/sec %5.3f ms %" PRId64 "/%" PRId64 " (%.2g%%) %s\n";
+
+const char report_bw_udp_format_no_omitted_error[] =
+"[%3d]%s %6.2f-%-6.2f sec %ss %ss/sec %5.3f ms Unknown/%" PRId64 " %s\n";
const char report_bw_udp_sender_format[] =
-"[%3d]%s %6.2f-%-6.2f sec %ss %ss/sec %s %d %s\n";
+"[%3d]%s %6.2f-%-6.2f sec %ss %ss/sec %s %" PRId64 " %s\n";
const char report_summary[] =
"Test Complete. Summary Results:\n";
@@ -394,13 +418,13 @@ const char report_sum_bw_format[] =
"[SUM]%s %6.2f-%-6.2f sec %ss %ss/sec %s\n";
const char report_sum_bw_retrans_format[] =
-"[SUM]%s %6.2f-%-6.2f sec %ss %ss/sec %3d %s\n";
+"[SUM]%s %6.2f-%-6.2f sec %ss %ss/sec %3"PRId64" %s\n";
const char report_sum_bw_udp_format[] =
-"[SUM]%s %6.2f-%-6.2f sec %ss %ss/sec %5.3f ms %d/%d (%.2g%%) %s\n";
+"[SUM]%s %6.2f-%-6.2f sec %ss %ss/sec %5.3f ms %" PRId64 "/%" PRId64 " (%.2g%%) %s\n";
const char report_sum_bw_udp_sender_format[] =
-"[SUM]%s %6.2f-%-6.2f sec %ss %ss/sec %s %d %s\n";
+"[SUM]%s %6.2f-%-6.2f sec %ss %ss/sec %s %" PRId64 " %s\n";
const char report_omitted[] = "(omitted)";
@@ -411,7 +435,7 @@ const char report_outoforder[] =
"[%3d]%s %4.1f-%4.1f sec %d datagrams received out-of-order\n";
const char report_sum_outoforder[] =
-"[SUM]%s %4.1f-%4.1f sec %d datagrams received out-of-order\n";
+"[SUM]%s %4.1f-%4.1f sec %"PRIu64" datagrams received out-of-order\n";
const char report_peer[] =
"[%3d] local %s port %u connected with %s port %u\n";
diff --git a/src/iperf_locale.h b/src/iperf_locale.h
index 47cf416ae..bc9c96cb4 100644
--- a/src/iperf_locale.h
+++ b/src/iperf_locale.h
@@ -78,6 +78,7 @@ extern const char report_bw_format[] ;
extern const char report_bw_retrans_format[] ;
extern const char report_bw_retrans_cwnd_format[] ;
extern const char report_bw_udp_format[] ;
+extern const char report_bw_udp_format_no_omitted_error[] ;
extern const char report_bw_udp_sender_format[] ;
extern const char report_summary[] ;
extern const char report_sum_bw_format[] ;
diff --git a/src/iperf_pthread.c b/src/iperf_pthread.c
new file mode 100644
index 000000000..9798a4112
--- /dev/null
+++ b/src/iperf_pthread.c
@@ -0,0 +1,41 @@
+#include "iperf_config.h"
+
+#if defined(HAVE_PTHREAD) && defined(__ANDROID__)
+
+/* Workaround for `pthread_cancel()` in Android, using `pthread_kill()` instead,
+ * as Android NDK does not support `pthread_cancel()`.
+ */
+
+#include
+#include
+#include "iperf_pthread.h"
+
+void iperf_thread_exit_handler(int sig)
+{
+ pthread_exit(0);
+}
+
+int iperf_set_thread_exit_handler() {
+ int rc;
+ struct sigaction actions;
+
+ memset(&actions, 0, sizeof(actions));
+ sigemptyset(&actions.sa_mask);
+ actions.sa_flags = 0;
+ actions.sa_handler = iperf_thread_exit_handler;
+
+ rc = sigaction(SIGUSR1, &actions, NULL);
+ return rc;
+}
+
+int pthread_setcanceltype(int type, int *oldtype) { return 0; }
+int pthread_setcancelstate(int state, int *oldstate) { return 0; }
+int pthread_cancel(pthread_t thread_id) {
+ int status;
+ if ((status = iperf_set_thread_exit_handler()) == 0) {
+ status = pthread_kill(thread_id, SIGUSR1);
+ }
+ return status;
+}
+
+#endif // defined(HAVE_PTHREAD) && defined(__ANDROID__)
diff --git a/src/iperf_pthread.h b/src/iperf_pthread.h
new file mode 100644
index 000000000..9fe3db8a2
--- /dev/null
+++ b/src/iperf_pthread.h
@@ -0,0 +1,21 @@
+#include "iperf_config.h"
+
+#if defined(HAVE_PTHREAD)
+
+#include
+
+#if defined(__ANDROID__)
+
+/* Adding missing `pthread` related definitions in Android.
+ */
+
+#define PTHREAD_CANCEL_ASYNCHRONOUS 0
+#define PTHREAD_CANCEL_ENABLE 0
+
+int pthread_setcanceltype(int type, int *oldtype);
+int pthread_setcancelstate(int state, int *oldstate);
+int pthread_cancel(pthread_t thread_id);
+
+#endif // defined(__ANDROID__)
+
+#endif // defined(HAVE_PTHREAD)
diff --git a/src/iperf_sctp.c b/src/iperf_sctp.c
index 104083281..af68a3fc9 100644
--- a/src/iperf_sctp.c
+++ b/src/iperf_sctp.c
@@ -39,10 +39,6 @@
#include
#include
-#ifdef HAVE_NETINET_SCTP_H
-#include
-#endif /* HAVE_NETINET_SCTP_H */
-
#include "iperf.h"
#include "iperf_api.h"
#include "iperf_sctp.h"
@@ -60,7 +56,7 @@ iperf_sctp_recv(struct iperf_stream *sp)
#if defined(HAVE_SCTP_H)
int r;
- r = Nread(sp->socket, sp->buffer, sp->settings->blksize, Psctp);
+ r = Nread_no_select(sp->socket, sp->buffer, sp->settings->blksize, Psctp);
if (r < 0)
return r;
@@ -172,7 +168,7 @@ iperf_sctp_listen(struct iperf_test *test)
/*
* If binding to the wildcard address with no explicit address
* family specified, then force us to get an AF_INET6 socket.
- * More details in the comments in netanounce().
+ * More details in the comments in netannounce().
*/
if (test->settings->domain == AF_UNSPEC && !test->bind_address) {
hints.ai_family = AF_INET6;
@@ -734,3 +730,49 @@ iperf_sctp_bindx(struct iperf_test *test, int s, int is_server)
return -1;
#endif /* HAVE_SCTP_H */
}
+
+
+/* iperf_sctp_get_rtt
+ *
+ * Get SCTP stream RTT.
+ * Assuming that iperf3 supports only one-to-one SCTP association, and not one-to-many association.
+ *
+ * Main resources used are RFC-6458, man pages for SCTP,
+ * https://docs.oracle.com/cd/E19253-01/817-4415/sockets-199/index.html.
+ *
+ */
+int
+iperf_sctp_get_info(struct iperf_stream *sp, struct iperf_sctp_info *sctp_info)
+{
+#if defined(HAVE_SCTP_H)
+ struct sctp_status status;
+ socklen_t len;
+ sctp_assoc_t assoc_id;
+ int rc = 0;
+
+ if (sp->test->protocol->id != Psctp) {
+ rc = -1;
+ } else {
+#ifdef SCTP_FUTURE_ASSOC
+ assoc_id = SCTP_FUTURE_ASSOC;
+#else
+ assoc_id = 0;
+#endif
+ len = sizeof(status);
+ rc = sctp_opt_info(sp->socket, assoc_id, SCTP_STATUS, &status, &len);
+ if (rc < 0) {
+ if (sp->test->debug_level >= DEBUG_LEVEL_ERROR)
+ iperf_err(sp->test, "sctp_opt_info get SCTP_STATUS for socket %d failed with errno %d - %s", sp->socket, errno, strerror(errno));
+ } else {
+ sctp_info->wnd = status.sstat_rwnd;
+ sctp_info->rtt = status.sstat_primary.spinfo_srtt;
+ sctp_info->pmtu = status.sstat_primary.spinfo_mtu;
+ sctp_info->cwnd = status.sstat_primary.spinfo_cwnd;
+ }
+ }
+
+ return rc;
+#else
+ return -1;
+#endif /* HAVE_SCTP_H */
+}
diff --git a/src/iperf_sctp.h b/src/iperf_sctp.h
index 764c410df..2956266f2 100644
--- a/src/iperf_sctp.h
+++ b/src/iperf_sctp.h
@@ -27,6 +27,10 @@
#ifndef IPERF_SCTP_H
#define IPERF_SCTP_H
+#ifdef HAVE_NETINET_SCTP_H
+#include
+#endif /* HAVE_NETINET_SCTP_H */
+
/**
* iperf_sctp_accept -- accepts a new SCTP connection
* on sctp_listener_socket for SCTP data and param/result
@@ -47,7 +51,7 @@ int iperf_sctp_recv(struct iperf_stream *);
/**
* iperf_sctp_send -- sends the client data for sctp
- * and the Param/result message exchanges
+ * and the Param/result message exchanges
* returns: bytes sent
*
*/
@@ -65,4 +69,6 @@ int iperf_sctp_init(struct iperf_test *test);
int iperf_sctp_bindx(struct iperf_test *test, int s, int is_server);
+int iperf_sctp_get_info(struct iperf_stream *sp, struct iperf_sctp_info *sctp_info);
+
#endif
diff --git a/src/iperf_server_api.c b/src/iperf_server_api.c
index 18f105ded..2f7a57a04 100644
--- a/src/iperf_server_api.c
+++ b/src/iperf_server_api.c
@@ -1,5 +1,5 @@
/*
- * iperf, Copyright (c) 2014-2022 The Regents of the University of
+ * iperf, Copyright (c) 2014-2023 The Regents of the University of
* California, through Lawrence Berkeley National Laboratory (subject
* to receipt of any required approvals from the U.S. Dept. of
* Energy). All rights reserved.
@@ -40,13 +40,12 @@
#include
#include
#include
-#ifdef HAVE_STDINT_H
#include
-#endif
#include
#include
#include
#include
+#include
#include "iperf.h"
#include "iperf_api.h"
@@ -66,6 +65,50 @@
#endif /* TCP_CA_NAME_MAX */
#endif /* HAVE_TCP_CONGESTION */
+void *
+iperf_server_worker_run(void *s) {
+ struct iperf_stream *sp = (struct iperf_stream *) s;
+ struct iperf_test *test = sp->test;
+
+ /* Blocking signal to make sure that signal will be handled by main thread */
+ sigset_t set;
+ sigemptyset(&set);
+#ifdef SIGTERM
+ sigaddset(&set, SIGTERM);
+#endif
+#ifdef SIGHUP
+ sigaddset(&set, SIGHUP);
+#endif
+#ifdef SIGINT
+ sigaddset(&set, SIGINT);
+#endif
+ if (pthread_sigmask(SIG_BLOCK, &set, NULL) != 0) {
+ i_errno = IEPTHREADSIGMASK;
+ goto cleanup_and_fail;
+ }
+
+ /* Allow this thread to be cancelled even if it's in a syscall */
+ pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
+ pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
+
+ while (! (test->done) && ! (sp->done)) {
+ if (sp->sender) {
+ if (iperf_send_mt(sp) < 0) {
+ goto cleanup_and_fail;
+ }
+ }
+ else {
+ if (iperf_recv_mt(sp) < 0) {
+ goto cleanup_and_fail;
+ }
+ }
+ }
+ return NULL;
+
+ cleanup_and_fail:
+ return NULL;
+}
+
int
iperf_server_listen(struct iperf_test *test)
{
@@ -110,6 +153,7 @@ int
iperf_accept(struct iperf_test *test)
{
int s;
+ int ret = -1;
signed char rbuf = ACCESS_DENIED;
socklen_t len;
struct sockaddr_storage addr;
@@ -117,7 +161,7 @@ iperf_accept(struct iperf_test *test)
len = sizeof(addr);
if ((s = accept(test->listener, (struct sockaddr *) &addr, &len)) < 0) {
i_errno = IEACCEPT;
- return -1;
+ return ret;
}
if (test->ctrl_sck == -1) {
@@ -127,7 +171,7 @@ iperf_accept(struct iperf_test *test)
int flag = 1;
if (setsockopt(test->ctrl_sck, IPPROTO_TCP, TCP_NODELAY, (char *) &flag, sizeof(int))) {
i_errno = IESETNODELAY;
- return -1;
+ goto error_handling;
}
#if defined(HAVE_TCP_USER_TIMEOUT)
@@ -135,34 +179,46 @@ iperf_accept(struct iperf_test *test)
if ((opt = test->settings->snd_timeout)) {
if (setsockopt(s, IPPROTO_TCP, TCP_USER_TIMEOUT, &opt, sizeof(opt)) < 0) {
i_errno = IESETUSERTIMEOUT;
- return -1;
+ goto error_handling;
}
}
#endif /* HAVE_TCP_USER_TIMEOUT */
- if (Nread(test->ctrl_sck, test->cookie, COOKIE_SIZE, Ptcp) < 0) {
- i_errno = IERECVCOOKIE;
+#if defined (HAVE_TCP_KEEPALIVE)
+ // Set Control Connection TCP Keepalive (especially useful for long UDP test sessions)
+ if (iperf_set_control_keepalive(test) < 0)
return -1;
+#endif //HAVE_TCP_KEEPALIVE
+
+ if (Nread(test->ctrl_sck, test->cookie, COOKIE_SIZE, Ptcp) != COOKIE_SIZE) {
+ /*
+ * Note this error covers both the case of a system error
+ * or the inability to read the correct amount of data
+ * (i.e. timed out).
+ */
+ i_errno = IERECVCOOKIE;
+ goto error_handling;
}
- FD_SET(test->ctrl_sck, &test->read_set);
- if (test->ctrl_sck > test->max_fd) test->max_fd = test->ctrl_sck;
+ FD_SET(test->ctrl_sck, &test->read_set);
+ if (test->ctrl_sck > test->max_fd) test->max_fd = test->ctrl_sck;
- if (iperf_set_send_state(test, PARAM_EXCHANGE) != 0)
- return -1;
+ if (iperf_set_send_state(test, PARAM_EXCHANGE) != 0)
+ goto error_handling;
if (iperf_exchange_parameters(test) < 0)
- return -1;
- if (test->server_affinity != -1)
- if (iperf_setaffinity(test, test->server_affinity) != 0)
- return -1;
+ goto error_handling;
+ if (test->server_affinity != -1) {
+ if (iperf_setaffinity(test, test->server_affinity) != 0)
+ goto error_handling;
+ }
if (test->on_connect)
test->on_connect(test);
} else {
- /*
- * Don't try to read from the socket. It could block an ongoing test.
- * Just send ACCESS_DENIED.
+ /*
+ * Don't try to read from the socket. It could block an ongoing test.
+ * Just send ACCESS_DENIED.
* Also, if sending failed, don't return an error, as the request is not related
* to the ongoing test, and returning an error will terminate the test.
- */
+ */
if (Nwrite(s, (char*) &rbuf, sizeof(rbuf), Ptcp) < 0) {
if (test->debug)
printf("failed to send ACCESS_DENIED to an unsolicited connection request during active test\n");
@@ -172,8 +228,10 @@ iperf_accept(struct iperf_test *test)
}
close(s);
}
-
return 0;
+ error_handling:
+ close(s);
+ return ret;
}
@@ -184,12 +242,16 @@ iperf_handle_message_server(struct iperf_test *test)
int rval;
struct iperf_stream *sp;
+ if (test->debug_level >= DEBUG_LEVEL_INFO) {
+ iperf_printf(test, "Reading new State from the Client - current state is %d-%s\n", test->state, state_to_text(test->state));
+ }
+
// XXX: Need to rethink how this behaves to fit API
if ((rval = Nread(test->ctrl_sck, (char*) &test->state, sizeof(signed char), Ptcp)) <= 0) {
if (rval == 0) {
- iperf_err(test, "the client has unexpectedly closed the connection");
+ iperf_err(test, "the client has unexpectedly closed the connection");
i_errno = IECTRLCLOSE;
- test->state = IPERF_DONE;
+ iperf_set_test_state(test, IPERF_DONE);
return 0;
} else {
i_errno = IERECVMESSAGE;
@@ -197,11 +259,15 @@ iperf_handle_message_server(struct iperf_test *test)
}
}
+ if (test->debug_level >= DEBUG_LEVEL_INFO) {
+ iperf_printf(test, "State change: server received and changed State to %d-%s\n", test->state, state_to_text(test->state));
+ }
+
switch(test->state) {
case TEST_START:
break;
case TEST_END:
- test->done = 1;
+ test->done = 1;
cpu_util(test->cpu_util);
test->stats_callback(test);
SLIST_FOREACH(sp, &test->streams, streams) {
@@ -210,11 +276,11 @@ iperf_handle_message_server(struct iperf_test *test)
close(sp->socket);
}
test->reporter_callback(test);
- if (iperf_set_send_state(test, EXCHANGE_RESULTS) != 0)
+ if (iperf_set_send_state(test, EXCHANGE_RESULTS) != 0)
return -1;
if (iperf_exchange_results(test) < 0)
return -1;
- if (iperf_set_send_state(test, DISPLAY_RESULTS) != 0)
+ if (iperf_set_send_state(test, DISPLAY_RESULTS) != 0)
return -1;
if (test->on_test_finish)
test->on_test_finish(test);
@@ -239,7 +305,7 @@ iperf_handle_message_server(struct iperf_test *test)
FD_CLR(sp->socket, &test->write_set);
close(sp->socket);
}
- test->state = IPERF_DONE;
+ iperf_set_test_state(test, IPERF_DONE);
break;
default:
i_errno = IEMESSAGE;
@@ -253,19 +319,11 @@ static void
server_timer_proc(TimerClientData client_data, struct iperf_time *nowP)
{
struct iperf_test *test = client_data.p;
- struct iperf_stream *sp;
test->timer = NULL;
if (test->done)
return;
test->done = 1;
- /* Free streams */
- while (!SLIST_EMPTY(&test->streams)) {
- sp = SLIST_FIRST(&test->streams);
- SLIST_REMOVE_HEAD(&test->streams, streams);
- close(sp->socket);
- iperf_free_stream(sp);
- }
close(test->ctrl_sck);
test->ctrl_sck = -1;
}
@@ -383,6 +441,36 @@ cleanup_server(struct iperf_test *test)
{
struct iperf_stream *sp;
+ /* Cancel outstanding threads */
+ int i_errno_save = i_errno;
+ SLIST_FOREACH(sp, &test->streams, streams) {
+ int rc;
+ sp->done = 1;
+ if (sp->thread_created == 1) {
+ rc = pthread_cancel(sp->thr);
+ if (rc != 0 && rc != ESRCH) {
+ i_errno = IEPTHREADCANCEL;
+ errno = rc;
+ iperf_err(test, "cleanup_server in pthread_cancel - %s", iperf_strerror(i_errno));
+ }
+ rc = pthread_join(sp->thr, NULL);
+ if (rc != 0 && rc != ESRCH) {
+ i_errno = IEPTHREADJOIN;
+ errno = rc;
+ iperf_err(test, "cleanup_server in pthread_join - %s", iperf_strerror(i_errno));
+ }
+ if (test->debug_level >= DEBUG_LEVEL_INFO) {
+ iperf_printf(test, "Thread FD %d stopped\n", sp->socket);
+ }
+ sp->thread_created = 0;
+ }
+ }
+ i_errno = i_errno_save;
+
+ if (test->debug_level >= DEBUG_LEVEL_INFO) {
+ iperf_printf(test, "All threads stopped\n");
+ }
+
/* Close open streams */
SLIST_FOREACH(sp, &test->streams, streams) {
if (sp->socket > -1) {
@@ -447,26 +535,31 @@ iperf_run_server(struct iperf_test *test)
struct iperf_time diff_time;
struct timeval* timeout;
struct timeval used_timeout;
+ iperf_size_t last_receive_blocks;
int flag;
int64_t t_usecs;
int64_t timeout_us;
int64_t rcv_timeout_us;
+ int32_t err;
- if (test->logfile)
+ if (test->logfile) {
if (iperf_open_logfile(test) < 0)
return -2;
+ }
- if (test->affinity != -1)
+ if (test->affinity != -1) {
if (iperf_setaffinity(test, test->affinity) != 0) {
cleanup_server(test);
return -2;
}
+ }
- if (test->json_output)
+ if (test->json_output) {
if (iperf_json_start(test) < 0) {
cleanup_server(test);
return -2;
}
+ }
if (test->json_output) {
cJSON_AddItemToObject(test->json_start, "version", cJSON_CreateString(version));
@@ -485,19 +578,39 @@ iperf_run_server(struct iperf_test *test)
}
iperf_time_now(&last_receive_time); // Initialize last time something was received
+ last_receive_blocks = 0;
- test->state = IPERF_START;
+ iperf_set_test_state(test, IPERF_START);
send_streams_accepted = 0;
rec_streams_accepted = 0;
rcv_timeout_us = (test->settings->rcv_timeout.secs * SEC_TO_US) + test->settings->rcv_timeout.usecs;
while (test->state != IPERF_DONE) {
- // Check if average transfer rate was exceeded (condition set in the callback routines)
+ // Check if average transfer rate was exceeded (condition set in the callback routines)
if (test->bitrate_limit_exceeded) {
- cleanup_server(test);
- i_errno = IETOTALRATE;
+ i_errno = IETOTALRATE;
+ if (iperf_set_send_state(test, SERVER_ERROR) != 0) {
+ cleanup_server(test);
return -1;
+ }
+
+ err = htonl(i_errno);
+ if (Nwrite(test->ctrl_sck, (char*) &err, sizeof(err), Ptcp) < 0) {
+ cleanup_server(test);
+ i_errno = IECTRLWRITE;
+ return -1;
+ }
+
+ err = htonl(errno);
+ if (Nwrite(test->ctrl_sck, (char*) &err, sizeof(err), Ptcp) < 0) {
+ cleanup_server(test);
+ i_errno = IECTRLWRITE;
+ return -1;
+ }
+
+ cleanup_server(test);
+ return -1;
}
memcpy(&read_set, &test->read_set, sizeof(fd_set));
@@ -520,6 +633,10 @@ iperf_run_server(struct iperf_test *test)
used_timeout.tv_usec = timeout->tv_usec;
timeout_us = (timeout->tv_sec * SEC_TO_US) + timeout->tv_usec;
}
+ /* Cap the maximum select timeout at 1 second */
+ if (timeout_us > SEC_TO_US) {
+ timeout_us = SEC_TO_US;
+ }
if (timeout_us < 0 || timeout_us > rcv_timeout_us) {
used_timeout.tv_sec = test->settings->rcv_timeout.secs;
used_timeout.tv_usec = test->settings->rcv_timeout.usecs;
@@ -533,13 +650,18 @@ iperf_run_server(struct iperf_test *test)
i_errno = IESELECT;
return -1;
} else if (result == 0) {
- // If nothing was received during the specified time (per state)
- // then probably something got stack either at the client, server or network,
- // and Test should be forced to end.
+ /*
+ * If nothing was received during the specified time (per
+ * state) then probably something got stuck either at the
+ * client, server or network, and test should be forced to
+ * end.
+ */
iperf_time_now(&now);
t_usecs = 0;
if (iperf_time_diff(&now, &last_receive_time, &diff_time) == 0) {
t_usecs = iperf_time_in_usecs(&diff_time);
+
+ /* We're in the state where we're still accepting connections */
if (test->state == IPERF_START) {
if (test->settings->idle_timeout > 0 && t_usecs >= test->settings->idle_timeout * SEC_TO_US) {
test->server_forced_idle_restarts_count += 1;
@@ -557,21 +679,33 @@ iperf_run_server(struct iperf_test *test)
return 2;
}
}
+
+ /*
+ * Running a test. If we're receiving, be sure we're making
+ * progress (sender hasn't died/crashed).
+ */
else if (test->mode != SENDER && t_usecs > rcv_timeout_us) {
- test->server_forced_no_msg_restarts_count += 1;
- i_errno = IENOMSG;
- if (iperf_get_verbose(test))
- iperf_err(test, "Server restart (#%d) during active test due to idle timeout for receiving data",
- test->server_forced_no_msg_restarts_count);
- cleanup_server(test);
- return -1;
+ /* Idle timeout if no new blocks received */
+ if (test->blocks_received == last_receive_blocks) {
+ test->server_forced_no_msg_restarts_count += 1;
+ i_errno = IENOMSG;
+ if (iperf_get_verbose(test))
+ iperf_err(test, "Server restart (#%d) during active test due to idle timeout for receiving data",
+ test->server_forced_no_msg_restarts_count);
+ cleanup_server(test);
+ return -1;
+ }
}
-
}
}
+ /* See if the test is making progress */
+ if (test->blocks_received > last_receive_blocks) {
+ last_receive_blocks = test->blocks_received;
+ last_receive_time = now;
+ }
+
if (result > 0) {
- iperf_time_now(&last_receive_time);
if (FD_ISSET(test->listener, &read_set)) {
if (test->state != CREATE_STREAMS) {
if (iperf_accept(test) < 0) {
@@ -709,24 +843,8 @@ iperf_run_server(struct iperf_test *test)
return -1;
}
- if (sp->sender)
- FD_SET(s, &test->write_set);
- else
- FD_SET(s, &test->read_set);
-
if (s > test->max_fd) test->max_fd = s;
- /*
- * If the protocol isn't UDP, or even if it is but
- * we're the receiver, set nonblocking sockets.
- * We need this to allow a server receiver to
- * maintain interactivity with the control channel.
- */
- if (test->protocol->id != Pudp ||
- !sp->sender) {
- setnonblocking(s, 1);
- }
-
if (test->on_new_stream)
test->on_new_stream(sp);
@@ -798,33 +916,38 @@ iperf_run_server(struct iperf_test *test)
cleanup_server(test);
return -1;
}
- }
- }
- if (test->state == TEST_RUNNING) {
- if (test->mode == BIDIRECTIONAL) {
- if (iperf_recv(test, &read_set) < 0) {
+ /* Create and spin up threads */
+ pthread_attr_t attr;
+ if (pthread_attr_init(&attr) != 0) {
+ i_errno = IEPTHREADATTRINIT;
cleanup_server(test);
- return -1;
+ };
+
+ SLIST_FOREACH(sp, &test->streams, streams) {
+ if (pthread_create(&(sp->thr), &attr, &iperf_server_worker_run, sp) != 0) {
+ i_errno = IEPTHREADCREATE;
+ cleanup_server(test);
+ return -1;
+ }
+ sp->thread_created = 1;
+ if (test->debug_level >= DEBUG_LEVEL_INFO) {
+ iperf_printf(test, "Thread FD %d created\n", sp->socket);
+ }
}
- if (iperf_send(test, &write_set) < 0) {
- cleanup_server(test);
- return -1;
+ if (test->debug_level >= DEBUG_LEVEL_INFO) {
+ iperf_printf(test, "All threads created\n");
}
- } else if (test->mode == SENDER) {
- // Reverse mode. Server sends.
- if (iperf_send(test, &write_set) < 0) {
- cleanup_server(test);
- return -1;
- }
- } else {
- // Regular mode. Server receives.
- if (iperf_recv(test, &read_set) < 0) {
- cleanup_server(test);
- return -1;
- }
+ if (pthread_attr_destroy(&attr) != 0) {
+ i_errno = IEPTHREADATTRDESTROY;
+ cleanup_server(test);
+ };
+
+ /* Reset receive-progress baseline after workers are ready */
+ last_receive_blocks = test->blocks_received;
+ iperf_time_now(&last_receive_time);
}
- }
+ }
}
if (result == 0 ||
diff --git a/src/iperf_tcp.c b/src/iperf_tcp.c
index ce6a5221b..700e65c0d 100644
--- a/src/iperf_tcp.c
+++ b/src/iperf_tcp.c
@@ -41,6 +41,7 @@
#include "iperf.h"
#include "iperf_api.h"
#include "iperf_tcp.h"
+#include "iperf_util.h"
#include "net.h"
#include "cjson.h"
@@ -56,20 +57,28 @@ int
iperf_tcp_recv(struct iperf_stream *sp)
{
int r;
+ int sock_opt;
+
+#if defined(HAVE_MSG_TRUNC)
+ sock_opt = sp->test->settings->skip_rx_copy ? MSG_TRUNC : 0;
+#else
+ sock_opt = 0;
+#endif /* HAVE_MSG_TRUNC */
+
+ r = Nrecv_no_select(sp->socket, sp->buffer, sp->settings->blksize, Ptcp, sock_opt);
- r = Nread(sp->socket, sp->buffer, sp->settings->blksize, Ptcp);
if (r < 0)
return r;
/* Only count bytes received while we're in the correct state. */
if (sp->test->state == TEST_RUNNING) {
- sp->result->bytes_received += r;
- sp->result->bytes_received_this_interval += r;
+ sp->result->bytes_received += r;
+ sp->result->bytes_received_this_interval += r;
}
else {
- if (sp->test->debug)
- printf("Late receive, state = %d\n", sp->test->state);
+ if (sp->test->debug)
+ printf("Late receive, state = %d-%s\n", sp->test->state, state_to_text(sp->test->state));
}
return r;
@@ -86,12 +95,12 @@ iperf_tcp_send(struct iperf_stream *sp)
int r;
if (!sp->pending_size)
- sp->pending_size = sp->settings->blksize;
+ sp->pending_size = sp->settings->blksize;
if (sp->test->zerocopy)
- r = Nsendfile(sp->buffer_fd, sp->socket, sp->buffer, sp->pending_size);
+ r = Nsendfile(sp->buffer_fd, sp->socket, sp->buffer, sp->pending_size);
else
- r = Nwrite(sp->socket, sp->buffer, sp->pending_size, Ptcp);
+ r = Nwrite(sp->socket, sp->buffer, sp->pending_size, Ptcp);
if (r < 0)
return r;
@@ -101,8 +110,8 @@ iperf_tcp_send(struct iperf_stream *sp)
sp->result->bytes_sent_this_interval += r;
if (sp->test->debug_level >= DEBUG_LEVEL_DEBUG)
- printf("sent %d bytes of %d, pending %d, total %" PRIu64 "\n",
- r, sp->settings->blksize, sp->pending_size, sp->result->bytes_sent);
+ printf("sent %d bytes of %d, pending %d, total %" PRIu64 "\n",
+ r, sp->settings->blksize, sp->pending_size, sp->result->bytes_sent);
return r;
}
@@ -117,7 +126,7 @@ iperf_tcp_accept(struct iperf_test * test)
{
int s;
signed char rbuf = ACCESS_DENIED;
- char cookie[COOKIE_SIZE];
+ char cookie[COOKIE_SIZE] = {0};
socklen_t len;
struct sockaddr_storage addr;
@@ -126,13 +135,30 @@ iperf_tcp_accept(struct iperf_test * test)
i_errno = IESTREAMCONNECT;
return -1;
}
+#if defined(HAVE_SO_MAX_PACING_RATE)
+ /* If fq socket pacing is specified, enable it. */
+
+ if (test->settings->fqrate) {
+ /* Convert bits per second to bytes per second */
+ uint64_t fqrate = test->settings->fqrate / 8;
+ if (fqrate > 0) {
+ if (test->debug) {
+ printf("Setting fair-queue socket pacing to %"PRIu64"\n", fqrate);
+ }
+ if (setsockopt(s, SOL_SOCKET, SO_MAX_PACING_RATE, &fqrate, sizeof(fqrate)) < 0) {
+ warning("Unable to set socket pacing");
+ }
+ }
+ }
+#endif /* HAVE_SO_MAX_PACING_RATE */
if (Nread(s, cookie, COOKIE_SIZE, Ptcp) < 0) {
i_errno = IERECVCOOKIE;
+ close(s);
return -1;
}
- if (strcmp(test->cookie, cookie) != 0) {
+ if (strncmp(test->cookie, cookie, COOKIE_SIZE) != 0) {
if (Nwrite(s, (char*) &rbuf, sizeof(rbuf), Ptcp) < 0) {
iperf_err(test, "failed to send access denied from busy server to new connecting client, errno = %d\n", errno);
}
@@ -166,9 +192,10 @@ iperf_tcp_listen(struct iperf_test *test)
*
* It's not clear whether this is a requirement or a convenience.
*/
- if (test->no_delay || test->settings->mss || test->settings->socket_bufsize) {
+ if (test->no_delay || test->mptcp || test->settings->mss || test->settings->socket_bufsize) {
struct addrinfo hints, *res;
char portstr[6];
+ int proto = 0;
FD_CLR(s, &test->read_set);
close(s);
@@ -179,7 +206,7 @@ iperf_tcp_listen(struct iperf_test *test)
/*
* If binding to the wildcard address with no explicit address
* family specified, then force us to get an AF_INET6 socket.
- * More details in the comments in netanounce().
+ * More details in the comments in netannounce().
*/
if (test->settings->domain == AF_UNSPEC && !test->bind_address) {
hints.ai_family = AF_INET6;
@@ -194,7 +221,12 @@ iperf_tcp_listen(struct iperf_test *test)
return -1;
}
- if ((s = socket(res->ai_family, SOCK_STREAM, 0)) < 0) {
+#if defined(HAVE_IPPROTO_MPTCP)
+ if (test->mptcp)
+ proto = IPPROTO_MPTCP;
+#endif
+
+ if ((s = socket(res->ai_family, SOCK_STREAM, proto)) < 0) {
freeaddrinfo(res);
i_errno = IESTREAMLISTEN;
return -1;
@@ -240,21 +272,6 @@ iperf_tcp_listen(struct iperf_test *test)
return -1;
}
}
-#if defined(HAVE_SO_MAX_PACING_RATE)
- /* If fq socket pacing is specified, enable it. */
- if (test->settings->fqrate) {
- /* Convert bits per second to bytes per second */
- unsigned int fqrate = test->settings->fqrate / 8;
- if (fqrate > 0) {
- if (test->debug) {
- printf("Setting fair-queue socket pacing to %u\n", fqrate);
- }
- if (setsockopt(s, SOL_SOCKET, SO_MAX_PACING_RATE, &fqrate, sizeof(fqrate)) < 0) {
- warning("Unable to set socket pacing");
- }
- }
- }
-#endif /* HAVE_SO_MAX_PACING_RATE */
{
unsigned int rate = test->settings->rate / 8;
if (rate > 0) {
@@ -309,6 +326,7 @@ iperf_tcp_listen(struct iperf_test *test)
if (listen(s, INT_MAX) < 0) {
i_errno = IESTREAMLISTEN;
+ close(s);
return -1;
}
@@ -329,6 +347,7 @@ iperf_tcp_listen(struct iperf_test *test)
}
if (test->settings->socket_bufsize && test->settings->socket_bufsize > sndbuf_actual) {
i_errno = IESETBUF2;
+ close(s);
return -1;
}
@@ -346,6 +365,7 @@ iperf_tcp_listen(struct iperf_test *test)
}
if (test->settings->socket_bufsize && test->settings->socket_bufsize > rcvbuf_actual) {
i_errno = IESETBUF2;
+ close(s);
return -1;
}
@@ -374,8 +394,14 @@ iperf_tcp_connect(struct iperf_test *test)
socklen_t optlen;
int saved_errno;
int rcvbuf_actual, sndbuf_actual;
+ int proto = 0;
+
+#if defined(HAVE_IPPROTO_MPTCP)
+ if (test->mptcp)
+ proto = IPPROTO_MPTCP;
+#endif
- s = create_socket(test->settings->domain, SOCK_STREAM, test->bind_address, test->bind_dev, test->bind_port, test->server_hostname, test->server_port, &server_res);
+ s = create_socket(test->settings->domain, SOCK_STREAM, proto, test->bind_address, test->bind_dev, test->bind_port, test->server_hostname, test->server_port, &server_res);
if (s < 0) {
i_errno = IESTREAMCONNECT;
return -1;
@@ -448,6 +474,8 @@ iperf_tcp_connect(struct iperf_test *test)
printf("SNDBUF is %u, expecting %u\n", sndbuf_actual, test->settings->socket_bufsize);
}
if (test->settings->socket_bufsize && test->settings->socket_bufsize > sndbuf_actual) {
+ close(s);
+ freeaddrinfo(server_res);
i_errno = IESETBUF2;
return -1;
}
@@ -466,6 +494,8 @@ iperf_tcp_connect(struct iperf_test *test)
printf("RCVBUF is %u, expecting %u\n", rcvbuf_actual, test->settings->socket_bufsize);
}
if (test->settings->socket_bufsize && test->settings->socket_bufsize > rcvbuf_actual) {
+ close(s);
+ freeaddrinfo(server_res);
i_errno = IESETBUF2;
return -1;
}
@@ -536,10 +566,10 @@ iperf_tcp_connect(struct iperf_test *test)
/* If socket pacing is specified try to enable it. */
if (test->settings->fqrate) {
/* Convert bits per second to bytes per second */
- unsigned int fqrate = test->settings->fqrate / 8;
+ uint64_t fqrate = test->settings->fqrate / 8;
if (fqrate > 0) {
if (test->debug) {
- printf("Setting fair-queue socket pacing to %u\n", fqrate);
+ printf("Setting fair-queue socket pacing to %"PRIu64"\n", fqrate);
}
if (setsockopt(s, SOL_SOCKET, SO_MAX_PACING_RATE, &fqrate, sizeof(fqrate)) < 0) {
warning("Unable to set socket pacing");
diff --git a/src/iperf_tcp.h b/src/iperf_tcp.h
index d53b0524d..9dbb2ee10 100644
--- a/src/iperf_tcp.h
+++ b/src/iperf_tcp.h
@@ -48,7 +48,7 @@ int iperf_tcp_recv(struct iperf_stream *);
/**
* iperf_tcp_send -- sends the client data for TCP
- * and the Param/result message exchanges
+ * and the Param/result message exchanges
* returns: bytes sent
*
*/
diff --git a/src/iperf_time.c b/src/iperf_time.c
index a435dd30d..86ba78edf 100644
--- a/src/iperf_time.c
+++ b/src/iperf_time.c
@@ -36,33 +36,52 @@
#include
int
-iperf_time_now(struct iperf_time *time1)
+clock_gettime_helper(struct iperf_time *now, clockid_t clk_id)
{
struct timespec ts;
int result;
- result = clock_gettime(CLOCK_MONOTONIC, &ts);
+ result = clock_gettime(clk_id, &ts);
if (result == 0) {
- time1->secs = (uint32_t) ts.tv_sec;
- time1->usecs = (uint32_t) ts.tv_nsec / 1000;
+ now->secs = (uint32_t) ts.tv_sec;
+ now->usecs = (uint32_t) ts.tv_nsec / 1000;
}
return result;
}
+int
+iperf_time_now(struct iperf_time *now)
+{
+ return clock_gettime_helper(now, CLOCK_MONOTONIC);
+}
+
+int
+iperf_time_now_wallclock(struct iperf_time *now)
+{
+ return clock_gettime_helper(now, CLOCK_REALTIME);
+}
+
#else
#include
int
-iperf_time_now(struct iperf_time *time1)
+iperf_time_now_wallclock(struct iperf_time *now)
{
struct timeval tv;
int result;
+ // Returns the non monotonic local wallclock time.
result = gettimeofday(&tv, NULL);
- time1->secs = tv.tv_sec;
- time1->usecs = tv.tv_usec;
+ now->secs = (uint32_t) tv.tv_sec;
+ now->usecs = (uint32_t) tv.tv_usec;
return result;
}
+int
+iperf_time_now(struct iperf_time *now)
+{
+ return iperf_time_now_wallclock(now);
+}
+
#endif
/* iperf_time_add_usecs
@@ -72,12 +91,11 @@ iperf_time_now(struct iperf_time *time1)
void
iperf_time_add_usecs(struct iperf_time *time1, uint64_t usecs)
{
- time1->secs += usecs / 1000000L;
- time1->usecs += usecs % 1000000L;
- if ( time1->usecs >= 1000000L ) {
- time1->secs += time1->usecs / 1000000L;
- time1->usecs %= 1000000L;
- }
+ uint64_t total_usecs;
+
+ total_usecs = time1->usecs + usecs;
+ time1->secs += total_usecs / 1000000L;
+ time1->usecs = total_usecs % 1000000L;
}
uint64_t
diff --git a/src/iperf_time.h b/src/iperf_time.h
index 588ee2624..3f46b496f 100644
--- a/src/iperf_time.h
+++ b/src/iperf_time.h
@@ -34,6 +34,24 @@ struct iperf_time {
uint32_t usecs;
};
+/**
+ * Retrieves the current wallclock time.
+ *
+ * When during operation the system-wide clock changes, users will see
+ * this and results might become inconsistent.
+ */
+int iperf_time_now_wallclock(struct iperf_time *time1);
+
+/**
+ * Retrieves the current time using a monotonic clock.
+ *
+ * When during operation the system-wide clock changes, users still will see
+ * a strictly monotonic increasing clock.
+ *
+ * Please note that a monotonic clock is only available on systems that have the
+ * `clock_gettime()` system call. On other systems, this falls back to
+ * `iperf_time_now_wallclock()`.
+ */
int iperf_time_now(struct iperf_time *time1);
void iperf_time_add_usecs(struct iperf_time *time1, uint64_t usecs);
@@ -44,6 +62,9 @@ int iperf_time_diff(struct iperf_time *time1, struct iperf_time *time2, struct i
uint64_t iperf_time_in_usecs(struct iperf_time *time);
+/**
+ * Returns the time in seconds as double type with a microsecond granularity.
+ */
double iperf_time_in_secs(struct iperf_time *time);
#endif
diff --git a/src/iperf_udp.c b/src/iperf_udp.c
index 5dc1422dc..393836c43 100644
--- a/src/iperf_udp.c
+++ b/src/iperf_udp.c
@@ -1,5 +1,5 @@
/*
- * iperf, Copyright (c) 2014-2022, The Regents of the University of
+ * iperf, Copyright (c) 2014-2026, The Regents of the University of
* California, through Lawrence Berkeley National Laboratory (subject
* to receipt of any required approvals from the U.S. Dept. of
* Energy). All rights reserved.
@@ -24,6 +24,8 @@
* This code is distributed under a BSD style license, see the LICENSE
* file for complete information.
*/
+#include "iperf_config.h"
+
#include
#include
#include
@@ -34,11 +36,13 @@
#include
#include
#include
-#ifdef HAVE_STDINT_H
#include
-#endif
+#include
#include
#include
+#if defined(HAVE_UDP_SEGMENT) || defined(HAVE_UDP_GRO)
+#include
+#endif
#include "iperf.h"
#include "iperf_api.h"
@@ -47,19 +51,6 @@
#include "timer.h"
#include "net.h"
#include "cjson.h"
-#include "portable_endian.h"
-
-#if defined(HAVE_INTTYPES_H)
-# include
-#else
-# ifndef PRIu64
-# if sizeof(long) == 8
-# define PRIu64 "lu"
-# else
-# define PRIu64 "llu"
-# endif
-# endif
-#endif
/* iperf_udp_recv
*
@@ -75,8 +66,35 @@ iperf_udp_recv(struct iperf_stream *sp)
int first_packet = 0;
double transit = 0, d = 0;
struct iperf_time sent_time, arrival_time, temp_time;
-
- r = Nread(sp->socket, sp->buffer, size, Pudp);
+ struct iperf_test *test = sp->test;
+ int sock_opt = 0;
+ int dgram_sz;
+ int buf_sz;
+ char *dgram_buf;
+ char *dgram_buf_end;
+ const int min_pkt_size = sizeof(uint32_t) * 3; /* sec + usec + pcount (32-bit) */
+
+#if defined(HAVE_MSG_TRUNC)
+ // UDP recv() with MSG_TRUNC reads only the size bytes, but return the length of the full packet
+ if (sp->test->settings->skip_rx_copy) {
+ sock_opt = MSG_TRUNC;
+ size = sizeof(sec) + sizeof(usec) + sizeof(pcount);
+ }
+#endif /* HAVE_MSG_TRUNC */
+
+ /* Configure loop parameters based on GRO availability */
+ if (sp->test->settings->gro) {
+ size = sp->test->settings->gro_bf_size;
+ r = Nread_gro(sp->socket, sp->buffer, size, Pudp, &dgram_sz);
+ /* Use negotiated block size for GRO segment stride to ensure correct parsing. */
+ dgram_sz = sp->settings->blksize;
+ buf_sz = r;
+ } else {
+ /* GRO disabled or unavailable - use normal UDP receive and single packet size */
+ r = Nrecv_no_select(sp->socket, sp->buffer, size, Pudp, sock_opt);
+ dgram_sz = sp->settings->blksize;
+ buf_sz = r;
+ }
/*
* If we got an error in the read, or if we didn't read anything
@@ -87,7 +105,7 @@ iperf_udp_recv(struct iperf_stream *sp)
return r;
/* Only count bytes received while we're in the correct state. */
- if (sp->test->state == TEST_RUNNING) {
+ if (test->state == TEST_RUNNING) {
/*
* For jitter computation below, it's important to know if this
@@ -100,105 +118,122 @@ iperf_udp_recv(struct iperf_stream *sp)
sp->result->bytes_received += r;
sp->result->bytes_received_this_interval += r;
- /* Dig the various counters out of the incoming UDP packet */
- if (sp->test->udp_counters_64bit) {
- memcpy(&sec, sp->buffer, sizeof(sec));
- memcpy(&usec, sp->buffer+4, sizeof(usec));
- memcpy(&pcount, sp->buffer+8, sizeof(pcount));
- sec = ntohl(sec);
- usec = ntohl(usec);
- pcount = be64toh(pcount);
- sent_time.secs = sec;
- sent_time.usecs = usec;
- }
- else {
- uint32_t pc;
- memcpy(&sec, sp->buffer, sizeof(sec));
- memcpy(&usec, sp->buffer+4, sizeof(usec));
- memcpy(&pc, sp->buffer+8, sizeof(pc));
- sec = ntohl(sec);
- usec = ntohl(usec);
- pcount = ntohl(pc);
- sent_time.secs = sec;
- sent_time.usecs = usec;
- }
-
- if (sp->test->debug_level >= DEBUG_LEVEL_DEBUG)
- fprintf(stderr, "pcount %" PRIu64 " packet_count %d\n", pcount, sp->packet_count);
-
- /*
- * Try to handle out of order packets. The way we do this
- * uses a constant amount of storage but might not be
- * correct in all cases. In particular we seem to have the
- * assumption that packets can't be duplicated in the network,
- * because duplicate packets will possibly cause some problems here.
- *
- * First figure out if the sequence numbers are going forward.
- * Note that pcount is the sequence number read from the packet,
- * and sp->packet_count is the highest sequence number seen so
- * far (so we're expecting to see the packet with sequence number
- * sp->packet_count + 1 arrive next).
- */
- if (pcount >= sp->packet_count + 1) {
-
- /* Forward, but is there a gap in sequence numbers? */
- if (pcount > sp->packet_count + 1) {
- /* There's a gap so count that as a loss. */
- sp->cnt_error += (pcount - 1) - sp->packet_count;
+ if (sp->test->debug)
+ printf("received %d bytes of %d, total %" PRIu64 "\n", r, size, sp->result->bytes_received);
+
+ /* Unified loop: processes single packet when GRO off, multiple when GRO on */
+ dgram_buf = sp->buffer;
+ dgram_buf_end = sp->buffer + buf_sz;
+
+ while (buf_sz >= dgram_sz && dgram_buf + dgram_sz <= dgram_buf_end) {
+
+ /* Ensure we have enough bytes for the packet header */
+ if (buf_sz < min_pkt_size)
+ break;
+
+ /* Extract packet headers */
+ if (sp->test->udp_counters_64bit) {
+ /* Verify we have enough space for 64-bit counter */
+ if (buf_sz < sizeof(uint32_t) * 2 + sizeof(uint64_t))
+ break;
+ memcpy(&sec, dgram_buf, sizeof(sec));
+ memcpy(&usec, dgram_buf+4, sizeof(usec));
+ memcpy(&pcount, dgram_buf+8, sizeof(pcount));
+ sec = ntohl(sec);
+ usec = ntohl(usec);
+ pcount = be64toh(pcount);
+ sent_time.secs = sec;
+ sent_time.usecs = usec;
+ } else {
+ uint32_t pc;
+ memcpy(&sec, dgram_buf, sizeof(sec));
+ memcpy(&usec, dgram_buf+4, sizeof(usec));
+ memcpy(&pc, dgram_buf+8, sizeof(pc));
+ sec = ntohl(sec);
+ usec = ntohl(usec);
+ pcount = ntohl(pc);
+ sent_time.secs = sec;
+ sent_time.usecs = usec;
}
- /* Update the highest sequence number seen so far. */
- sp->packet_count = pcount;
- } else {
- /*
- * Sequence number went backward (or was stationary?!?).
- * This counts as an out-of-order packet.
- */
- sp->outoforder_packets++;
-
- /*
- * If we have lost packets, then the fact that we are now
- * seeing an out-of-order packet offsets a prior sequence
- * number gap that was counted as a loss. So we can take
- * away a loss.
- */
- if (sp->cnt_error > 0)
- sp->cnt_error--;
-
- /* Log the out-of-order packet */
- if (sp->test->debug)
- fprintf(stderr, "OUT OF ORDER - incoming packet sequence %" PRIu64 " but expected sequence %d on stream %d", pcount, sp->packet_count + 1, sp->socket);
- }
-
- /*
- * jitter measurement
- *
- * This computation is based on RFC 1889 (specifically
- * sections 6.3.1 and A.8).
- *
- * Note that synchronized clocks are not required since
- * the source packet delta times are known. Also this
- * computation does not require knowing the round-trip
- * time.
- */
- iperf_time_now(&arrival_time);
-
- iperf_time_diff(&arrival_time, &sent_time, &temp_time);
- transit = iperf_time_in_secs(&temp_time);
+ /*
+ * Try to handle out of order packets. The way we do this
+ * uses a constant amount of storage but might not be
+ * correct in all cases. In particular we seem to have the
+ * assumption that packets can't be duplicated in the network,
+ * because duplicate packets will possibly cause some problems here.
+ *
+ * First figure out if the sequence numbers are going forward.
+ * Note that pcount is the sequence number read from the packet,
+ * and sp->packet_count is the highest sequence number seen so
+ * far (so we're expecting to see the packet with sequence number
+ * sp->packet_count + 1 arrive next).
+ */
+ if (pcount >= sp->packet_count + 1) {
+
+ /* Forward, but is there a gap in sequence numbers? */
+ if (pcount > sp->packet_count + 1) {
+ /* There's a gap so count that as a loss. */
+ sp->cnt_error += (pcount - 1) - sp->packet_count;
+ if (test->debug_level >= DEBUG_LEVEL_INFO)
+ fprintf(stderr, "LOST %" PRIu64 " PACKETS - received packet %" PRIu64 " but expected sequence %" PRIu64 " on stream %d\n", (pcount - sp->packet_count + 1), pcount, sp->packet_count + 1, sp->socket);
+ }
+ /* Update the highest sequence number seen so far. */
+ sp->packet_count = pcount;
+ } else {
+
+ /*
+ * Sequence number went backward (or was stationary?!?).
+ * This counts as an out-of-order packet.
+ */
+ sp->outoforder_packets++;
+
+ /*
+ * If we have lost packets, then the fact that we are now
+ * seeing an out-of-order packet offsets a prior sequence
+ * number gap that was counted as a loss. So we can take
+ * away a loss.
+ */
+ if (sp->cnt_error > 0)
+ sp->cnt_error--;
+
+ /* Log the out-of-order packet */
+ if (test->debug_level >= DEBUG_LEVEL_INFO)
+ fprintf(stderr, "OUT OF ORDER - received packet %" PRIu64 " but expected sequence %" PRIu64 " on stream %d\n", pcount, sp->packet_count + 1, sp->socket);
+ }
- /* Hack to handle the first packet by initializing prev_transit. */
- if (first_packet)
+ /*
+ * jitter measurement
+ *
+ * This computation is based on RFC 1889 (specifically
+ * sections 6.3.1 and A.8).
+ *
+ * Note that synchronized clocks are not required since
+ * the source packet delta times are known. Also this
+ * computation does not require knowing the round-trip
+ * time.
+ */
+ iperf_time_now(&arrival_time);
+ iperf_time_diff(&arrival_time, &sent_time, &temp_time);
+ transit = iperf_time_in_secs(&temp_time);
+
+ /* Hack to handle the first packet by initializing prev_transit. */
+ if (first_packet)
+ sp->prev_transit = transit;
+ d = transit - sp->prev_transit;
+ if (d < 0)
+ d = -d;
sp->prev_transit = transit;
+ sp->jitter += (d - sp->jitter) / 16.0;
+ first_packet = 0;
- d = transit - sp->prev_transit;
- if (d < 0)
- d = -d;
- sp->prev_transit = transit;
- sp->jitter += (d - sp->jitter) / 16.0;
+ dgram_buf += dgram_sz;
+ buf_sz -= dgram_sz;
+ }
}
else {
- if (sp->test->debug)
- printf("Late receive, state = %d\n", sp->test->state);
+ if (test->debug_level >= DEBUG_LEVEL_INFO)
+ printf("Late receive, state = %d\n", test->state);
}
return r;
@@ -215,49 +250,103 @@ iperf_udp_send(struct iperf_stream *sp)
int r;
int size = sp->settings->blksize;
struct iperf_time before;
+ int dgram_sz;
+ int buf_sz;
+ int cnt = 0;
+ char *dgram_buf;
+ char *dgram_buf_end;
+ const int min_pkt_size = sizeof(uint32_t) * 3; /* sec + usec + pcount (32-bit) */
+
+ /* Configure loop parameters based on GSO availability */
+ if (sp->test->settings->gso) {
+ dgram_sz = sp->test->settings->gso_dg_size;
+ buf_sz = sp->test->settings->gso_bf_size;
+ /* Validate GSO parameters */
+ if (dgram_sz <= 0 || dgram_sz < min_pkt_size || dgram_sz > buf_sz) {
+ if (sp->test->debug_level >= DEBUG_LEVEL_INFO)
+ printf("Invalid GSO dgram_sz %d for buf_sz %d, disabling GSO\n", dgram_sz, buf_sz);
+ dgram_sz = buf_sz = size;
+ sp->test->settings->gso = 0; /* Disable GSO for safety */
+ }
+ } else {
+ /* GSO disabled or unavailable - single packet */
+ dgram_sz = buf_sz = size;
+ }
- iperf_time_now(&before);
+ dgram_buf = sp->buffer;
+ dgram_buf_end = sp->buffer + buf_sz;
- ++sp->packet_count;
+ /* Unified loop: processes single packet when GSO off, multiple when GSO on */
+ while (buf_sz > 0 && dgram_buf + dgram_sz <= dgram_buf_end) {
+ cnt++;
- if (sp->test->udp_counters_64bit) {
+ if (sp->test->debug_level >= DEBUG_LEVEL_DEBUG)
+ printf("%d (%d) remaining %d\n", cnt, dgram_sz, buf_sz);
- uint32_t sec, usec;
- uint64_t pcount;
+ /* Prevent buffer underflow */
+ if (buf_sz < dgram_sz) {
+ if (sp->test->debug_level >= DEBUG_LEVEL_INFO)
+ printf("Buffer underflow protection: buf_sz %d < dgram_sz %d\n", buf_sz, dgram_sz);
+ break;
+ }
- sec = htonl(before.secs);
- usec = htonl(before.usecs);
- pcount = htobe64(sp->packet_count);
+ iperf_time_now(&before);
+ ++sp->packet_count;
- memcpy(sp->buffer, &sec, sizeof(sec));
- memcpy(sp->buffer+4, &usec, sizeof(usec));
- memcpy(sp->buffer+8, &pcount, sizeof(pcount));
+ if (sp->test->udp_counters_64bit) {
+ uint32_t sec, usec;
+ uint64_t pcount;
- }
- else {
+ sec = htonl(before.secs);
+ usec = htonl(before.usecs);
+ pcount = htobe64(sp->packet_count);
+
+ memcpy(dgram_buf, &sec, sizeof(sec));
+ memcpy(dgram_buf+4, &usec, sizeof(usec));
+ memcpy(dgram_buf+8, &pcount, sizeof(pcount));
+ } else {
+ uint32_t sec, usec, pcount;
- uint32_t sec, usec, pcount;
+ sec = htonl(before.secs);
+ usec = htonl(before.usecs);
+ pcount = htonl(sp->packet_count);
- sec = htonl(before.secs);
- usec = htonl(before.usecs);
- pcount = htonl(sp->packet_count);
+ memcpy(dgram_buf, &sec, sizeof(sec));
+ memcpy(dgram_buf+4, &usec, sizeof(usec));
+ memcpy(dgram_buf+8, &pcount, sizeof(pcount));
+ }
- memcpy(sp->buffer, &sec, sizeof(sec));
- memcpy(sp->buffer+4, &usec, sizeof(usec));
- memcpy(sp->buffer+8, &pcount, sizeof(pcount));
+ dgram_buf += dgram_sz;
+ buf_sz -= dgram_sz;
+ }
+ /* Warn if we didn't process all the buffer due to size mismatch */
+ if (buf_sz > 0 && sp->test->debug_level >= DEBUG_LEVEL_INFO) {
+ printf("GSO: %d bytes remaining unprocessed\n", buf_sz);
}
- r = Nwrite(sp->socket, sp->buffer, size, Pudp);
+ if (sp->test->settings->gso) {
+ size = sp->test->settings->gso_bf_size;
+ r = Nwrite_gso(sp->socket, sp->buffer, size, Pudp, sp->test->settings->gso_dg_size);
+ } else {
+ r = Nwrite(sp->socket, sp->buffer, size, Pudp);
+ }
- if (r < 0)
- return r;
+ if (r <= 0) {
+ --sp->packet_count; /* Don't count messages that no data was sent from them.
+ * Allows "resending" a massage with the same numbering */
+ if (r < 0) {
+ if (r == NET_SOFTERROR && sp->test->debug_level >= DEBUG_LEVEL_INFO)
+ printf("UDP send failed on NET_SOFTERROR. errno=%s\n", strerror(errno));
+ return r;
+ }
+ }
sp->result->bytes_sent += r;
sp->result->bytes_sent_this_interval += r;
if (sp->test->debug_level >= DEBUG_LEVEL_DEBUG)
- printf("sent %d bytes of %d, total %" PRIu64 "\n", r, sp->settings->blksize, sp->result->bytes_sent);
+ printf("sent %d bytes of %d, total %" PRIu64 "\n", r, size, sp->result->bytes_sent);
return r;
}
@@ -367,6 +456,64 @@ iperf_udp_buffercheck(struct iperf_test *test, int s)
return rc;
}
+#ifdef HAVE_UDP_SEGMENT
+int
+iperf_udp_gso(struct iperf_test *test, int s)
+{
+ int rc;
+ int gso = test->settings->gso_dg_size;
+
+ rc = setsockopt(s, IPPROTO_UDP, UDP_SEGMENT, (char*) &gso, sizeof(gso));
+ if (rc) {
+ if (test->debug)
+ iperf_printf(test, "No GSO (%d)\n", rc);
+ test->settings->gso = 0;
+ } else {
+ if (test->debug)
+ iperf_printf(test, "GSO (%d)\n", gso);
+ }
+
+ return rc;
+}
+#else
+int
+iperf_udp_gso(struct iperf_test *test, int s)
+{
+ /* GSO not supported on this platform */
+ test->settings->gso = 0;
+ return -1;
+}
+#endif
+
+#ifdef HAVE_UDP_GRO
+int
+iperf_udp_gro(struct iperf_test *test, int s)
+{
+ int rc;
+ int gro = 1;
+
+ rc = setsockopt(s, IPPROTO_UDP, UDP_GRO, (char*) &gro, sizeof(gro));
+ if (rc) {
+ if (test->debug)
+ iperf_printf(test, "No GRO (%d)\n", rc);
+ test->settings->gro = 0;
+ } else {
+ if (test->debug)
+ iperf_printf(test, "GRO\n");
+ }
+
+ return rc;
+}
+#else
+int
+iperf_udp_gro(struct iperf_test *test, int s)
+{
+ /* GRO not supported on this platform */
+ test->settings->gro = 0;
+ return -1;
+}
+#endif
+
/*
* iperf_udp_accept
*
@@ -426,14 +573,19 @@ iperf_udp_accept(struct iperf_test *test)
}
}
+ if (test->settings->gso)
+ iperf_udp_gso(test, s);
+ if (test->settings->gro)
+ iperf_udp_gro(test, s);
+
#if defined(HAVE_SO_MAX_PACING_RATE)
/* If socket pacing is specified, try it. */
if (test->settings->fqrate) {
/* Convert bits per second to bytes per second */
- unsigned int fqrate = test->settings->fqrate / 8;
+ uint64_t fqrate = test->settings->fqrate / 8;
if (fqrate > 0) {
if (test->debug) {
- printf("Setting fair-queue socket pacing to %u\n", fqrate);
+ printf("Setting fair-queue socket pacing to %"PRIu64"\n", fqrate);
}
if (setsockopt(s, SOL_SOCKET, SO_MAX_PACING_RATE, &fqrate, sizeof(fqrate)) < 0) {
warning("Unable to set socket pacing");
@@ -453,6 +605,7 @@ iperf_udp_accept(struct iperf_test *test)
/*
* Create a new "listening" socket to replace the one we were using before.
*/
+ FD_CLR(test->prot_listener, &test->read_set); // No control messages from old listener
test->prot_listener = netannounce(test->settings->domain, Pudp, test->bind_address, test->bind_dev, test->server_port);
if (test->prot_listener < 0) {
i_errno = IESTREAMLISTEN;
@@ -524,6 +677,12 @@ iperf_udp_connect(struct iperf_test *test)
if (rc < 0)
/* error */
return rc;
+
+ if (test->settings->gso)
+ iperf_udp_gso(test, s);
+ if (test->settings->gro)
+ iperf_udp_gro(test, s);
+
/*
* If the socket buffer was too small, but it was the default
* size, then try explicitly setting it to something larger.
@@ -546,10 +705,10 @@ iperf_udp_connect(struct iperf_test *test)
/* If socket pacing is available and not disabled, try it. */
if (test->settings->fqrate) {
/* Convert bits per second to bytes per second */
- unsigned int fqrate = test->settings->fqrate / 8;
+ uint64_t fqrate = test->settings->fqrate / 8;
if (fqrate > 0) {
if (test->debug) {
- printf("Setting fair-queue socket pacing to %u\n", fqrate);
+ printf("Setting fair-queue socket pacing to %"PRIu64"\n", fqrate);
}
if (setsockopt(s, SOL_SOCKET, SO_MAX_PACING_RATE, &fqrate, sizeof(fqrate)) < 0) {
warning("Unable to set socket pacing");
diff --git a/src/iperf_util.c b/src/iperf_util.c
index d5795eed4..1182bb933 100644
--- a/src/iperf_util.c
+++ b/src/iperf_util.c
@@ -1,5 +1,5 @@
/*
- * iperf, Copyright (c) 2014, 2016, 2017, The Regents of the University of
+ * iperf, Copyright (c) 2014-2026, The Regents of the University of
* California, through Lawrence Berkeley National Laboratory (subject
* to receipt of any required approvals from the U.S. Dept. of
* Energy). All rights reserved.
@@ -105,7 +105,7 @@ void fill_with_repeating_pattern(void *out, size_t outsize)
* Generate and return a cookie string
*
* Iperf uses this function to create test "cookies" which
- * server as unique test identifiers. These cookies are also
+ * serve as unique test identifiers. These cookies are also
* used for the authentication of stream connections.
* Assumes cookie has size (COOKIE_SIZE + 1) char's.
*/
@@ -337,6 +337,26 @@ get_optional_features(void)
numfeatures++;
#endif /* HAVE_DONT_FRAGMENT */
+#if defined(HAVE_PTHREAD)
+ if (numfeatures > 0) {
+ strncat(features, ", ",
+ sizeof(features) - strlen(features) - 1);
+ }
+ strncat(features, "POSIX threads",
+ sizeof(features) - strlen(features) - 1);
+ numfeatures++;
+#endif /* HAVE_PTHREAD */
+
+#if defined(HAVE_UDP_GRO) || defined(HAVE_UDP_SEGMENT)
+ if (numfeatures > 0) {
+ strncat(features, ", ",
+ sizeof(features) - strlen(features) - 1);
+ }
+ strncat(features, "GSO/GRO support",
+ sizeof(features) - strlen(features) - 1);
+ numfeatures++;
+#endif /* HAVE_UDP_GRO || HAVE_UDP_SEGMENT */
+
if (numfeatures == 0) {
strncat(features, "None",
sizeof(features) - strlen(features) - 1);
@@ -420,6 +440,42 @@ iperf_json_printf(const char *format, ...)
return o;
}
+/********************** cJSON GetObjectItem w/ Type Helper ********************/
+cJSON * iperf_cJSON_GetObjectItemType(cJSON * j, char * item_string, int expected_type){
+ cJSON *j_p;
+ if((j_p = cJSON_GetObjectItem(j, item_string)) != NULL)
+ switch(expected_type){
+ case cJSON_True:
+ if(cJSON_IsBool(j_p))
+ return j_p;
+ else
+ iperf_err(NULL, "iperf_cJSON_GetObjectItemType mismatch %s", item_string);
+ break;
+ case cJSON_String:
+ if(cJSON_IsString(j_p))
+ return j_p;
+ else
+ iperf_err(NULL, "iperf_cJSON_GetObjectItemType mismatch %s", item_string);
+ break;
+ case cJSON_Number:
+ if(cJSON_IsNumber(j_p))
+ return j_p;
+ else
+ iperf_err(NULL, "iperf_cJSON_GetObjectItemType mismatch %s", item_string);
+ break;
+ case cJSON_Array:
+ if(cJSON_IsArray(j_p))
+ return j_p;
+ else
+ iperf_err(NULL, "iperf_cJSON_GetObjectItemType mismatch %s", item_string);
+ break;
+ default:
+ iperf_err(NULL, "unsupported type");
+ }
+
+ return NULL;
+}
+
/* Debugging routine to dump out an fd_set. */
void
iperf_dump_fdset(FILE *fp, const char *str, int nfds, fd_set *fds)
@@ -585,3 +641,30 @@ getline(char **buf, size_t *bufsiz, FILE *fp)
}
#endif
+
+/* Translate numeric State to text - for debugging purposes */
+char *
+state_to_text(signed char state)
+{
+ char *txt;
+
+ switch (state) {
+ case 0: txt = "Test reset"; break;
+ case TEST_START: txt = "TEST_START - starting a new test"; break;
+ case TEST_RUNNING: txt = "TEST_RUNNING"; break;
+ case TEST_END: txt = "TEST_END"; break;
+ case PARAM_EXCHANGE: txt = "PARAM_EXCHANGE - Client to Server Parameters Exchange"; break;
+ case CREATE_STREAMS: txt = "CREATE_STREAMS"; break;
+ case SERVER_TERMINATE: txt = "SERVER_TERMINATE"; break;
+ case CLIENT_TERMINATE: txt = "CLIENT_TERMINATE"; break;
+ case EXCHANGE_RESULTS: txt = "EXCHANGE_RESULTS"; break;
+ case DISPLAY_RESULTS: txt = "DISPLAY_RESULTS"; break;
+ case IPERF_START: txt = "IPERF_START - waiting for a new test"; break;
+ case IPERF_DONE: txt = "IPERF_DONE"; break;
+ case ACCESS_DENIED: txt = "ACCESS_DENIED - Server is busy"; break;
+ case SERVER_ERROR: txt = "SERVER_ERROR"; break;
+ default: txt = "Unknown State";
+ }
+
+ return txt;
+}
diff --git a/src/iperf_util.h b/src/iperf_util.h
index b109af2c6..02b280ec5 100644
--- a/src/iperf_util.h
+++ b/src/iperf_util.h
@@ -53,6 +53,7 @@ const char* get_system_info(void);
const char* get_optional_features(void);
cJSON* iperf_json_printf(const char *format, ...);
+cJSON * iperf_cJSON_GetObjectItemType(cJSON * j_p, char * item_string, int expected_type);
void iperf_dump_fdset(FILE *fp, const char *str, int nfds, fd_set *fds);
@@ -64,4 +65,6 @@ extern int daemon(int nochdir, int noclose);
ssize_t getline(char **buf, size_t *bufsiz, FILE *fp);
#endif /* HAVE_GETLINE */
+char * state_to_text(signed char state);
+
#endif
diff --git a/src/libiperf.3 b/src/libiperf.3
index 4b278e394..2edc95494 100644
--- a/src/libiperf.3
+++ b/src/libiperf.3
@@ -32,6 +32,7 @@ Setting test parameters:
void iperf_set_test_blksize( struct iperf_test *t, int blksize );
void iperf_set_test_num_streams( struct iperf_test *t, int num_streams );
void iperf_set_test_json_output( struct iperf_test *t, int json_output );
+ void iperf_set_test_json_stream( struct iperf_test *t, int json_stream );
int iperf_has_zerocopy( void );
void iperf_set_test_zerocopy( struct iperf_test* t, int zerocopy );
void iperf_set_test_tos( struct iperf_test* t, int tos );
diff --git a/src/main.c b/src/main.c
index 3b397c00a..708fd4f4c 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1,5 +1,5 @@
/*
- * iperf, Copyright (c) 2014-2022, The Regents of the University of
+ * iperf, Copyright (c) 2014-2023, The Regents of the University of
* California, through Lawrence Berkeley National Laboratory (subject
* to receipt of any required approvals from the U.S. Dept. of
* Energy). All rights reserved.
@@ -33,9 +33,7 @@
#include
#include
#include
-#ifdef HAVE_STDINT_H
#include
-#endif
#include
#include
#include
@@ -59,6 +57,24 @@ main(int argc, char **argv)
{
struct iperf_test *test;
+ /*
+ * Atomics check. We prefer to have atomic types (which is
+ * basically on any compiler supporting C11 or better). If we
+ * don't have them, we try to approximate the type we need with a
+ * regular integer, but complain if they're not lock-free. We only
+ * know how to check this on GCC. GCC on CentOS 7 / RHEL 7 is the
+ * targeted use case for these check.
+ */
+#ifndef HAVE_STDATOMIC_H
+#ifdef __GNUC__
+ if (! __atomic_always_lock_free (sizeof (u_int64_t), 0)) {
+#endif // __GNUC__
+ fprintf(stderr, "Warning: Cannot guarantee lock-free operation with 64-bit data types\n");
+#ifdef __GNUC__
+ }
+#endif // __GNUC__
+#endif // HAVE_STDATOMIC_H
+
// XXX: Setting the process affinity requires root on most systems.
// Is this a feature we really need?
#ifdef TEST_PROC_AFFINITY
@@ -115,10 +131,12 @@ main(int argc, char **argv)
static jmp_buf sigend_jmp_buf;
+static int signed_sig;
static void __attribute__ ((noreturn))
sigend_handler(int sig)
{
+ signed_sig = sig;
longjmp(sigend_jmp_buf, 1);
}
@@ -129,7 +147,7 @@ run(struct iperf_test *test)
/* Termination signals. */
iperf_catch_sigend(sigend_handler);
if (setjmp(sigend_jmp_buf))
- iperf_got_sigend(test);
+ iperf_got_sigend(test, signed_sig);
/* Ignore SIGPIPE to simplify error handling */
signal(SIGPIPE, SIG_IGN);
@@ -138,7 +156,7 @@ run(struct iperf_test *test)
case 's':
if (test->daemon) {
int rc;
- rc = daemon(0, 0);
+ rc = daemon(1, 0);
if (rc < 0) {
i_errno = IEDAEMON;
iperf_errexit(test, "error - %s", iperf_strerror(i_errno));
diff --git a/src/net.c b/src/net.c
index 1a88155bc..275595f20 100644
--- a/src/net.c
+++ b/src/net.c
@@ -1,5 +1,5 @@
/*
- * iperf, Copyright (c) 2014-2019, The Regents of the University of
+ * iperf, Copyright (c) 2014-2023, The Regents of the University of
* California, through Lawrence Berkeley National Laboratory (subject
* to receipt of any required approvals from the U.S. Dept. of
* Energy). All rights reserved.
@@ -38,6 +38,9 @@
#include
#include
#include
+#if defined(HAVE_UDP_SEGMENT) || defined(HAVE_UDP_GRO)
+#include
+#endif
#ifdef HAVE_SENDFILE
#ifdef linux
@@ -65,6 +68,9 @@
#include "net.h"
#include "timer.h"
+static int nread_read_timeout = 10;
+static int nread_overall_timeout = 30;
+
/*
* Declaration of gerror in iperf_error.c. Most other files in iperf3 can get this
* by including "iperf.h", but net.c lives "below" this layer. Clearly the
@@ -115,13 +121,13 @@ timeout_connect(int s, const struct sockaddr *name, socklen_t namelen,
return (ret);
}
-/* netdial and netannouce code comes from libtask: http://swtch.com/libtask/
+/* netdial and netannounce code comes from libtask: http://swtch.com/libtask/
* Copyright: http://swtch.com/libtask/COPYRIGHT
*/
/* create a socket */
int
-create_socket(int domain, int proto, const char *local, const char *bind_dev, int local_port, const char *server, int port, struct addrinfo **server_res_out)
+create_socket(int domain, int type, int proto, const char *local, const char *bind_dev, int local_port, const char *server, int port, struct addrinfo **server_res_out)
{
struct addrinfo hints, *local_res = NULL, *server_res = NULL;
int s, saved_errno;
@@ -130,14 +136,14 @@ create_socket(int domain, int proto, const char *local, const char *bind_dev, in
if (local) {
memset(&hints, 0, sizeof(hints));
hints.ai_family = domain;
- hints.ai_socktype = proto;
+ hints.ai_socktype = type;
if ((gerror = getaddrinfo(local, NULL, &hints, &local_res)) != 0)
return -1;
}
memset(&hints, 0, sizeof(hints));
hints.ai_family = domain;
- hints.ai_socktype = proto;
+ hints.ai_socktype = type;
snprintf(portstr, sizeof(portstr), "%d", port);
if ((gerror = getaddrinfo(server, portstr, &hints, &server_res)) != 0) {
if (local)
@@ -145,7 +151,7 @@ create_socket(int domain, int proto, const char *local, const char *bind_dev, in
return -1;
}
- s = socket(server_res->ai_family, proto, 0);
+ s = socket(server_res->ai_family, type, proto);
if (s < 0) {
if (local)
freeaddrinfo(local_res);
@@ -235,7 +241,7 @@ netdial(int domain, int proto, const char *local, const char *bind_dev, int loca
struct addrinfo *server_res = NULL;
int s, saved_errno;
- s = create_socket(domain, proto, local, bind_dev, local_port, server, port, &server_res);
+ s = create_socket(domain, proto, 0, local, bind_dev, local_port, server, port, &server_res);
if (s < 0) {
return -1;
}
@@ -362,20 +368,60 @@ netannounce(int domain, int proto, const char *local, const char *bind_dev, int
return s;
}
-
/*******************************************************************/
-/* reads 'count' bytes from a socket */
+/* Nread - reads 'count' bytes from a socket */
/********************************************************************/
int
Nread(int fd, char *buf, size_t count, int prot)
+{
+ return Nrecv(fd, buf, count, prot, 0);
+}
+
+/*******************************************************************/
+/* Nrecv - reads 'count' bytes from a socket */
+/********************************************************************/
+
+int
+Nrecv(int fd, char *buf, size_t count, int prot, int sock_opt)
{
register ssize_t r;
register size_t nleft = count;
+ struct iperf_time ftimeout = { 0, 0 };
+
+ fd_set rfdset;
+ struct timeval timeout = { nread_read_timeout, 0 };
+
+ /*
+ * fd might not be ready for reading on entry. Check for this
+ * (with timeout) first.
+ *
+ * This check could go inside the while() loop below, except we're
+ * currently considering whether it might make sense to support a
+ * codepath that bypasses this check, for situations where we
+ * already know that fd has data on it (for example if we'd gotten
+ * to here as the result of a select() call.
+ */
+ {
+ FD_ZERO(&rfdset);
+ FD_SET(fd, &rfdset);
+ r = select(fd + 1, &rfdset, NULL, NULL, &timeout);
+ if (r < 0) {
+ return NET_HARDERROR;
+ }
+ if (r == 0) {
+ return 0;
+ }
+ }
while (nleft > 0) {
- r = read(fd, buf, nleft);
+ if (sock_opt)
+ r = recv(fd, buf, nleft, sock_opt);
+ else
+ r = read(fd, buf, nleft);
+
if (r < 0) {
+ /* XXX EWOULDBLOCK can't happen without non-blocking sockets */
if (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK)
break;
else
@@ -383,12 +429,188 @@ Nread(int fd, char *buf, size_t count, int prot)
} else if (r == 0)
break;
- nleft -= r;
- buf += r;
+ if (sock_opt & MSG_TRUNC) {
+ size_t bytes_copied = (r > nleft)? nleft: r;
+ nleft -= bytes_copied;
+ buf += bytes_copied;
+ }
+ else {
+ nleft -= r;
+ buf += r;
+ }
+
+ /*
+ * We need some more bytes but don't want to wait around
+ * forever for them. In the case of partial results, we need
+ * to be able to read some bytes every nread_timeout seconds.
+ */
+ if (nleft > 0) {
+ struct iperf_time now;
+
+ /*
+ * Also, we have an approximate upper limit for the total time
+ * that a Nread call is supposed to take. We trade off accuracy
+ * of this timeout for a hopefully lower performance impact.
+ */
+ iperf_time_now(&now);
+ if (ftimeout.secs == 0) {
+ ftimeout = now;
+ iperf_time_add_usecs(&ftimeout, nread_overall_timeout * 1000000L);
+ }
+ if (iperf_time_compare(&ftimeout, &now) < 0) {
+ break;
+ }
+
+ FD_ZERO(&rfdset);
+ FD_SET(fd, &rfdset);
+ r = select(fd + 1, &rfdset, NULL, NULL, &timeout);
+ if (r < 0) {
+ return NET_HARDERROR;
+ }
+ if (r == 0) {
+ break;
+ }
+ }
}
return count - nleft;
}
+/********************************************************************/
+/* Nreads 'count' bytes from a socket - but without using select() */
+/********************************************************************/
+int
+Nread_no_select(int fd, char *buf, size_t count, int prot)
+{
+ return Nrecv_no_select(fd, buf, count, prot, 0);
+}
+
+/********************************************************************/
+/* Nrecv reads 'count' bytes from a socket - but without using select() */
+/********************************************************************/
+int
+Nrecv_no_select(int fd, char *buf, size_t count, int prot, int sock_opt)
+{
+ register ssize_t r;
+ register size_t nleft = count;
+
+ while (nleft > 0) {
+ if (sock_opt)
+ r = recv(fd, buf, nleft, sock_opt);
+ else
+ r = read(fd, buf, nleft);
+
+ if (r < 0) {
+ /* XXX EWOULDBLOCK can't happen without non-blocking sockets */
+ if (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK)
+ break;
+ else
+ return NET_HARDERROR;
+ } else if (r == 0)
+ break;
+
+ if (sock_opt & MSG_TRUNC) {
+ size_t bytes_copied = (r > nleft)? nleft: r;
+ nleft -= bytes_copied;
+ buf += bytes_copied;
+ }
+ else {
+ nleft -= r;
+ buf += r;
+ }
+
+
+ }
+ return count - nleft;
+}
+
+#ifdef HAVE_UDP_GRO
+static int recv_msg_gro(int fd, char *buf, int len, int *gso_size)
+{
+ char control[CMSG_SPACE(sizeof(uint16_t))] = {0};
+ struct msghdr msg = {0};
+ struct iovec iov = {0};
+ struct cmsghdr *cmsg;
+ uint16_t *gsosizeptr;
+ int ret;
+
+ /* Input validation */
+ if (!buf || len <= 0 || !gso_size) {
+ return -1;
+ }
+
+ iov.iov_base = buf;
+ iov.iov_len = len;
+
+ msg.msg_iov = &iov;
+ msg.msg_iovlen = 1;
+
+ msg.msg_control = control;
+ msg.msg_controllen = sizeof(control);
+
+ *gso_size = -1;
+ ret = recvmsg(fd, &msg, MSG_DONTWAIT);
+
+ if (ret > 0) {
+ for (cmsg = CMSG_FIRSTHDR(&msg); cmsg != NULL; cmsg = CMSG_NXTHDR(&msg, cmsg)) {
+ if (cmsg->cmsg_level == IPPROTO_UDP && cmsg->cmsg_type == UDP_GRO) {
+ /* Validate cmsg data length */
+ if (cmsg->cmsg_len >= CMSG_LEN(sizeof(uint16_t))) {
+ gsosizeptr = (uint16_t *) CMSG_DATA(cmsg);
+ *gso_size = *gsosizeptr;
+ /* Sanity check the gso_size value */
+ if (*gso_size <= 0 || *gso_size > len) {
+ *gso_size = -1; /* Mark as invalid */
+ }
+ }
+ break;
+ }
+ }
+ }
+
+ return ret;
+}
+
+int
+Nread_gro(int fd, char *buf, size_t count, int prot, int *dgram_sz)
+{
+ register ssize_t r;
+
+ /* Input validation */
+ if (!buf || count <= 0 || !dgram_sz) {
+ return NET_HARDERROR;
+ }
+
+ /* Limit maximum buffer size to prevent excessive memory usage */
+ if (count > MAX_UDP_BLOCKSIZE) {
+ count = MAX_UDP_BLOCKSIZE;
+ }
+
+ r = recv_msg_gro(fd, buf, count, dgram_sz);
+
+ if (r < 0) {
+ if (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK) {
+ return 0;
+ } else {
+ return NET_HARDERROR;
+ }
+ }
+
+ /* Additional validation of returned dgram_sz */
+ if (r > 0 && *dgram_sz > 0 && *dgram_sz > r) {
+ /* dgram_sz shouldn't be larger than actual received data */
+ *dgram_sz = r;
+ }
+
+ return r;
+}
+#else
+int
+Nread_gro(int fd, char *buf, size_t count, int prot, int *dgram_sz)
+{
+ /* GRO not supported on this platform */
+ return NET_HARDERROR;
+}
+#endif /* HAVE_UDP_GRO */
/*
* N W R I T E
@@ -407,14 +629,17 @@ Nwrite(int fd, const char *buf, size_t count, int prot)
case EINTR:
case EAGAIN:
#if (EAGAIN != EWOULDBLOCK)
+ /* XXX EWOULDBLOCK can't happen without non-blocking sockets */
case EWOULDBLOCK:
#endif
+ if (count == nleft)
+ return NET_SOFTERROR;
return count - nleft;
- case ENOBUFS:
- return NET_SOFTERROR;
+ case ENOBUFS :
+ return NET_SOFTERROR;
- default:
+ default:
return NET_HARDERROR;
}
} else if (r == 0)
@@ -425,6 +650,80 @@ Nwrite(int fd, const char *buf, size_t count, int prot)
return count;
}
+#ifdef HAVE_UDP_SEGMENT
+static void udp_msg_gso(struct cmsghdr *cm, uint16_t gso_size)
+{
+ uint16_t *valp;
+
+ cm->cmsg_level = IPPROTO_UDP;
+ cm->cmsg_type = UDP_SEGMENT;
+ cm->cmsg_len = CMSG_LEN(sizeof(gso_size));
+ valp = (void *) CMSG_DATA(cm);
+ *valp = gso_size;
+}
+
+static int udp_sendmsg_gso(int fd, const char *buf, size_t count, uint16_t gso_size)
+{
+ char control[CMSG_SPACE(sizeof(gso_size))] = {0};
+ struct msghdr msg = {0};
+ struct iovec iov = {0};
+ size_t msg_controllen;
+ struct cmsghdr *cmsg;
+ int ret;
+
+ iov.iov_base = (void *) buf;
+ iov.iov_len = count;
+
+ msg.msg_iov = &iov;
+ msg.msg_iovlen = 1;
+
+ msg.msg_control = control;
+ msg.msg_controllen = sizeof(control);
+ cmsg = CMSG_FIRSTHDR(&msg);
+
+ udp_msg_gso(cmsg, gso_size);
+
+ msg_controllen = CMSG_SPACE(sizeof(gso_size));
+ msg.msg_controllen = msg_controllen;
+
+ ret = sendmsg(fd, &msg, 0);
+
+ return ret;
+}
+
+int
+Nwrite_gso(int fd, const char *buf, size_t count, int prot, uint16_t gso_size)
+{
+ register ssize_t r;
+
+ r = udp_sendmsg_gso(fd, buf, count, gso_size);
+
+ if (r < 0) {
+ switch (errno) {
+ case EINTR:
+ case EAGAIN:
+#if (EAGAIN != EWOULDBLOCK)
+ case EWOULDBLOCK:
+#endif
+ return 0;
+
+ case ENOBUFS:
+ return NET_SOFTERROR;
+
+ default:
+ return NET_HARDERROR;
+ }
+ }
+ return r;
+}
+#else
+int
+Nwrite_gso(int fd, const char *buf, size_t count, int prot, uint16_t gso_size)
+{
+ /* GSO not supported on this platform */
+ return NET_HARDERROR;
+}
+#endif /* HAVE_UDP_SEGMENT */
int
has_sendfile(void)
@@ -477,6 +776,7 @@ Nsendfile(int fromfd, int tofd, const char *buf, size_t count)
case EINTR:
case EAGAIN:
#if (EAGAIN != EWOULDBLOCK)
+ /* XXX EWOULDBLOCK can't happen without non-blocking sockets */
case EWOULDBLOCK:
#endif
if (count == nleft)
diff --git a/src/net.h b/src/net.h
index f0e1b4f98..9ce20e4c7 100644
--- a/src/net.h
+++ b/src/net.h
@@ -28,11 +28,16 @@
#define __NET_H
int timeout_connect(int s, const struct sockaddr *name, socklen_t namelen, int timeout);
-int create_socket(int domain, int proto, const char *local, const char *bind_dev, int local_port, const char *server, int port, struct addrinfo **server_res_out);
+int create_socket(int domain, int type, int proto, const char *local, const char *bind_dev, int local_port, const char *server, int port, struct addrinfo **server_res_out);
int netdial(int domain, int proto, const char *local, const char *bind_dev, int local_port, const char *server, int port, int timeout);
int netannounce(int domain, int proto, const char *local, const char *bind_dev, int port);
int Nread(int fd, char *buf, size_t count, int prot);
+int Nrecv(int fd, char *buf, size_t count, int prot, int sock_opt);
+int Nread_no_select(int fd, char *buf, size_t count, int prot);
+int Nrecv_no_select(int fd, char *buf, size_t count, int prot, int sock_opt);
+int Nread_gro(int fd, char *buf, size_t count, int prot, int *dgram_sz);
int Nwrite(int fd, const char *buf, size_t count, int prot) /* __attribute__((hot)) */;
+int Nwrite_gso(int fd, const char *buf, size_t count, int prot, uint16_t gso_size);
int has_sendfile(void);
int Nsendfile(int fromfd, int tofd, const char *buf, size_t count) /* __attribute__((hot)) */;
int setnonblocking(int fd, int nonblocking);
diff --git a/src/portable_endian.h b/src/portable_endian.h
index c3c73ffd7..dbb678992 100644
--- a/src/portable_endian.h
+++ b/src/portable_endian.h
@@ -131,7 +131,9 @@
// the truth because we use the homebrew htonll, et al. implementations
// that were originally the sole implementation of this functionality
// in iperf 3.0.
+#if (!defined(__vxworks)) && (!defined(__VXWORKS__))
# warning platform not supported
+#endif
# include
#if BYTE_ORDER == BIG_ENDIAN
#define HTONLL(n) (n)
diff --git a/src/t_api.c b/src/t_api.c
index d822f559e..d3bfb7e20 100644
--- a/src/t_api.c
+++ b/src/t_api.c
@@ -27,9 +27,7 @@
#include
-#ifdef HAVE_STDINT_H
#include
-#endif
#include
#include
diff --git a/src/t_auth.c b/src/t_auth.c
index 22c78ae1f..096150363 100644
--- a/src/t_auth.c
+++ b/src/t_auth.c
@@ -27,9 +27,7 @@
#include "iperf_config.h"
#include
-#ifdef HAVE_STDINT_H
#include
-#endif
#include
#include
@@ -43,6 +41,7 @@
#include "units.h"
+
#if defined(HAVE_SSL)
int test_authtoken(const char *authUser, const char *authPassword, EVP_PKEY *pubkey, EVP_PKEY *privkey);
@@ -81,7 +80,7 @@ main(int argc, char **argv)
assert(test_load_private_key_from_file(privkeyfile) == 0);
/* load public key pair for use in further tests */
- EVP_PKEY *pubkey, *privkey;
+ EVP_PKEY *pubkey = NULL, *privkey = NULL;
pubkey = load_pubkey_from_file(pubkeyfile);
assert(pubkey);
privkey = load_privkey_from_file(privkeyfile);
@@ -90,6 +89,23 @@ main(int argc, char **argv)
/* authentication token tests */
assert(test_authtoken("kilroy", "fubar", pubkey, privkey) == 0);
+ if (pubkey != NULL){
+ EVP_PKEY_free(pubkey);
+ pubkey = NULL;
+ }
+ if (privkey != NULL){
+ EVP_PKEY_free(privkey);
+ privkey = NULL;
+ }
+ if (base64Text != NULL){
+ free(base64Text);
+ base64Text = NULL;
+ }
+ if (base64Decode != NULL){
+ free(base64Decode);
+ base64Decode = NULL;
+ }
+
/* This should fail because the data is way too long for the RSA key */
/* assert(test_authtoken("kilroykilroykilroykilroykilroykilroykilroykilroykilroykilroykilroykilroykilroykilroykilroykilroykilroykilroykilroykilroykilroykilroykilroykilroykilroykilroy", "fubarfubarfubarfubarfubarfubarfubarfubarfubarfubarfubarfubarfubarfubarfubarfubarfubarfubarfubarfubarfubarfubarfubarfubarfubarfubarfubarfubarfubarfubarfubar", pubkey, privkey) < 0); */
@@ -103,12 +119,26 @@ test_authtoken(const char *authUser, const char *authPassword, EVP_PKEY *pubkey,
char *decodePassword;
time_t decodeTime;
- assert(encode_auth_setting(authUser, authPassword, pubkey, &authToken) == 0);
- assert(decode_auth_setting(0, authToken, privkey, &decodeUser, &decodePassword, &decodeTime) == 0);
+ int use_pkcs1_padding = 1;
+ assert(encode_auth_setting(authUser, authPassword, pubkey, &authToken, use_pkcs1_padding) == 0);
+ assert(decode_auth_setting(0, authToken, privkey, &decodeUser, &decodePassword, &decodeTime, use_pkcs1_padding) == 0);
assert(strcmp(decodeUser, authUser) == 0);
assert(strcmp(decodePassword, authPassword) == 0);
+ if (authToken !=NULL){
+ free(authToken);
+ authToken = NULL;
+ }
+ if (decodeUser !=NULL){
+ free(decodeUser);
+ decodeUser = NULL;
+ }
+ if (decodePassword !=NULL){
+ free(decodePassword);
+ decodePassword = NULL;
+ }
+
time_t now = time(NULL);
assert(now - decodeTime >= 0); /* time has to go forwards */
diff --git a/src/t_timer.c b/src/t_timer.c
index 8eec7d8f3..fb6eb19b7 100644
--- a/src/t_timer.c
+++ b/src/t_timer.c
@@ -26,9 +26,7 @@
*/
#include "iperf_config.h"
-#ifdef HAVE_STDINT_H
#include
-#endif
#include
#include
#include
diff --git a/src/t_units.c b/src/t_units.c
index 73f21a9d8..13883aa54 100644
--- a/src/t_units.c
+++ b/src/t_units.c
@@ -25,9 +25,7 @@
* file for complete information.
*/
#include
-#ifdef HAVE_STDINT_H
#include
-#endif
#include
#include
diff --git a/src/tcp_info.c b/src/tcp_info.c
index 160063c1f..004d854e0 100644
--- a/src/tcp_info.c
+++ b/src/tcp_info.c
@@ -35,7 +35,7 @@
#
* FreeBSD has a limited implementation that only includes the following:
* tcpi_snd_ssthresh, tcpi_snd_cwnd, tcpi_rcv_space, tcpi_rtt
- * Based on information on http://wiki.freebsd.org/8.0TODO, I dont think this will be
+ * Based on information on http://wiki.freebsd.org/8.0TODO, I don't think this will be
* fixed before v8.1 at the earliest.
*
* OSX has no support.
@@ -218,17 +218,20 @@ get_pmtu(struct iperf_interval_results *irp)
}
/*************************************************************/
-void
-build_tcpinfo_message(struct iperf_interval_results *r, char *message)
+/*
+ * Return number of reordering events seen.
+ */
+long
+get_reorder(struct iperf_interval_results *irp)
{
-#if defined(linux) && defined(TCP_INFO)
- sprintf(message, report_tcpInfo, r->tcpInfo.tcpi_snd_cwnd, r->tcpInfo.tcpi_snd_ssthresh,
- r->tcpInfo.tcpi_rcv_ssthresh, r->tcpInfo.tcpi_unacked, r->tcpInfo.tcpi_sacked,
- r->tcpInfo.tcpi_lost, r->tcpInfo.tcpi_retrans, r->tcpInfo.tcpi_fackets,
- r->tcpInfo.tcpi_rtt, r->tcpInfo.tcpi_reordering);
-#endif
-#if (defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)) && defined(TCP_INFO)
- sprintf(message, report_tcpInfo, r->tcpInfo.tcpi_snd_cwnd,
- r->tcpInfo.tcpi_rcv_space, r->tcpInfo.tcpi_snd_ssthresh, r->tcpInfo.tcpi_rtt);
+ /* TCP_REPAIR_ON is unrelated, but both that define
+ * and the tcpi_reord_seen field were added in Linux 4.19
+ * (similar situation as has_tcpinfo_retransmits()).
+ */
+#if defined(linux) && defined(TCP_REPAIR_ON)
+ return irp->tcpInfo.tcpi_reord_seen;
+#else
+ return -1;
#endif
}
+
diff --git a/src/timer.h b/src/timer.h
index 58c3db875..dd09e53bc 100644
--- a/src/timer.h
+++ b/src/timer.h
@@ -86,8 +86,8 @@ extern void tmr_run( struct iperf_time* nowP ) /* __attribute__((hot)) */;
/* Reset the clock on a timer, to current time plus the original timeout. */
extern void tmr_reset( struct iperf_time* nowP, Timer* timer );
-/* Deschedule a timer. Note that non-periodic timers are automatically
-** descheduled when they run, so you don't have to call this on them.
+/* Unschedule a timer. Note that non-periodic timers are automatically
+** unscheduled when they run, so you don't have to call this on them.
*/
extern void tmr_cancel( Timer* timer );
diff --git a/src/units.c b/src/units.c
index 7376a0b7f..1e8b52e07 100644
--- a/src/units.c
+++ b/src/units.c
@@ -32,7 +32,7 @@
* 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 CONTIBUTORS OR COPYRIGHT
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE
@@ -54,15 +54,14 @@
#include
#include
#include