mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-06-14 12:31:25 +00:00
Update from Gnulib by running admin/merge-gnulib
This commit is contained in:
parent
a937396e76
commit
f81d3a4882
5 changed files with 54 additions and 56 deletions
|
|
@ -49,7 +49,10 @@ extern "C" {
|
||||||
any notion of "current directory".
|
any notion of "current directory".
|
||||||
IS_RELATIVE_FILE_NAME(Filename)
|
IS_RELATIVE_FILE_NAME(Filename)
|
||||||
tests whether Filename may be concatenated
|
tests whether Filename may be concatenated
|
||||||
to a directory filename.
|
to a directory filename to yield the name
|
||||||
|
of a file relative to that directory.
|
||||||
|
Watch out: IS_RELATIVE_FILE_NAME ("") is 1
|
||||||
|
even though "" is not a relative file name.
|
||||||
Note: On native Windows, OS/2, DOS, "c:" is neither an absolute nor a
|
Note: On native Windows, OS/2, DOS, "c:" is neither an absolute nor a
|
||||||
relative file name!
|
relative file name!
|
||||||
IS_FILE_NAME_WITH_DIR(Filename) tests whether Filename contains a device
|
IS_FILE_NAME_WITH_DIR(Filename) tests whether Filename contains a device
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,7 @@ gl_consolesafe_fwrite (const void *ptr, size_t size, size_t nmemb, FILE *fp)
|
||||||
specifiers as the mingw *printf functions. */
|
specifiers as the mingw *printf functions. */
|
||||||
|
|
||||||
static int
|
static int
|
||||||
vasprintf (char **resultp, const char *format, va_list args)
|
local_vasprintf (char **resultp, const char *format, va_list args)
|
||||||
{
|
{
|
||||||
/* First try: Use a stack-allocated buffer. */
|
/* First try: Use a stack-allocated buffer. */
|
||||||
char buf[2048];
|
char buf[2048];
|
||||||
|
|
@ -123,6 +123,9 @@ vasprintf (char **resultp, const char *format, va_list args)
|
||||||
return nbytes;
|
return nbytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# undef vasprintf
|
||||||
|
# define vasprintf local_vasprintf
|
||||||
|
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
/* Bypass the functions __mingw_[v][f]printf, that trigger a bug in msvcrt,
|
/* Bypass the functions __mingw_[v][f]printf, that trigger a bug in msvcrt,
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
# getdelim.m4
|
# getdelim.m4
|
||||||
# serial 21
|
# serial 22
|
||||||
|
|
||||||
dnl Copyright (C) 2005-2007, 2009-2026 Free Software Foundation, Inc.
|
dnl Copyright (C) 2005-2007, 2009-2026 Free Software Foundation, Inc.
|
||||||
dnl
|
dnl
|
||||||
|
|
@ -37,7 +37,6 @@ AC_DEFUN([gl_FUNC_GETDELIM],
|
||||||
gl_cv_func_working_getdelim=no ;;
|
gl_cv_func_working_getdelim=no ;;
|
||||||
*)
|
*)
|
||||||
echo fooNbarN | tr -d '\012' | tr N '\012' > conftest.data
|
echo fooNbarN | tr -d '\012' | tr N '\012' > conftest.data
|
||||||
touch conftest.empty
|
|
||||||
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||||
# include <stdio.h>
|
# include <stdio.h>
|
||||||
# include <stdlib.h>
|
# include <stdlib.h>
|
||||||
|
|
@ -68,36 +67,32 @@ AC_DEFUN([gl_FUNC_GETDELIM],
|
||||||
free (line);
|
free (line);
|
||||||
}
|
}
|
||||||
fclose (in);
|
fclose (in);
|
||||||
{
|
|
||||||
/* Test that reading EOF as the first character sets the first byte
|
|
||||||
in the buffer to NUL. This fails on glibc 2.42 and earlier. */
|
|
||||||
in = fopen ("./conftest.empty", "r");
|
|
||||||
if (!in)
|
|
||||||
return 1;
|
|
||||||
char *line = malloc (1);
|
|
||||||
line[0] = 'A';
|
|
||||||
size_t siz = 1;
|
|
||||||
if (getdelim (&line, &siz, '\n', in) != -1 || line[0] != '\0')
|
|
||||||
result |= 8;
|
|
||||||
free (line);
|
|
||||||
}
|
|
||||||
fclose (in);
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
]])],
|
]])],
|
||||||
[gl_cv_func_working_getdelim=yes],
|
[gl_cv_func_working_getdelim=yes],
|
||||||
[gl_cv_func_working_getdelim=no],
|
[gl_cv_func_working_getdelim=no],
|
||||||
[case "$host_os" in
|
[dnl We're cross compiling.
|
||||||
# Guess yes on musl.
|
dnl Guess it works on glibc2 systems and musl systems.
|
||||||
*-musl* | midipix*) gl_cv_func_working_getdelim="guessing yes" ;;
|
AC_EGREP_CPP([Lucky GNU user],
|
||||||
# Guess no on glibc.
|
[
|
||||||
*-gnu* | gnu*) gl_cv_func_working_getdelim="guessing no" ;;
|
#include <features.h>
|
||||||
*) gl_cv_func_working_getdelim="$gl_cross_guess_normal" ;;
|
#ifdef __GNU_LIBRARY__
|
||||||
esac
|
#if (__GLIBC__ >= 2) && !defined __UCLIBC__
|
||||||
|
Lucky GNU user
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
],
|
||||||
|
[gl_cv_func_working_getdelim="guessing yes"],
|
||||||
|
[case "$host_os" in
|
||||||
|
*-musl* | midipix*) gl_cv_func_working_getdelim="guessing yes" ;;
|
||||||
|
*) gl_cv_func_working_getdelim="$gl_cross_guess_normal" ;;
|
||||||
|
esac
|
||||||
|
])
|
||||||
])
|
])
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
rm -f conftest.data conftest.empty
|
rm -f conftest.data
|
||||||
])
|
])
|
||||||
case "$gl_cv_func_working_getdelim" in
|
case "$gl_cv_func_working_getdelim" in
|
||||||
*yes) ;;
|
*yes) ;;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
# getline.m4
|
# getline.m4
|
||||||
# serial 35
|
# serial 36
|
||||||
|
|
||||||
dnl Copyright (C) 1998-2003, 2005-2007, 2009-2026 Free Software Foundation,
|
dnl Copyright (C) 1998-2003, 2005-2007, 2009-2026 Free Software Foundation,
|
||||||
dnl Inc.
|
dnl Inc.
|
||||||
|
|
@ -31,7 +31,6 @@ AC_DEFUN([gl_FUNC_GETLINE],
|
||||||
AC_CACHE_CHECK([for working getline function],
|
AC_CACHE_CHECK([for working getline function],
|
||||||
[am_cv_func_working_getline],
|
[am_cv_func_working_getline],
|
||||||
[echo fooNbarN | tr -d '\012' | tr N '\012' > conftest.data
|
[echo fooNbarN | tr -d '\012' | tr N '\012' > conftest.data
|
||||||
touch conftest.empty
|
|
||||||
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||||
# include <stdio.h>
|
# include <stdio.h>
|
||||||
# include <stdlib.h>
|
# include <stdlib.h>
|
||||||
|
|
@ -62,34 +61,30 @@ AC_DEFUN([gl_FUNC_GETLINE],
|
||||||
free (line);
|
free (line);
|
||||||
}
|
}
|
||||||
fclose (in);
|
fclose (in);
|
||||||
{
|
|
||||||
/* Test that reading EOF as the first character sets the first byte
|
|
||||||
in the buffer to NUL. This fails on glibc 2.42 and earlier. */
|
|
||||||
in = fopen ("./conftest.empty", "r");
|
|
||||||
if (!in)
|
|
||||||
return 1;
|
|
||||||
char *line = malloc (1);
|
|
||||||
line[0] = 'A';
|
|
||||||
size_t siz = 1;
|
|
||||||
if (getline (&line, &siz, in) != -1 || line[0] != '\0')
|
|
||||||
result |= 8;
|
|
||||||
free (line);
|
|
||||||
}
|
|
||||||
fclose (in);
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
]])],
|
]])],
|
||||||
[am_cv_func_working_getline=yes],
|
[am_cv_func_working_getline=yes],
|
||||||
[am_cv_func_working_getline=no],
|
[am_cv_func_working_getline=no],
|
||||||
[case "$host_os" in
|
[dnl We're cross compiling.
|
||||||
# Guess yes on musl.
|
dnl Guess it works on glibc2 systems and musl systems.
|
||||||
*-musl* | midipix*) am_cv_func_working_getline="guessing yes" ;;
|
AC_EGREP_CPP([Lucky GNU user],
|
||||||
# Guess no on glibc.
|
[
|
||||||
*-gnu* | gnu*) am_cv_func_working_getline="guessing no" ;;
|
#include <features.h>
|
||||||
*) am_cv_func_working_getline="$gl_cross_guess_normal" ;;
|
#ifdef __GNU_LIBRARY__
|
||||||
esac
|
#if (__GLIBC__ >= 2) && !defined __UCLIBC__
|
||||||
|
Lucky GNU user
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
],
|
||||||
|
[am_cv_func_working_getline="guessing yes"],
|
||||||
|
[case "$host_os" in
|
||||||
|
*-musl* | midipix*) am_cv_func_working_getline="guessing yes" ;;
|
||||||
|
*) am_cv_func_working_getline="$gl_cross_guess_normal" ;;
|
||||||
|
esac
|
||||||
|
])
|
||||||
])
|
])
|
||||||
rm -f conftest.data conftest.empty
|
rm -f conftest.data
|
||||||
])
|
])
|
||||||
else
|
else
|
||||||
am_cv_func_working_getline=no
|
am_cv_func_working_getline=no
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
# selinux-selinux-h.m4
|
# selinux-selinux-h.m4
|
||||||
# serial 10 -*- Autoconf -*-
|
# serial 12 -*- Autoconf -*-
|
||||||
dnl Copyright (C) 2006-2007, 2009-2026 Free Software Foundation, Inc.
|
dnl Copyright (C) 2006-2007, 2009-2026 Free Software Foundation, Inc.
|
||||||
dnl This file is free software; the Free Software Foundation
|
dnl This file is free software; the Free Software Foundation
|
||||||
dnl gives unlimited permission to copy and/or distribute it,
|
dnl gives unlimited permission to copy and/or distribute it,
|
||||||
|
|
@ -49,7 +49,7 @@ AC_DEFUN([gl_CHECK_HEADER_SELINUX_SELINUX_H],
|
||||||
USE_SELINUX_SELINUX_H=0
|
USE_SELINUX_SELINUX_H=0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
case "$ac_cv_search_setfilecon:$ac_cv_header_selinux_selinux_h" in
|
case "$ac_cv_search_getfilecon_raw:$ac_cv_header_selinux_selinux_h" in
|
||||||
no:*) # already warned
|
no:*) # already warned
|
||||||
;;
|
;;
|
||||||
*:no)
|
*:no)
|
||||||
|
|
@ -79,15 +79,17 @@ AC_DEFUN([gl_LIBSELINUX],
|
||||||
LIB_SELINUX=
|
LIB_SELINUX=
|
||||||
if test "$with_selinux" != no; then
|
if test "$with_selinux" != no; then
|
||||||
gl_saved_LIBS=$LIBS
|
gl_saved_LIBS=$LIBS
|
||||||
AC_SEARCH_LIBS([setfilecon], [selinux],
|
dnl On Android, in Termux, prefer libandroid-selinux.so, because it
|
||||||
[test "$ac_cv_search_setfilecon" = "none required" ||
|
dnl defines many more API functions than /system/lib/libselinux.so.
|
||||||
LIB_SELINUX=$ac_cv_search_setfilecon])
|
AC_SEARCH_LIBS([getfilecon_raw], [android-selinux selinux],
|
||||||
|
[test "$ac_cv_search_getfilecon_raw" = "none required" ||
|
||||||
|
LIB_SELINUX=$ac_cv_search_getfilecon_raw])
|
||||||
LIBS=$gl_saved_LIBS
|
LIBS=$gl_saved_LIBS
|
||||||
fi
|
fi
|
||||||
AC_SUBST([LIB_SELINUX])
|
AC_SUBST([LIB_SELINUX])
|
||||||
|
|
||||||
# Warn if SELinux is found but libselinux is absent;
|
# Warn if SELinux is found but libselinux is absent;
|
||||||
if test "$ac_cv_search_setfilecon" = no; then
|
if test "$ac_cv_search_getfilecon_raw" = no; then
|
||||||
if test "$host" = "$build" \
|
if test "$host" = "$build" \
|
||||||
&& { test -d /sys/fs/selinux || test -d /selinux; }; then
|
&& { test -d /sys/fs/selinux || test -d /selinux; }; then
|
||||||
AC_MSG_WARN([This system supports SELinux but libselinux is missing.])
|
AC_MSG_WARN([This system supports SELinux but libselinux is missing.])
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue