Blame m4/double-slash-root.m4

Packit 709fb3
# double-slash-root.m4 serial 4   -*- Autoconf -*-
Packit 709fb3
dnl Copyright (C) 2006, 2008-2017 Free Software Foundation, Inc.
Packit 709fb3
dnl This file is free software; the Free Software Foundation
Packit 709fb3
dnl gives unlimited permission to copy and/or distribute it,
Packit 709fb3
dnl with or without modifications, as long as this notice is preserved.
Packit 709fb3
Packit 709fb3
AC_DEFUN([gl_DOUBLE_SLASH_ROOT],
Packit 709fb3
[
Packit 709fb3
  AC_REQUIRE([AC_CANONICAL_HOST])
Packit 709fb3
  AC_CACHE_CHECK([whether // is distinct from /], [gl_cv_double_slash_root],
Packit 709fb3
    [ if test x"$cross_compiling" = xyes ; then
Packit 709fb3
        # When cross-compiling, there is no way to tell whether // is special
Packit 709fb3
        # short of a list of hosts.  However, the only known hosts to date
Packit 709fb3
        # that have a distinct // are Apollo DomainOS (too old to port to),
Packit 709fb3
        # Cygwin, and z/OS.  If anyone knows of another system for which // has
Packit 709fb3
        # special semantics and is distinct from /, please report it to
Packit 709fb3
        # <bug-gnulib@gnu.org>.
Packit 709fb3
        case $host in
Packit 709fb3
          *-cygwin | i370-ibm-openedition)
Packit 709fb3
            gl_cv_double_slash_root=yes ;;
Packit 709fb3
          *)
Packit 709fb3
            # Be optimistic and assume that / and // are the same when we
Packit 709fb3
            # don't know.
Packit 709fb3
            gl_cv_double_slash_root='unknown, assuming no' ;;
Packit 709fb3
        esac
Packit 709fb3
      else
Packit 709fb3
        set x `ls -di / // 2>/dev/null`
Packit 709fb3
        if test "$[2]" = "$[4]" && wc //dev/null >/dev/null 2>&1; then
Packit 709fb3
          gl_cv_double_slash_root=no
Packit 709fb3
        else
Packit 709fb3
          gl_cv_double_slash_root=yes
Packit 709fb3
        fi
Packit 709fb3
      fi])
Packit 709fb3
  if test "$gl_cv_double_slash_root" = yes; then
Packit 709fb3
    AC_DEFINE([DOUBLE_SLASH_IS_DISTINCT_ROOT], [1],
Packit 709fb3
      [Define to 1 if // is a file system root distinct from /.])
Packit 709fb3
  fi
Packit 709fb3
])