2013-02-11 23:37:18 +00:00
|
|
|
# Configure a GNU-like replacement for <string.h>.
|
|
|
|
|
2021-01-01 09:13:56 +00:00
|
|
|
# Copyright (C) 2007-2021 Free Software Foundation, Inc.
|
2013-02-11 23:37:18 +00:00
|
|
|
# This file is free software; the Free Software Foundation
|
|
|
|
# gives unlimited permission to copy and/or distribute it,
|
|
|
|
# with or without modifications, as long as this notice is preserved.
|
|
|
|
|
Update from Gnulib
Make the following changes by hand, and run 'admin/merge-gnulib'.
* .gitignore: Add lib/malloc/*.gl.h.
* admin/merge-gnulib: Copy lib/af_alg.h and lib/save-cwd.h
directly from Gnulib, without worrying about Gnulib modules,
as these files are special cases.
(AVOIDED_MODULES): Remove malloc-posix.
* lib/malloc.c, lib/realloc.c, m4/malloc.m4, m4/realloc.m4:
* m4/year2038.m4: New files, copied from Gnulib.
* lib/malloca.c, lib/malloca.h:
* m4/close-stream.m4, m4/glibc21.m4, m4/malloca.m4:
Remove. These are either no longer present in Gnulib, or are no
longer needed by modules that Emacs uses.
* oldXMenu/AddPane.c, oldXmenu/Addsel.c: Include XmenuInt.h first;
needed for new Gnulib.
* src/xmenu.c: Call emacs_abort, not abort.
2021-10-04 19:11:39 +00:00
|
|
|
# serial 34
|
2013-02-11 23:37:18 +00:00
|
|
|
|
|
|
|
# Written by Paul Eggert.
|
|
|
|
|
Update from Gnulib
Make the following changes by hand, and run 'admin/merge-gnulib'.
* .gitignore: Add lib/malloc/*.gl.h.
* admin/merge-gnulib: Copy lib/af_alg.h and lib/save-cwd.h
directly from Gnulib, without worrying about Gnulib modules,
as these files are special cases.
(AVOIDED_MODULES): Remove malloc-posix.
* lib/malloc.c, lib/realloc.c, m4/malloc.m4, m4/realloc.m4:
* m4/year2038.m4: New files, copied from Gnulib.
* lib/malloca.c, lib/malloca.h:
* m4/close-stream.m4, m4/glibc21.m4, m4/malloca.m4:
Remove. These are either no longer present in Gnulib, or are no
longer needed by modules that Emacs uses.
* oldXMenu/AddPane.c, oldXmenu/Addsel.c: Include XmenuInt.h first;
needed for new Gnulib.
* src/xmenu.c: Call emacs_abort, not abort.
2021-10-04 19:11:39 +00:00
|
|
|
AC_DEFUN_ONCE([gl_STRING_H],
|
2013-02-11 23:37:18 +00:00
|
|
|
[
|
Update from Gnulib
Make the following changes by hand, and run 'admin/merge-gnulib'.
* .gitignore: Add lib/malloc/*.gl.h.
* admin/merge-gnulib: Copy lib/af_alg.h and lib/save-cwd.h
directly from Gnulib, without worrying about Gnulib modules,
as these files are special cases.
(AVOIDED_MODULES): Remove malloc-posix.
* lib/malloc.c, lib/realloc.c, m4/malloc.m4, m4/realloc.m4:
* m4/year2038.m4: New files, copied from Gnulib.
* lib/malloca.c, lib/malloca.h:
* m4/close-stream.m4, m4/glibc21.m4, m4/malloca.m4:
Remove. These are either no longer present in Gnulib, or are no
longer needed by modules that Emacs uses.
* oldXMenu/AddPane.c, oldXmenu/Addsel.c: Include XmenuInt.h first;
needed for new Gnulib.
* src/xmenu.c: Call emacs_abort, not abort.
2021-10-04 19:11:39 +00:00
|
|
|
dnl Ensure to expand the default settings once only, before all statements
|
|
|
|
dnl that occur in other macros.
|
|
|
|
AC_REQUIRE([gl_STRING_H_DEFAULTS])
|
2013-02-11 23:37:18 +00:00
|
|
|
gl_NEXT_HEADERS([string.h])
|
|
|
|
|
|
|
|
dnl Check for declarations of anything we want to poison if the
|
|
|
|
dnl corresponding gnulib module is not in use, and which is not
|
|
|
|
dnl guaranteed by C89.
|
|
|
|
gl_WARN_ON_USE_PREPARE([[#include <string.h>
|
|
|
|
]],
|
|
|
|
[ffsl ffsll memmem mempcpy memrchr rawmemchr stpcpy stpncpy strchrnul
|
|
|
|
strdup strncat strndup strnlen strpbrk strsep strcasestr strtok_r
|
2020-09-06 00:48:45 +00:00
|
|
|
strerror_r strerrorname_np sigabbrev_np sigdescr_np strsignal strverscmp])
|
Update from Gnulib
This incorporates:
2020-02-22 fchmodat, lchmod: simplify
2020-02-22 lchmod: fix link error on Solaris 10
2020-02-22 use 'restrict' in all POSIX function declarations
2020-02-22 chmodat, chownat: new modules
* lib/gnulib.mk.in: Regenerate.
* lib/inttypes.in.h, lib/openat.h, lib/signal.in.h:
* lib/stdio.in.h, lib/stdlib.in.h, lib/string.in.h:
* lib/sys_stat.in.h, lib/time.in.h, lib/unistd.in.h, m4/inttypes.m4:
* m4/signal_h.m4, m4/stdio_h.m4, m4/stdlib_h.m4, m4/string_h.m4:
* m4/sys_socket_h.m4, m4/sys_stat_h.m4, m4/time_h.m4:
* m4/unistd_h.m4: Copy from Gnulib.
2020-02-23 09:24:21 +00:00
|
|
|
|
|
|
|
AC_REQUIRE([AC_C_RESTRICT])
|
2013-02-11 23:37:18 +00:00
|
|
|
])
|
|
|
|
|
Update from Gnulib
Make the following changes by hand, and run 'admin/merge-gnulib'.
* .gitignore: Add lib/malloc/*.gl.h.
* admin/merge-gnulib: Copy lib/af_alg.h and lib/save-cwd.h
directly from Gnulib, without worrying about Gnulib modules,
as these files are special cases.
(AVOIDED_MODULES): Remove malloc-posix.
* lib/malloc.c, lib/realloc.c, m4/malloc.m4, m4/realloc.m4:
* m4/year2038.m4: New files, copied from Gnulib.
* lib/malloca.c, lib/malloca.h:
* m4/close-stream.m4, m4/glibc21.m4, m4/malloca.m4:
Remove. These are either no longer present in Gnulib, or are no
longer needed by modules that Emacs uses.
* oldXMenu/AddPane.c, oldXmenu/Addsel.c: Include XmenuInt.h first;
needed for new Gnulib.
* src/xmenu.c: Call emacs_abort, not abort.
2021-10-04 19:11:39 +00:00
|
|
|
# gl_STRING_MODULE_INDICATOR([modulename])
|
|
|
|
# sets the shell variable that indicates the presence of the given module
|
|
|
|
# to a C preprocessor expression that will evaluate to 1.
|
|
|
|
# This macro invocation must not occur in macros that are AC_REQUIREd.
|
2013-02-11 23:37:18 +00:00
|
|
|
AC_DEFUN([gl_STRING_MODULE_INDICATOR],
|
|
|
|
[
|
Update from Gnulib
Make the following changes by hand, and run 'admin/merge-gnulib'.
* .gitignore: Add lib/malloc/*.gl.h.
* admin/merge-gnulib: Copy lib/af_alg.h and lib/save-cwd.h
directly from Gnulib, without worrying about Gnulib modules,
as these files are special cases.
(AVOIDED_MODULES): Remove malloc-posix.
* lib/malloc.c, lib/realloc.c, m4/malloc.m4, m4/realloc.m4:
* m4/year2038.m4: New files, copied from Gnulib.
* lib/malloca.c, lib/malloca.h:
* m4/close-stream.m4, m4/glibc21.m4, m4/malloca.m4:
Remove. These are either no longer present in Gnulib, or are no
longer needed by modules that Emacs uses.
* oldXMenu/AddPane.c, oldXmenu/Addsel.c: Include XmenuInt.h first;
needed for new Gnulib.
* src/xmenu.c: Call emacs_abort, not abort.
2021-10-04 19:11:39 +00:00
|
|
|
dnl Ensure to expand the default settings once only.
|
|
|
|
gl_STRING_H_REQUIRE_DEFAULTS
|
2013-02-11 23:37:18 +00:00
|
|
|
gl_MODULE_INDICATOR_SET_VARIABLE([$1])
|
|
|
|
dnl Define it also as a C macro, for the benefit of the unit tests.
|
|
|
|
gl_MODULE_INDICATOR_FOR_TESTS([$1])
|
|
|
|
])
|
|
|
|
|
Update from Gnulib
Make the following changes by hand, and run 'admin/merge-gnulib'.
* .gitignore: Add lib/malloc/*.gl.h.
* admin/merge-gnulib: Copy lib/af_alg.h and lib/save-cwd.h
directly from Gnulib, without worrying about Gnulib modules,
as these files are special cases.
(AVOIDED_MODULES): Remove malloc-posix.
* lib/malloc.c, lib/realloc.c, m4/malloc.m4, m4/realloc.m4:
* m4/year2038.m4: New files, copied from Gnulib.
* lib/malloca.c, lib/malloca.h:
* m4/close-stream.m4, m4/glibc21.m4, m4/malloca.m4:
Remove. These are either no longer present in Gnulib, or are no
longer needed by modules that Emacs uses.
* oldXMenu/AddPane.c, oldXmenu/Addsel.c: Include XmenuInt.h first;
needed for new Gnulib.
* src/xmenu.c: Call emacs_abort, not abort.
2021-10-04 19:11:39 +00:00
|
|
|
# Initializes the default values for AC_SUBSTed shell variables.
|
|
|
|
# This macro must not be AC_REQUIREd. It must only be invoked, and only
|
|
|
|
# outside of macros or in macros that are not AC_REQUIREd.
|
|
|
|
AC_DEFUN([gl_STRING_H_REQUIRE_DEFAULTS],
|
|
|
|
[
|
|
|
|
m4_defun(GL_MODULE_INDICATOR_PREFIX[_STRING_H_MODULE_INDICATOR_DEFAULTS], [
|
|
|
|
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXPLICIT_BZERO])
|
|
|
|
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FFSL])
|
|
|
|
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FFSLL])
|
|
|
|
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MEMCHR])
|
|
|
|
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MEMMEM])
|
|
|
|
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MEMPCPY])
|
|
|
|
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MEMRCHR])
|
|
|
|
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RAWMEMCHR])
|
|
|
|
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STPCPY])
|
|
|
|
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STPNCPY])
|
|
|
|
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRCHRNUL])
|
|
|
|
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRDUP])
|
|
|
|
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRNCAT])
|
|
|
|
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRNDUP])
|
|
|
|
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRNLEN])
|
|
|
|
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRPBRK])
|
|
|
|
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRSEP])
|
|
|
|
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRSTR])
|
|
|
|
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRCASESTR])
|
|
|
|
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOK_R])
|
|
|
|
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSLEN])
|
|
|
|
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSNLEN])
|
|
|
|
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSCHR])
|
|
|
|
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSRCHR])
|
|
|
|
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSSTR])
|
|
|
|
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSCASECMP])
|
|
|
|
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSNCASECMP])
|
|
|
|
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSPCASECMP])
|
|
|
|
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSCASESTR])
|
|
|
|
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSCSPN])
|
|
|
|
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSPBRK])
|
|
|
|
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSSPN])
|
|
|
|
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSSEP])
|
|
|
|
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSTOK_R])
|
|
|
|
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRERROR])
|
|
|
|
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRERROR_R])
|
|
|
|
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRERRORNAME_NP])
|
|
|
|
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SIGABBREV_NP])
|
|
|
|
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SIGDESCR_NP])
|
|
|
|
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRSIGNAL])
|
|
|
|
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRVERSCMP])
|
|
|
|
dnl Support Microsoft deprecated alias function names by default.
|
|
|
|
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_MEMCCPY], [1])
|
|
|
|
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_STRDUP], [1])
|
|
|
|
])
|
|
|
|
m4_require(GL_MODULE_INDICATOR_PREFIX[_STRING_H_MODULE_INDICATOR_DEFAULTS])
|
|
|
|
dnl Make sure the shell variable for GNULIB_FREE_POSIX is initialized.
|
|
|
|
gl_STDLIB_H_REQUIRE_DEFAULTS
|
|
|
|
AC_REQUIRE([gl_STRING_H_DEFAULTS])
|
|
|
|
])
|
|
|
|
|
|
|
|
AC_DEFUN([gl_STRING_H_DEFAULTS],
|
2013-02-11 23:37:18 +00:00
|
|
|
[
|
2020-09-06 00:48:45 +00:00
|
|
|
HAVE_MBSLEN=0; AC_SUBST([HAVE_MBSLEN])
|
2013-02-11 23:37:18 +00:00
|
|
|
dnl Assume proper GNU behavior unless another module says otherwise.
|
2017-07-16 23:22:33 +00:00
|
|
|
HAVE_EXPLICIT_BZERO=1; AC_SUBST([HAVE_EXPLICIT_BZERO])
|
2013-02-11 23:37:18 +00:00
|
|
|
HAVE_FFSL=1; AC_SUBST([HAVE_FFSL])
|
|
|
|
HAVE_FFSLL=1; AC_SUBST([HAVE_FFSLL])
|
|
|
|
HAVE_DECL_MEMMEM=1; AC_SUBST([HAVE_DECL_MEMMEM])
|
|
|
|
HAVE_MEMPCPY=1; AC_SUBST([HAVE_MEMPCPY])
|
|
|
|
HAVE_DECL_MEMRCHR=1; AC_SUBST([HAVE_DECL_MEMRCHR])
|
|
|
|
HAVE_RAWMEMCHR=1; AC_SUBST([HAVE_RAWMEMCHR])
|
|
|
|
HAVE_STPCPY=1; AC_SUBST([HAVE_STPCPY])
|
|
|
|
HAVE_STPNCPY=1; AC_SUBST([HAVE_STPNCPY])
|
|
|
|
HAVE_STRCHRNUL=1; AC_SUBST([HAVE_STRCHRNUL])
|
|
|
|
HAVE_DECL_STRDUP=1; AC_SUBST([HAVE_DECL_STRDUP])
|
|
|
|
HAVE_DECL_STRNDUP=1; AC_SUBST([HAVE_DECL_STRNDUP])
|
|
|
|
HAVE_DECL_STRNLEN=1; AC_SUBST([HAVE_DECL_STRNLEN])
|
|
|
|
HAVE_STRPBRK=1; AC_SUBST([HAVE_STRPBRK])
|
|
|
|
HAVE_STRSEP=1; AC_SUBST([HAVE_STRSEP])
|
|
|
|
HAVE_STRCASESTR=1; AC_SUBST([HAVE_STRCASESTR])
|
|
|
|
HAVE_DECL_STRTOK_R=1; AC_SUBST([HAVE_DECL_STRTOK_R])
|
|
|
|
HAVE_DECL_STRERROR_R=1; AC_SUBST([HAVE_DECL_STRERROR_R])
|
2020-09-06 00:48:45 +00:00
|
|
|
HAVE_STRERRORNAME_NP=1; AC_SUBST([HAVE_STRERRORNAME_NP])
|
2020-08-21 19:19:18 +00:00
|
|
|
HAVE_SIGABBREV_NP=1; AC_SUBST([HAVE_SIGABBREV_NP])
|
2020-08-23 21:09:48 +00:00
|
|
|
HAVE_SIGDESCR_NP=1; AC_SUBST([HAVE_SIGDESCR_NP])
|
2013-02-11 23:37:18 +00:00
|
|
|
HAVE_DECL_STRSIGNAL=1; AC_SUBST([HAVE_DECL_STRSIGNAL])
|
|
|
|
HAVE_STRVERSCMP=1; AC_SUBST([HAVE_STRVERSCMP])
|
2021-01-22 19:45:38 +00:00
|
|
|
REPLACE_FFSLL=0; AC_SUBST([REPLACE_FFSLL])
|
2013-02-11 23:37:18 +00:00
|
|
|
REPLACE_MEMCHR=0; AC_SUBST([REPLACE_MEMCHR])
|
|
|
|
REPLACE_MEMMEM=0; AC_SUBST([REPLACE_MEMMEM])
|
|
|
|
REPLACE_STPNCPY=0; AC_SUBST([REPLACE_STPNCPY])
|
2017-09-30 04:55:32 +00:00
|
|
|
REPLACE_STRCHRNUL=0; AC_SUBST([REPLACE_STRCHRNUL])
|
2013-02-11 23:37:18 +00:00
|
|
|
REPLACE_STRDUP=0; AC_SUBST([REPLACE_STRDUP])
|
2017-09-30 04:55:32 +00:00
|
|
|
REPLACE_STRNCAT=0; AC_SUBST([REPLACE_STRNCAT])
|
|
|
|
REPLACE_STRNDUP=0; AC_SUBST([REPLACE_STRNDUP])
|
|
|
|
REPLACE_STRNLEN=0; AC_SUBST([REPLACE_STRNLEN])
|
2013-02-11 23:37:18 +00:00
|
|
|
REPLACE_STRSTR=0; AC_SUBST([REPLACE_STRSTR])
|
|
|
|
REPLACE_STRCASESTR=0; AC_SUBST([REPLACE_STRCASESTR])
|
2017-09-30 04:55:32 +00:00
|
|
|
REPLACE_STRTOK_R=0; AC_SUBST([REPLACE_STRTOK_R])
|
2013-02-11 23:37:18 +00:00
|
|
|
REPLACE_STRERROR=0; AC_SUBST([REPLACE_STRERROR])
|
|
|
|
REPLACE_STRERROR_R=0; AC_SUBST([REPLACE_STRERROR_R])
|
2020-09-06 00:48:45 +00:00
|
|
|
REPLACE_STRERRORNAME_NP=0; AC_SUBST([REPLACE_STRERRORNAME_NP])
|
2013-02-11 23:37:18 +00:00
|
|
|
REPLACE_STRSIGNAL=0; AC_SUBST([REPLACE_STRSIGNAL])
|
|
|
|
UNDEFINE_STRTOK_R=0; AC_SUBST([UNDEFINE_STRTOK_R])
|
|
|
|
])
|