Blame gnulib/m4/double-slash-root.m4

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