aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHk <8922964+rollingslack@users.noreply.github.com>2018-06-29 19:23:41 -0400
committerBruce A. Mah <bmah@kitchenlab.org>2018-06-29 16:23:41 -0700
commite6689a8cbbf4ae504b302f410be5108b14987512 (patch)
tree1c6ea52976340127512693c27b40977155a5a5db
parent02e16f67fbbd2a6175c6f205478bf628ca6ec0fb (diff)
downloadiperf3-e6689a8cbbf4ae504b302f410be5108b14987512.tar.gz
Provide a configure feature flag (--disable-profiling) to disable creation of iperf3_profile binary (#763)
Fixes #749.
-rw-r--r--configure.ac7
-rw-r--r--src/Makefile.am21
2 files changed, 21 insertions, 7 deletions
diff --git a/configure.ac b/configure.ac
index d928730..c47c5f7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -52,6 +52,13 @@ if test "x$GCC" = "xyes"; then
CFLAGS="$CFLAGS -Wall"
fi
+# Check if profiling must be disabled
+AC_ARG_ENABLE([profiling],
+ AS_HELP_STRING([--disable-profiling], [Disable iperf profiling binary]),
+ [:],
+ [enable_profiling=yes])
+AM_CONDITIONAL([ENABLE_PROFILING], [test x$enable_profiling = xyes])
+
# Checks for header files.
AC_HEADER_STDC
diff --git a/src/Makefile.am b/src/Makefile.am
index 9184e84..ef7b66a 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,7 +1,11 @@
lib_LTLIBRARIES = libiperf.la # Build and install an iperf library
bin_PROGRAMS = iperf3 # Build and install an iperf binary
+if ENABLE_PROFILING
noinst_PROGRAMS = t_timer t_units t_uuid iperf3_profile # Build, but don't install the test programs and a profiled version of iperf3
-include_HEADERS = iperf_api.h # Defines the headers that get installed with the program
+else
+noinst_PROGRAMS = t_timer t_units t_uuid # Build, but don't install the test programs
+endif
+include_HEADERS = iperf_api.h # Defines the headers that get installed with the program
# Specify the source files and flags for the iperf library
@@ -15,7 +19,7 @@ libiperf_la_SOURCES = \
iperf_error.c \
iperf_auth.h \
iperf_auth.c \
- iperf_client_api.c \
+ iperf_client_api.c \
iperf_locale.c \
iperf_locale.h \
iperf_server_api.c \
@@ -23,14 +27,14 @@ libiperf_la_SOURCES = \
iperf_tcp.h \
iperf_udp.c \
iperf_udp.h \
- iperf_sctp.c \
- iperf_sctp.h \
+ iperf_sctp.c \
+ iperf_sctp.h \
iperf_util.c \
iperf_util.h \
- dscp.c \
+ dscp.c \
net.c \
net.h \
- portable_endian.h \
+ portable_endian.h \
queue.h \
tcp_info.c \
timer.c \
@@ -45,14 +49,17 @@ iperf3_CFLAGS = -g
iperf3_LDADD = libiperf.la
iperf3_LDFLAGS = -g
+if ENABLE_PROFILING
+# If the iperf-profiled-binary is enabled (and this condition is true by default)
# Specify the sources and various flags for the profiled iperf binary. This
# binary recompiles all the source files to make sure they are all profiled.
iperf3_profile_SOURCES = main.c \
- $(libiperf_la_SOURCES)
+ $(libiperf_la_SOURCES)
iperf3_profile_CFLAGS = -pg -g
iperf3_profile_LDADD = libiperf.la
iperf3_profile_LDFLAGS = -pg -g
+endif
# Specify the sources and various flags for the test cases
t_timer_SOURCES = t_timer.c