home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / rcs567s.zip / rcs / src / conf.heg < prev    next >
Text File  |  1994-08-01  |  14KB  |  416 lines

  1. /* example RCS compile-time configuration */
  2.  
  3.     /* $Id: conf.heg,v 1.15 1994/03/20 04:52:58 eggert Exp $ */
  4.  
  5. /*
  6.  * This example RCS compile-time configuration describes a host that conforms
  7.  * to Standard C (1990) & Posix 1003.1-1990 and has GNU diffutils 2.5 or later.
  8.  * If you can't get conf.sh to work as described in the Makefile,
  9.  * copy this file to conf.h and edit conf.h by hand; see INSTALL.
  10.  */
  11.  
  12. #define exitmain(n) return n /* how to exit from main() */
  13. /* #define _POSIX_SOURCE */ /* Define this if Posix + strict Standard C.  */
  14.  
  15. #include <errno.h>
  16. #include <stdio.h>
  17. #include <time.h>
  18.  
  19. /* Comment out #include lines below that do not work.  */
  20. #include <sys/types.h>
  21. #include <sys/stat.h>
  22. #include <dirent.h>
  23. #include <fcntl.h>
  24. #include <limits.h>
  25. #include <pwd.h>
  26. /* #include <siginfo.h> */
  27. #include <signal.h>
  28. #include <stdlib.h>
  29. #include <string.h>
  30. /* #include <sys/mman.h> */
  31. #include <sys/wait.h>
  32. /* #include <ucontext.h> */
  33. #include <unistd.h>
  34. #include <utime.h>
  35. /* #include <vfork.h> */
  36.  
  37. /* Define the following symbols to be 1 or 0.  */
  38. #define has_sys_dir_h 0 /* Does #include <sys/dir.h> work?  */
  39. #define has_sys_param_h 0 /* Does #include <sys/param.h> work?  */
  40. /* extern int errno; */ /* Uncomment if <errno.h> doesn't declare errno.  */
  41. #define has_readlink 0 /* Does readlink() work?  */
  42. #define readlink_isreg_errno EINVAL /* errno after readlink on regular file */
  43.  
  44. #if !defined(PATH_MAX) && !defined(_POSIX_PATH_MAX)
  45. #    if has_sys_param_h
  46. #        include <sys/param.h>
  47. #        define included_sys_param_h 1
  48. #    endif
  49. #    ifndef PATH_MAX
  50. #        ifndef MAXPATHLEN
  51. #            define MAXPATHLEN 1024
  52. #        endif
  53. #        define PATH_MAX (MAXPATHLEN-1)
  54. #    endif
  55. #endif
  56. #if has_readlink && !defined(MAXSYMLINKS)
  57. #    if has_sys_param_h && !included_sys_param_h
  58. #        include <sys/param.h>
  59. #    endif
  60. #    ifndef MAXSYMLINKS
  61. #        define MAXSYMLINKS 20 /* BSD; not standard yet */
  62. #    endif
  63. #endif
  64.  
  65. /* Comment out the typedefs below if the types are already declared.  */
  66. /* Fix any uncommented typedefs that are wrong.  */
  67. /* typedef int mode_t; */
  68. /* typedef long off_t; */
  69. /* typedef int pid_t; */
  70. /* typedef int sig_atomic_t; */
  71. /* typedef unsigned size_t; */
  72. /* typedef int ssize_t; */
  73. /* typedef long time_t; */
  74. /* typedef int uid_t; */
  75.  
  76. /* Comment out the keyword definitions below if the keywords work.  */
  77. /* #define const */
  78. /* #define volatile */
  79.  
  80. /* Define the following symbols to be 1 or 0.  */
  81. #define has_prototypes 1 /* Do function prototypes work?  */
  82. #define has_stdarg 1 /* Does <stdarg.h> work?  */
  83. #define has_varargs 0 /* Does <varargs.h> work?  */
  84. #define va_start_args 2 /* How many args does va_start() take?  */
  85. #if has_prototypes
  86. #    define P(params) params
  87. #else
  88. #    define P(params) ()
  89. #endif
  90. #if has_stdarg
  91. #    include <stdarg.h>
  92. #else
  93. #    if has_varargs
  94. #        include <varargs.h>
  95. #    else
  96.         typedef char *va_list;
  97. #        define va_dcl int va_alist;
  98. #        define va_start(ap) ((ap) = (va_list)&va_alist)
  99. #        define va_arg(ap,t) (((t*) ((ap)+=sizeof(t)))  [-1])
  100. #        define va_end(ap)
  101. #    endif
  102. #endif
  103. #if va_start_args == 2
  104. #    define vararg_start va_start
  105. #else
  106. #    define vararg_start(ap,p) va_start(ap)
  107. #endif
  108.  
  109. #define text_equals_binary_stdio 1 /* Does stdio treat text like binary?  */
  110. #define text_work_stdio 0 /* Text i/o for working file, binary for RCS file?  */
  111. #if text_equals_binary_stdio
  112.     /* Text and binary i/o behave the same, or binary i/o does not work.  */
  113. #    define FOPEN_R "r"
  114. #    define FOPEN_W "w"
  115. #    define FOPEN_WPLUS "w+"
  116. #    define OPEN_O_BINARY 0
  117. #else
  118.     /* Text and binary i/o behave differently.  */
  119.     /* This is incompatible with Posix and Unix.  */
  120. #    define FOPEN_R "rb"
  121. #    define FOPEN_W "wb"
  122. #    define FOPEN_WPLUS "w+b"
  123. #    define OPEN_O_BINARY O_BINARY
  124. #    ifndef O_BINARY
  125. #    define O_BINARY 0
  126. #    endif
  127. #endif
  128. #if text_work_stdio
  129. #    define FOPEN_R_WORK "r"
  130. #    define FOPEN_W_WORK "w"
  131. #    define FOPEN_WPLUS_WORK "w+"
  132. #    define OPEN_O_WORK 0
  133. #else
  134. #    define FOPEN_R_WORK FOPEN_R
  135. #    define FOPEN_W_WORK FOPEN_W
  136. #    define FOPEN_WPLUS_WORK FOPEN_WPLUS
  137. #    define OPEN_O_WORK OPEN_O_BINARY
  138. #endif
  139.  
  140. /* This may need changing on non-Unix systems (notably DOS).  */
  141. #define OPEN_CREAT_READONLY (S_IRUSR|S_IRGRP|S_IROTH) /* lock file mode */
  142. #define OPEN_O_LOCK 0 /* extra open flags for creating lock file */
  143. #define OPEN_O_WRONLY O_WRONLY
  144.  
  145. /* Define or comment out the following symbols as needed.  */
  146. #define bad_chmod_close 0 /* Can chmod() close file descriptors?  */
  147. #define bad_creat0 0 /* Do writes fail after creat(f,0)?  */
  148. #define bad_fopen_wplus 0 /* Does fopen(f,FOPEN_WPLUS) fail to truncate f?  */
  149. #define getlogin_is_secure 0 /* Is getlogin() secure?  Usually it's not.  */
  150. #define has_attribute_noreturn 0 /* Does __attribute__((noreturn)) work?  */
  151. #if has_attribute_noreturn
  152. #    define exiting __attribute__((noreturn))
  153. #else
  154. #    define exiting
  155. #endif
  156. #define has_dirent 1 /* Do opendir(), readdir(), closedir() work?  */
  157. #define void_closedir 0 /* Does closedir() yield void?  */
  158. #define has_fchmod 0 /* Does fchmod() work?  */
  159. #define has_fflush_input 1 /* Does fflush() work on input files?  */
  160. #define has_fputs 1 /* Does fputs() work?  */
  161. #define has_ftruncate 0 /* Does ftruncate() work?  */
  162. #define has_getuid 1 /* Does getuid() work?  */
  163. #define has_getpwuid 1 /* Does getpwuid() work?  */
  164. #define has_memcmp 1 /* Does memcmp() work?  */
  165. #define has_memcpy 1 /* Does memcpy() work?  */
  166. #define has_memmove 1 /* Does memmove() work?  */
  167. #define has_madvise 0 /* Does madvise() work?  */
  168. #define has_mmap 0 /* Does mmap() work on regular files?  */
  169. /* typedef char *caddr_t; */ /* mmap argument type */
  170. #define mmap_signal SIGBUS /* signal received if you reference nonexistent part of mmapped file */
  171. #define has_rename 1 /* Does rename() work?  */
  172. #define bad_a_rename 0 /* Does rename(A,B) fail if A is unwritable?  */
  173. #define bad_b_rename 0 /* Does rename(A,B) fail if B is unwritable?  */
  174. /* typedef int void; */ /* Some ancient compilers need this.  */
  175. #define VOID (void) /* 'VOID e;' discards the value of an expression 'e'.  */
  176. #define has_seteuid 0 /* Does seteuid() work?  See INSTALL.  */
  177. #define has_setreuid 0 /* Does setreuid() work?  See INSTALL.  */
  178. #define has_setuid 1 /* Does setuid() exist?  */
  179. #define has_sigaction 1 /* Does struct sigaction work?  */
  180. #define has_signal 1 /* Does signal() work?  */
  181. #define signal_type void /* type returned by signal handlers */
  182. #define sig_zaps_handler 0 /* Must a signal handler reinvoke signal()?  */
  183. #define has_sigblock 0 /* Does sigblock() work?  */
  184. /* #define sigmask(s) (1 << ((s)-1)) */ /* Yield mask for signal number.  */
  185. typedef ssize_t fread_type; /* type returned by fread() and fwrite() */
  186. typedef size_t freadarg_type; /* type of their size arguments */
  187. typedef void *malloc_type; /* type returned by malloc() */
  188. #define has_getcwd 1 /* Does getcwd() work?  */
  189. #define has_getwd 0 /* Does getwd() work?  */
  190. #define needs_getabsname 0 /* Must we define getabsname?  */
  191. #define has_mktemp 0 /* Does mktemp() work?  */
  192. #define has_NFS 0 /* Might NFS be used?  */
  193. #define has_psiginfo 0 /* Does psiginfo() work?  */
  194. #define has_psignal 0 /* Does psignal() work?  */
  195. #define has_sys_siglist 0 /* Does sys_siglist[] work?  */
  196. /* #define strchr index */ /* Use old-fashioned name for strchr()?  */
  197. /* #define strrchr rindex */ /* Use old-fashioned name for strrchr()?  */
  198. #define bad_unlink 0 /* Does unlink() fail on unwritable files?  */
  199. #define has_vfork 0 /* Does vfork() work?  */
  200. #define has_fork 1 /* Does fork() work?  */
  201. #define has_spawn 0 /* Does spawn*() work?  */
  202. #define has_waitpid 1 /* Does waitpid() work?  */
  203. #define RCS_SHELL "/bin/sh" /* shell to run RCS subprograms */
  204. #define has_printf_dot 1 /* Does "%.2d" print leading 0?  */
  205. #define has_vfprintf 1 /* Does vfprintf() work?  */
  206. #define has_attribute_format_printf 0 /* Does __attribute__((format(printf,N,N+1))) work?  */
  207. #if has_attribute_format_printf
  208. #    define printf_string(m, n) __attribute__((format(printf, m, n)))
  209. #else
  210. #    define printf_string(m, n)
  211. #endif
  212. #if has_attribute_format_printf && has_attribute_noreturn
  213.     /* Work around a bug in GCC 2.5.x.  */
  214. #    define printf_string_exiting(m, n) __attribute__((format(printf, m, n), noreturn))
  215. #else
  216. #    define printf_string_exiting(m, n) printf_string(m, n) exiting
  217. #endif
  218. #define has__doprintf 0 /* Does _doprintf() work?  */
  219. #define has__doprnt 0 /* Does _doprnt() work?  */
  220. /* #undef EXIT_FAILURE */ /* Uncomment this if EXIT_FAILURE is broken.  */
  221. #define large_memory 0 /* Can main memory hold entire RCS files?  */
  222. #ifndef LONG_MAX
  223. #define LONG_MAX 2147483647L /* long maximum */
  224. #endif
  225. /* Do struct stat s and t describe the same file?  Answer d if unknown.  */
  226. #define same_file(s,t,d) ((s).st_ino==(t).st_ino && (s).st_dev==(t).st_dev)
  227. #define has_utimbuf 1 /* Does struct utimbuf work?  */
  228. #define CO "/usr/local/bin/co" /* name of 'co' program */
  229. #define COMPAT2 0 /* Are version 2 files supported?  */
  230. #define DIFF "/usr/local/bin/diff" /* name of 'diff' program */
  231. #define DIFF3 "/usr/local/bin/diff3" /* name of 'diff3' program */
  232. #define DIFF3_A 1 /* Does diff3 -A work?  */
  233. #define DIFF3_BIN 1 /* Is diff3 user-visible (not the /usr/lib auxiliary)?  */
  234. #define DIFF_FLAGS , "-an" /* Make diff output suitable for RCS.  */
  235. #define DIFF_L 1 /* Does diff -L work? */
  236. #define DIFF_SUCCESS 0 /* DIFF status if no differences are found */
  237. #define DIFF_FAILURE 1 /* DIFF status if differences are found */
  238. #define DIFF_TROUBLE 2 /* DIFF status if trouble */
  239. #define ED "/bin/ed" /* name of 'ed' program (used only if !DIFF3_BIN) */
  240. #define MERGE "/usr/local/bin/merge" /* name of 'merge' program */
  241. #define TMPDIR "/tmp" /* default directory for temporary files */
  242. #define SLASH '/' /* principal filename separator */
  243. #define SLASHes '/' /* `case SLASHes:' labels all filename separators */
  244. #define isSLASH(c) ((c) == SLASH) /* Is arg a filename separator?  */
  245. #define ROOTPATH(p) isSLASH((p)[0]) /* Is p an absolute pathname?  */
  246. #define X_DEFAULT ",v/" /* default value for -x option */
  247. #define SLASHSLASH_is_SLASH 0 /* Are // and / the same directory?  */
  248. #define ALL_ABSOLUTE 1 /* Do all subprograms satisfy ROOTPATH?  */
  249. #define DIFF_ABSOLUTE 1 /* Is ROOTPATH(DIFF) true?  */
  250. #define SENDMAIL "/bin/mail" /* how to send mail */
  251. #define TZ_must_be_set 0 /* Must TZ be set for gmtime() to work?  */
  252.  
  253.  
  254.  
  255. /* Adjust the following declarations as needed.  */
  256.  
  257.  
  258. /* The rest is for the benefit of non-standard, traditional hosts.  */
  259. /* Don't bother to declare functions that in traditional hosts do not appear, */
  260. /* or are declared in .h files, or return int or void.  */
  261.  
  262.  
  263. /* traditional BSD */
  264.  
  265. #if has_sys_siglist && !defined(sys_siglist)
  266.     extern char const * const sys_siglist[];
  267. #endif
  268.  
  269.  
  270. /* Posix (ISO/IEC 9945-1: 1990 / IEEE Std 1003.1-1990) */
  271.  
  272. /* <fcntl.h> */
  273. #ifdef O_CREAT
  274. #    define open_can_creat 1
  275. #else
  276. #    define open_can_creat 0
  277. #    define O_RDONLY 0
  278. #    define O_WRONLY 1
  279. #    define O_RDWR 2
  280. #    define O_CREAT 01000
  281. #    define O_TRUNC 02000
  282. #endif
  283. #ifndef O_EXCL
  284. #define O_EXCL 0
  285. #endif
  286.  
  287. /* <sys/stat.h> */
  288. #ifndef S_IRUSR
  289. #    ifdef S_IREAD
  290. #        define S_IRUSR S_IREAD
  291. #    else
  292. #        define S_IRUSR 0400
  293. #    endif
  294. #    ifdef S_IWRITE
  295. #        define S_IWUSR S_IWRITE
  296. #    else
  297. #        define S_IWUSR (S_IRUSR/2)
  298. #    endif
  299. #endif
  300. #ifndef S_IRGRP
  301. #    if has_getuid
  302. #        define S_IRGRP (S_IRUSR / 0010)
  303. #        define S_IWGRP (S_IWUSR / 0010)
  304. #        define S_IROTH (S_IRUSR / 0100)
  305. #        define S_IWOTH (S_IWUSR / 0100)
  306. #    else
  307.         /* single user OS -- not Posix or Unix */
  308. #        define S_IRGRP 0
  309. #        define S_IWGRP 0
  310. #        define S_IROTH 0
  311. #        define S_IWOTH 0
  312. #    endif
  313. #endif
  314. #ifndef S_ISREG
  315. #define S_ISREG(n) (((n) & S_IFMT) == S_IFREG)
  316. #endif
  317.  
  318. /* <sys/wait.h> */
  319. #ifndef WEXITSTATUS
  320. #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
  321. #undef WIFEXITED /* Avoid 4.3BSD incompatibility with Posix.  */
  322. #endif
  323. #ifndef WIFEXITED
  324. #define WIFEXITED(stat_val) (((stat_val)  &  0377) == 0)
  325. #endif
  326. #ifndef WTERMSIG
  327. #define WTERMSIG(stat_val) ((stat_val) & 0177)
  328. #undef WIFSIGNALED /* Avoid 4.3BSD incompatibility with Posix.  */
  329. #endif
  330. #ifndef WIFSIGNALED
  331. #define WIFSIGNALED(stat_val) ((unsigned)(stat_val) - 1  <  0377)
  332. #endif
  333.  
  334. /* <unistd.h> */
  335. char *getlogin P((void));
  336. #ifndef STDIN_FILENO
  337. #    define STDIN_FILENO 0
  338. #    define STDOUT_FILENO 1
  339. #    define STDERR_FILENO 2
  340. #endif
  341. #if has_fork && !has_vfork
  342. #    undef vfork
  343. #    define vfork fork
  344. #endif
  345. #if has_getcwd || !has_getwd
  346.     char *getcwd P((char*,size_t));
  347. #else
  348.     char *getwd P((char*));
  349. #endif
  350. #if has_setuid && !has_seteuid
  351. #    undef seteuid
  352. #    define seteuid setuid
  353. #endif
  354. #if has_spawn
  355. #    if ALL_ABSOLUTE
  356. #        define spawn_RCS spawnv
  357. #    else
  358. #        define spawn_RCS spawnvp
  359. #    endif
  360. #else
  361. #    if ALL_ABSOLUTE
  362. #        define exec_RCS execv
  363. #    else
  364. #        define exec_RCS execvp
  365. #    endif
  366. #endif
  367.  
  368. /* utime.h */
  369. #if !has_utimbuf
  370.     struct utimbuf { time_t actime, modtime; };
  371. #endif
  372.  
  373.  
  374. /* Standard C library */
  375.  
  376. /* <stdio.h> */
  377. #ifndef L_tmpnam
  378. #define L_tmpnam 32 /* power of 2 > sizeof("/usr/tmp/xxxxxxxxxxxxxxx") */
  379. #endif
  380. #ifndef SEEK_SET
  381. #define SEEK_SET 0
  382. #endif
  383. #ifndef SEEK_CUR
  384. #define SEEK_CUR 1
  385. #endif
  386. #if has_mktemp
  387.     char *mktemp P((char*)); /* traditional */
  388. #else
  389.     char *tmpnam P((char*));
  390. #endif
  391.  
  392. /* <stdlib.h> */
  393. char *getenv P((char const*));
  394. void _exit P((int)) exiting;
  395. void exit P((int)) exiting;
  396. malloc_type malloc P((size_t));
  397. malloc_type realloc P((malloc_type,size_t));
  398. #ifndef EXIT_FAILURE
  399. #define EXIT_FAILURE 1
  400. #endif
  401. #ifndef EXIT_SUCCESS
  402. #define EXIT_SUCCESS 0
  403. #endif
  404.  
  405. /* <string.h> */
  406. char *strcpy P((char*,char const*));
  407. char *strchr P((char const*,int));
  408. char *strrchr P((char const*,int));
  409. void *memcpy P((void*,void const*,size_t));
  410. #if has_memmove
  411.     void *memmove P((void*,void const*,size_t));
  412. #endif
  413.  
  414. /* <time.h> */
  415. time_t time P((time_t*));
  416.