Debian Codegraph @

m4/double-slash-root.m4

raw
1 # double-slash-root.m4
2 # serial 4 -*- Autoconf -*-
3 dnl Copyright (C) 2006, 2008-2024 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
7 dnl This file is offered as-is, without any warranty.
8
9 AC_DEFUN([gl_DOUBLE_SLASH_ROOT],
10 [
11 AC_REQUIRE([AC_CANONICAL_HOST])
12 AC_CACHE_CHECK([whether // is distinct from /], [gl_cv_double_slash_root],
13 [ if test x"$cross_compiling" = xyes ; then
14 # When cross-compiling, there is no way to tell whether // is special
15 # short of a list of hosts. However, the only known hosts to date
16 # that have a distinct // are Apollo DomainOS (too old to port to),
17 # Cygwin, and z/OS. If anyone knows of another system for which // has
18 # special semantics and is distinct from /, please report it to
19 # <[email protected]>.
20 case $host in
21 *-cygwin | i370-ibm-openedition)
22 gl_cv_double_slash_root=yes ;;
23 *)
24 # Be optimistic and assume that / and // are the same when we
25 # don't know.
26 gl_cv_double_slash_root='unknown, assuming no' ;;
27 esac
28 else
29 set x `ls -di / // 2>/dev/null`
30 if test "$[2]" = "$[4]" && wc //dev/null >/dev/null 2>&1; then
31 gl_cv_double_slash_root=no
32 else
33 gl_cv_double_slash_root=yes
34 fi
35 fi])
36 if test "$gl_cv_double_slash_root" = yes; then
37 AC_DEFINE([DOUBLE_SLASH_IS_DISTINCT_ROOT], [1],
38 [Define to 1 if // is a file system root distinct from /.])
39 fi
40 ])