2021-01-01 09:51:18 +00:00
|
|
|
# canonicalize.m4 serial 35
|
Fix locating pdump by symlink
* admin/merge-gnulib (GNULIB_MODULES): Add canonicalize-lgpl module
* build-aux/config.guess, build-aux/gitlog-to-changelog,
build-aux/update-copyright, lib/canonicalize-lgpl.c,
lib/gnulib.mk.in, lib/malloca.c, lib/malloca.h, lib/pathmax.h,
m4/canonicalize.m4, m4/double-slash-root.m4, m4/gnulib-comp.m4,
m4/malloca.m4, my/pathmax.4: copy from GNUlib or regenerate from
update
* src/emacs.c: find dump by canonical path
2019-06-24 01:19:08 +00:00
|
|
|
|
2021-01-01 09:13:56 +00:00
|
|
|
dnl Copyright (C) 2003-2007, 2009-2021 Free Software Foundation, Inc.
|
Fix locating pdump by symlink
* admin/merge-gnulib (GNULIB_MODULES): Add canonicalize-lgpl module
* build-aux/config.guess, build-aux/gitlog-to-changelog,
build-aux/update-copyright, lib/canonicalize-lgpl.c,
lib/gnulib.mk.in, lib/malloca.c, lib/malloca.h, lib/pathmax.h,
m4/canonicalize.m4, m4/double-slash-root.m4, m4/gnulib-comp.m4,
m4/malloca.m4, my/pathmax.4: copy from GNUlib or regenerate from
update
* src/emacs.c: find dump by canonical path
2019-06-24 01:19:08 +00:00
|
|
|
|
|
|
|
dnl This file is free software; the Free Software Foundation
|
|
|
|
dnl gives unlimited permission to copy and/or distribute it,
|
|
|
|
dnl with or without modifications, as long as this notice is preserved.
|
|
|
|
|
|
|
|
# Provides canonicalize_file_name and canonicalize_filename_mode, but does
|
|
|
|
# not provide or fix realpath.
|
|
|
|
AC_DEFUN([gl_FUNC_CANONICALIZE_FILENAME_MODE],
|
|
|
|
[
|
|
|
|
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
|
2020-12-25 10:33:29 +00:00
|
|
|
AC_REQUIRE([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
|
|
|
|
AC_CHECK_FUNCS_ONCE([canonicalize_file_name faccessat])
|
Fix locating pdump by symlink
* admin/merge-gnulib (GNULIB_MODULES): Add canonicalize-lgpl module
* build-aux/config.guess, build-aux/gitlog-to-changelog,
build-aux/update-copyright, lib/canonicalize-lgpl.c,
lib/gnulib.mk.in, lib/malloca.c, lib/malloca.h, lib/pathmax.h,
m4/canonicalize.m4, m4/double-slash-root.m4, m4/gnulib-comp.m4,
m4/malloca.m4, my/pathmax.4: copy from GNUlib or regenerate from
update
* src/emacs.c: find dump by canonical path
2019-06-24 01:19:08 +00:00
|
|
|
AC_REQUIRE([gl_DOUBLE_SLASH_ROOT])
|
|
|
|
AC_REQUIRE([gl_FUNC_REALPATH_WORKS])
|
|
|
|
if test $ac_cv_func_canonicalize_file_name = no; then
|
|
|
|
HAVE_CANONICALIZE_FILE_NAME=0
|
|
|
|
else
|
|
|
|
case "$gl_cv_func_realpath_works" in
|
|
|
|
*yes) ;;
|
|
|
|
*) REPLACE_CANONICALIZE_FILE_NAME=1 ;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
])
|
|
|
|
|
|
|
|
# Provides canonicalize_file_name and realpath.
|
|
|
|
AC_DEFUN([gl_CANONICALIZE_LGPL],
|
|
|
|
[
|
|
|
|
AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
|
|
|
|
AC_REQUIRE([gl_CANONICALIZE_LGPL_SEPARATE])
|
|
|
|
if test $ac_cv_func_canonicalize_file_name = no; then
|
|
|
|
HAVE_CANONICALIZE_FILE_NAME=0
|
|
|
|
if test $ac_cv_func_realpath = no; then
|
|
|
|
HAVE_REALPATH=0
|
|
|
|
else
|
|
|
|
case "$gl_cv_func_realpath_works" in
|
|
|
|
*yes) ;;
|
|
|
|
*) REPLACE_REALPATH=1 ;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
case "$gl_cv_func_realpath_works" in
|
|
|
|
*yes)
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
REPLACE_CANONICALIZE_FILE_NAME=1
|
|
|
|
REPLACE_REALPATH=1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
])
|
|
|
|
|
|
|
|
# Like gl_CANONICALIZE_LGPL, except prepare for separate compilation
|
|
|
|
# (no REPLACE_CANONICALIZE_FILE_NAME, no REPLACE_REALPATH, no AC_LIBOBJ).
|
|
|
|
AC_DEFUN([gl_CANONICALIZE_LGPL_SEPARATE],
|
|
|
|
[
|
|
|
|
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
|
2020-12-25 10:33:29 +00:00
|
|
|
AC_REQUIRE([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
|
|
|
|
AC_CHECK_FUNCS_ONCE([canonicalize_file_name faccessat])
|
Update from Gnulib
This incorporates:
2020-08-16 time_rz: remove unused functions
2020-08-16 time_rz: fix issues with mktime_z failures
2020-08-16 nstrftime: Guide inlining also on clang
2020-08-16 intprops: Avoid bogus warning on clang
2020-08-16 libc-config: Enable __REDIRECT macro also on clang
2020-08-16 regex: Use initializer shorthand syntax also with clang
2020-08-16 regex: Use space optimization also with clang
2020-08-16 Use _Static_assert and static_assert when present on clang
2020-08-16 Use 'throw ()' for optimization in C++ mode also on clang
2020-08-16 stdio: Don't break attribute 'scanf' on clang
2020-08-16 Fix "warning: 'format' attribute ...: rpl_printf"
2020-08-16 Fix "warning: attribute declaration must precede definition"
2020-08-16 Fix undesired warnings
2020-08-16 Don't use Autoconf quadrigraphsxo
2020-08-16 Fix quoting of AC_LANG_PROGRAM arguments
2020-08-16 Assume autoconf >= 2.64
2020-08-15 nstrftime: be more predictable about errno
2020-08-15 canonicalize: Fix autoconf test on MSVC/clang
2020-08-15 Support compiling without -loldnames on native Windows
2020-08-14 mktime, mktime-internal: Remove obsolete code
2020-08-14 Assume tzset exists
* lib/c++defs.h, lib/canonicalize-lgpl.c, lib/cdefs.h, lib/dup2.c:
* lib/fcntl.in.h, lib/getopt-cdefs.in.h, lib/intprops.h, lib/md5.h:
* lib/mktime.c, lib/nstrftime.c, lib/open.c, lib/regcomp.c:
* lib/regex_internal.h, lib/stdio.in.h, lib/stdlib.in.h:
* lib/strftime.h, lib/string.in.h, lib/sys_select.in.h:
* lib/sys_stat.in.h, lib/sys_time.in.h, lib/time.in.h, lib/time_rz.c:
* lib/unistd.in.h, lib/verify.h, m4/00gnulib.m4:
* m4/absolute-header.m4, m4/alloca.m4, m4/canonicalize.m4, m4/dup2.m4:
* m4/fchmodat.m4, m4/fcntl.m4, m4/fdopendir.m4, m4/fpending.m4:
* m4/futimens.m4, m4/getdtablesize.m4, m4/getloadavg.m4:
* m4/gnulib-common.m4, m4/include_next.m4, m4/largefile.m4:
* m4/manywarnings.m4, m4/mktime.m4, m4/nstrftime.m4, m4/open-slash.m4:
* m4/pselect.m4, m4/pthread_sigmask.m4, m4/time_h.m4, m4/utimens.m4:
* m4/utimensat.m4, m4/utimes.m4, m4/warnings.m4:
Copy from Gnulib.
* lib/gnulib.mk.in: Regenerate.
2020-08-16 21:22:56 +00:00
|
|
|
|
|
|
|
dnl On native Windows, we use _getcwd(), regardless whether getcwd() is
|
|
|
|
dnl available through the linker option '-loldnames'.
|
|
|
|
AC_REQUIRE([AC_CANONICAL_HOST])
|
|
|
|
case "$host_os" in
|
|
|
|
mingw*) ;;
|
|
|
|
*) AC_CHECK_FUNCS([getcwd]) ;;
|
|
|
|
esac
|
|
|
|
|
Fix locating pdump by symlink
* admin/merge-gnulib (GNULIB_MODULES): Add canonicalize-lgpl module
* build-aux/config.guess, build-aux/gitlog-to-changelog,
build-aux/update-copyright, lib/canonicalize-lgpl.c,
lib/gnulib.mk.in, lib/malloca.c, lib/malloca.h, lib/pathmax.h,
m4/canonicalize.m4, m4/double-slash-root.m4, m4/gnulib-comp.m4,
m4/malloca.m4, my/pathmax.4: copy from GNUlib or regenerate from
update
* src/emacs.c: find dump by canonical path
2019-06-24 01:19:08 +00:00
|
|
|
AC_REQUIRE([gl_DOUBLE_SLASH_ROOT])
|
|
|
|
AC_REQUIRE([gl_FUNC_REALPATH_WORKS])
|
|
|
|
AC_CHECK_HEADERS_ONCE([sys/param.h])
|
|
|
|
])
|
|
|
|
|
|
|
|
# Check whether realpath works. Assume that if a platform has both
|
|
|
|
# realpath and canonicalize_file_name, but the former is broken, then
|
|
|
|
# so is the latter.
|
|
|
|
AC_DEFUN([gl_FUNC_REALPATH_WORKS],
|
|
|
|
[
|
|
|
|
AC_CHECK_FUNCS_ONCE([realpath])
|
|
|
|
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
|
|
|
|
AC_CACHE_CHECK([whether realpath works], [gl_cv_func_realpath_works], [
|
Update from Gnulib
This incorporates:
2020-08-16 time_rz: remove unused functions
2020-08-16 time_rz: fix issues with mktime_z failures
2020-08-16 nstrftime: Guide inlining also on clang
2020-08-16 intprops: Avoid bogus warning on clang
2020-08-16 libc-config: Enable __REDIRECT macro also on clang
2020-08-16 regex: Use initializer shorthand syntax also with clang
2020-08-16 regex: Use space optimization also with clang
2020-08-16 Use _Static_assert and static_assert when present on clang
2020-08-16 Use 'throw ()' for optimization in C++ mode also on clang
2020-08-16 stdio: Don't break attribute 'scanf' on clang
2020-08-16 Fix "warning: 'format' attribute ...: rpl_printf"
2020-08-16 Fix "warning: attribute declaration must precede definition"
2020-08-16 Fix undesired warnings
2020-08-16 Don't use Autoconf quadrigraphsxo
2020-08-16 Fix quoting of AC_LANG_PROGRAM arguments
2020-08-16 Assume autoconf >= 2.64
2020-08-15 nstrftime: be more predictable about errno
2020-08-15 canonicalize: Fix autoconf test on MSVC/clang
2020-08-15 Support compiling without -loldnames on native Windows
2020-08-14 mktime, mktime-internal: Remove obsolete code
2020-08-14 Assume tzset exists
* lib/c++defs.h, lib/canonicalize-lgpl.c, lib/cdefs.h, lib/dup2.c:
* lib/fcntl.in.h, lib/getopt-cdefs.in.h, lib/intprops.h, lib/md5.h:
* lib/mktime.c, lib/nstrftime.c, lib/open.c, lib/regcomp.c:
* lib/regex_internal.h, lib/stdio.in.h, lib/stdlib.in.h:
* lib/strftime.h, lib/string.in.h, lib/sys_select.in.h:
* lib/sys_stat.in.h, lib/sys_time.in.h, lib/time.in.h, lib/time_rz.c:
* lib/unistd.in.h, lib/verify.h, m4/00gnulib.m4:
* m4/absolute-header.m4, m4/alloca.m4, m4/canonicalize.m4, m4/dup2.m4:
* m4/fchmodat.m4, m4/fcntl.m4, m4/fdopendir.m4, m4/fpending.m4:
* m4/futimens.m4, m4/getdtablesize.m4, m4/getloadavg.m4:
* m4/gnulib-common.m4, m4/include_next.m4, m4/largefile.m4:
* m4/manywarnings.m4, m4/mktime.m4, m4/nstrftime.m4, m4/open-slash.m4:
* m4/pselect.m4, m4/pthread_sigmask.m4, m4/time_h.m4, m4/utimens.m4:
* m4/utimensat.m4, m4/utimes.m4, m4/warnings.m4:
Copy from Gnulib.
* lib/gnulib.mk.in: Regenerate.
2020-08-16 21:22:56 +00:00
|
|
|
rm -rf conftest.a conftest.d
|
Fix locating pdump by symlink
* admin/merge-gnulib (GNULIB_MODULES): Add canonicalize-lgpl module
* build-aux/config.guess, build-aux/gitlog-to-changelog,
build-aux/update-copyright, lib/canonicalize-lgpl.c,
lib/gnulib.mk.in, lib/malloca.c, lib/malloca.h, lib/pathmax.h,
m4/canonicalize.m4, m4/double-slash-root.m4, m4/gnulib-comp.m4,
m4/malloca.m4, my/pathmax.4: copy from GNUlib or regenerate from
update
* src/emacs.c: find dump by canonical path
2019-06-24 01:19:08 +00:00
|
|
|
touch conftest.a
|
|
|
|
mkdir conftest.d
|
|
|
|
AC_RUN_IFELSE([
|
|
|
|
AC_LANG_PROGRAM([[
|
|
|
|
]GL_NOCRASH[
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
]], [[
|
|
|
|
int result = 0;
|
|
|
|
{
|
|
|
|
char *name = realpath ("conftest.a", NULL);
|
|
|
|
if (!(name && *name == '/'))
|
|
|
|
result |= 1;
|
|
|
|
free (name);
|
|
|
|
}
|
|
|
|
{
|
|
|
|
char *name = realpath ("conftest.b/../conftest.a", NULL);
|
|
|
|
if (name != NULL)
|
|
|
|
result |= 2;
|
|
|
|
free (name);
|
|
|
|
}
|
|
|
|
{
|
|
|
|
char *name = realpath ("conftest.a/", NULL);
|
|
|
|
if (name != NULL)
|
|
|
|
result |= 4;
|
|
|
|
free (name);
|
|
|
|
}
|
|
|
|
{
|
|
|
|
char *name1 = realpath (".", NULL);
|
|
|
|
char *name2 = realpath ("conftest.d//./..", NULL);
|
|
|
|
if (! name1 || ! name2 || strcmp (name1, name2))
|
|
|
|
result |= 8;
|
|
|
|
free (name1);
|
|
|
|
free (name2);
|
|
|
|
}
|
|
|
|
return result;
|
|
|
|
]])
|
|
|
|
],
|
|
|
|
[gl_cv_func_realpath_works=yes],
|
|
|
|
[gl_cv_func_realpath_works=no],
|
|
|
|
[case "$host_os" in
|
|
|
|
# Guess yes on glibc systems.
|
|
|
|
*-gnu* | gnu*) gl_cv_func_realpath_works="guessing yes" ;;
|
|
|
|
# Guess yes on musl systems.
|
|
|
|
*-musl*) gl_cv_func_realpath_works="guessing yes" ;;
|
|
|
|
# Guess no on native Windows.
|
|
|
|
mingw*) gl_cv_func_realpath_works="guessing no" ;;
|
Update from Gnulib
This incorporates:
2019-09-22 Update some URLs
2019-09-15 fcntl-h: fix compilation error of creat.c on MSVC
2019-09-15 creat: new module
2019-09-15 access: new module
2019-09-09 Add option to assume best, not worst, when cross-compiling.
* build-aux/config.guess, build-aux/config.sub, doc/misc/texinfo.tex:
* lib/careadlinkat.c, lib/careadlinkat.h, lib/count-leading-zeros.h:
* lib/count-trailing-zeros.h, lib/diffseq.h, lib/fcntl.in.h:
* lib/ftoastr.c, lib/get-permissions.c:
* lib/ieee754.in.h, lib/inttypes.in.h, lib/mktime.c, lib/open.c:
* lib/pathmax.h, lib/pipe2.c, lib/stddef.in.h, lib/stdint.in.h:
* lib/stdlib.in.h, lib/str-two-way.h, lib/string.in.h, lib/time.in.h:
* lib/timegm.c, lib/unistd.in.h, m4/canonicalize.m4:
* m4/extern-inline.m4, m4/fcntl_h.m4, m4/fdopendir.m4:
* m4/getgroups.m4, m4/getopt.m4, m4/gettimeofday.m4:
* m4/gnulib-common.m4, m4/largefile.m4:
* m4/lstat.m4, m4/memmem.m4, m4/mktime.m4, m4/nocrash.m4, m4/open.m4:
* m4/pselect.m4, m4/putenv.m4, m4/readlink.m4, m4/regex.m4:
* m4/symlink.m4, m4/unistd_h.m4, m4/utimens.m4, m4/utimes.m4:
Copy from Gnulib.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* m4/open-slash.m4: New file, copied from Gnulib.
2019-09-23 06:50:59 +00:00
|
|
|
# If we don't know, obey --enable-cross-guesses.
|
|
|
|
*) gl_cv_func_realpath_works="$gl_cross_guess_normal" ;;
|
Fix locating pdump by symlink
* admin/merge-gnulib (GNULIB_MODULES): Add canonicalize-lgpl module
* build-aux/config.guess, build-aux/gitlog-to-changelog,
build-aux/update-copyright, lib/canonicalize-lgpl.c,
lib/gnulib.mk.in, lib/malloca.c, lib/malloca.h, lib/pathmax.h,
m4/canonicalize.m4, m4/double-slash-root.m4, m4/gnulib-comp.m4,
m4/malloca.m4, my/pathmax.4: copy from GNUlib or regenerate from
update
* src/emacs.c: find dump by canonical path
2019-06-24 01:19:08 +00:00
|
|
|
esac
|
|
|
|
])
|
|
|
|
rm -rf conftest.a conftest.d
|
|
|
|
])
|
|
|
|
case "$gl_cv_func_realpath_works" in
|
|
|
|
*yes)
|
|
|
|
AC_DEFINE([FUNC_REALPATH_WORKS], [1], [Define to 1 if realpath()
|
|
|
|
can malloc memory, always gives an absolute path, and handles
|
|
|
|
trailing slash correctly.])
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
])
|