Build libiperf3 as both a shared library and a static library by default.

Use --disable-static or --disable-shared to build only one flavor
of libraries.

Tested on MacOS, FreeBSD, and CentOS 6 Linux.

Resolves #146.

Originally submitted by:	@i2aaron
This commit is contained in:
Bruce A. Mah 2014-03-04 14:31:35 -08:00
parent 2be606a503
commit 3c4ef74e5e
No known key found for this signature in database
GPG Key ID: 4984910A8CAAEE8A
2 changed files with 14 additions and 9 deletions

4
.gitignore vendored
View File

@ -1,5 +1,7 @@
*~ *~
*.a *.a
*.la
*.lo
*.o *.o
*.orig *.orig
*.Po *.Po
@ -9,6 +11,8 @@ config/test-driver
config.log config.log
config.status config.status
libtool libtool
src/.deps
src/.libs
src/config.h src/config.h
src/stamp-h1 src/stamp-h1
src/iperf3 src/iperf3

View File

@ -1,13 +1,14 @@
lib_LIBRARIES = libiperf.a # Build and install a static iperf library lib_LTLIBRARIES = libiperf.la # Build and install an iperf library
bin_PROGRAMS = iperf3 # Build and install an iperf binary bin_PROGRAMS = iperf3 # Build and install an iperf binary
noinst_PROGRAMS = t_timer t_units t_uuid iperf3_profile # Build, but don't install the test programs and a profiled version of iperf3 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 include_HEADERS = iperf_api.h # Defines the headers that get installed with the program
# Specify the source files and flags for the iperf library # Specify the source files and flags for the iperf library
libiperf_a_SOURCES = \ libiperf_la_SOURCES = \
cjson.c \ cjson.c \
cjson.h \ cjson.h \
flowlabel.h \
iperf.h \ iperf.h \
iperf_api.c \ iperf_api.c \
iperf_api.h \ iperf_api.h \
@ -39,33 +40,33 @@ libiperf_a_SOURCES = \
# Specify the sources and various flags for the iperf binary # Specify the sources and various flags for the iperf binary
iperf3_SOURCES = main.c iperf3_SOURCES = main.c
iperf3_CFLAGS = -g -Wall iperf3_CFLAGS = -g -Wall
iperf3_LDADD = libiperf.a iperf3_LDADD = libiperf.la
iperf3_LDFLAGS = -g iperf3_LDFLAGS = -g
# Specify the sources and various flags for the profiled iperf binary. This # 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. # binary recompiles all the source files to make sure they are all profiled.
iperf3_profile_SOURCES = main.c \ iperf3_profile_SOURCES = main.c \
$(libiperf_a_SOURCES) $(libiperf_la_SOURCES)
iperf3_profile_CFLAGS = -pg -g -Wall iperf3_profile_CFLAGS = -pg -g -Wall
iperf3_profile_LDADD = libiperf.a iperf3_profile_LDADD = libiperf.la
iperf3_profile_LDFLAGS = -pg -g iperf3_profile_LDFLAGS = -pg -g
# Specify the sources and various flags for the test cases # Specify the sources and various flags for the test cases
t_timer_SOURCES = t_timer.c t_timer_SOURCES = t_timer.c
t_timer_CFLAGS = -g -Wall t_timer_CFLAGS = -g -Wall
t_timer_LDFLAGS = iperf_error.o t_timer_LDFLAGS =
t_timer_LDADD = libiperf.a t_timer_LDADD = libiperf.la
t_units_SOURCES = t_units.c t_units_SOURCES = t_units.c
t_units_CFLAGS = -g -Wall t_units_CFLAGS = -g -Wall
t_units_LDFLAGS = t_units_LDFLAGS =
t_units_LDADD = libiperf.a t_units_LDADD = libiperf.la
t_uuid_SOURCES = t_uuid.c t_uuid_SOURCES = t_uuid.c
t_uuid_CFLAGS = -g -Wall t_uuid_CFLAGS = -g -Wall
t_uuid_LDFLAGS = t_uuid_LDFLAGS =
t_uuid_LDADD = libiperf.a t_uuid_LDADD = libiperf.la