aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEzra <ezkissel@indiana.edu>2020-05-04 18:09:05 -0400
committerGitHub <noreply@github.com>2020-05-04 15:09:05 -0700
commit9427ecdf3c5e62e3a8340fd2226c2c2f68545254 (patch)
tree399886b0fb2d2584808d32697c9923de14a73feb
parente39e44fdfd58915bf5da0d835b73a62a04760dc9 (diff)
downloadiperf3-9427ecdf3c5e62e3a8340fd2226c2c2f68545254.tar.gz
Add configure option to enable static linking of iperf binary. (#989)
-rw-r--r--config/iperf_config_static_bin.m411
-rw-r--r--configure.ac4
2 files changed, 15 insertions, 0 deletions
diff --git a/config/iperf_config_static_bin.m4 b/config/iperf_config_static_bin.m4
new file mode 100644
index 0000000..1f35bbf
--- /dev/null
+++ b/config/iperf_config_static_bin.m4
@@ -0,0 +1,11 @@
+# Also link binaries as static
+AC_ARG_ENABLE([static-bin],
+ AS_HELP_STRING([--enable-static-bin], [link iperf binary statically]),
+ [enable_static_bin=yes
+ AC_DISABLE_SHARED],
+ [:])
+AM_CONDITIONAL([ENABLE_STATIC_BIN], [test x$enable_static_bin = xno])
+
+AS_IF([test "x$enable_static_bin" == xyes],
+ [LDFLAGS="$LDFLAGS --static"]
+ [])
diff --git a/configure.ac b/configure.ac
index 7d8a855..2ad501c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,6 +26,7 @@
# Initialize the autoconf system for the specified tool, version and mailing list
AC_INIT(iperf, 3.7+, https://github.com/esnet/iperf, iperf, https://software.es.net/iperf/)
m4_include([config/ax_check_openssl.m4])
+m4_include([config/iperf_config_static_bin.m4])
AC_LANG(C)
# Specify where the auxiliary files created by configure should go. The config
@@ -35,6 +36,9 @@ AC_CONFIG_AUX_DIR(config)
# Initialize the automake system
AM_INIT_AUTOMAKE([foreign])
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+LT_INIT
+
AM_MAINTAINER_MODE
AM_CONFIG_HEADER(src/iperf_config.h)