summaryrefslogtreecommitdiff
blob: 2a8c127d0e8a54992d06db1528e07429ea26edfc (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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
From b5731b01541ebc345bffd9b57c08981196f1ad1d Mon Sep 17 00:00:00 2001
From: Sebastian Pipping <sebastian@pipping.org>
Date: Wed, 14 Mar 2012 13:40:19 +0100
Subject: [PATCH] Introduce configure options --with[out]-gs and
 --with[out]-bzip2 to allow bypassing gs/bzip2
 auto-detection

---
 configure.ac |   24 ++++++++++++++++++++----
 1 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/configure.ac b/configure.ac
index bb60d2f..e2f154d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1154,13 +1154,21 @@ AC_SUBST(Z_LIBS)
 # Check for libbzip2
 ####################
 
-have_libbzip2=yes
-if test -z "$BZIP2_LIBS"; then
+AC_ARG_WITH(gs,  [  --without-bzip2         build without bzip2 support])
+
+have_libbzip2=no
+if test "x$with_bzip2" != xno; then
+  have_libbzip2=yes
   AC_CHECK_LIB(bz2, BZ2_bzCompress,
     [AC_CHECK_HEADER(bzlib.h,
       BZIP2_LIBS='-lbz2',
       [have_libbzip2="no (libbzip2 header files not found)"])],
     [have_libbzip2="no (libbzip2 library not found)"])
+  if test "x$have_libbzip2" != xyes -a "x$with_bzip2" = xyes; then
+    AC_MSG_ERROR([
+*** Checks for bzip2 library failed. You can build without it by passing
+*** --without-bzip2 to configure but you won't be able to use compressed files then.])
+  fi
 fi
 
 AM_CONDITIONAL(HAVE_BZIP2, test "x$have_libbzip2" = xyes)
@@ -1176,13 +1184,21 @@ fi
 # Check for Ghostscript library
 ###############################
 
-have_gs=yes
-if test -z "$GS_LIBS"; then
+AC_ARG_WITH(gs,  [  --without-gs            build without Ghostscript support])
+
+have_gs=no
+if test "x$with_gs" != xno; then
+  have_gs=yes
   AC_CHECK_LIB(gs, gsapi_new_instance,
     [AC_CHECK_HEADER(ghostscript/iapi.h,
       FILE_PS='file-ps$(EXEEXT)'; GS_LIBS='-lgs',
       [have_gs="no (Ghostscript header files not found)"])],
     [have_gs="no (Ghostscript library not found)"])
+  if test "x$have_gs" != xyes -a "x$with_gs" = xyes; then
+    AC_MSG_ERROR([
+*** Checks for Ghostscript library failed. You can build without it by passing
+*** --without-gs to configure but you won't be able to use Postscript files then.])
+  fi
 fi
 
 AC_SUBST(FILE_PS)
-- 
1.7.8.5