From e0c2ccd99bc6dd2c7ce45dfb465dd286947aabf9 Mon Sep 17 00:00:00 2001 From: Bram Matthys Date: Sat, 25 May 2019 11:27:53 +0200 Subject: [PATCH] Remove unused configure checks: HAVE_C99_VARLEN_ARRAY, HAVE_RAND_EGD, and an AC_SUBST for MKPASSWDLIBS. --- configure | 85 ---------------------------------------------- configure.ac | 23 ++----------- include/setup.h.in | 6 ---- 3 files changed, 2 insertions(+), 112 deletions(-) diff --git a/configure b/configure index b79dd3231..b577b4054 100755 --- a/configure +++ b/configure @@ -671,7 +671,6 @@ HARDEN_BINLDFLAGS HARDEN_BINCFLAGS HARDEN_LDFLAGS HARDEN_CFLAGS -MKPASSWDLIBS OBJEXT EXEEXT ac_ct_CC @@ -3789,7 +3788,6 @@ if test "x$ac_cv_lib_descrypt_crypt" = xyes; then : $as_echo "#define HAVE_CRYPT /**/" >>confdefs.h IRCDLIBS="$IRCDLIBS-ldescrypt " - MKPASSWDLIBS="-ldescrypt" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for crypt in -lcrypt" >&5 $as_echo_n "checking for crypt in -lcrypt... " >&6; } @@ -3832,7 +3830,6 @@ if test "x$ac_cv_lib_crypt_crypt" = xyes; then : $as_echo "#define HAVE_CRYPT /**/" >>confdefs.h IRCDLIBS="$IRCDLIBS-lcrypt " - MKPASSWDLIBS="-lcrypt" fi fi @@ -3919,50 +3916,6 @@ if test "x$ac_cv_lib_nsl_inet_ntoa" = xyes; then : INETLIB="-lnsl" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for RAND_egd in -lcrypto" >&5 -$as_echo_n "checking for RAND_egd in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_RAND_egd+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lcrypto $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char RAND_egd (); -int -main () -{ -return RAND_egd (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_crypto_RAND_egd=yes -else - ac_cv_lib_crypto_RAND_egd=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_RAND_egd" >&5 -$as_echo "$ac_cv_lib_crypto_RAND_egd" >&6; } -if test "x$ac_cv_lib_crypto_RAND_egd" = xyes; then : - -$as_echo "#define HAVE_RAND_EGD 1" >>confdefs.h - -fi - - - # We want to check for compiler flag support, but there is no way to make # clang's "argument unused" warning fatal. So we invoke the compiler through a @@ -7617,44 +7570,6 @@ $as_echo "#define HAVE_INET_NTOP /**/" >>confdefs.h fi done -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if C99 variable length arrays are supported" >&5 -$as_echo_n "checking if C99 variable length arrays are supported... " >&6; } -if ${ac_cv_varlen_arrays+:} false; then : - $as_echo_n "(cached) " >&6 -else - -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - -int main() { -int i = 5; -int a[i]; -a[0] = 1; -return 0; -} - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_varlen_arrays=yes -else - ac_cv_varlen_arrays=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_varlen_arrays" >&5 -$as_echo "$ac_cv_varlen_arrays" >&6; } -if test "$ac_cv_varlen_arrays" = "yes" ; then - -$as_echo "#define HAVE_C99_VARLEN_ARRAY /**/" >>confdefs.h - -fi for ac_func in setrlimit do : diff --git a/configure.ac b/configure.ac index a21abc652..78873ea0a 100644 --- a/configure.ac +++ b/configure.ac @@ -70,22 +70,16 @@ AC_PATH_PROG(PKGCONFIG, pkg-config) dnl Checks for libraries. AC_CHECK_LIB(descrypt, crypt, [AC_DEFINE([HAVE_CRYPT], [], [Define if you have crypt]) - IRCDLIBS="$IRCDLIBS-ldescrypt " - MKPASSWDLIBS="-ldescrypt"], + IRCDLIBS="$IRCDLIBS-ldescrypt "], [AC_CHECK_LIB(crypt, crypt, [AC_DEFINE([HAVE_CRYPT], [], [Define if you have crypt]) - IRCDLIBS="$IRCDLIBS-lcrypt " - MKPASSWDLIBS="-lcrypt"])]) + IRCDLIBS="$IRCDLIBS-lcrypt "])]) AC_CHECK_LIB(socket, socket, [IRCDLIBS="$IRCDLIBS-lsocket " SOCKLIB="-lsocket"]) AC_CHECK_LIB(nsl, inet_ntoa, [IRCDLIBS="$IRCDLIBS-lnsl " INETLIB="-lnsl"]) -AC_CHECK_LIB(crypto, RAND_egd, - AC_DEFINE(HAVE_RAND_EGD, 1, [Define if the libcrypto has RAND_egd])) - -AC_SUBST(MKPASSWDLIBS) dnl HARDENING START dnl This is taken from https://github.com/kmcallister/autoharden @@ -464,19 +458,6 @@ AC_CHECK_FUNCS(inet_pton, AC_DEFINE([HAVE_INET_PTON], [], [Define if you have inet_pton])) AC_CHECK_FUNCS(inet_ntop, AC_DEFINE([HAVE_INET_NTOP], [], [Define if you have inet_ntop])) -dnl Check if it supports C99 style variable length arrays -AC_CACHE_CHECK([if C99 variable length arrays are supported], [ac_cv_varlen_arrays], [ -AC_TRY_COMPILE(,[ -int main() { -int i = 5; -int a[i]; -a[0] = 1; -return 0; -}], ac_cv_varlen_arrays=yes, ac_cv_varlen_arrays=no) -]) -if test "$ac_cv_varlen_arrays" = "yes" ; then - AC_DEFINE([HAVE_C99_VARLEN_ARRAY], [], [Define if you have a compiler with C99 variable length array support]) -fi AC_CHECK_FUNCS([setrlimit]) AC_FUNC_VPRINTF diff --git a/include/setup.h.in b/include/setup.h.in index dc21042a2..3b6565428 100644 --- a/include/setup.h.in +++ b/include/setup.h.in @@ -52,9 +52,6 @@ /* Define to 1 if you have the `bzero' function. */ #undef HAVE_BZERO -/* Define if you have a compiler with C99 variable length array support */ -#undef HAVE_C99_VARLEN_ARRAY - /* Define if you have crypt */ #undef HAVE_CRYPT @@ -127,9 +124,6 @@ /* Have PTHREAD_PRIO_INHERIT. */ #undef HAVE_PTHREAD_PRIO_INHERIT -/* Define if the libcrypto has RAND_egd */ -#undef HAVE_RAND_EGD - /* Define if you have setproctitle */ #undef HAVE_SETPROCTITLE