/[svn]/ircd-hybrid/branches/8.2.x/m4/ax_arg_openssl.m4
ViewVC logotype

Annotation of /ircd-hybrid/branches/8.2.x/m4/ax_arg_openssl.m4

Parent Directory Parent Directory | Revision Log Revision Log


Revision 9163 - (hide annotations)
Fri Jan 17 19:07:00 2020 UTC (2 months, 2 weeks ago) by michael
File size: 2935 byte(s)
- ax_arg_openssl.m4: minor correction to AC_MSG_CHECKING usage

1 michael 4363 AC_DEFUN([AX_ARG_OPENSSL], [
2 michael 2481 AC_ARG_ENABLE(openssl,
3 michael 4366 [ --enable-openssl[=DIR] Enable LibreSSL/OpenSSL support (DIR optional).
4     --disable-openssl Disable LibreSSL/OpenSSL support. ],
5 michael 2481 [ cf_enable_openssl=$enableval ],
6     [ cf_enable_openssl="auto" ])
7 michael 4366 AC_MSG_CHECKING([for LibreSSL/OpenSSL])
8 michael 2481 if test "$cf_enable_openssl" != "no"; then
9     cf_openssl_basedir=""
10     if test "$cf_enable_openssl" != "auto" &&
11     test "$cf_enable_openssl" != "yes"; then
12     dnl Support for --enable-openssl=/some/place
13     cf_openssl_basedir="${cf_enable_openssl}"
14     else
15     dnl Do the auto-probe here. Check some common directory paths.
16     for dirs in /usr/local/ssl /usr/pkg /usr/local /usr/lib /usr/lib/ssl\
17     /opt /opt/openssl /usr/local/openssl; do
18     if test -f "${dirs}/include/openssl/opensslv.h"; then
19     cf_openssl_basedir="${dirs}"
20     break
21     fi
22     done
23     unset dirs
24     fi
25    
26     dnl Now check cf_openssl_found to see if we found anything.
27     if test ! -z "$cf_openssl_basedir"; then
28     if test -f "${cf_openssl_basedir}/include/openssl/opensslv.h"; then
29     CPPFLAGS="-I${cf_openssl_basedir}/include $CPPFLAGS"
30     LDFLAGS="-L${cf_openssl_basedir}/lib $LDFLAGS"
31     else
32     dnl OpenSSL wasn't found in the directory specified. Naughty
33     dnl administrator...
34     cf_openssl_basedir=""
35     fi
36     else
37     dnl Check for stock FreeBSD 4.x and 5.x systems, since their files
38     dnl are in /usr/include and /usr/lib. In this case, we don't want to
39     dnl change INCLUDES or LIBS, but still want to enable OpenSSL.
40     dnl We can't do this check above, because some people want two versions
41     dnl of OpenSSL installed (stock FreeBSD 4.x/5.x and /usr/local/ssl)
42     dnl and they want /usr/local/ssl to have preference.
43     if test -f "/usr/include/openssl/opensslv.h"; then
44     cf_openssl_basedir="/usr"
45     fi
46     fi
47    
48     dnl If we have a basedir defined, then everything is okay. Otherwise,
49     dnl we have a problem.
50     if test ! -z "$cf_openssl_basedir"; then
51     AC_MSG_RESULT([$cf_openssl_basedir])
52     cf_enable_openssl="yes"
53     else
54     AC_MSG_RESULT([not found. Please check your path.])
55     cf_enable_openssl="no"
56     fi
57     unset cf_openssl_basedir
58     else
59     dnl If --disable-openssl was specified
60     AC_MSG_RESULT([disabled])
61     fi
62    
63     AS_IF([test "$cf_enable_openssl" != "no"],
64 michael 9163 [AC_MSG_CHECKING([for LibreSSL, or OpenSSL 1.1.1 and above])
65 michael 2481 AC_RUN_IFELSE([
66     AC_LANG_PROGRAM([
67     #include <openssl/opensslv.h>
68     #include <stdlib.h>],
69 michael 9130 [[ exit(!(OPENSSL_VERSION_NUMBER >= 0x1010100fL)); ]])],
70 michael 2481 [cf_openssl_version_ok=yes],
71     [cf_openssl_version_ok=no],
72     [cf_openssl_version_ok=no])
73    
74     AS_IF([test "$cf_openssl_version_ok" = "yes"],
75     [AC_MSG_RESULT(found)
76    
77     AC_CHECK_LIB(crypto, RSA_free)
78     AS_IF([test "$ac_cv_lib_crypto_RSA_free" = "yes"],
79     [AC_CHECK_LIB(ssl, SSL_connect)])
80 michael 4366 ],[AC_MSG_RESULT(no - LibreSSL/OpenSSL support disabled)
81 michael 2481 cf_enable_openssl="no"])])
82     ])

Properties

Name Value
svn:eol-style native

svnadmin@ircd-hybrid.org
ViewVC Help
Powered by ViewVC 1.1.26