Skip to content

Commit

Permalink
Merge branch 'develop' into feature/userhostnames
Browse files Browse the repository at this point in the history
  • Loading branch information
vanosg authored Dec 31, 2023
2 parents df4d2bf + 8256ee2 commit 6ae7c38
Show file tree
Hide file tree
Showing 102 changed files with 11,989 additions and 9,039 deletions.
96 changes: 39 additions & 57 deletions aclocal.m4
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,12 @@ dnl Check for a working C99 C compiler.
dnl
AC_DEFUN([EGG_CHECK_CC_C99],
[
if test "$ac_cv_prog_cc_c99" = no; then
if test "$ac_cv_prog_cc_c11" = no && test "$ac_cv_prog_cc_c99" = no; then
cat << 'EOF' >&2
configure: error:
This C compiler does not appear to have a working C99 mode.
A working C99 C compiler is required to compile Eggdrop.
This C compiler does not appear to have a working C99/C11 mode.
A working C99/C11 C compiler is required to compile Eggdrop.
EOF
exit 1
Expand Down Expand Up @@ -313,49 +313,37 @@ AC_DEFUN([EGG_FUNC_B64_NTOP],
# Check for b64_ntop. If we have b64_ntop, we assume b64_pton as well.
AC_MSG_CHECKING(for b64_ntop)
AC_TRY_LINK(
[
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <sys/types.h>
#include <netinet/in.h>
#include <resolv.h>
],
[b64_ntop(NULL, 0, NULL, 0);],
found_b64_ntop=yes,
found_b64_ntop=no
)
]], [[b64_ntop(NULL, 0, NULL, 0);]])],[found_b64_ntop=yes],[found_b64_ntop=no
])
if test "x$found_b64_ntop" = xno; then
AC_MSG_RESULT(no)
AC_MSG_CHECKING(for b64_ntop with -lresolv)
OLD_LIBS="$LIBS"
LIBS="$LIBS -lresolv"
AC_TRY_LINK(
[
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <sys/types.h>
#include <netinet/in.h>
#include <resolv.h>
],
[b64_ntop(NULL, 0, NULL, 0);],
found_b64_ntop=yes,
found_b64_ntop=no
)
]], [[b64_ntop(NULL, 0, NULL, 0);]])],[found_b64_ntop=yes],[found_b64_ntop=no
])
if test "x$found_b64_ntop" = xno; then
LIBS="$OLD_LIBS"
AC_MSG_RESULT(no)
AC_MSG_CHECKING(for b64_ntop with -lnetwork)
OLD_LIBS="$LIBS"
LIBS="-lnetwork"
AC_TRY_LINK(
[
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <sys/types.h>
#include <netinet/in.h>
#include <resolv.h>
],
[b64_ntop(NULL, 0, NULL, 0);],
found_b64_ntop=yes,
found_b64_ntop=no
)
]], [[b64_ntop(NULL, 0, NULL, 0);]])],[found_b64_ntop=yes],[found_b64_ntop=no
])
if test "x$found_b64_ntop" = xno; then
LIBS="$OLD_LIBS"
AC_MSG_RESULT(no)
Expand Down Expand Up @@ -1429,22 +1417,20 @@ if test "$enable_ipv6" = "yes"; then
if test "$egg_cv_var_have_in6_addr" = "yes"; then
# Check for in6addr_any
AC_CACHE_CHECK([for the in6addr_any constant], [egg_cv_var_have_in6addr_any], [
AC_TRY_COMPILE([
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <sys/types.h>
#include <netinet/in.h>
], [struct in6_addr i6 = in6addr_any;],
[egg_cv_var_have_in6addr_any="yes"], [egg_cv_var_have_in6addr_any="no"])
]], [[struct in6_addr i6 = in6addr_any;]])],[egg_cv_var_have_in6addr_any="yes"],[egg_cv_var_have_in6addr_any="no"])
])
if test "$egg_cv_var_have_in6addr_any" = "yes"; then
AC_DEFINE(HAVE_IN6ADDR_ANY, 1, [Define to 1 if you have the in6addr_any constant.])
fi
# Check for in6addr_loopback
AC_CACHE_CHECK([for the in6addr_loopback constant], [egg_cv_var_have_in6addr_loopback], [
AC_TRY_COMPILE([
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <sys/types.h>
#include <netinet/in.h>
], [struct in6_addr i6 = in6addr_loopback;],
[egg_cv_var_have_in6addr_loopback="yes"], [egg_cv_var_have_in6addr_loopback="no"])
]], [[struct in6_addr i6 = in6addr_loopback;]])],[egg_cv_var_have_in6addr_loopback="yes"],[egg_cv_var_have_in6addr_loopback="no"])
])
if test "$egg_cv_var_have_in6addr_loopback" = "yes"; then
AC_DEFINE(HAVE_IN6ADDR_LOOPBACK, 1, [Define to 1 if you have the in6addr_loopback constant.])
Expand Down Expand Up @@ -1530,13 +1516,10 @@ AC_DEFUN([EGG_TLS_ENABLE],
[
AC_MSG_CHECKING([whether to enable TLS support])
AC_ARG_ENABLE(tls,
[ --enable-tls enable TLS support (autodetect)],
[enable_tls="$enableval"])
AC_ARG_ENABLE(tls,
[ --disable-tls disable TLS support ], [enable_tls="$enableval"],
[enable_tls="autodetect"])
[ --disable-tls disable TLS support ], [tls_enabled="$enableval"],
[tls_enabled="$enableval"])
AC_MSG_RESULT([$enable_tls])
AC_MSG_RESULT([$tls_enabled])
])


Expand All @@ -1546,14 +1529,14 @@ AC_DEFUN(EGG_TLS_WITHSSL,
[
save_LIBS="$LIBS"
AC_ARG_WITH(sslinc, [ --with-sslinc=PATH Path to OpenSSL headers], [
if test "$enable_tls" != "no"; then
if test "$tls_enabled" != "no"; then
if test -d "$withval"; then
save_CC="$CC"
save_CPP="$CPP"
CC="$CC -I$withval"
CPP="$CPP -I$withval"
AC_CHECK_HEADERS([openssl/ssl.h openssl/x509v3.h], [sslinc="-I$withval"], [
AC_MSG_WARN([Invalid path to OpenSSL headers. $withval/openssl/ doesn't contain the required files.])
AC_MSG_ERROR([Invalid path to OpenSSL headers. $withval/openssl/ doesn't contain the required files.])
sslinc=""
break
], [[
Expand All @@ -1567,25 +1550,25 @@ AC_DEFUN(EGG_TLS_WITHSSL,
CC="$save_CC"
CPP="$save_CPP"
else
AC_MSG_WARN([Invalid path to OpenSSL headers. $withval is not a directory.])
AC_MSG_ERROR([Invalid path to OpenSSL headers. $withval is not a directory.])
fi
fi
])
AC_ARG_WITH(ssllib, [ --with-ssllib=PATH Path to OpenSSL libraries],
[
if test "$enable_tls" != "no"; then
if test "$tls_enabled" != "no"; then
if test -d "$withval"; then
AC_CHECK_LIB(crypto, X509_digest, , [havessllib="no"], [-L$withval -lssl])
AC_CHECK_LIB(ssl, SSL_accept, , [havessllib="no"], [-L$withval -lcrypto])
if test "$havessllib" = "no"; then
AC_MSG_WARN([Invalid path to OpenSSL libs. $withval doesn't contain the required files.])
AC_MSG_ERROR([Invalid path to OpenSSL libs. $withval doesn't contain the required files.])
else
AC_SUBST(SSL_LIBS, [-L$withval])
LDFLAGS="${LDFLAGS} -L$withval"
fi
else
AC_MSG_WARN([You have specified an invalid path to OpenSSL libs. $withval is not a directory.])
AC_MSG_ERROR([You have specified an invalid path to OpenSSL libs. $withval is not a directory.])
fi
fi
])
Expand All @@ -1596,8 +1579,7 @@ dnl EGG_TLS_DETECT
dnl
AC_DEFUN([EGG_TLS_DETECT],
[
tls_enabled="no"
if test "$enable_tls" != "no"; then
if test "$tls_enabled" != "no"; then
if test -z "$SSL_INCLUDES"; then
AC_CHECK_HEADERS([openssl/ssl.h openssl/x509v3.h], , [havesslinc="no"], [
#ifdef CYGWIN_HACKS
Expand All @@ -1610,11 +1592,12 @@ AC_DEFUN([EGG_TLS_DETECT],
if test -z "$SSL_LIBS"; then
AC_CHECK_LIB(crypto, X509_digest, , [havessllib="no"], [-lssl])
AC_CHECK_LIB(ssl, SSL_accept, , [havessllib="no"], [-lcrypto])
AC_CHECK_FUNCS([EVP_md5 EVP_sha1 a2i_IPADDRESS], , [[
AC_CHECK_FUNCS([EVP_sha1 a2i_IPADDRESS], , [[
havessllib="no"
break
]])
fi
AC_CHECK_FUNCS([EVP_md5])
AC_CHECK_FUNC(OPENSSL_buf2hexstr, ,
AC_CHECK_FUNC(hex_to_string,
AC_DEFINE([OPENSSL_buf2hexstr], [hex_to_string], [Define this to hex_to_string when using OpenSSL < 1.1.0])
Expand All @@ -1631,20 +1614,20 @@ AC_DEFUN([EGG_TLS_DETECT],
break
]])
)
if test "$enable_tls" = "yes"; then
if test "$havesslinc" = "no"; then
AC_MSG_WARN([Cannot find OpenSSL headers.])
AC_MSG_WARN([Please specify the path to the openssl include dir using --with-sslinc=path])
fi
if test "$havessllib" = "no"; then
AC_MSG_WARN([Cannot find OpenSSL libraries.])
AC_MSG_WARN([Please specify the path to libssl and libcrypto using --with-ssllib=path])
fi
if test "$havesslinc" = "no"; then
AC_MSG_WARN([Cannot find OpenSSL headers.])
AC_MSG_WARN([Please specify the path to the openssl include dir using --with-sslinc=path])
fi
if test "$havessllib" = "no"; then
AC_MSG_WARN([Cannot find OpenSSL libraries.])
AC_MSG_WARN([Please specify the path to libssl and libcrypto using --with-ssllib=path])
fi
AC_MSG_CHECKING([for OpenSSL])
if test "$havesslinc" = "no" || test "$havessllib" = "no"; then
AC_MSG_RESULT([no (make sure you have version 0.9.8 or higher installed)])
LIBS="$save_LIBS"
AC_MSG_RESULT([no])
AC_MSG_RESULT([* We tried, but couldn't find TLS libraries. If installed, please specify their paths using the configure flags above])
AC_MSG_RESULT([* While not recommended, you can continue without TLS protection by specifying the --disable-tls configure flag])
AC_MSG_ERROR([TLS Libraries not found])
else
AC_MSG_RESULT([yes])
if test "$EGG_CYGWIN" = "yes"; then
Expand All @@ -1659,7 +1642,6 @@ AC_DEFUN([EGG_TLS_DETECT],
)
dnl EVP_PKEY_get1_EC_KEY: OpenSSL without EC (SunOS 5.11 Solaris 11.3 I love you Oracle)
AC_CHECK_FUNCS([EVP_PKEY_get1_EC_KEY])
tls_enabled="yes"
EGG_MD5_COMPAT
fi
fi
Expand Down
Loading

0 comments on commit 6ae7c38

Please sign in to comment.