From 82699a67dbb6bfcc9452bb969e7872809232a84f Mon Sep 17 00:00:00 2001 From: Alex Kiernan Date: Wed, 4 Sep 2019 17:29:15 +0100 Subject: [PATCH 1/2] Always enable trivial-httpd for tests When running tests we always need ostree-trivial-httpd, so enable it unconditionally Signed-off-by: Alex Kiernan --- Makefile.am | 1 + ci/build.sh | 5 +++++ ci/travis-build.sh | 1 + 3 files changed, 7 insertions(+) diff --git a/Makefile.am b/Makefile.am index cd04a055..673dbf88 100644 --- a/Makefile.am +++ b/Makefile.am @@ -39,6 +39,7 @@ AM_DISTCHECK_CONFIGURE_FLAGS += \ --enable-gtk-doc \ --enable-man \ --disable-maintainer-mode \ + --enable-trivial-httpd-cmdline \ $(NULL) GITIGNOREFILES = aclocal.m4 build-aux/ buildutil/*.m4 config.h.in gtk-doc.make diff --git a/ci/build.sh b/ci/build.sh index 09015074..806af050 100755 --- a/ci/build.sh +++ b/ci/build.sh @@ -22,6 +22,11 @@ case "${CONFIGOPTS:-}" in fi ;; esac +# unless libsoup is disabled, enable trivial-httpd for the tests +case "${CONFIGOPTS:-}" in + *--without-soup*) ;; + *) CONFIGOPTS="${CONFIGOPTS:-} --enable-trivial-httpd-cmdline" ;; +esac # always fail on warnings; https://github.com/ostreedev/ostree/pull/971 # NB: this disables the default set of flags from configure.ac diff --git a/ci/travis-build.sh b/ci/travis-build.sh index 3fd969bd..7c85313a 100755 --- a/ci/travis-build.sh +++ b/ci/travis-build.sh @@ -85,6 +85,7 @@ make="make -j${ci_parallel} V=1 VERBOSE=1" ../configure \ --enable-always-build-tests \ + --enable-trivial-httpd-cmdline \ ${ci_configopts} "$@" From 83d44ac20ae80d74e05d89744fd1fbd4f45b7fba Mon Sep 17 00:00:00 2001 From: Alex Kiernan Date: Thu, 5 Sep 2019 13:22:15 +0100 Subject: [PATCH 2/2] Gate ostree-trivial-httpd on BUILDOPT_TRIVIAL_HTTPD When building without --enable-trivial-httpd-cmdline, don't build or install the ostree-trivial-httpd binary. Signed-off-by: Alex Kiernan --- Makefile-ostree.am | 3 ++- configure.ac | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile-ostree.am b/Makefile-ostree.am index 76f39cad..7b53cb14 100644 --- a/Makefile-ostree.am +++ b/Makefile-ostree.am @@ -143,12 +143,13 @@ ostree_SOURCES += src/ostree/ot-builtin-pull.c endif if USE_LIBSOUP -# Eventually once we stop things from using this, we should support disabling this +if BUILDOPT_TRIVIAL_HTTPD ostree_SOURCES += src/ostree/ot-builtin-trivial-httpd.c pkglibexec_PROGRAMS += ostree-trivial-httpd ostree_trivial_httpd_SOURCES = src/ostree/ostree-trivial-httpd.c ostree_trivial_httpd_CFLAGS = $(ostree_bin_shared_cflags) $(OT_INTERNAL_SOUP_CFLAGS) ostree_trivial_httpd_LDADD = $(ostree_bin_shared_ldadd) $(OT_INTERNAL_SOUP_LIBS) +endif if !USE_CURL # This is necessary for the cookie jar bits diff --git a/configure.ac b/configure.ac index 6861afb8..e009d6b2 100644 --- a/configure.ac +++ b/configure.ac @@ -195,6 +195,9 @@ AC_ARG_ENABLE(trivial-httpd-cmdline, [Continue to support "ostree trivial-httpd" [default=no]])],, enable_trivial_httpd_cmdline=no) AM_CONDITIONAL(BUILDOPT_TRIVIAL_HTTPD, test x$enable_trivial_httpd_cmdline = xyes) +AS_IF([test x$with_soup = xno && test x$enable_trivial_httpd_cmdline = xyes], [ + AC_MSG_ERROR([trivial-httpd enabled, but libsoup is not; libsoup is needed for trivial-httpd]) +]) AM_COND_IF(BUILDOPT_TRIVIAL_HTTPD, [AC_DEFINE([BUILDOPT_ENABLE_TRIVIAL_HTTPD_CMDLINE], 1, [Define if we are enabling ostree trivial-httpd entrypoint])] )