File: fix-libzstd-detection

package info (click to toggle)
bacula 15.0.3-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 29,780 kB
  • sloc: ansic: 194,276; cpp: 41,177; sh: 28,258; python: 6,669; makefile: 5,275; perl: 3,666; sql: 1,371; java: 345; xml: 196; awk: 51; sed: 25
file content (43 lines) | stat: -rw-r--r-- 1,192 bytes parent folder | download
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
39
40
41
42
43
From 8d9669fb26bd8bce30e4c48a522d9943c110b5c2 Mon Sep 17 00:00:00 2001
From: Corey Hickey <bugfood-c@fatooh.org>
Date: Sun, 18 May 2025 19:17:33 -0700
Subject: [PATCH] fix detection of zstd
Forwarded: not-needed

This fixes an issue where if the curl lib is not found, then zstd will
not be supported.

The detection method for both curl and zstd uses a shell variable 'error'.
Unless we unset the variable afterward, the results of the curl check
carry over to the zstd check.
---
 bacula/autoconf/configure.in | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/autoconf/configure.in b/bacula/autoconf/configure.in
index 5660f69b1c..24ec76a295 100644
--- a/autoconf/configure.in
+++ b/autoconf/configure.in
@@ -982,7 +982,9 @@ AC_CHECK_LIB(curl,curl_version_info,,[error="Can't find CURL library."])
 
 if test x"${error}" == "x"; then
    support_curl=yes
-fi 
+fi
+
+unset error
 
 AC_MSG_RESULT([$support_curl])
 if test "$support_curl" = "yes"; then
@@ -1043,6 +1045,8 @@ else
     ZSTD_INC=""
 fi
 
+unset error
+
 AC_MSG_RESULT([$support_zstd])
 if test "$support_zstd" = "yes"; then
    AC_DEFINE(HAVE_ZSTD, 1, [Define if ZSTD library is available])
-- 
GitLab