Branch: refs/heads/master Author: Jiří Techet techet@gmail.com Committer: GitHub noreply@github.com Date: Wed, 05 Feb 2025 17:35:52 UTC Commit: be946d5d07b5c4582068580d06a3b940c4d378f0 https://github.com/geany/geany/commit/be946d5d07b5c4582068580d06a3b940c4d378...
Log Message: ----------- Merge pull request #4181 from techee/macos_regex
Use builtin regex on macOS for performance reasons
Modified Paths: -------------- configure.ac meson.build
Modified: configure.ac 18 lines changed, 11 insertions(+), 7 deletions(-) =================================================================== @@ -50,13 +50,17 @@ AC_CHECK_HEADERS([fcntl.h stdlib.h sys/time.h errno.h limits.h]) # Checks for dependencies needed by ctags AC_CHECK_HEADERS([dirent.h fnmatch.h direct.h io.h sys/dir.h]) AC_DEFINE([HAVE_STDBOOL_H], [1], [whether or not to use <stdbool.h>.]) -AC_CHECK_FUNC([regcomp], - [have_regcomp=yes], - [have_regcomp=no - dnl various stuff for ctags/gnu_regex/ - AC_CHECK_HEADERS([langinfo.h locale.h libintl.h wctype.h wchar.h]) - AC_CHECK_FUNCS([memcpy isblank wcrtomb mbrtowc wcscoll]) - AC_FUNC_ALLOCA]) +AC_CANONICAL_HOST +AS_CASE([${host_os}], + [darwin*], [dnl Using builtin regex on macOS for performance reasons + have_regcomp=no], + [AC_CHECK_FUNC([regcomp], + [have_regcomp=yes], + [have_regcomp=no + dnl various stuff for ctags/gnu_regex/ + AC_CHECK_HEADERS([langinfo.h locale.h libintl.h wctype.h wchar.h]) + AC_CHECK_FUNCS([memcpy isblank wcrtomb mbrtowc wcscoll]) + AC_FUNC_ALLOCA])]) AM_CONDITIONAL([USE_BUNDLED_REGEX], [test "xno" = "x$have_regcomp"]) AC_CHECK_FUNC([fnmatch], [have_fnmatch=yes], [have_fnmatch=no]) AM_CONDITIONAL([USE_BUNDLED_FNMATCH], [test "xno" = "x$have_fnmatch"])
Modified: meson.build 6 lines changed, 5 insertions(+), 1 deletions(-) =================================================================== @@ -71,7 +71,6 @@ check_functions = [ ['memcpy', '#include <string.h>'], ['mkstemp', '#include <stdlib.h>'], ['realpath', '#include <limits.h>\n#include <stdlib.h>'], - ['regcomp', '#include <regex.h>'], ['socket', '#include <sys/socket.h>'], # man page says strings.h but we include only string.h and it works ['strcasecmp', '#include <string.h>'], @@ -87,6 +86,11 @@ check_functions = [ ['g_strv_equal', '#include <glib.h>'] ]
+# Using builtin regex on macOS for performance reasons +if (host_machine.system() != 'darwin') + check_functions += [['regcomp', '#include <regex.h>']] +endif + foreach h : check_headers define = 'HAVE_' + h.underscorify().to_upper() if cc.has_header(h)
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).