1
#serial 11 -*- autoconf -*-
3
# Define some macros required for proper operation of code in lib/*.c
4
# on MSDOS/Windows systems.
6
# Copyright (C) 2000-2001, 2004-2006, 2009-2010 Free Software Foundation, Inc.
7
# This file is free software; the Free Software Foundation
8
# gives unlimited permission to copy and/or distribute it,
9
# with or without modifications, as long as this notice is preserved.
15
AC_CACHE_CHECK([whether system is Windows or MSDOS], [ac_cv_win_or_dos],
17
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[
18
#if !defined _WIN32 && !defined __WIN32__ && !defined __MSDOS__ && !defined __CYGWIN__
19
neither MSDOS nor Windows
21
[ac_cv_win_or_dos=yes],
22
[ac_cv_win_or_dos=no])
25
if test x"$ac_cv_win_or_dos" = xyes; then
26
ac_fs_accepts_drive_letter_prefix=1
27
ac_fs_backslash_is_file_name_separator=1
28
AC_CACHE_CHECK([whether drive letter can start relative path],
29
[ac_cv_drive_letter_can_be_relative],
31
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[
32
#if defined __CYGWIN__
33
drive letters are always absolute
35
[ac_cv_drive_letter_can_be_relative=yes],
36
[ac_cv_drive_letter_can_be_relative=no])
38
if test x"$ac_cv_drive_letter_can_be_relative" = xyes; then
39
ac_fs_drive_letter_can_be_relative=1
41
ac_fs_drive_letter_can_be_relative=0
44
ac_fs_accepts_drive_letter_prefix=0
45
ac_fs_backslash_is_file_name_separator=0
46
ac_fs_drive_letter_can_be_relative=0
49
AC_DEFINE_UNQUOTED([FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX],
50
$ac_fs_accepts_drive_letter_prefix,
51
[Define on systems for which file names may have a so-called
52
`drive letter' prefix, define this to compute the length of that
53
prefix, including the colon.])
56
[#if FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR
57
# define ISSLASH(C) ((C) == '/' || (C) == '\\')
59
# define ISSLASH(C) ((C) == '/')
62
AC_DEFINE_UNQUOTED([FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR],
63
$ac_fs_backslash_is_file_name_separator,
64
[Define if the backslash character may also serve as a file name
65
component separator.])
67
AC_DEFINE_UNQUOTED([FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE],
68
$ac_fs_drive_letter_can_be_relative,
69
[Define if a drive letter prefix denotes a relative path if it is
70
not followed by a file name component separator.])