2N/A#serial 11 -*- autoconf -*-
2N/A
2N/A# Define some macros required for proper operation of code in lib/*.c
2N/A# on MSDOS/Windows systems.
2N/A
2N/A# Copyright (C) 2000-2001, 2004-2006, 2009-2010 Free Software Foundation, Inc.
2N/A# This file is free software; the Free Software Foundation
2N/A# gives unlimited permission to copy and/or distribute it,
2N/A# with or without modifications, as long as this notice is preserved.
2N/A
2N/A# From Jim Meyering.
2N/A
2N/AAC_DEFUN([gl_AC_DOS],
2N/A [
2N/A AC_CACHE_CHECK([whether system is Windows or MSDOS], [ac_cv_win_or_dos],
2N/A [
2N/A AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[
2N/A#if !defined _WIN32 && !defined __WIN32__ && !defined __MSDOS__ && !defined __CYGWIN__
2N/Aneither MSDOS nor Windows
2N/A#endif]])],
2N/A [ac_cv_win_or_dos=yes],
2N/A [ac_cv_win_or_dos=no])
2N/A ])
2N/A
2N/A if test x"$ac_cv_win_or_dos" = xyes; then
2N/A ac_fs_accepts_drive_letter_prefix=1
2N/A ac_fs_backslash_is_file_name_separator=1
2N/A AC_CACHE_CHECK([whether drive letter can start relative path],
2N/A [ac_cv_drive_letter_can_be_relative],
2N/A [
2N/A AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[
2N/A#if defined __CYGWIN__
2N/Adrive letters are always absolute
2N/A#endif]])],
2N/A [ac_cv_drive_letter_can_be_relative=yes],
2N/A [ac_cv_drive_letter_can_be_relative=no])
2N/A ])
2N/A if test x"$ac_cv_drive_letter_can_be_relative" = xyes; then
2N/A ac_fs_drive_letter_can_be_relative=1
2N/A else
2N/A ac_fs_drive_letter_can_be_relative=0
2N/A fi
2N/A else
2N/A ac_fs_accepts_drive_letter_prefix=0
2N/A ac_fs_backslash_is_file_name_separator=0
2N/A ac_fs_drive_letter_can_be_relative=0
2N/A fi
2N/A
2N/A AC_DEFINE_UNQUOTED([FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX],
2N/A $ac_fs_accepts_drive_letter_prefix,
2N/A [Define on systems for which file names may have a so-called
2N/A `drive letter' prefix, define this to compute the length of that
2N/A prefix, including the colon.])
2N/A
2N/A AH_VERBATIM(ISSLASH,
2N/A [#if FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR
2N/A# define ISSLASH(C) ((C) == '/' || (C) == '\\')
2N/A#else
2N/A# define ISSLASH(C) ((C) == '/')
2N/A#endif])
2N/A
2N/A AC_DEFINE_UNQUOTED([FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR],
2N/A $ac_fs_backslash_is_file_name_separator,
2N/A [Define if the backslash character may also serve as a file name
2N/A component separator.])
2N/A
2N/A AC_DEFINE_UNQUOTED([FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE],
2N/A $ac_fs_drive_letter_can_be_relative,
2N/A [Define if a drive letter prefix denotes a relative path if it is
2N/A not followed by a file name component separator.])
2N/A ])