1 /* config.h --- configuration file for OS/2 2 Karl Fogel <kfogel@cyclic.com> --- Oct 1995 */ 3 4 /* This program is free software; you can redistribute it and/or modify 5 it under the terms of the GNU General Public License as published by 6 the Free Software Foundation; either version 2, or (at your option) 7 any later version. 8 9 This program is distributed in the hope that it will be useful, 10 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 GNU General Public License for more details. */ 13 14 /* This file lives in the os2/ subdirectory, which is only included 15 * in your header search path if you're working under IBM C++, 16 * and use os2/makefile (with GNU make for OS/2). Thus, this is the 17 * right place to put configuration information for OS/2. 18 */ 19 20 21 /* We need some system header files here since we evaluate values from 22 * these files below. 23 */ 24 #include <stdio.h> 25 #include <errno.h> 26 27 28 29 #ifndef __STDC__ 30 /* You bet! */ 31 #define __STDC__ 1 32 #endif 33 34 /* The IBM compiler uses the (non-standard) error code EACCESS instead of 35 EACCES (note: one 'S'). Define EACCESS to be EACCES and use the standard 36 name in the code. */ 37 #ifndef EACCES 38 #define EACCES EACCESS 39 #endif 40 41 /* Handle some other name differences between the IBM and the Watcom 42 * compiler. 43 */ 44 #ifdef __WATCOMC__ 45 #define _setmode setmode 46 #define _cwait cwait 47 #endif 48 49 /* Some more WATCOM stuff: The watcom compiler defines va_list as an array, 50 * not as a pointer, which will make the vasprintf code break without the 51 * following define: 52 */ 53 #ifdef __WATCOMC__ 54 #define VA_LIST_IS_ARRAY 55 #endif 56 57 /* Define if on AIX 3. 58 System headers sometimes define this. 59 We just want to avoid a redefinition error message. */ 60 #undef _ALL_SOURCE 61 62 /* Define to empty if the keyword does not work. */ 63 /* Const is working. */ 64 #undef const 65 66 /* Define to `int' if <sys/types.h> doesn't define. */ 67 /* OS/2 doesn't have gid_t. It doesn't even really have group 68 numbers, I think. This will take more thought to get right, but 69 let's get it running first. */ 70 #define gid_t int 71 72 /* Define if you support file names longer than 14 characters. */ 73 /* We support long file names, but not long corporate acronyms. */ 74 #define HAVE_LONG_FILE_NAMES 1 75 76 /* Define if you have <sys/wait.h> that is POSIX.1 compatible. */ 77 /* If POSIX.1 requires this, why doesn't WNT have it? */ 78 /* Maybe POSIX only says that if it is present, it must behave a 79 certain way, but that it can simply be not present too. I 80 dunno. */ 81 /* Anyway, OS/2 ain't got it. */ 82 #undef HAVE_SYS_WAIT_H 83 84 /* Define if utime(file, NULL) sets file's timestamp to the present. */ 85 /* Documentation says yup; haven't verified experimentally. */ 86 #define HAVE_UTIME_NULL 1 87 88 /* Define if on MINIX. */ 89 /* Hah. */ 90 #undef _MINIX 91 92 /* Define to `int' if <sys/types.h> doesn't define. */ 93 #define mode_t int 94 95 /* Define to `int' if <sys/types.h> doesn't define. */ 96 #define pid_t int 97 98 /* Define if the system does not provide POSIX.1 features except 99 with this defined. */ 100 /* This string doesn't appear anywhere in the system header files, 101 so I assume it's irrelevant. */ 102 #undef _POSIX_1_SOURCE 103 104 /* Define if you need to in order for stat and other things to work. */ 105 /* Same as for _POSIX_1_SOURCE, above. */ 106 #undef _POSIX_SOURCE 107 108 /* Define as the return type of signal handlers (int or void). */ 109 /* IBMCPP manual indicates they are void. */ 110 #define RETSIGTYPE void 111 112 /* Define to `unsigned' if <sys/types.h> doesn't define. */ 113 /* sys/types.h doesn't define it, but stdio.h does, which cvs.h 114 #includes, so things should be okay. */ 115 /* #undef size_t */ 116 117 /* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */ 118 /* sys/stat.h apparently doesn't even have them; setting this will let 119 ../lib/system.h define them. */ 120 #define STAT_MACROS_BROKEN 1 121 122 /* Define if you have the ANSI C header files. */ 123 /* We have at least a reasonable facsimile thereof. */ 124 #define STDC_HEADERS 1 125 126 /* Define if you can safely include both <sys/time.h> and <time.h>. */ 127 /* We don't have <sys/time.h> at all. Why isn't there a definition 128 for HAVE_SYS_TIME_H anywhere in config.h.in? */ 129 #undef TIME_WITH_SYS_TIME 130 131 /* Define to `int' if <sys/types.h> doesn't define. */ 132 #define uid_t int 133 134 /* Define if you have MIT Kerberos version 4 available. */ 135 /* We don't. */ 136 #undef HAVE_KERBEROS 137 138 /* Define if you want CVS to be able to be a remote repository client. */ 139 /* That's all we want. */ 140 #define CLIENT_SUPPORT 141 142 /* Define if you want CVS to be able to serve repositories to remote 143 clients. */ 144 /* No server support yet. Note that you don't have to define 145 CLIENT_SUPPORT or SERVER_SUPPORT to enable the non-remote code; 146 that's always there. */ 147 #undef SERVER_SUPPORT 148 149 /* Define if you have the connect function. */ 150 /* Not used? */ 151 /* It appears to be used in client.c now... don't know yet it OS/2 has it. */ 152 #define HAVE_CONNECT 153 154 /* Define if you have the fchdir function. */ 155 #undef HAVE_FCHDIR 156 157 /* Define if you have the fchmod function. */ 158 #undef HAVE_FCHMOD 159 160 /* Define if you have the fsync function. */ 161 #undef HAVE_FSYNC 162 163 /* Define if you have the ftime function. */ 164 #define HAVE_FTIME 1 165 166 /* Define if you have the ftruncate function. */ 167 #undef HAVE_FTRUNCATE 168 169 /* Define if you have the getpagesize function. */ 170 #undef HAVE_GETPAGESIZE 171 172 /* Define if you have the krb_get_err_text function. */ 173 #undef HAVE_KRB_GET_ERR_TEXT 174 175 /* Define if you have the putenv function. */ 176 #define HAVE_PUTENV 1 177 178 /* Define if you have the sigaction function. */ 179 #undef HAVE_SIGACTION 180 181 /* Define if you have the sigblock function. */ 182 #undef HAVE_SIGBLOCK 183 184 /* Define if you have the sigprocmask function. */ 185 #undef HAVE_SIGPROCMASK 186 187 /* Define if you have the sigsetmask function. */ 188 #undef HAVE_SIGSETMASK 189 190 /* Define if you have the sigvec function. */ 191 #undef HAVE_SIGVEC 192 193 /* Define if you have the timezone function. */ 194 /* Hmm, I actually rather think it's an extern long 195 variable; that message was mechanically generated 196 by autoconf. And I don't see any actual uses of 197 this function in the code anyway, hmm. */ 198 #undef HAVE_TIMEZONE 199 200 /* Define if you have the tzset function. */ 201 #define HAVE_TZSET 1 202 203 /* Define if you have the vfork function. */ 204 #undef HAVE_VFORK 205 206 /* Define if you have the vprintf function. */ 207 #define HAVE_VPRINTF 1 208 209 /* Define if you have the <direct.h> header file. */ 210 #define HAVE_DIRECT_H 1 211 212 /* Define if you have the <dirent.h> header file. */ 213 /* We have our own dirent.h and dirent.c. */ 214 #ifdef __WATCOMC__ 215 #undef HAVE_DIRENT_H 216 #else 217 #define HAVE_DIRENT_H 1 218 #endif 219 220 /* Define if you have the <errno.h> header file. */ 221 #define HAVE_ERRNO_H 1 222 223 /* Define if you have the <fcntl.h> header file. */ 224 #define HAVE_FCNTL_H 1 225 226 /* Define if you have the <io.h> header file. */ 227 /* Low-level Unix I/O routines like open, creat, etc. */ 228 #define HAVE_IO_H 1 229 230 /* Define if you have the <memory.h> header file. */ 231 #define HAVE_MEMORY_H 1 232 233 /* Define if you have the <ndbm.h> header file. */ 234 #undef HAVE_NDBM_H 235 236 /* Define if you have the <ndir.h> header file. */ 237 #undef HAVE_NDIR_H 238 239 /* Define if you have the <string.h> header file. */ 240 #define HAVE_STRING_H 1 241 242 /* Define if you have the <sys/bsdtypes.h> header file. */ 243 #undef HAVE_SYS_BSDTYPES_H 244 245 /* Define if you have the <sys/dir.h> header file. */ 246 #undef HAVE_SYS_DIR_H 247 248 /* Define if you have the <sys/ndir.h> header file. */ 249 #undef HAVE_SYS_NDIR_H 250 251 /* Define if you have the <sys/param.h> header file. */ 252 #undef HAVE_SYS_PARAM_H 253 254 /* Define if you have the <sys/select.h> header file. */ 255 #undef HAVE_SYS_SELECT_H 256 257 /* Define if you have the <sys/time.h> header file. */ 258 #undef HAVE_SYS_TIME_H 259 260 /* Define if you have the <unistd.h> header file. */ 261 #undef HAVE_UNISTD_H 262 263 /* Define if you have the <utime.h> header file. */ 264 #undef HAVE_UTIME_H 265 266 /* Define if you have the <sys/utime.h> header file. */ 267 #define HAVE_SYS_UTIME_H 1 268 269 /* Define if you have the inet library (-linet). */ 270 #undef HAVE_LIBINET 271 272 /* Define if you have the nsl library (-lnsl). */ 273 /* This is not used anywhere in the source code. */ 274 #undef HAVE_LIBNSL 275 276 /* Define if you have the nsl_s library (-lnsl_s). */ 277 #undef HAVE_LIBNSL_S 278 279 /* Define if you have the socket library (-lsocket). */ 280 /* This isn't ever used either. */ 281 #undef HAVE_LIBSOCKET 282 283 /* Under OS/2, mkdir only takes one argument. */ 284 #define CVS_MKDIR os2_mkdir 285 extern int os2_mkdir (const char *PATH, int MODE); 286 287 /* OS/2 needs a special chdir functions that handles drives */ 288 #define CVS_CHDIR os2_chdir 289 extern int os2_chdir (const char *Dir); 290 291 /* This function doesn't exist under OS/2; we provide a stub. */ 292 extern int readlink (char *path, char *buf, int buf_size); 293 294 /* This is just a call to GetCurrentProcessID. */ 295 #ifndef __WATCOMC__ 296 extern pid_t getpid (void); 297 #endif 298 299 /* We definitely have prototypes. */ 300 #define USE_PROTOTYPES 1 301 302 /* Under OS/2, filenames are case-insensitive, and both / and \ 303 are path component separators. */ 304 #define FOLD_FN_CHAR(c) (OS2_filename_classes[(unsigned char) (c)]) 305 extern unsigned char OS2_filename_classes[]; 306 307 /* Is the character C a path name separator? Under OS/2, you can use 308 either / or \. */ 309 #define ISDIRSEP(c) (FOLD_FN_CHAR(c) == '/') 310 311 /* Like strcmp, but with the appropriate tweaks for file names. 312 Under OS/2, filenames are case-insensitive but case-preserving, 313 and both \ and / are path element separators. */ 314 extern int fncmp (const char *n1, const char *n2); 315 316 /* Fold characters in FILENAME to their canonical forms. 317 If FOLD_FN_CHAR is not #defined, the system provides a default 318 definition for this. */ 319 extern void fnfold (char *FILENAME); 320 321 /* This is where old bits go to die under OS/2 as well as WinNT. */ 322 #define DEVNULL "nul" 323 324 /* Make sure that we don't try to perform operations on RCS files on the 325 local machine. I think I neglected to apply some changes from 326 MHI's port in that area of code, or found some issues I didn't want 327 to deal with. */ 328 #define CLIENT_ONLY 329 330 /* We actually do have a transparent rsh, whew. */ 331 #undef RSH_NOT_TRANSPARENT 332 /* But it won't be transparent unless we ask it nicely! */ 333 #define RSH_NEEDS_BINARY_FLAG 1 334 335 /* OS/2 doesn't really have user/group permissions, at least not 336 according to the C library manual pages. So we'll make decoys. 337 (This was partly introduced for an obsolete reason, now taken care 338 of by CHMOD_BROKEN, but I haven't carefully looked at every case 339 (in particular mode_to_string), so it might still be needed). 340 We do not need that for the watcom compiler since watcom already 341 all those permission bits defined. It would probably be better to 342 include the necessary system header files in system.h, and then make 343 each permission define only if it is not already defined. 344 */ 345 #ifndef __WATCOMC__ 346 #define NEED_DECOY_PERMISSIONS 1 /* see system.h */ 347 #endif 348 349 350 351 /* For the access() function, for which IBM OS/2 compiler has no pre-defined 352 mnemonic masks. */ 353 #ifndef __WATCOMC__ 354 #define R_OK 04 355 #define W_OK 02 356 #define F_OK 00 357 #define X_OK R_OK /* I think this is right for OS/2. */ 358 #endif 359 360 /* For getpid() */ 361 #include <process.h> 362 363 /* So "tcpip.h" gets included in lib/system.h: */ 364 #define USE_OWN_TCPIP_H 1 365 /* The IBM TCP/IP library gets initialized in main(): */ 366 #define SYSTEM_INITIALIZE(pargc,pargv) init_sockets() 367 extern void init_sockets(); 368 369 /* Under OS/2, we have our own popen() and pclose()... */ 370 #define USE_OWN_POPEN 1 371 /* ... and we use popenRW to start the rsh server. */ 372 #define START_RSH_WITH_POPEN_RW 1 373 374 /* 375 * This tells the client that it must use send()/recv() to talk to the 376 * server if it is connected to the server via a socket. Sigh. 377 * Windows 95 and VMS cannot convert sockets to file descriptors either, 378 * apparently. 379 */ 380 #define NO_SOCKET_TO_FD 1 381 382 /* chmod() doesn't seem to work -- IBM's own example program does not 383 * behave as its documentation claims, in fact! I suspect that 384 * DosSetPathInfo is the way to go, but can't seem to make that work 385 * either. For now, we can deal with some cases by invoking the DOS 386 * "attrib" command via system(). */ 387 #define CHMOD_BROKEN 1 388 389 /* Rule Number 1 of OS/2 Programming: If the function you're looking 390 for doesn't exist, try putting "Dos" in front of it. 391 Do not forget to include the os2 header file if we use DosSleep. */ 392 #ifndef sleep 393 #include "os2inc.h" 394 #define sleep(x) DosSleep(((long)(x))*1000L) 395 #endif /* sleep */ 396 397 /* Set to 1 for some debugging messages. */ 398 #if 0 399 #define KFF_DEBUG(call) printf("*** %s:%d: ", __FILE__, __LINE__); \ 400 call; fflush(stdout); 401 #else 402 #define KFF_DEBUG(call) 403 #endif 404