home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / mm / mm-ccmd-0.91-20031009.tar.gz / mm-ccmd-0.91-20031009.tar / work / ccmd / machdep.h < prev    next >
C/C++ Source or Header  |  2002-09-20  |  7KB  |  259 lines

  1. /*
  2.  Copyright (c) 1986, 1990 by The Trustees of Columbia University in
  3.  the City of New York.  Permission is granted to any individual or
  4.  institution to use, copy, or redistribute this software so long as it
  5.  is not sold for profit, provided this copyright notice is retained.
  6.  
  7. */
  8. /*
  9.  * This file contains conditional compilation directives describing the
  10.  * presence or absence of certain common features which are not unique
  11.  * to any one generic environment.
  12.  *
  13.  * Machine dependencies which need to be reflected in the compilation
  14.  * of ccmd applications should go into ccmdmd.h.
  15.  */
  16.  
  17. /* KLH: Completely re-written Feb-2002, along lines similar to that
  18.  *    of the "cenv.h" file in the KLH10 distribution.
  19.  *
  20.  *    Note that all of the HAVE_ conditional macros must be defined as
  21.  *    either 0 or 1 by the end of this file, and code must test their
  22.  *    values rather than whether they are defined.
  23.  */
  24.  
  25. /* Allow site-specific settings here to override even those provided
  26.  * by the Makefile.
  27.  */
  28. #include "site.h"
  29.  
  30.  
  31. /* Attempt to identify general system type being compiled for.
  32.  * This requires conspiracy with the Makefile.
  33.  */
  34.  
  35. /* Specific OS flags, in alpha order */
  36.  
  37. #ifndef  CCMD_OS_AIX
  38. # define CCMD_OS_AIX 0
  39. #endif
  40. #ifndef  CCMD_OS_BSD    /* Old-style BSD (4.2 and earlier) */
  41. # define CCMD_OS_BSD 0
  42. #endif
  43. #ifndef  CCMD_OS_BSD44    /* New-style BSD (4.4 and up) */
  44. # define CCMD_OS_BSD44 0
  45. #endif
  46. #ifndef  CCMD_OS_DECOSF    /* DEC OSF/1, Digital Unix, Tru64 */
  47. # define CCMD_OS_DECOSF 0
  48. #endif
  49. #ifndef  CCMD_OS_HPUX
  50. # define CCMD_OS_HPUX 0
  51. #endif
  52. #ifndef  CCMD_OS_LINUX
  53. # define CCMD_OS_LINUX 0
  54. #endif
  55. #ifndef  CCMD_OS_MSDOS
  56. # define CCMD_OS_MSDOS 0
  57. #endif
  58. #ifndef  CCMD_OS_SOLARIS
  59. # define CCMD_OS_SOLARIS 0
  60. #endif
  61. #ifndef  CCMD_OS_U3B
  62. # define CCMD_OS_U3B 0
  63. #endif
  64.  
  65. /* At this point we can test to see if nothing is defined, and if so
  66.  * attempt to figure it out from well-known predefined macros.
  67.  * What's here is the old code, which badly needs updating.
  68.  *
  69.  * Other macros still used in various places in the code, not
  70.  * yet cleaned up:
  71.  *    V7 LATTICE VENIX RAINBOW
  72.  */
  73. #if !(CCMD_OS_AIX|CCMD_OS_BSD|CCMD_OS_BSD44|CCMD_OS_DECOSF \
  74.      |CCMD_OS_HPUX|CCMD_OS_LINUX|CCMD_OS_MSDOS|CCMD_OS_SOLARIS|CCMD_OS_U3B)
  75. # ifdef unix
  76. #  ifdef hpux
  77. #   undef  CCMD_OS_HPUX
  78. #   define CCMD_OS_HPUX 1
  79. #  elif (u3b || u3b2 || u3b5 || u3b15 || u3b20)
  80. #   undef  CCMD_OS_U3B
  81. #   define CCMD_OS_U3B 1
  82. #  elif /* defined(TIOCNOTTY) || */ sun || ultrix || accel
  83. #   undef  CCMD_OS_BSD
  84. #   define CCMD_OS_BSD 1
  85. #  endif
  86. # elif defined(MSDOS)
  87. #   undef  CCMD_OS_MSDOS
  88. #   define CCMD_OS_MSDOS 1
  89. # endif
  90. #endif
  91.  
  92. /* Composite flags (BSD and BSD44 probably should go here) */
  93.  
  94. #ifndef  CCMD_OS_SVR2
  95. # define CCMD_OS_SVR2 (CCMD_OS_AIX)
  96. #endif
  97. #ifndef  CCMD_OS_SVR3
  98. # define CCMD_OS_SVR3 (CCMD_OS_DECOSF|CCMD_OS_SOLARIS)
  99. #endif
  100. #ifndef  CCMD_OS_SVR4
  101. # define CCMD_OS_SVR4 (0)
  102. #endif
  103. #ifndef  CCMD_OS_SYSV
  104. # define CCMD_OS_SYSV (CCMD_OS_HPUX|CCMD_OS_U3B \
  105.               |CCMD_OS_SVR2|CCMD_OS_SVR3|CCMD_OS_SVR4)
  106. #endif
  107. #ifndef  CCMD_OS_UNIX
  108. # ifdef unix
  109. #  define CCMD_OS_UNIX 1
  110. # else
  111. #  define CCMD_OS_UNIX (CCMD_OS_AIX|CCMD_OS_BSD|CCMD_OS_BSD44|CCMD_OS_DECOSF \
  112.                |CCMD_OS_HPUX|CCMD_OS_LINUX|CCMD_OS_SOLARIS|CCMD_OS_U3B)
  113. # endif
  114. #endif
  115.  
  116.  
  117. /* ======================================================== */
  118.  
  119. /* Weird site-dependent options, not sure where to put */
  120.  
  121. /* completion is slow when using Sun's YP facility */
  122. /* #define NO_USERNAME_COMPLETION */
  123. /* #define NO_GROUP_COMPLETION */
  124.  
  125.  
  126. /* ======================================================== */
  127.  
  128. /* Defaults for all HAVE_ conditional macros, in quest to remove
  129.    sys-oriented conditionals in favor of feature-oriented ones.
  130. */
  131.  
  132. #ifndef  HAVE_INDEX    /* System uses index/rindex? */
  133. # define HAVE_INDEX (CCMD_OS_BSD)
  134. #endif
  135.  
  136. #ifndef  HAVE_BSTRING    /* System has bcopy/bzero/bcmp? */
  137. # define HAVE_BSTRING (CCMD_OS_BSD|CCMD_OS_LINUX)
  138. #endif
  139.  
  140. #ifndef  HAVE_VOIDSIG    /* System sig handlers declared as void? */
  141. # define HAVE_VOIDSIG (CCMD_OS_SVR3|CCMD_OS_SVR4)
  142. #endif
  143.  
  144. #ifndef HAVE_PW_AGE
  145. # if (CCMD_OS_BSD44|CCMD_OS_LINUX|CCMD_OS_AIX|CCMD_OS_DECOSF)
  146. #  define HAVE_PW_AGE 0        /* Known to NOT have field */
  147. # elif CCMD_OS_SYSV
  148. #  define HAVE_PW_AGE 1
  149. # else
  150. #  define HAVE_PW_AGE 0        /* Unknown, assume 0 */ 
  151. # endif
  152. #endif
  153.  
  154. #ifndef HAVE_PW_COMMENT
  155. # if (CCMD_OS_BSD44|CCMD_OS_LINUX|CCMD_OS_AIX)
  156. #  define HAVE_PW_COMMENT 0    /* Known to NOT have field */
  157. # else
  158. #  define HAVE_PW_COMMENT 1
  159. # endif
  160. #endif
  161.  
  162.  
  163. #ifndef  HAVE_TZ_SYSV    /* Have SYSV "extern timezone;" crock? */
  164. # define HAVE_TZ_SYSV (CCMD_OS_SYSV|CCMD_OS_LINUX|CCMD_OS_SOLARIS)
  165. #endif
  166.  
  167. #ifndef  HAVE_TZ_BSD    /* Have BSD gettimeofday() tz value? */
  168. # define HAVE_TZ_BSD (CCMD_OS_BSD|CCMD_OS_BSD44|CCMD_OS_AIX|CCMD_OS_SVR4)
  169. #endif
  170.  
  171. #ifndef  HAVE_VFPRINTF    /* Have ANSI vfprintf() ? */
  172. # define HAVE_VFPRINTF (ANSIC || !CCMD_OS_BSD)
  173. #endif
  174.  
  175. /* Determine TTY driver stuff to use.
  176.  * HAVE_TERMIOS overrides HAVE_TERMIO which overrides HAVE_TERM_BSD
  177.  */
  178. #ifndef  HAVE_TERMIOS    /* System uses termios ? */
  179. # define HAVE_TERMIOS 0
  180. #endif
  181. #ifndef  HAVE_TERMIO    /* System uses termio ? */
  182. # define HAVE_TERMIO 0
  183. #endif
  184. #ifndef  HAVE_TERM_BSD    /* Using old BSD TTY calls? */
  185. # define HAVE_TERM_BSD 0
  186. #endif
  187. #if !(HAVE_TERMIOS|HAVE_TERMIO|HAVE_TERM_BSD)
  188. # if (CCMD_OS_SOLARIS|CCMD_OS_DECOSF|CCMD_OS_BSD44|CCMD_OS_LINUX)
  189. #  undef  HAVE_TERMIOS
  190. #  define HAVE_TERMIOS 1
  191. # elif CCMD_OS_SYSV
  192. #  undef  HAVE_TERMIO
  193. #  define HAVE_TERMIO 1
  194. # elif CCMD_OS_BSD
  195. #  undef  HAVE_TERM_BSD
  196. #  define HAVE_TERM_BSD 1
  197. # endif
  198. #endif
  199.  
  200. #ifndef  HAVE_UNISTD    /* System has <unistd.h> ? */
  201. # define HAVE_UNISTD (CCMD_OS_SOLARIS|CCMD_OS_DECOSF|CCMD_OS_BSD44 \
  202.              |CCMD_OS_LINUX)
  203. #endif
  204.  
  205. #ifndef  HAVE_SIGSETS    /* System has sigset_t facilities? */
  206. # define HAVE_SIGSETS (CCMD_OS_SOLARIS|CCMD_OS_DECOSF|CCMD_OS_BSD44 \
  207.              |CCMD_OS_LINUX)
  208. #endif
  209.  
  210. #ifndef  HAVE_GETENV    /* System has getenv() ? */
  211. # define HAVE_GETENV (CCMD_OS_SOLARIS|CCMD_OS_DECOSF|CCMD_OS_BSD44 \
  212.              |CCMD_OS_LINUX)
  213. #endif
  214.  
  215. #ifndef  HAVE_SETENV    /* System has setenv() ? */
  216. # define HAVE_SETENV (CCMD_OS_DECOSF|CCMD_OS_BSD44 \
  217.              |CCMD_OS_LINUX)
  218. #endif
  219.  
  220. #ifndef  HAVE_FPURGE    /* System has fpurge() ? */
  221. # define HAVE_FPURGE (CCMD_OS_BSD44)
  222. #endif
  223.  
  224.  
  225. /*
  226.  * We want to define exactly one of the following directory access
  227.  * mechanisms.
  228.  */
  229. #ifndef  HAVE_DIRENTLIB        /* <dirent.h>  e.g. POSIX */
  230. # define HAVE_DIRENTLIB 0
  231. #endif
  232. #ifndef  HAVE_DIRLIB        /* <sys/dir.h> e.g. 4.2BSD */
  233. # define HAVE_DIRLIB 0
  234. #endif
  235. #ifndef  HAVE_NDIRLIB        /* <ndir.h>    e.g. HPUX */
  236. # define HAVE_NDIRLIB 0
  237. #endif
  238. #ifndef  HAVE_NODIRLIB        /*  -none-     e.g. V7 */
  239. # define HAVE_NODIRLIB 0
  240. #endif
  241.  
  242. #if !(HAVE_DIRLIB | HAVE_NDIRLIB | HAVE_DIRENTLIB | HAVE_NODIRLIB)
  243. # if (CCMD_OS_BSD44 | CCMD_OS_AIX | CCMD_OS_DECOSF | CCMD_OS_SOLARIS \
  244.     | CCMD_OS_LINUX | CCMD_OS_SVR3 | CCMD_OS_SVR4)
  245. #  undef  HAVE_DIRENTLIB
  246. #  define HAVE_DIRENTLIB 1
  247. # elif CCMD_OS_BSD
  248. #  undef  HAVE_DIRLIB
  249. #  define HAVE_DIRLIB 1
  250. # elif CCMD_OS_HPUX
  251. #  undef  HAVE_NDIRLIB
  252. #  define HAVE_NDIRLIB 1
  253. # else
  254. #  undef  HAVE_NODIRLIB
  255. #  define HAVE_NODIRLIB 1
  256. # endif
  257. #endif
  258.  
  259.