summaryrefslogtreecommitdiffstats
path: root/gl/m4/dos.m4
diff options
context:
space:
mode:
authorTon Voon <tonvoon@users.sourceforge.net>2007-01-24 22:47:25 (GMT)
committerTon Voon <tonvoon@users.sourceforge.net>2007-01-24 22:47:25 (GMT)
commitfe856aa957978504137c1d425815d4ed8a22be40 (patch)
treea5bb46ce0e64b2056f75700eadbf27aba7c39418 /gl/m4/dos.m4
parent210f39bc84cfbb21cd72dc054e43f13815ee0616 (diff)
downloadmonitoring-plugins-fe856aa957978504137c1d425815d4ed8a22be40.tar.gz
Sync with gnulib - lots of extraneous code removed in preference to GNU code
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1580 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'gl/m4/dos.m4')
-rw-r--r--gl/m4/dos.m471
1 files changed, 71 insertions, 0 deletions
diff --git a/gl/m4/dos.m4 b/gl/m4/dos.m4
new file mode 100644
index 0000000..dd59571
--- /dev/null
+++ b/gl/m4/dos.m4
@@ -0,0 +1,71 @@
1#serial 10 -*- autoconf -*-
2
3# Define some macros required for proper operation of code in lib/*.c
4# on MSDOS/Windows systems.
5
6# Copyright (C) 2000, 2001, 2004, 2005, 2006 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.
10
11# From Jim Meyering.
12
13AC_DEFUN([gl_AC_DOS],
14 [
15 AC_CACHE_CHECK([whether system is Windows or MSDOS], [ac_cv_win_or_dos],
16 [
17 AC_TRY_COMPILE([],
18 [#if !defined _WIN32 && !defined __WIN32__ && !defined __MSDOS__ && !defined __CYGWIN__
19neither MSDOS nor Windows
20#endif],
21 [ac_cv_win_or_dos=yes],
22 [ac_cv_win_or_dos=no])
23 ])
24
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],
30 [
31 AC_TRY_COMPILE([],
32 [#if defined __CYGWIN__
33drive letters are always absolute
34#endif],
35 [ac_cv_drive_letter_can_be_relative=yes],
36 [ac_cv_drive_letter_can_be_relative=no])
37 ])
38 if test x"$ac_cv_drive_letter_can_be_relative" = xyes; then
39 ac_fs_drive_letter_can_be_relative=1
40 else
41 ac_fs_drive_letter_can_be_relative=0
42 fi
43 else
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
47 fi
48
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.])
54
55 AH_VERBATIM(ISSLASH,
56 [#if FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR
57# define ISSLASH(C) ((C) == '/' || (C) == '\\')
58#else
59# define ISSLASH(C) ((C) == '/')
60#endif])
61
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.])
66
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.])
71 ])