3 # Define some macros required for proper operation of code in lib/*.c
4 # on MSDOS/Windows systems.
6 # Copyright (C) 2000, 2001, 2004 Free Software Foundation, Inc.
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2, or (at your option)
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
27 AC_CACHE_CHECK([whether system is Windows or MSDOS], [ac_cv_win_or_dos],
30 [#if !defined _WIN32 && !defined __WIN32__ && !defined __MSDOS__ && !defined __CYGWIN__
31 neither MSDOS nor Windows
33 [ac_cv_win_or_dos=yes],
34 [ac_cv_win_or_dos=no])
37 if test x"$ac_cv_win_or_dos" = xyes; then
38 ac_fs_accepts_drive_letter_prefix=1
39 ac_fs_backslash_is_file_name_separator=1
41 ac_fs_accepts_drive_letter_prefix=0
42 ac_fs_backslash_is_file_name_separator=0
45 AH_VERBATIM(FILE_SYSTEM_PREFIX_LEN,
46 [#if FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX
47 # define FILE_SYSTEM_PREFIX_LEN(Filename) \
48 ((Filename)[0] && (Filename)[1] == ':' ? 2 : 0)
50 # define FILE_SYSTEM_PREFIX_LEN(Filename) 0
53 AC_DEFINE_UNQUOTED([FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX],
54 $ac_fs_accepts_drive_letter_prefix,
55 [Define on systems for which file names may have a so-called
56 `drive letter' prefix, define this to compute the length of that
57 prefix, including the colon.])
60 [#if FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR
61 # define ISSLASH(C) ((C) == '/' || (C) == '\\')
63 # define ISSLASH(C) ((C) == '/')
66 AC_DEFINE_UNQUOTED([FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR],
67 $ac_fs_backslash_is_file_name_separator,
68 [Define if the backslash character may also serve as a file name
69 component separator.])