diff options
author | Pino Toscano <ptoscano@redhat.com> | 2017-10-17 17:02:53 +0200 |
---|---|---|
committer | Pino Toscano <ptoscano@redhat.com> | 2017-10-19 12:56:20 +0200 |
commit | cc5be3aee94228cadef997667fe65a4fa6b760c4 (patch) | |
tree | ba9ee48de1dd748e2874f0bd9a2c36b5bd2d00a5 /tests | |
parent | 206a544582a37f4b016841bc6fa7962b87cece8a (diff) | |
download | libosinfo-cc5be3aee94228cadef997667fe65a4fa6b760c4.tar.gz |
build: make curl optional, and only for tests
Look for curl only when the tests are enabled, and as optional build
dependency. If curl is missing, then the two network tests are not
built. Also, limit the use of curl CFLAGS/LIBS only for the tests that
really need it.
As side result, it is possible to drop the curl BuildRequires from the
mingw spec, as it builds with --enable-tests=no.
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Makefile.am | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am index e3df06b..9315e04 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -16,16 +16,20 @@ check_PROGRAMS = \ test-db \ test-loader \ test-isodetect \ - test-mediauris \ - test-treeuris \ test-install-script \ $(NULL) +if HAVE_CURL +check_PROGRAMS += \ + test-mediauris \ + test-treeuris \ + $(NULL) +endif + COMMON_LDADD = \ $(COVERAGE_LDFLAGS) \ $(GLIB_LIBS) \ $(GOBJECT_LIBS) \ - $(CURL_LIBS) \ $(CHECK_LIBS) \ ../osinfo/libosinfo-1.0.la COMMON_CFLAGS = \ @@ -33,7 +37,6 @@ COMMON_CFLAGS = \ $(COVERAGE_CFLAGS) \ $(GLIB_CFLAGS) \ $(GOBJECT_CFLAGS) \ - $(CURL_CFLAGS) \ -I$(top_srcdir) \ -DSRCDIR="\"$(abs_top_srcdir)\"" \ -DBUILDDIR="\"$(abs_top_builddir)\"" \ @@ -95,13 +98,15 @@ test_isodetect_LDADD = $(COMMON_LDADD) test_isodetect_CFLAGS = $(COMMON_CFLAGS) test_isodetect_SOURCES = test-isodetect.c -test_mediauris_LDADD = $(COMMON_LDADD) -test_mediauris_CFLAGS = $(COMMON_CFLAGS) +if HAVE_CURL +test_mediauris_LDADD = $(COMMON_LDADD) $(CURL_LIBS) +test_mediauris_CFLAGS = $(COMMON_CFLAGS) $(CURL_CFLAGS) test_mediauris_SOURCES = test-mediauris.c -test_treeuris_LDADD = $(COMMON_LDADD) -test_treeuris_CFLAGS = $(COMMON_CFLAGS) +test_treeuris_LDADD = $(COMMON_LDADD) $(CURL_LIBS) +test_treeuris_CFLAGS = $(COMMON_CFLAGS) $(CURL_CFLAGS) test_treeuris_SOURCES = test-treeuris.c +endif test_install_script_LDADD = $(COMMON_LDADD) test_install_script_CFLAGS = $(COMMON_CFLAGS) |