gollvm: add memmem configure rules for libgo
Add cmake checks/rules for detecting the presence of 'memmem' (not
sure why they didn't make it in initially). Having memmem available
will help with the internal/bytealg package performance.
Change-Id: Iff5f234bf708bb53f9213a71b711e7ab85d114fc
Reviewed-on: https://go-review.googlesource.com/c/gollvm/+/180957
Reviewed-by: Cherry Zhang <cherryyz@google.com>
diff --git a/cmake/modules/ConfigSetup.cmake b/cmake/modules/ConfigSetup.cmake
index 259cf86..d2fded2 100644
--- a/cmake/modules/ConfigSetup.cmake
+++ b/cmake/modules/ConfigSetup.cmake
@@ -60,6 +60,7 @@
check_symbol_exists(open64 "fcntl.h" HAVE_OPEN64)
check_symbol_exists(mknodat "sys/types.h;sys/stat.h;fcntl.h;unistd.h" HAVE_MKNODAT)
check_symbol_exists(pipe2 "unistd.h" HAVE_PIPE2)
+check_symbol_exists(memmem "string.h" HAVE_MEMMEM)
# Checks for include files
check_include_file(dlfcn.h HAVE_DLFCN_H)
diff --git a/libgo/config.h.cmake b/libgo/config.h.cmake
index 1f2ce2f..7f0cefe 100644
--- a/libgo/config.h.cmake
+++ b/libgo/config.h.cmake
@@ -147,6 +147,9 @@
/* Define to 1 if assembler supports AES instructions. */
#cmakedefine HAVE_AS_X86_AES 1
+/* Define to 1 if you have the `memmem' function. */
+#cmakedefine HAVE_MEMMEM 1
+
/* Define if we're to use libffi. */
#cmakedefine USE_LIBFFI 1