From 26ab9027f0c15f95089edcde6e6c8280f829bb9c Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 26 Aug 2024 02:11:05 +0200 Subject: [PATCH] configure: fix indentation more Follow-up to 0052b4b52dfbd6455a24dd95837e5236dc8e1f5d #14628 Closes #14682 --- m4/curl-bearssl.m4 | 42 +++++++------- m4/curl-compilers.m4 | 10 ++-- m4/curl-functions.m4 | 30 +++++----- m4/curl-gnutls.m4 | 28 ++++----- m4/curl-mbedtls.m4 | 24 ++++---- m4/curl-openssl.m4 | 135 +++++++++++++++++++++---------------------- m4/curl-rustls.m4 | 1 - m4/curl-sysconfig.m4 | 14 ++--- m4/curl-wolfssl.m4 | 34 +++++------ m4/xc-val-flgs.m4 | 4 +- 10 files changed, 159 insertions(+), 163 deletions(-) diff --git a/m4/curl-bearssl.m4 b/m4/curl-bearssl.m4 index f2d661de10..02a80e8c13 100644 --- a/m4/curl-bearssl.m4 +++ b/m4/curl-bearssl.m4 @@ -43,14 +43,14 @@ if test "x$OPT_BEARSSL" != xno; then AC_CHECK_LIB(bearssl, br_ssl_client_init_full, dnl libbearssl found, set the variable - [ - AC_DEFINE(USE_BEARSSL, 1, [if BearSSL is enabled]) - AC_SUBST(USE_BEARSSL, [1]) - BEARSSL_ENABLED=1 - USE_BEARSSL="yes" - ssl_msg="BearSSL" - test bearssl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes - ], [], -lbearssl) + [ + AC_DEFINE(USE_BEARSSL, 1, [if BearSSL is enabled]) + AC_SUBST(USE_BEARSSL, [1]) + BEARSSL_ENABLED=1 + USE_BEARSSL="yes" + ssl_msg="BearSSL" + test bearssl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes + ], [], -lbearssl) fi addld="" @@ -66,22 +66,22 @@ if test "x$OPT_BEARSSL" != xno; then LDFLAGS="$LDFLAGS $addld" if test "$addcflags" != "-I/usr/include"; then - CPPFLAGS="$CPPFLAGS $addcflags" + CPPFLAGS="$CPPFLAGS $addcflags" fi AC_CHECK_LIB(bearssl, br_ssl_client_init_full, - [ - AC_DEFINE(USE_BEARSSL, 1, [if BearSSL is enabled]) - AC_SUBST(USE_BEARSSL, [1]) - BEARSSL_ENABLED=1 - USE_BEARSSL="yes" - ssl_msg="BearSSL" - test bearssl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes - ], - [ - CPPFLAGS=$_cppflags - LDFLAGS=$_ldflags - ], -lbearssl) + [ + AC_DEFINE(USE_BEARSSL, 1, [if BearSSL is enabled]) + AC_SUBST(USE_BEARSSL, [1]) + BEARSSL_ENABLED=1 + USE_BEARSSL="yes" + ssl_msg="BearSSL" + test bearssl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes + ], + [ + CPPFLAGS=$_cppflags + LDFLAGS=$_ldflags + ], -lbearssl) fi if test "x$USE_BEARSSL" = "xyes"; then diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index 6f884d2141..240aa2b0b1 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -148,7 +148,7 @@ AC_DEFUN([CURL_CHECK_COMPILER_DEC_C], [ CURL_CHECK_DEF([__DECC], [], [silent]) CURL_CHECK_DEF([__DECC_VER], [], [silent]) if test "$curl_cv_have_def___DECC" = "yes" && - test "$curl_cv_have_def___DECC_VER" = "yes"; then + test "$curl_cv_have_def___DECC_VER" = "yes"; then AC_MSG_RESULT([yes]) compiler_id="DEC_C" flags_dbg_yes="-g2" @@ -1424,10 +1424,10 @@ AC_DEFUN([CURL_CHECK_COMPILER_SYMBOL_HIDING], [ $tmp_EXTERN char *dummy(char *buff); char *dummy(char *buff) { - if(buff) - return ++buff; - else - return buff; + if(buff) + return ++buff; + else + return buff; } ]],[[ char b[16]; diff --git a/m4/curl-functions.m4 b/m4/curl-functions.m4 index 38d7dfee6f..7a35b98ffe 100644 --- a/m4/curl-functions.m4 +++ b/m4/curl-functions.m4 @@ -4870,11 +4870,11 @@ dnl CURL_LIBRARY_PATH variable. It keeps the LD_LIBRARY_PATH dnl changes contained within this macro. AC_DEFUN([CURL_RUN_IFELSE], [ - case $host_os in - darwin*) + case $host_os in + darwin*) AC_RUN_IFELSE([AC_LANG_SOURCE([$1])], $2, $3, $4) - ;; - *) + ;; + *) oldcc=$CC old=$LD_LIBRARY_PATH CC="sh ./run-compiler" @@ -4883,8 +4883,8 @@ AC_DEFUN([CURL_RUN_IFELSE], [ AC_RUN_IFELSE([AC_LANG_SOURCE([$1])], $2, $3, $4) LD_LIBRARY_PATH=$old # restore CC=$oldcc - ;; - esac + ;; + esac ]) dnl CURL_COVERAGE @@ -4901,8 +4901,8 @@ AC_DEFUN([CURL_COVERAGE],[ dnl check if enabled by argument AC_ARG_ENABLE(code-coverage, - AS_HELP_STRING([--enable-code-coverage], [Provide code coverage]), - coverage="$enableval") + AS_HELP_STRING([--enable-code-coverage], [Provide code coverage]), + coverage="$enableval") dnl if not gcc switch off again AS_IF([ test "$GCC" != "yes" ], coverage="no" ) @@ -4981,19 +4981,19 @@ AC_DEFUN([CURL_SIZEOF], [ r=0 dnl Check the sizes in a reasonable order for typesize in 8 4 2 16 1; do - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include $2 ]], - [switch(0) { - case 0: - case (sizeof($1) == $typesize):; - } + [switch(0) { + case 0: + case (sizeof($1) == $typesize):; + } ]) ], [ - r=$typesize], + r=$typesize], [ - r=0]) + r=0]) dnl get out of the loop once matched if test $r -gt 0; then break; diff --git a/m4/curl-gnutls.m4 b/m4/curl-gnutls.m4 index 199e10cd45..93c3946a93 100644 --- a/m4/curl-gnutls.m4 +++ b/m4/curl-gnutls.m4 @@ -93,24 +93,24 @@ if test "x$OPT_GNUTLS" != xno; then LIBS="$addlib $LIBS" LDFLAGS="$LDFLAGS $addld" if test "$addcflags" != "-I/usr/include"; then - CPPFLAGS="$CPPFLAGS $addcflags" + CPPFLAGS="$CPPFLAGS $addcflags" fi dnl this function is selected since it was introduced in 3.1.10 AC_CHECK_LIB(gnutls, gnutls_x509_crt_get_dn2, - [ - AC_DEFINE(USE_GNUTLS, 1, [if GnuTLS is enabled]) - AC_SUBST(USE_GNUTLS, [1]) - GNUTLS_ENABLED=1 - USE_GNUTLS="yes" - ssl_msg="GnuTLS" - QUIC_ENABLED=yes - test gnutls != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes - ], - [ - LIBS="$CLEANLIBS" - CPPFLAGS="$CLEANCPPFLAGS" - ]) + [ + AC_DEFINE(USE_GNUTLS, 1, [if GnuTLS is enabled]) + AC_SUBST(USE_GNUTLS, [1]) + GNUTLS_ENABLED=1 + USE_GNUTLS="yes" + ssl_msg="GnuTLS" + QUIC_ENABLED=yes + test gnutls != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes + ], + [ + LIBS="$CLEANLIBS" + CPPFLAGS="$CLEANCPPFLAGS" + ]) if test "x$USE_GNUTLS" = "xyes"; then AC_MSG_NOTICE([detected GnuTLS version $version]) diff --git a/m4/curl-mbedtls.m4 b/m4/curl-mbedtls.m4 index 6d3e568572..bf14c6c893 100644 --- a/m4/curl-mbedtls.m4 +++ b/m4/curl-mbedtls.m4 @@ -70,18 +70,18 @@ if test "x$OPT_MBEDTLS" != xno; then fi AC_CHECK_LIB(mbedtls, mbedtls_ssl_init, - [ - AC_DEFINE(USE_MBEDTLS, 1, [if mbedTLS is enabled]) - AC_SUBST(USE_MBEDTLS, [1]) - MBEDTLS_ENABLED=1 - USE_MBEDTLS="yes" - ssl_msg="mbedTLS" - test mbedtls != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes - ], - [ - CPPFLAGS=$_cppflags - LDFLAGS=$_ldflags - ], -lmbedx509 -lmbedcrypto) + [ + AC_DEFINE(USE_MBEDTLS, 1, [if mbedTLS is enabled]) + AC_SUBST(USE_MBEDTLS, [1]) + MBEDTLS_ENABLED=1 + USE_MBEDTLS="yes" + ssl_msg="mbedTLS" + test mbedtls != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes + ], + [ + CPPFLAGS=$_cppflags + LDFLAGS=$_ldflags + ], -lmbedx509 -lmbedcrypto) fi if test "x$USE_MBEDTLS" = "xyes"; then diff --git a/m4/curl-openssl.m4 b/m4/curl-openssl.m4 index ed50b1c083..e33b563781 100644 --- a/m4/curl-openssl.m4 +++ b/m4/curl-openssl.m4 @@ -141,63 +141,60 @@ if test "x$OPT_OPENSSL" != xno; then LDFLAGS="$LDFLAGS $SSL_LDFLAGS" AC_CHECK_LIB(crypto, HMAC_Update,[ - HAVECRYPTO="yes" - LIBS="-lcrypto $LIBS" - ],[ - if test -n "$LIB_OPENSSL" ; then - LDFLAGS="$CLEANLDFLAGS -L$LIB_OPENSSL" - fi - if test "$PKGCONFIG" = "no" -a -n "$PREFIX_OPENSSL" ; then - # only set this if pkg-config wasn't used - CPPFLAGS="$CLEANCPPFLAGS -I$PREFIX_OPENSSL/include" - fi - # Linking previously failed, try extra paths from --with-openssl or - # pkg-config. Use a different function name to avoid reusing the earlier - # cached result. - AC_CHECK_LIB(crypto, HMAC_Init_ex,[ - HAVECRYPTO="yes" - LIBS="-lcrypto $LIBS"], [ + HAVECRYPTO="yes" + LIBS="-lcrypto $LIBS" + ],[ + if test -n "$LIB_OPENSSL" ; then + LDFLAGS="$CLEANLDFLAGS -L$LIB_OPENSSL" + fi + if test "$PKGCONFIG" = "no" -a -n "$PREFIX_OPENSSL" ; then + # only set this if pkg-config wasn't used + CPPFLAGS="$CLEANCPPFLAGS -I$PREFIX_OPENSSL/include" + fi + # Linking previously failed, try extra paths from --with-openssl or + # pkg-config. Use a different function name to avoid reusing the earlier + # cached result. + AC_CHECK_LIB(crypto, HMAC_Init_ex,[ + HAVECRYPTO="yes" + LIBS="-lcrypto $LIBS"], [ - dnl still no, but what about with -ldl? - AC_MSG_CHECKING([OpenSSL linking with -ldl]) - LIBS="-lcrypto $CLEANLIBS -ldl" - AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ - #include - ]], [[ - ERR_clear_error(); - ]]) ], - [ - AC_MSG_RESULT(yes) - HAVECRYPTO="yes" - ], - [ - AC_MSG_RESULT(no) - dnl ok, so what about both -ldl and -lpthread? - dnl This may be necessary for static libraries. + dnl still no, but what about with -ldl? + AC_MSG_CHECKING([OpenSSL linking with -ldl]) + LIBS="-lcrypto $CLEANLIBS -ldl" + AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ + #include + ]], [[ + ERR_clear_error(); + ]]) ], + [ + AC_MSG_RESULT(yes) + HAVECRYPTO="yes" + ], + [ + AC_MSG_RESULT(no) + dnl ok, so what about both -ldl and -lpthread? + dnl This may be necessary for static libraries. - AC_MSG_CHECKING([OpenSSL linking with -ldl and -lpthread]) - LIBS="-lcrypto $CLEANLIBS -ldl -lpthread" - AC_LINK_IFELSE([ - AC_LANG_PROGRAM([[ - #include - ]], [[ - ERR_clear_error(); - ]])], - [ - AC_MSG_RESULT(yes) - HAVECRYPTO="yes" - ], - [ - AC_MSG_RESULT(no) - LDFLAGS="$CLEANLDFLAGS" - CPPFLAGS="$CLEANCPPFLAGS" - LIBS="$CLEANLIBS" - - ]) - - ]) - - ]) + AC_MSG_CHECKING([OpenSSL linking with -ldl and -lpthread]) + LIBS="-lcrypto $CLEANLIBS -ldl -lpthread" + AC_LINK_IFELSE([ + AC_LANG_PROGRAM([[ + #include + ]], [[ + ERR_clear_error(); + ]])], + [ + AC_MSG_RESULT(yes) + HAVECRYPTO="yes" + ], + [ + AC_MSG_RESULT(no) + LDFLAGS="$CLEANLDFLAGS" + CPPFLAGS="$CLEANCPPFLAGS" + LIBS="$CLEANLIBS" + ]) + ]) + ]) ]) if test X"$HAVECRYPTO" = X"yes"; then @@ -284,7 +281,7 @@ if test "x$OPT_OPENSSL" != xno; then #ifndef OPENSSL_IS_AWSLC #error not AWS-LC #endif - ]]) + ]]) ],[ AC_MSG_RESULT([yes]) ssl_msg="AWS-LC" @@ -296,7 +293,7 @@ if test "x$OPT_OPENSSL" != xno; then AC_MSG_CHECKING([for LibreSSL]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ -#include + #include ]],[[ int dummy = LIBRESSL_VERSION_NUMBER; ]]) @@ -312,7 +309,7 @@ if test "x$OPT_OPENSSL" != xno; then AC_MSG_CHECKING([for OpenSSL >= v3]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ -#include + #include ]],[[ #if (OPENSSL_VERSION_NUMBER >= 0x30000000L) return 0; @@ -339,14 +336,14 @@ if test "x$OPT_OPENSSL" != xno; then if test "$OPENSSL_ENABLED" = "1"; then if test -n "$LIB_OPENSSL"; then - dnl when the ssl shared libs were found in a path that the run-time - dnl linker doesn't search through, we need to add it to CURL_LIBRARY_PATH - dnl to prevent further configure tests to fail due to this - if test "x$cross_compiling" != "xyes"; then - CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$LIB_OPENSSL" - export CURL_LIBRARY_PATH - AC_MSG_NOTICE([Added $LIB_OPENSSL to CURL_LIBRARY_PATH]) - fi + dnl when the ssl shared libs were found in a path that the run-time + dnl linker doesn't search through, we need to add it to CURL_LIBRARY_PATH + dnl to prevent further configure tests to fail due to this + if test "x$cross_compiling" != "xyes"; then + CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$LIB_OPENSSL" + export CURL_LIBRARY_PATH + AC_MSG_NOTICE([Added $LIB_OPENSSL to CURL_LIBRARY_PATH]) + fi fi check_for_ca_bundle=1 LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE openssl" @@ -356,7 +353,7 @@ if test "x$OPT_OPENSSL" != xno; then fi if test X"$OPT_OPENSSL" != Xno && - test "$OPENSSL_ENABLED" != "1"; then + test "$OPENSSL_ENABLED" != "1"; then AC_MSG_NOTICE([OPT_OPENSSL: $OPT_OPENSSL]) AC_MSG_NOTICE([OPENSSL_ENABLED: $OPENSSL_ENABLED]) AC_MSG_ERROR([--with-openssl was given but OpenSSL could not be detected]) @@ -395,7 +392,7 @@ if test "$OPENSSL_ENABLED" = "1"; then AC_MSG_CHECKING([for SRP support in OpenSSL]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ -#include + #include ]],[[ SSL_CTX_set_srp_username(NULL, ""); SSL_CTX_set_srp_password(NULL, ""); @@ -430,7 +427,7 @@ if test "$OPENSSL_ENABLED" = "1"; then AC_MSG_CHECKING([for QUIC support and OpenSSL >= 3.3]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ -#include + #include ]],[[ #if (OPENSSL_VERSION_NUMBER < 0x30300000L) #error need at least version 3.3.0 diff --git a/m4/curl-rustls.m4 b/m4/curl-rustls.m4 index dc47d4d9f4..4d2aabfbc0 100644 --- a/m4/curl-rustls.m4 +++ b/m4/curl-rustls.m4 @@ -186,5 +186,4 @@ if test "x$OPT_RUSTLS" != xno; then fi ]) - RUSTLS_ENABLED diff --git a/m4/curl-sysconfig.m4 b/m4/curl-sysconfig.m4 index f92fc18997..7da71346c7 100644 --- a/m4/curl-sysconfig.m4 +++ b/m4/curl-sysconfig.m4 @@ -28,14 +28,14 @@ case $host_os in darwin*) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ -#include -#include + #include + #include ]],[[ -#if TARGET_OS_MAC && !(defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE) - return 0; -#else -#error Not macOS -#endif + #if TARGET_OS_MAC && !(defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE) + return 0; + #else + #error Not macOS + #endif ]]) ],[ build_for_macos="yes" diff --git a/m4/curl-wolfssl.m4 b/m4/curl-wolfssl.m4 index e8f4eae0d3..b3f65ceef8 100644 --- a/m4/curl-wolfssl.m4 +++ b/m4/curl-wolfssl.m4 @@ -80,8 +80,8 @@ if test "x$OPT_WOLFSSL" != xno; then LDFLAGS="$LDFLAGS $addld" AC_MSG_NOTICE([Add $addld to LDFLAGS]) if test "$addcflags" != "-I/usr/include"; then - CPPFLAGS="$CPPFLAGS $addcflags" - AC_MSG_NOTICE([Add $addcflags to CPPFLAGS]) + CPPFLAGS="$CPPFLAGS $addcflags" + AC_MSG_NOTICE([Add $addcflags to CPPFLAGS]) fi my_ac_save_LIBS="$LIBS" @@ -101,21 +101,21 @@ if test "x$OPT_WOLFSSL" != xno; then return wolfSSL_Init(); ]]) ],[ - AC_MSG_RESULT(yes) - AC_DEFINE(USE_WOLFSSL, 1, [if wolfSSL is enabled]) - AC_SUBST(USE_WOLFSSL, [1]) - WOLFSSL_ENABLED=1 - USE_WOLFSSL="yes" - ssl_msg="wolfSSL" - QUIC_ENABLED=yes - test wolfssl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes - ], - [ - AC_MSG_RESULT(no) - CPPFLAGS=$_cppflags - LDFLAGS=$_ldflags - wolfssllibpath="" - ]) + AC_MSG_RESULT(yes) + AC_DEFINE(USE_WOLFSSL, 1, [if wolfSSL is enabled]) + AC_SUBST(USE_WOLFSSL, [1]) + WOLFSSL_ENABLED=1 + USE_WOLFSSL="yes" + ssl_msg="wolfSSL" + QUIC_ENABLED=yes + test wolfssl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes + ], + [ + AC_MSG_RESULT(no) + CPPFLAGS=$_cppflags + LDFLAGS=$_ldflags + wolfssllibpath="" + ]) LIBS="$my_ac_save_LIBS" fi diff --git a/m4/xc-val-flgs.m4 b/m4/xc-val-flgs.m4 index af7a3d2d8b..e2225c2e57 100644 --- a/m4/xc-val-flgs.m4 +++ b/m4/xc-val-flgs.m4 @@ -211,7 +211,7 @@ AC_DEFUN([XC_CHECK_USER_FLAGS], [ test $xc_bad_var_cflags = yes || test $xc_bad_var_ldflags = yes || test $xc_bad_var_cppflags = yes; then - AC_MSG_ERROR([Can not continue. Fix errors mentioned immediately above this line.]) + AC_MSG_ERROR([Can not continue. Fix errors mentioned immediately above this line.]) fi ]) @@ -239,6 +239,6 @@ AC_DEFUN([XC_CHECK_BUILD_FLAGS], [ test $xc_bad_var_cflags = yes || test $xc_bad_var_ldflags = yes || test $xc_bad_var_cppflags = yes; then - AC_MSG_WARN([Continuing even with errors mentioned immediately above this line.]) + AC_MSG_WARN([Continuing even with errors mentioned immediately above this line.]) fi ])