Debian Codegraph @

tools/gnulib/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
8 AC_DEFUN([gl_DOUBLE_SLASH_ROOT],
9 [
10 AC_REQUIRE([AC_CANONICAL_HOST])
11 AC_CACHE_CHECK([whether // is distinct from /], [gl_cv_double_slash_root],
12 [ if test x"$cross_compiling" = xyes ; then
13 # When cross-compiling, there is no way to tell whether // is special
14 # short of a list of hosts. However, the only known hosts to date
15 # that have a distinct // are Apollo DomainOS (too old to port to),
16 # Cygwin, and z/OS. If anyone knows of another system for which // has
17 # special semantics and is distinct from /, please report it to
18 # <[email protected]>.
19 case $host in
20 *-cygwin | i370-ibm-openedition)
21 gl_cv_double_slash_root=yes ;;
22 *)
23 # Be optimistic and assume that / and // are the same when we
24 # don't know.
25 gl_cv_double_slash_root='unknown, assuming no' ;;
26 esac
27 else
28 set x `ls -di / // 2>/dev/null`
29 if test "$[2]" = "$[4]" && wc //dev/null >/dev/null 2>&1; then
30 gl_cv_double_slash_root=no
31 else
32 gl_cv_double_slash_root=yes
33 fi
34 fi])
35 if test "$gl_cv_double_slash_root" = yes; then
36 AC_DEFINE([DOUBLE_SLASH_IS_DISTINCT_ROOT], [1],
37 [Define to 1 if // is a file system root distinct from /.])
38 fi
39 ])