aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-core/swupd-client/swupd-client-2.87/Right-usage-of-AC_ARG_ENABLE-on-bzip2.patch
blob: e5b53efac7d7b375a1bcb01bb01b52e570a82a8a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
From d80ae9954c5e5b720766274249dbf5309b7c70a9 Mon Sep 17 00:00:00 2001
From: Amarnath Valluri <amarnath.valluri@intel.com>
Date: Wed, 13 Jan 2016 15:46:19 +0200
Subject: [PATCH] Right usage of AC_ARG_ENABLE on bzip2

Upstream-Status: Pending[Not submitted]

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 configure.ac | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/configure.ac b/configure.ac
index f94a17d..b11ef0a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -20,11 +20,13 @@ AC_CONFIG_HEADERS([config.h])
 PKG_CHECK_MODULES([lzma], [liblzma])
 PKG_CHECK_MODULES([zlib], [zlib])
 AC_ARG_ENABLE(
-	bzip2,
-	AS_HELP_STRING([--disable-bzip2],[Do not use bzip2 compression (uses bzip2 by default)]),
-	AC_DEFINE(SWUPD_WITHOUT_BZIP2,1,[Do not use bzip2 compression]) ,
-	AC_DEFINE(SWUPD_WITH_BZIP2,1,[Use bzip2 compression])
-	AC_CHECK_LIB([bz2], [BZ2_bzBuffToBuffCompress], [], [AC_MSG_ERROR([the libbz2 library is missing])])
+	[bzip2],
+	AS_HELP_STRING([--disable-bzip2],[Do not use bzip2 compression (uses bzip2 by default)])
+)
+AS_IF([test "x$enable_bzip2" = "xyes" ],
+  [AC_DEFINE(SWUPD_WITH_BZIP2,1,[Use bzip2 compression])
+	 AC_CHECK_LIB([bz2], [BZ2_bzBuffToBuffCompress], [], [AC_MSG_ERROR([the libbz2 library is missing])])],
+  [AC_DEFINE(SWUPD_WITHOUT_BZIP2,1,[Do not use bzip2 compression])]
 )
 
 AC_ARG_WITH([systemdsystemunitdir], AS_HELP_STRING([--with-systemdsystemunitdir=DIR],
-- 
2.1.4