diff --git a/cbt/Makefile.am b/cbt/Makefile.am index c0903cf2..b663be89 100644 --- a/cbt/Makefile.am +++ b/cbt/Makefile.am @@ -9,9 +9,10 @@ sbin_PROGRAMS = cbt-util noinst_LTLIBRARIES = libcbtutil.la libcbtutil_la_SOURCES = cbt-util.c +libcbtutil_la_LIBADD = -luuid cbt_util_SOURCES = main.c -cbt_util_LDADD = libcbtutil.la -lrt -luuid +cbt_util_LDADD = libcbtutil.la clean-local: -rm -rf *.gc?? diff --git a/mockatests/cbt/Makefile.am b/mockatests/cbt/Makefile.am index 8103886a..a6503a8a 100644 --- a/mockatests/cbt/Makefile.am +++ b/mockatests/cbt/Makefile.am @@ -11,9 +11,10 @@ AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/cbt -I../include check_PROGRAMS = test-cbt-util TESTS = test-cbt-util +test_cbt_util_LDADD = $(top_srcdir)/cbt/libcbtutil.la ../wrappers/libwrappers.la + test_cbt_util_SOURCES = test-cbt-util.c test-cbt-util-commands.c test-cbt-util-set.c test-cbt-util-get.c test-cbt-util-create.c test-cbt-util-coalesce.c -test_cbt_util_LDFLAGS = $(top_srcdir)/cbt/libcbtutil.la -lcmocka -luuid -test_cbt_util_LDFLAGS += ../wrappers/libwrappers.la +test_cbt_util_LDFLAGS = -lcmocka test_cbt_util_LDFLAGS += -Wl,--wrap=fopen,--wrap=fclose test_cbt_util_LDFLAGS += -Wl,--wrap=malloc,--wrap=free,--wrap=calloc # Need to wrap both of these as rpmbuild/mock set -D_FORTIFY_SOURCE=2 diff --git a/mockatests/control/Makefile.am b/mockatests/control/Makefile.am index 3f04cd73..140ac6a8 100644 --- a/mockatests/control/Makefile.am +++ b/mockatests/control/Makefile.am @@ -11,11 +11,11 @@ AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/control -I../include check_PROGRAMS = test-control TESTS = test-control -test_control_SOURCES = test-control.c test-tap-ctl-free.c test-tap-ctl-allocate.c test-tap-ctl-close.c test-tap-ctl-list.c control-wrappers.c util.c -test_control_LDFLAGS = $(top_srcdir)/control/libblktapctl.la -lcmocka -luuid +test_control_LDADD = $(top_srcdir)/control/libblktapctl.la ../wrappers/libwrappers.la +test_control_SOURCES = test-control.c test-tap-ctl-free.c test-tap-ctl-allocate.c test-tap-ctl-close.c test-tap-ctl-list.c control-wrappers.c util.c +test_control_LDFLAGS = -lcmocka test_control_LDFLAGS += -static-libtool-libs -test_control_LDFLAGS += ../wrappers/libwrappers.la # Would be good to use the cmocka malloc wraps but looks like maybe strdup doesn't call malloc #test_control_LDFLAGS += -Wl,--wrap=malloc,--wrap=free test_control_LDFLAGS += -Wl,--wrap=socket,--wrap=connect,--wrap=read,--wrap=select,--wrap=write,--wrap=fdopen diff --git a/mockatests/drivers/Makefile.am b/mockatests/drivers/Makefile.am index 355c6db9..a4427fb3 100644 --- a/mockatests/drivers/Makefile.am +++ b/mockatests/drivers/Makefile.am @@ -11,8 +11,10 @@ AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/drivers -I../include check_PROGRAMS = test-drivers TESTS = test-drivers +test_drivers_LDADD = $(top_srcdir)/drivers/libtapdisk.la + test_drivers_SOURCES = test-drivers.c test-tapdisk-stats.c test-tapdisk-vbd.c vbd-wrappers.c test-tapdisk-nbdserver.c -test_drivers_LDFLAGS = $(top_srcdir)/drivers/libtapdisk.la -lcmocka -luuid +test_drivers_LDFLAGS = -lcmocka test_drivers_LDFLAGS += -Wl,--wrap=tapdisk_image_check_request test_drivers_LDFLAGS += -Wl,--wrap=td_queue_block_status test_drivers_LDFLAGS += -Wl,--wrap=send diff --git a/mockatests/vhd/Makefile.am b/mockatests/vhd/Makefile.am index 6172e5a1..fb8f2fd3 100644 --- a/mockatests/vhd/Makefile.am +++ b/mockatests/vhd/Makefile.am @@ -12,8 +12,10 @@ AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/cbt -I../include check_PROGRAMS = test-vhd-util TESTS = test-vhd-util +test_vhd_util_LDADD = $(top_srcdir)/vhd/lib/libvhd.la + test_vhd_util_SOURCES = test-vhd-util.c test-vhd-util-snapshot.c test-canonpath.c test-vhd-util-utilities.c vhd-wrappers.c -test_vhd_util_LDFLAGS = $(top_srcdir)/vhd/lib/libvhd.la -lcmocka -luuid +test_vhd_util_LDFLAGS = -lcmocka test_vhd_util_LDFLAGS += -static-libtool-libs test_vhd_util_LDFLAGS += -Wl,--wrap=free,--wrap=malloc,--wrap=realloc test_vhd_util_LDFLAGS += -Wl,--wrap=canonpath