Do not assume, that "crypt" function is provided by glibc; #1536881


diff -Naur mysql-5.7.34_orig/config.h.cmake mysql-5.7.34_patched/config.h.cmake
--- mysql-5.7.34_orig/config.h.cmake	2021-06-24 11:17:47.697396007 +0800
+++ mysql-5.7.34_patched/config.h.cmake	2021-06-24 11:44:15.405418497 +0800
@@ -69,6 +69,7 @@
 #cmakedefine HAVE_FNMATCH_H 1
 #cmakedefine HAVE_SYS_UN_H 1
 #cmakedefine HAVE_SASL_SASL_H 1
+#cmakedefine HAVE_CRYPT_H 1
 
 /* Libevent */
 #cmakedefine HAVE_DEVPOLL 1
diff -Naur mysql-5.7.34_orig/configure.cmake mysql-5.7.34_patched/configure.cmake
--- mysql-5.7.34_orig/configure.cmake	2021-06-24 11:17:47.697396007 +0800
+++ mysql-5.7.34_patched/configure.cmake	2021-06-24 11:43:24.612905857 +0800
@@ -252,6 +252,7 @@
 CHECK_INCLUDE_FILES (sys/param.h HAVE_SYS_PARAM_H) # Used by NDB/libevent
 CHECK_INCLUDE_FILES (fnmatch.h HAVE_FNMATCH_H)
 CHECK_INCLUDE_FILES (sys/un.h HAVE_SYS_UN_H)
+CHECK_INCLUDE_FILES (crypt.h HAVE_CRYPT_H)
 
 # For libevent
 CHECK_INCLUDE_FILES(sys/devpoll.h HAVE_DEVPOLL)
diff -Naur mysql-5.7.34_orig/include/my_global.h mysql-5.7.34_patched/include/my_global.h
--- mysql-5.7.34_orig/include/my_global.h	2021-06-24 11:17:47.721396249 +0800
+++ mysql-5.7.34_patched/include/my_global.h	2021-06-24 11:41:58.240034110 +0800
@@ -61,6 +61,9 @@
 #include <time.h>
 #include <errno.h>				/* Recommended by debian */
 #include <sys/types.h>
+#if defined(HAVE_CRYPT_H)
+#include <crypt.h>
+#endif
 
 #ifdef HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
