blob: 362b2f36ab5167f502ea0f1b22849fee665e1ee7 [file] [log] [blame]
Brad Bishop0a921262019-09-24 07:40:45 -04001From 2629328b39ae117876f4854409c2231220a30b9c Mon Sep 17 00:00:00 2001
2From: Alex Kiernan <alex.kiernan@gmail.com>
3Date: Thu, 5 Sep 2019 13:22:15 +0100
4Subject: [PATCH 2/2] Gate ostree-trivial-httpd on BUILDOPT_TRIVIAL_HTTPD
5
6When building without --enable-trivial-httpd-cmdline, don't build or install
7the ostree-trivial-httpd binary.
8
9Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
10Upstream-Status: Submitted [https://github.com/ostreedev/ostree/pull/1912]
11---
12 Makefile-ostree.am | 3 ++-
13 configure.ac | 3 +++
14 2 files changed, 5 insertions(+), 1 deletion(-)
15
16diff --git a/Makefile-ostree.am b/Makefile-ostree.am
17index 76f39cad4b74..7b53cb148960 100644
18--- a/Makefile-ostree.am
19+++ b/Makefile-ostree.am
20@@ -143,12 +143,13 @@ ostree_SOURCES += src/ostree/ot-builtin-pull.c
21 endif
22
23 if USE_LIBSOUP
24-# Eventually once we stop things from using this, we should support disabling this
25+if BUILDOPT_TRIVIAL_HTTPD
26 ostree_SOURCES += src/ostree/ot-builtin-trivial-httpd.c
27 pkglibexec_PROGRAMS += ostree-trivial-httpd
28 ostree_trivial_httpd_SOURCES = src/ostree/ostree-trivial-httpd.c
29 ostree_trivial_httpd_CFLAGS = $(ostree_bin_shared_cflags) $(OT_INTERNAL_SOUP_CFLAGS)
30 ostree_trivial_httpd_LDADD = $(ostree_bin_shared_ldadd) $(OT_INTERNAL_SOUP_LIBS)
31+endif
32
33 if !USE_CURL
34 # This is necessary for the cookie jar bits
35diff --git a/configure.ac b/configure.ac
36index 069bab01752e..ffc67980d507 100644
37--- a/configure.ac
38+++ b/configure.ac
39@@ -192,6 +192,9 @@ AC_ARG_ENABLE(trivial-httpd-cmdline,
40 [Continue to support "ostree trivial-httpd" [default=no]])],,
41 enable_trivial_httpd_cmdline=no)
42 AM_CONDITIONAL(BUILDOPT_TRIVIAL_HTTPD, test x$enable_trivial_httpd_cmdline = xyes)
43+AS_IF([test x$with_soup = xno && test x$enable_trivial_httpd_cmdline = xyes], [
44+ AC_MSG_ERROR([trivial-httpd enabled, but libsoup is not; libsoup is needed for trivial-httpd])
45+])
46 AM_COND_IF(BUILDOPT_TRIVIAL_HTTPD,
47 [AC_DEFINE([BUILDOPT_ENABLE_TRIVIAL_HTTPD_CMDLINE], 1, [Define if we are enabling ostree trivial-httpd entrypoint])]
48 )
49--
502.17.1
51