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