]> git.ipfire.org Git - thirdparty/rsync.git/commitdiff
Change usage (--version) output to note when ASM isn't really being used.
authorWayne Davison <wayne@opencoder.net>
Tue, 22 Feb 2022 00:39:16 +0000 (16:39 -0800)
committerWayne Davison <wayne@opencoder.net>
Tue, 22 Feb 2022 00:41:50 +0000 (16:41 -0800)
configure.ac
usage.c

index 7031283a997778ca25b8cb8877e7421e4345fa0c..9960fafcd166ab73541015f86eb84a674ecfb607 100644 (file)
@@ -322,39 +322,6 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[return 0;]])],
 CFLAGS="$OLD_CFLAGS"
 AC_SUBST(NOEXECSTACK)
 
-ASM=
-
-AC_MSG_CHECKING([whether to enable ASM optimizations])
-AC_ARG_ENABLE(asm,
-    AS_HELP_STRING([--enable-asm],[enable/disable to control ASM optimizations]))
-
-if test x"$enable_asm" = x""; then
-    case "$host_os" in
-       *linux*) ;;
-       *) enable_asm=no ;;
-    esac
-fi
-
-if test x"$enable_asm" != x"no"; then
-    if test x"$host_cpu" = x"x86_64" || test x"$host_cpu" = x"amd64"; then
-       ASM="$host_cpu"
-    elif test x"$enable_asm" = x"yes"; then
-        AC_MSG_RESULT(unavailable)
-        AC_MSG_ERROR(The ASM optimizations are currently x86_64|amd64 only.
-Omit --enable-asm to continue without it.)
-    fi
-fi
-
-if test x"$ASM" != x""; then
-    AC_MSG_RESULT([yes ($ASM)])
-    AC_DEFINE(HAVE_ASM, 1, [Define to 1 to enable ASM optimizations])
-    ASM='$(ASM_'"$ASM)"
-else
-    AC_MSG_RESULT(no)
-fi
-
-AC_SUBST(ASM)
-
 # arrgh. libc in some old debian version screwed up the largefile
 # stuff, getting byte range locking wrong
 AC_CACHE_CHECK([for broken largefile support],rsync_cv_HAVE_BROKEN_LARGEFILE,[
@@ -457,7 +424,8 @@ if test x"$enable_openssl" != x"no"; then
     if test x"$ac_cv_header_openssl_md4_h" = x"yes" && test x"$ac_cv_header_openssl_md5_h" = x"yes"; then
       AC_MSG_RESULT(yes)
       AC_SEARCH_LIBS(MD5_Init, crypto,
-          [AC_DEFINE(USE_OPENSSL)],
+          [AC_DEFINE(USE_OPENSSL)
+          enable_openssl=yes],
           [err_msg="$err_msg$nl- Failed to find MD5_Init function in openssl crypto lib.";
           no_lib="$no_lib openssl"])
     else
@@ -465,10 +433,46 @@ if test x"$enable_openssl" != x"no"; then
        err_msg="$err_msg$nl- Failed to find openssl/md4.h and openssl/md5.h for openssl crypto lib support."
        no_lib="$no_lib openssl"
     fi
+    if test x"$enable_asm" != x"yes"; then
+       enable_asm=no
+    fi
 else
     AC_MSG_RESULT(no)
 fi
 
+ASM=
+
+AC_MSG_CHECKING([whether to enable ASM optimizations])
+AC_ARG_ENABLE(asm,
+    AS_HELP_STRING([--enable-asm],[enable/disable to control ASM optimizations]))
+
+if test x"$enable_asm" = x""; then
+    case "$host_os" in
+       *linux*) ;;
+       *) enable_asm=no ;;
+    esac
+fi
+
+if test x"$enable_asm" != x"no"; then
+    if test x"$host_cpu" = x"x86_64" || test x"$host_cpu" = x"amd64"; then
+       ASM="$host_cpu"
+    elif test x"$enable_asm" = x"yes"; then
+        AC_MSG_RESULT(unavailable)
+        AC_MSG_ERROR(The ASM optimizations are currently x86_64|amd64 only.
+Omit --enable-asm to continue without it.)
+    fi
+fi
+
+if test x"$ASM" != x""; then
+    AC_MSG_RESULT([yes ($ASM)])
+    AC_DEFINE(HAVE_ASM, 1, [Define to 1 to enable ASM optimizations])
+    ASM='$(ASM_'"$ASM)"
+else
+    AC_MSG_RESULT(no)
+fi
+
+AC_SUBST(ASM)
+
 AC_MSG_CHECKING([whether to enable xxhash checksum support])
 AC_ARG_ENABLE([xxhash],
        AS_HELP_STRING([--disable-xxhash],[disable to omit xxhash checksums]))
@@ -1417,6 +1421,10 @@ esac
 AC_CONFIG_FILES([Makefile lib/dummy zlib/dummy popt/dummy shconfig])
 AC_OUTPUT
 
+if test "$enable_openssl" = yes && test "$enable_asm" = yes; then
+    echo "*** Ignoring --enable-asm option -- using openssl for MD5 checksums ***"
+fi
+
 AC_MSG_RESULT()
 AC_MSG_RESULT([    rsync $PACKAGE_VERSION configuration successful])
 AC_MSG_RESULT()
diff --git a/usage.c b/usage.c
index db13535f4a25291f3d4e537689241ca4727c617e..c8c4f0257f2184a168af95b18860ff81775cb81d 100644 (file)
--- a/usage.c
+++ b/usage.c
@@ -144,7 +144,7 @@ static void print_info_flags(enum logcode f)
 #endif
                        "SIMD",
 
-#ifndef HAVE_ASM
+#if !defined HAVE_ASM || defined USE_OPENSSL
                "no "
 #endif
                        "asm",