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
|
From: Nathan Phillip Brink <ohnobinki@ohnopublishing.net>
Date: Thu, 12 May 2011 02:34:49 -0400
Subject: [PATCH] Add --without-openssl to ./configure
Make dependency on openssl not necessarily automagic. Now
--with-openssl will cause ./configure to die if openssl cannot be
found. --with-openssl=auto or no argument uses the old automagic
behavior. (Backported to xchat-gnome-0.26.1).
---
configure.ac | 22 +++++++++++++++-------
1 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/configure.ac b/configure.ac
index 62c0d8f..e2fed71 100644
--- a/configure.ac
+++ b/configure.ac
@@ -283,15 +283,21 @@ if test "x$have_tcl" != "xno"; then
fi
# openssl
-PKG_CHECK_MODULES([OPENSSL], [openssl], openssl=yes, openssl=no)
-if test "x$openssl" = xyes; then
- AC_SUBST([OPENSSL_CFLAGS])
- AC_SUBST([OPENSSL_LIBS])
- AC_DEFINE(USE_OPENSSL, [], [Whether to use OpenSSL])
-else
- AC_MSG_WARN([Library requirements (openssl) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.])
-fi
-AM_CONDITIONAL(USE_OPENSSL, test "x$openssl" = "xyes")
+AC_ARG_WITH([openssl], [AS_HELP_STRING([--without-openssl], [Disable SSL support using openssl])],
+ [], [with_openssl=auto])
+AS_IF([test "x$with_openssl" != "xno"],
+ [PKG_CHECK_MODULES([OPENSSL], [openssl],
+ [AC_DEFINE([USE_OPENSSL], [], [Whether to use OpenSSL])
+ with_openssl=yes
+ ],
+ [openssl_not_found_msg="Library requirements (openssl) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them."
+ AS_IF([test "x$with_openssl" != "xauto"],
+ [AC_MSG_ERROR([$openssl_not_found_msg (An error because --with-openssl was specified).])],
+ [AC_MSG_WARN([$openssl_not_found_msg])])
+ with_openssl=no
+ ])
+ ])
+AM_CONDITIONAL([USE_OPENSSL], [test "x$with_openssl" = "xyes"])
# i18n
IT_PROG_INTLTOOL([0.40.0])
|