From d41d1d126239f3a8fc80f54931e8135677b231b0 Mon Sep 17 00:00:00 2001 From: Artjoms Rimdjonoks Date: Wed, 10 Aug 2022 13:49:03 +0300 Subject: [PATCH] .......... [DEV-2241] run autoupdate on m4 files --- m4/ax_lib_mysql.m4 | 64 ++++++++++++++--------------------------- m4/ax_lib_postgresql.m4 | 12 +++----- m4/iconv.m4 | 9 ++---- m4/ldap.m4 | 8 +++--- m4/libevent.m4 | 9 ++---- m4/libgnutls.m4 | 9 ++---- m4/libmodbus.m4 | 18 ++++-------- m4/libopenssl.m4 | 18 ++++-------- m4/libssh.m4 | 9 ++---- m4/libssh2.m4 | 9 ++---- m4/netsnmp.m4 | 34 +++++++++------------- m4/pcre.m4 | 9 ++---- m4/pcre2.m4 | 9 ++---- m4/pthread.m4 | 9 ++---- m4/resolv.m4 | 11 +++---- m4/zlib.m4 | 9 ++---- tests/conf_tests.m4 | 9 ++---- 17 files changed, 90 insertions(+), 165 deletions(-) diff --git a/m4/ax_lib_mysql.m4 b/m4/ax_lib_mysql.m4 index 68555933fdc5..639c25d28592 100644 --- a/m4/ax_lib_mysql.m4 +++ b/m4/ax_lib_mysql.m4 @@ -49,49 +49,39 @@ AC_DEFUN([LIBMYSQL_OPTIONS_TRY], [ AC_MSG_CHECKING([for MySQL init options function]) - AC_TRY_LINK( -[ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include -], -[ +]], [[ MYSQL *mysql; mysql_options(mysql, MYSQL_INIT_COMMAND, "set @@session.auto_increment_offset=1"); -], - AC_DEFINE_UNQUOTED([MYSQL_OPTIONS], [mysql_options], [Define mysql options]) - AC_DEFINE_UNQUOTED([MYSQL_OPTIONS_ARGS_VOID_CAST], [], [Define void cast for mysql options args]) +]])],[AC_DEFINE_UNQUOTED(MYSQL_OPTIONS, mysql_options, Define mysql options) + AC_DEFINE_UNQUOTED(MYSQL_OPTIONS_ARGS_VOID_CAST, , Define void cast for mysql options args) found_mysql_options="yes" - AC_MSG_RESULT(yes), - AC_MSG_RESULT(no)) + AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)]) ]) AC_DEFUN([LIBMARIADB_OPTIONS_TRY], [ AC_MSG_CHECKING([for MariaDB init options function]) - AC_TRY_LINK( -[ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include -], -[ +]], [[ MYSQL *mysql; mysql_optionsv(mysql, MYSQL_INIT_COMMAND, (void *)"set @@session.auto_increment_offset=1"); -], - AC_DEFINE_UNQUOTED([MYSQL_OPTIONS], [mysql_optionsv], [Define mysql options]) - AC_DEFINE_UNQUOTED([MYSQL_OPTIONS_ARGS_VOID_CAST], [(void *)], [Define void cast for mysql options args]) +]])],[AC_DEFINE_UNQUOTED(MYSQL_OPTIONS, mysql_optionsv, Define mysql options) + AC_DEFINE_UNQUOTED(MYSQL_OPTIONS_ARGS_VOID_CAST, (void *), Define void cast for mysql options args) found_mariadb_options="yes" - AC_MSG_RESULT(yes), - AC_MSG_RESULT(no)) + AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)]) ]) AC_DEFUN([LIBMYSQL_TLS_TRY_LINK], [ AC_MSG_CHECKING([for TLS support in MySQL library]) - AC_TRY_LINK( -[ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include -], -[ +]], [[ unsigned int mysql_tls_mode; MYSQL *mysql; @@ -108,38 +98,30 @@ AC_DEFUN([LIBMYSQL_TLS_TRY_LINK], mysql_options(mysql, MYSQL_OPT_SSL_KEY, ""); mysql_options(mysql, MYSQL_OPT_SSL_CERT, ""); mysql_options(mysql, MYSQL_OPT_SSL_CIPHER, ""); -], - AC_DEFINE([HAVE_MYSQL_TLS], [1], [Define to 1 if TLS is supported in MySQL library]) +]])],[AC_DEFINE(HAVE_MYSQL_TLS, 1, Define to 1 if TLS is supported in MySQL library) found_mysql_tls="yes" - AC_MSG_RESULT(yes), - AC_MSG_RESULT(no)) + AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)]) ]) AC_DEFUN([LIBMYSQL_TLS_CIPHERS_TRY_LINK], [ AC_MSG_CHECKING([for TLS ciphersuites in MySQL library]) - AC_TRY_LINK( -[ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include -], -[ +]], [[ MYSQL *mysql; mysql_options(mysql, MYSQL_OPT_TLS_CIPHERSUITES, ""); -], - AC_DEFINE([HAVE_MYSQL_TLS_CIPHERSUITES], [1], [Define to 1 if TLS ciphersuites are supported in MySQL library]) - AC_MSG_RESULT(yes), - AC_MSG_RESULT(no)) +]])],[AC_DEFINE(HAVE_MYSQL_TLS_CIPHERSUITES, 1, Define to 1 if TLS ciphersuites are supported in MySQL library) + AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)]) ]) AC_DEFUN([LIBMARIADB_TLS_TRY_LINK], [ AC_MSG_CHECKING([for TLS support in MariaDB library]) - AC_TRY_LINK( -[ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include -], -[ +]], [[ MYSQL *mysql; mysql_optionsv(mysql, MYSQL_OPT_SSL_ENFORCE, (void *)""); @@ -148,11 +130,9 @@ AC_DEFUN([LIBMARIADB_TLS_TRY_LINK], mysql_optionsv(mysql, MYSQL_OPT_SSL_KEY, (void *)""); mysql_optionsv(mysql, MYSQL_OPT_SSL_CERT, (void *)""); mysql_optionsv(mysql, MYSQL_OPT_SSL_CIPHER, (void *)""); -], - AC_DEFINE([HAVE_MARIADB_TLS], [1], [Define to 1 if TLS is supported in MariaDB library]) +]])],[AC_DEFINE(HAVE_MARIADB_TLS, 1, Define to 1 if TLS is supported in MariaDB library) found_mariadb_tls="yes" - AC_MSG_RESULT(yes), - AC_MSG_RESULT(no)) + AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)]) ]) AC_DEFUN([AX_LIB_MYSQL], diff --git a/m4/ax_lib_postgresql.m4 b/m4/ax_lib_postgresql.m4 index 005021a14ed1..087ea0047127 100644 --- a/m4/ax_lib_postgresql.m4 +++ b/m4/ax_lib_postgresql.m4 @@ -99,18 +99,14 @@ AC_DEFUN([AX_LIB_POSTGRESQL], LIBS="${LIBS} ${POSTGRESQL_LIBS}" AC_MSG_CHECKING([for PostgreSQL libraries]) - AC_TRY_LINK( -[ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include -], -[ +]], [[ PGconn *conn; conn = PQsetdbLogin(NULL, NULL, NULL, NULL, NULL, NULL, NULL); -], - AC_DEFINE([HAVE_POSTGRESQL], [1], [Define to 1 if PostgreSQL libraries are available]) +]])],[AC_DEFINE(HAVE_POSTGRESQL, 1, Define to 1 if PostgreSQL libraries are available) found_postgresql="yes" - AC_MSG_RESULT(yes), - AC_MSG_RESULT(no)) + AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)]) CFLAGS="${_save_postgresql_cflags}" LDFLAGS="${_save_postgresql_ldflags}" diff --git a/m4/iconv.m4 b/m4/iconv.m4 index af6de97156b7..e088116fdf8b 100644 --- a/m4/iconv.m4 +++ b/m4/iconv.m4 @@ -16,17 +16,14 @@ AC_DEFUN([LIBICONV_TRY_LINK], [ found_iconv=$1 -AC_TRY_LINK( -[ +AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include #include -], -[ +]], [[ iconv_t cd = iconv_open("",""); iconv(cd, NULL, NULL, NULL, NULL); iconv_close(cd); -], -found_iconv="yes") +]])],[found_iconv="yes"],[]) ])dnl AC_DEFUN([LIBICONV_CHECK_CONFIG], diff --git a/m4/ldap.m4 b/m4/ldap.m4 index a4752809e461..e7659bdd5a2f 100644 --- a/m4/ldap.m4 +++ b/m4/ldap.m4 @@ -29,18 +29,18 @@ CPPFLAGS="$CPPFLAGS $3" CFLAGS="$CFLAGS $4" ldap_link="no" -AC_TRY_LINK([ +AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include #include #include #include -],[ +]], [[ printf("%p,%p", ldap_initialize, ldap_str2attributetype); printf("%p", ber_free); return 0; -],[ +]])],[ ldap_link="yes" -]) +],[]) CPPFLAGS="$_save_ldap_cppflags" CFLAGS="$_save_ldap_cflags" diff --git a/m4/libevent.m4 b/m4/libevent.m4 index b81b9d37efd9..c07a30e62c4d 100644 --- a/m4/libevent.m4 +++ b/m4/libevent.m4 @@ -15,15 +15,12 @@ AC_DEFUN([LIBEVENT_TRY_LINK], [ -AC_TRY_LINK( -[ +AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include #include -], -[ +]], [[ event_init(); -], -found_libevent="yes") +]])],[found_libevent="yes"],[]) ])dnl AC_DEFUN([LIBEVENT_CHECK_CONFIG], diff --git a/m4/libgnutls.m4 b/m4/libgnutls.m4 index 12442327fea4..de211f850fed 100644 --- a/m4/libgnutls.m4 +++ b/m4/libgnutls.m4 @@ -19,14 +19,11 @@ AC_DEFUN([LIBGNUTLS_TRY_LINK], [ -AC_TRY_LINK( -[ +AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include -], -[ +]], [[ gnutls_global_init(); -], -found_gnutls="yes",) +]])],[found_gnutls="yes"],[]) ])dnl AC_DEFUN([LIBGNUTLS_ACCEPT_VERSION], diff --git a/m4/libmodbus.m4 b/m4/libmodbus.m4 index 295717e300cd..0484f40dd50c 100644 --- a/m4/libmodbus.m4 +++ b/m4/libmodbus.m4 @@ -20,30 +20,24 @@ AC_DEFUN([LIBMODBUS30_TRY_LINK], [ -AC_TRY_LINK( -[ +AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include "modbus.h" -], -[ +]], [[ modbus_t *mdb_ctx; mdb_ctx = modbus_new_tcp("127.0.0.1", 502); modbus_set_response_timeout(mdb_ctx, NULL); -], -found_libmodbus="30",) +]])],[found_libmodbus="30"],[]) ])dnl AC_DEFUN([LIBMODBUS31_TRY_LINK], [ -AC_TRY_LINK( -[ +AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include "modbus.h" -], -[ +]], [[ modbus_t *mdb_ctx; mdb_ctx = modbus_new_tcp("127.0.0.1", 502); modbus_set_response_timeout(mdb_ctx, 1, 0) -], -found_libmodbus="31",) +]])],[found_libmodbus="31"],[]) ])dnl AC_DEFUN([LIBMODBUS_ACCEPT_VERSION], diff --git a/m4/libopenssl.m4 b/m4/libopenssl.m4 index 8d9add9414f1..bcde3b5b02ed 100644 --- a/m4/libopenssl.m4 +++ b/m4/libopenssl.m4 @@ -19,35 +19,29 @@ AC_DEFUN([LIBOPENSSL_TRY_LINK], [ -AC_TRY_LINK( -[ +AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include #include -], -[ +]], [[ /* check that both libssl and libcrypto are available */ SSL *ssl = NULL; SSL_connect(ssl); /* a function from libssl, present in both OpenSSL 1.0.1 and 1.1.0 */ BIO_new(BIO_s_mem()); /* a function from libcrypto */ -], -found_openssl="yes",) +]])],[found_openssl="yes"],[]) ])dnl AC_DEFUN([LIBOPENSSL_TRY_LINK_PSK], [ -AC_TRY_LINK( -[ +AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include -], -[ +]], [[ /* check if OPENSSL_NO_PSK is defined */ #ifdef OPENSSL_NO_PSK # error "OPENSSL_NO_PSK is defined. PSK support will not be available." #endif -], -found_openssl_with_psk="yes",) +]])],[found_openssl_with_psk="yes"],[]) ])dnl AC_DEFUN([LIBOPENSSL_ACCEPT_VERSION], diff --git a/m4/libssh.m4 b/m4/libssh.m4 index c07015edefb2..657ec208b461 100644 --- a/m4/libssh.m4 +++ b/m4/libssh.m4 @@ -20,15 +20,12 @@ AC_DEFUN([LIBSSH_TRY_LINK], [ -AC_TRY_LINK( -[ +AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include -], -[ +]], [[ ssh_session my_ssh_session; my_ssh_session = ssh_new(); -], -found_ssh="yes",) +]])],[found_ssh="yes"],[]) ])dnl AC_DEFUN([LIBSSH_ACCEPT_VERSION], diff --git a/m4/libssh2.m4 b/m4/libssh2.m4 index 7fda01b1802b..eebe9700265e 100644 --- a/m4/libssh2.m4 +++ b/m4/libssh2.m4 @@ -20,15 +20,12 @@ AC_DEFUN([LIBSSH2_TRY_LINK], [ -AC_TRY_LINK( -[ +AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include -], -[ +]], [[ LIBSSH2_SESSION *session; session = libssh2_session_init(); -], -found_ssh2="yes",) +]])],[found_ssh2="yes"],[]) ])dnl AC_DEFUN([LIBSSH2_ACCEPT_VERSION], diff --git a/m4/netsnmp.m4 b/m4/netsnmp.m4 index 38b3f2c8bc6a..c9887c2d7f9f 100644 --- a/m4/netsnmp.m4 +++ b/m4/netsnmp.m4 @@ -158,13 +158,13 @@ AS_HELP_STRING([--with-net-snmp@<:@=ARG@:>@], dnl Check for SHA224/256/384/512 protocol support for auth AC_MSG_CHECKING(for strong SHA auth protocol support) - AC_TRY_LINK([ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include #include - ],[ + ]], [[ struct snmp_session session; session.securityAuthProto = usmHMAC384SHA512AuthProtocol; - ],[ + ]])],[ AC_DEFINE(HAVE_NETSNMP_STRONG_AUTH, 1, [Define to 1 if strong SHA auth protocols are supported.]) AC_MSG_RESULT(yes) ],[ @@ -173,13 +173,13 @@ session.securityAuthProto = usmHMAC384SHA512AuthProtocol; dnl Check for AES192/256 protocol support for privacy AC_MSG_CHECKING(for strong AES privacy protocol support) - AC_TRY_LINK([ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include #include - ],[ + ]], [[ struct snmp_session session; session.securityPrivProto = usmAES256PrivProtocol; - ],[ + ]])],[ AC_DEFINE(HAVE_NETSNMP_STRONG_PRIV, 1, [Define to 1 if strong AES priv protocols are supported.]) AC_MSG_RESULT(yes) ],[ @@ -188,28 +188,22 @@ session.securityPrivProto = usmAES256PrivProtocol; dnl Check for localname in struct snmp_session AC_MSG_CHECKING(for localname in struct snmp_session) - AC_TRY_COMPILE([ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include -#include ], - [ +#include ]], [[ struct snmp_session session; session.localname = ""; - ], - AC_DEFINE(HAVE_NETSNMP_SESSION_LOCALNAME, 1, [Define to 1 if 'session.localname' exist.]) - AC_MSG_RESULT(yes), - AC_MSG_RESULT(no)) + ]])],[AC_DEFINE(HAVE_NETSNMP_SESSION_LOCALNAME, 1, Define to 1 if 'session.localname' exist.) + AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)]) - AC_TRY_COMPILE([ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include -#include ], - [ +#include ]], [[ struct snmp_session session; session.securityPrivProto = usmDESPrivProtocol; - ], - AC_DEFINE(HAVE_NETSNMP_SESSION_DES, 1, [Define to 1 if 'usmDESPrivProtocol' exist.]) - AC_MSG_RESULT(yes), - AC_MSG_RESULT(no)) + ]])],[AC_DEFINE(HAVE_NETSNMP_SESSION_DES, 1, Define to 1 if 'usmDESPrivProtocol' exist.) + AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)]) CFLAGS="$_save_netsnmp_cflags" LDFLAGS="$_save_netsnmp_ldflags" diff --git a/m4/pcre.m4 b/m4/pcre.m4 index 1df2c43713a2..110576208dab 100644 --- a/m4/pcre.m4 +++ b/m4/pcre.m4 @@ -13,17 +13,14 @@ AC_DEFUN([LIBPCRE_TRY_LINK], [ -AC_TRY_LINK( -[ +AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include -], -[ +]], [[ const char* error = NULL; int error_offset = -1; pcre *regexp = pcre_compile("test", PCRE_UTF8, &error, &error_offset, NULL); pcre_free(regexp); -], -found_libpcre="yes") +]])],[found_libpcre="yes"],[]) ])dnl AC_DEFUN([LIBPCRE_CHECK_CONFIG], diff --git a/m4/pcre2.m4 b/m4/pcre2.m4 index 4f3aa51a0a17..756a4a4a0305 100644 --- a/m4/pcre2.m4 +++ b/m4/pcre2.m4 @@ -13,18 +13,15 @@ AC_DEFUN([LIBPCRE2_TRY_LINK], [ -AC_TRY_LINK( -[ +AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #define PCRE2_CODE_UNIT_WIDTH 8 #include -], -[ +]], [[ int error = 0; PCRE2_SIZE error_offset = 0; pcre2_code *regexp = pcre2_compile("test", PCRE2_ZERO_TERMINATED, PCRE2_UTF, &error, &error_offset, NULL); pcre2_code_free(regexp); -], -found_libpcre2="yes") +]])],[found_libpcre2="yes"],[]) ])dnl AC_DEFUN([LIBPCRE2_CHECK_CONFIG], diff --git a/m4/pthread.m4 b/m4/pthread.m4 index fce049c0c053..de8001e8d616 100644 --- a/m4/pthread.m4 +++ b/m4/pthread.m4 @@ -12,18 +12,15 @@ AC_DEFUN([LIBPTHREAD_TRY_LINK], [ -AC_TRY_LINK( -[ +AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include -], -[ +]], [[ pthread_mutexattr_t mta; pthread_mutex_t mutex; pthread_mutexattr_init(&mta); pthread_mutex_init(&mutex, &mta); -], -found_libpthread="yes") +]])],[found_libpthread="yes"],[]) ])dnl AC_DEFUN([LIBPTHREAD_TRY_RUN], diff --git a/m4/resolv.m4 b/m4/resolv.m4 index dc3c6d7bdf60..367a3477f5a4 100644 --- a/m4/resolv.m4 +++ b/m4/resolv.m4 @@ -7,8 +7,7 @@ AC_DEFUN([LIBRESOLV_TRY_LINK], [ am_save_LIBS="$LIBS" LIBS="$LIBS $1" -AC_TRY_LINK( -[ +AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #ifdef HAVE_SYS_TYPES_H # include #endif @@ -27,15 +26,13 @@ AC_TRY_LINK( #ifndef T_SOA # define T_SOA ns_t_soa #endif /* T_SOA */ -], -[ +]], [[ char *buf; res_init(); res_query("", C_IN, T_SOA, (unsigned char *)buf, 0); -], -found_resolv="yes" -RESOLV_LIBS="$1") +]])],[found_resolv="yes" +RESOLV_LIBS="$1"],[]) LIBS="$am_save_LIBS" ])dnl diff --git a/m4/zlib.m4 b/m4/zlib.m4 index e37ea82a4359..9b080c4a1465 100644 --- a/m4/zlib.m4 +++ b/m4/zlib.m4 @@ -14,15 +14,12 @@ AC_DEFUN([ZLIB_TRY_LINK], [ found_zlib=$1 -AC_TRY_LINK( -[ +AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include -], -[ +]], [[ z_stream defstream; deflateInit(&defstream, Z_BEST_COMPRESSION); -], -found_zlib="yes") +]])],[found_zlib="yes"],[]) ])dnl AC_DEFUN([ZLIB_CHECK_CONFIG], diff --git a/tests/conf_tests.m4 b/tests/conf_tests.m4 index 9a25dc1c2b70..4102bc441597 100644 --- a/tests/conf_tests.m4 +++ b/tests/conf_tests.m4 @@ -84,13 +84,10 @@ AC_DEFUN([CONF_TESTS], esac -AC_TRY_LINK( -[ +AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include -], -[ +]], [[ __fxstat(0, 0, NULL); -], -AC_DEFINE([HAVE_FXSTAT], [1], [Define to 1 if fxstat function is available])) +]])],[AC_DEFINE(HAVE_FXSTAT, 1, Define to 1 if fxstat function is available)],[]) ])