xref: /openbsd-src/gnu/usr.bin/cvs/os2/config.h (revision e79e306285af588019b14bb4031379f450685a93)
102d9f452Stholo /* config.h --- configuration file for OS/2
202d9f452Stholo    Karl Fogel <kfogel@cyclic.com> --- Oct 1995  */
302d9f452Stholo 
4*2770ece5Stholo /* This program is free software; you can redistribute it and/or modify
5*2770ece5Stholo    it under the terms of the GNU General Public License as published by
6*2770ece5Stholo    the Free Software Foundation; either version 2, or (at your option)
7*2770ece5Stholo    any later version.
8*2770ece5Stholo 
9*2770ece5Stholo    This program is distributed in the hope that it will be useful,
10*2770ece5Stholo    but WITHOUT ANY WARRANTY; without even the implied warranty of
11*2770ece5Stholo    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12*2770ece5Stholo    GNU General Public License for more details.  */
13*2770ece5Stholo 
1402d9f452Stholo /* This file lives in the os2/ subdirectory, which is only included
1502d9f452Stholo  * in your header search path if you're working under IBM C++,
1602d9f452Stholo  * and use os2/makefile (with GNU make for OS/2).  Thus, this is the
1702d9f452Stholo  * right place to put configuration information for OS/2.
1802d9f452Stholo  */
1902d9f452Stholo 
2002d9f452Stholo 
21461cc63eStholo /* We need some system header files here since we evaluate values from
22461cc63eStholo  * these files below.
23461cc63eStholo  */
24461cc63eStholo #include <stdio.h>
25461cc63eStholo #include <errno.h>
26461cc63eStholo 
27461cc63eStholo 
28461cc63eStholo 
29461cc63eStholo #ifndef __STDC__
3002d9f452Stholo /* You bet! */
3102d9f452Stholo #define __STDC__ 1
32461cc63eStholo #endif
33461cc63eStholo 
34461cc63eStholo /* The IBM compiler uses the (non-standard) error code EACCESS instead of
35461cc63eStholo    EACCES (note: one 'S'). Define EACCESS to be EACCES and use the standard
36461cc63eStholo    name in the code. */
37461cc63eStholo #ifndef EACCES
38461cc63eStholo #define EACCES EACCESS
39461cc63eStholo #endif
40461cc63eStholo 
41461cc63eStholo /* Handle some other name differences between the IBM and the Watcom
42461cc63eStholo  * compiler.
43461cc63eStholo  */
44461cc63eStholo #ifdef __WATCOMC__
45461cc63eStholo #define _setmode        setmode
46461cc63eStholo #define _cwait          cwait
47461cc63eStholo #endif
4802d9f452Stholo 
49780d15dfStholo /* Some more WATCOM stuff: The watcom compiler defines va_list as an array,
50780d15dfStholo  * not as a pointer, which will make the vasprintf code break without the
51780d15dfStholo  * following define:
52780d15dfStholo  */
53780d15dfStholo #ifdef  __WATCOMC__
54780d15dfStholo #define VA_LIST_IS_ARRAY
55780d15dfStholo #endif
56780d15dfStholo 
5702d9f452Stholo /* Define if on AIX 3.
5802d9f452Stholo    System headers sometimes define this.
5902d9f452Stholo    We just want to avoid a redefinition error message.  */
6002d9f452Stholo #undef _ALL_SOURCE
6102d9f452Stholo 
6202d9f452Stholo /* Define to empty if the keyword does not work.  */
6302d9f452Stholo /* Const is working.  */
6402d9f452Stholo #undef const
6502d9f452Stholo 
6602d9f452Stholo /* Define to `int' if <sys/types.h> doesn't define.  */
6702d9f452Stholo /* OS/2 doesn't have gid_t.  It doesn't even really have group
6802d9f452Stholo    numbers, I think.  This will take more thought to get right, but
6902d9f452Stholo    let's get it running first.  */
7002d9f452Stholo #define gid_t int
7102d9f452Stholo 
7202d9f452Stholo /* Define if you support file names longer than 14 characters.  */
7302d9f452Stholo /* We support long file names, but not long corporate acronyms. */
7402d9f452Stholo #define HAVE_LONG_FILE_NAMES 1
7502d9f452Stholo 
7602d9f452Stholo /* Define if you have <sys/wait.h> that is POSIX.1 compatible.  */
7702d9f452Stholo /* If POSIX.1 requires this, why doesn't WNT have it?  */
7802d9f452Stholo /* Maybe POSIX only says that if it is present, it must behave a
7902d9f452Stholo    certain way, but that it can simply be not present too.  I
8002d9f452Stholo    dunno. */
8102d9f452Stholo /* Anyway, OS/2 ain't got it. */
8202d9f452Stholo #undef HAVE_SYS_WAIT_H
8302d9f452Stholo 
8402d9f452Stholo /* Define if utime(file, NULL) sets file's timestamp to the present.  */
8502d9f452Stholo /* Documentation says yup; haven't verified experimentally. */
8602d9f452Stholo #define HAVE_UTIME_NULL 1
8702d9f452Stholo 
8802d9f452Stholo /* Define if on MINIX.  */
8902d9f452Stholo /* Hah.  */
9002d9f452Stholo #undef _MINIX
9102d9f452Stholo 
9202d9f452Stholo /* Define to `int' if <sys/types.h> doesn't define.  */
9302d9f452Stholo #define mode_t int
9402d9f452Stholo 
9502d9f452Stholo /* Define to `int' if <sys/types.h> doesn't define.  */
9602d9f452Stholo #define pid_t int
9702d9f452Stholo 
9802d9f452Stholo /* Define if the system does not provide POSIX.1 features except
9902d9f452Stholo    with this defined.  */
10002d9f452Stholo /* This string doesn't appear anywhere in the system header files,
10102d9f452Stholo    so I assume it's irrelevant.  */
10202d9f452Stholo #undef _POSIX_1_SOURCE
10302d9f452Stholo 
10402d9f452Stholo /* Define if you need to in order for stat and other things to work.  */
10502d9f452Stholo /* Same as for _POSIX_1_SOURCE, above.  */
10602d9f452Stholo #undef _POSIX_SOURCE
10702d9f452Stholo 
10802d9f452Stholo /* Define as the return type of signal handlers (int or void).  */
10902d9f452Stholo /* IBMCPP manual indicates they are void.  */
11002d9f452Stholo #define RETSIGTYPE void
11102d9f452Stholo 
11202d9f452Stholo /* Define to `unsigned' if <sys/types.h> doesn't define.  */
11302d9f452Stholo /* sys/types.h doesn't define it, but stdio.h does, which cvs.h
11402d9f452Stholo    #includes, so things should be okay.  */
11502d9f452Stholo /* #undef size_t */
11602d9f452Stholo 
11702d9f452Stholo /* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */
11802d9f452Stholo /* sys/stat.h apparently doesn't even have them; setting this will let
11902d9f452Stholo    ../lib/system.h define them. */
12002d9f452Stholo #define STAT_MACROS_BROKEN 1
12102d9f452Stholo 
12202d9f452Stholo /* Define if you have the ANSI C header files.  */
12302d9f452Stholo /* We have at least a reasonable facsimile thereof. */
12402d9f452Stholo #define STDC_HEADERS 1
12502d9f452Stholo 
12602d9f452Stholo /* Define if you can safely include both <sys/time.h> and <time.h>.  */
12702d9f452Stholo /* We don't have <sys/time.h> at all.  Why isn't there a definition
12802d9f452Stholo    for HAVE_SYS_TIME_H anywhere in config.h.in?  */
12902d9f452Stholo #undef TIME_WITH_SYS_TIME
13002d9f452Stholo 
13102d9f452Stholo /* Define to `int' if <sys/types.h> doesn't define.  */
13202d9f452Stholo #define uid_t int
13302d9f452Stholo 
13402d9f452Stholo /* Define if you have MIT Kerberos version 4 available.  */
13502d9f452Stholo /* We don't. */
13602d9f452Stholo #undef HAVE_KERBEROS
13702d9f452Stholo 
13802d9f452Stholo /* Define if you want CVS to be able to be a remote repository client.  */
13902d9f452Stholo /* That's all we want.  */
14002d9f452Stholo #define CLIENT_SUPPORT
14102d9f452Stholo 
14202d9f452Stholo /* Define if you want CVS to be able to serve repositories to remote
14302d9f452Stholo    clients.  */
14402d9f452Stholo /* No server support yet.  Note that you don't have to define
14502d9f452Stholo    CLIENT_SUPPORT or SERVER_SUPPORT to enable the non-remote code;
14602d9f452Stholo    that's always there.  */
14702d9f452Stholo #undef SERVER_SUPPORT
14802d9f452Stholo 
14902d9f452Stholo /* Define if you have the connect function.  */
15002d9f452Stholo /* Not used?  */
15102d9f452Stholo /* It appears to be used in client.c now... don't know yet it OS/2 has it. */
15202d9f452Stholo #define HAVE_CONNECT
15302d9f452Stholo 
15402d9f452Stholo /* Define if you have the fchdir function.  */
15502d9f452Stholo #undef HAVE_FCHDIR
15602d9f452Stholo 
15702d9f452Stholo /* Define if you have the fchmod function.  */
15802d9f452Stholo #undef HAVE_FCHMOD
15902d9f452Stholo 
16002d9f452Stholo /* Define if you have the fsync function.  */
16102d9f452Stholo #undef HAVE_FSYNC
16202d9f452Stholo 
16302d9f452Stholo /* Define if you have the ftime function.  */
16402d9f452Stholo #define HAVE_FTIME 1
16502d9f452Stholo 
16602d9f452Stholo /* Define if you have the ftruncate function.  */
16702d9f452Stholo #undef HAVE_FTRUNCATE
16802d9f452Stholo 
16902d9f452Stholo /* Define if you have the getpagesize function.  */
17002d9f452Stholo #undef HAVE_GETPAGESIZE
17102d9f452Stholo 
17202d9f452Stholo /* Define if you have the krb_get_err_text function.  */
17302d9f452Stholo #undef HAVE_KRB_GET_ERR_TEXT
17402d9f452Stholo 
17502d9f452Stholo /* Define if you have the putenv function.  */
17602d9f452Stholo #define HAVE_PUTENV 1
17702d9f452Stholo 
17802d9f452Stholo /* Define if you have the sigaction function.  */
17902d9f452Stholo #undef HAVE_SIGACTION
18002d9f452Stholo 
18102d9f452Stholo /* Define if you have the sigblock function.  */
18202d9f452Stholo #undef HAVE_SIGBLOCK
18302d9f452Stholo 
18402d9f452Stholo /* Define if you have the sigprocmask function.  */
18502d9f452Stholo #undef HAVE_SIGPROCMASK
18602d9f452Stholo 
18702d9f452Stholo /* Define if you have the sigsetmask function.  */
18802d9f452Stholo #undef HAVE_SIGSETMASK
18902d9f452Stholo 
19002d9f452Stholo /* Define if you have the sigvec function.  */
19102d9f452Stholo #undef HAVE_SIGVEC
19202d9f452Stholo 
19302d9f452Stholo /* Define if you have the timezone function.  */
19402d9f452Stholo /* Hmm, I actually rather think it's an extern long
19502d9f452Stholo    variable; that message was mechanically generated
19602d9f452Stholo    by autoconf.  And I don't see any actual uses of
19702d9f452Stholo    this function in the code anyway, hmm.  */
19802d9f452Stholo #undef HAVE_TIMEZONE
19902d9f452Stholo 
200461cc63eStholo /* Define if you have the tzset function.  */
201461cc63eStholo #define HAVE_TZSET 1
202461cc63eStholo 
20302d9f452Stholo /* Define if you have the vfork function.  */
20402d9f452Stholo #undef HAVE_VFORK
20502d9f452Stholo 
20602d9f452Stholo /* Define if you have the vprintf function.  */
20702d9f452Stholo #define HAVE_VPRINTF 1
20802d9f452Stholo 
20902d9f452Stholo /* Define if you have the <direct.h> header file.  */
21002d9f452Stholo #define HAVE_DIRECT_H 1
21102d9f452Stholo 
21202d9f452Stholo /* Define if you have the <dirent.h> header file.  */
21302d9f452Stholo /* We have our own dirent.h and dirent.c. */
214461cc63eStholo #ifdef __WATCOMC__
215461cc63eStholo #undef HAVE_DIRENT_H
216461cc63eStholo #else
21702d9f452Stholo #define HAVE_DIRENT_H 1
218461cc63eStholo #endif
21902d9f452Stholo 
22002d9f452Stholo /* Define if you have the <errno.h> header file.  */
22102d9f452Stholo #define HAVE_ERRNO_H 1
22202d9f452Stholo 
22302d9f452Stholo /* Define if you have the <fcntl.h> header file.  */
22402d9f452Stholo #define HAVE_FCNTL_H 1
22502d9f452Stholo 
22602d9f452Stholo /* Define if you have the <io.h> header file.  */
22702d9f452Stholo /* Low-level Unix I/O routines like open, creat, etc.  */
22802d9f452Stholo #define HAVE_IO_H 1
22902d9f452Stholo 
23002d9f452Stholo /* Define if you have the <memory.h> header file.  */
23102d9f452Stholo #define HAVE_MEMORY_H 1
23202d9f452Stholo 
23302d9f452Stholo /* Define if you have the <ndbm.h> header file.  */
23402d9f452Stholo #undef HAVE_NDBM_H
23502d9f452Stholo 
23602d9f452Stholo /* Define if you have the <ndir.h> header file.  */
23702d9f452Stholo #undef HAVE_NDIR_H
23802d9f452Stholo 
23902d9f452Stholo /* Define if you have the <string.h> header file.  */
24002d9f452Stholo #define HAVE_STRING_H 1
24102d9f452Stholo 
24202d9f452Stholo /* Define if you have the <sys/bsdtypes.h> header file.  */
24302d9f452Stholo #undef HAVE_SYS_BSDTYPES_H
24402d9f452Stholo 
24502d9f452Stholo /* Define if you have the <sys/dir.h> header file.  */
24602d9f452Stholo #undef HAVE_SYS_DIR_H
24702d9f452Stholo 
24802d9f452Stholo /* Define if you have the <sys/ndir.h> header file.  */
24902d9f452Stholo #undef HAVE_SYS_NDIR_H
25002d9f452Stholo 
25102d9f452Stholo /* Define if you have the <sys/param.h> header file.  */
25202d9f452Stholo #undef HAVE_SYS_PARAM_H
25302d9f452Stholo 
25402d9f452Stholo /* Define if you have the <sys/select.h> header file.  */
25502d9f452Stholo #undef HAVE_SYS_SELECT_H
25602d9f452Stholo 
25702d9f452Stholo /* Define if you have the <sys/time.h> header file.  */
25802d9f452Stholo #undef HAVE_SYS_TIME_H
25902d9f452Stholo 
26002d9f452Stholo /* Define if you have the <unistd.h> header file.  */
26102d9f452Stholo #undef HAVE_UNISTD_H
26202d9f452Stholo 
26302d9f452Stholo /* Define if you have the <utime.h> header file.  */
26402d9f452Stholo #undef HAVE_UTIME_H
26502d9f452Stholo 
26602d9f452Stholo /* Define if you have the <sys/utime.h> header file.  */
26702d9f452Stholo #define HAVE_SYS_UTIME_H 1
26802d9f452Stholo 
26902d9f452Stholo /* Define if you have the inet library (-linet).  */
27002d9f452Stholo #undef HAVE_LIBINET
27102d9f452Stholo 
27202d9f452Stholo /* Define if you have the nsl library (-lnsl).  */
27302d9f452Stholo /* This is not used anywhere in the source code.  */
27402d9f452Stholo #undef HAVE_LIBNSL
27502d9f452Stholo 
27602d9f452Stholo /* Define if you have the nsl_s library (-lnsl_s).  */
27702d9f452Stholo #undef HAVE_LIBNSL_S
27802d9f452Stholo 
27902d9f452Stholo /* Define if you have the socket library (-lsocket).  */
28002d9f452Stholo /* This isn't ever used either.  */
28102d9f452Stholo #undef HAVE_LIBSOCKET
28202d9f452Stholo 
28302d9f452Stholo /* Under OS/2, mkdir only takes one argument.  */
28402d9f452Stholo #define CVS_MKDIR os2_mkdir
28502d9f452Stholo extern int os2_mkdir (const char *PATH, int MODE);
28602d9f452Stholo 
287780d15dfStholo /* OS/2 needs a special chdir functions that handles drives */
288780d15dfStholo #define CVS_CHDIR os2_chdir
289780d15dfStholo extern int os2_chdir (const char *Dir);
290780d15dfStholo 
29102d9f452Stholo /* This function doesn't exist under OS/2; we provide a stub. */
29202d9f452Stholo extern int readlink (char *path, char *buf, int buf_size);
29302d9f452Stholo 
29402d9f452Stholo /* This is just a call to GetCurrentProcessID.  */
295461cc63eStholo #ifndef __WATCOMC__
29602d9f452Stholo extern pid_t getpid (void);
297461cc63eStholo #endif
29802d9f452Stholo 
29902d9f452Stholo /* We definitely have prototypes.  */
30002d9f452Stholo #define USE_PROTOTYPES 1
30102d9f452Stholo 
30202d9f452Stholo /* Under OS/2, filenames are case-insensitive, and both / and \
30302d9f452Stholo    are path component separators.  */
30402d9f452Stholo #define FOLD_FN_CHAR(c) (OS2_filename_classes[(unsigned char) (c)])
30502d9f452Stholo extern unsigned char OS2_filename_classes[];
30602d9f452Stholo 
30702d9f452Stholo /* Is the character C a path name separator?  Under OS/2, you can use
30802d9f452Stholo    either / or \.  */
30902d9f452Stholo #define ISDIRSEP(c) (FOLD_FN_CHAR(c) == '/')
31002d9f452Stholo 
31102d9f452Stholo /* Like strcmp, but with the appropriate tweaks for file names.
31202d9f452Stholo    Under OS/2, filenames are case-insensitive but case-preserving,
31302d9f452Stholo    and both \ and / are path element separators.  */
31402d9f452Stholo extern int fncmp (const char *n1, const char *n2);
31502d9f452Stholo 
31602d9f452Stholo /* Fold characters in FILENAME to their canonical forms.
31702d9f452Stholo    If FOLD_FN_CHAR is not #defined, the system provides a default
31802d9f452Stholo    definition for this.  */
31902d9f452Stholo extern void fnfold (char *FILENAME);
32002d9f452Stholo 
32102d9f452Stholo /* This is where old bits go to die under OS/2 as well as WinNT.  */
32202d9f452Stholo #define DEVNULL "nul"
32302d9f452Stholo 
32402d9f452Stholo /* Make sure that we don't try to perform operations on RCS files on the
32502d9f452Stholo    local machine.  I think I neglected to apply some changes from
32602d9f452Stholo    MHI's port in that area of code, or found some issues I didn't want
32702d9f452Stholo    to deal with.  */
32802d9f452Stholo #define CLIENT_ONLY
32902d9f452Stholo 
33002d9f452Stholo /* We actually do have a transparent rsh, whew. */
33102d9f452Stholo #undef RSH_NOT_TRANSPARENT
33202d9f452Stholo /* But it won't be transparent unless we ask it nicely! */
33302d9f452Stholo #define RSH_NEEDS_BINARY_FLAG 1
33402d9f452Stholo 
33502d9f452Stholo /* OS/2 doesn't really have user/group permissions, at least not
33650bf276cStholo    according to the C library manual pages.  So we'll make decoys.
33750bf276cStholo    (This was partly introduced for an obsolete reason, now taken care
33850bf276cStholo    of by CHMOD_BROKEN, but I haven't carefully looked at every case
339461cc63eStholo    (in particular mode_to_string), so it might still be needed).
340461cc63eStholo    We do not need that for the watcom compiler since watcom already
341461cc63eStholo    all those permission bits defined. It would probably be better to
342461cc63eStholo    include the necessary system header files in system.h, and then make
343461cc63eStholo    each permission define only if it is not already defined.
344461cc63eStholo */
345461cc63eStholo #ifndef __WATCOMC__
34602d9f452Stholo #define NEED_DECOY_PERMISSIONS 1     /* see system.h */
347461cc63eStholo #endif
34802d9f452Stholo 
34902d9f452Stholo 
35002d9f452Stholo 
351461cc63eStholo /* For the access() function, for which IBM OS/2 compiler has no pre-defined
35202d9f452Stholo    mnemonic masks. */
353461cc63eStholo #ifndef __WATCOMC__
35402d9f452Stholo #define R_OK 04
35502d9f452Stholo #define W_OK 02
35602d9f452Stholo #define F_OK 00
35702d9f452Stholo #define X_OK R_OK  /* I think this is right for OS/2. */
358461cc63eStholo #endif
35902d9f452Stholo 
36002d9f452Stholo /* For getpid() */
36102d9f452Stholo #include <process.h>
36202d9f452Stholo 
36302d9f452Stholo /* So "tcpip.h" gets included in lib/system.h: */
36402d9f452Stholo #define USE_OWN_TCPIP_H 1
36502d9f452Stholo /* The IBM TCP/IP library gets initialized in main(): */
36650bf276cStholo #define SYSTEM_INITIALIZE(pargc,pargv) init_sockets()
36702d9f452Stholo extern void init_sockets();
36802d9f452Stholo 
36902d9f452Stholo /* Under OS/2, we have our own popen() and pclose()... */
37002d9f452Stholo #define USE_OWN_POPEN 1
37102d9f452Stholo /* ... and we use popenRW to start the rsh server. */
37202d9f452Stholo #define START_RSH_WITH_POPEN_RW 1
37302d9f452Stholo 
37402d9f452Stholo /*
37502d9f452Stholo  * This tells the client that it must use send()/recv() to talk to the
37602d9f452Stholo  * server if it is connected to the server via a socket.  Sigh.
377461cc63eStholo  * Windows 95 and VMS cannot convert sockets to file descriptors either,
37802d9f452Stholo  * apparently.
37902d9f452Stholo  */
38002d9f452Stholo #define NO_SOCKET_TO_FD 1
38102d9f452Stholo 
38202d9f452Stholo /* chmod() doesn't seem to work -- IBM's own example program does not
38302d9f452Stholo  * behave as its documentation claims, in fact!  I suspect that
38402d9f452Stholo  * DosSetPathInfo is the way to go, but can't seem to make that work
38502d9f452Stholo  * either.  For now, we can deal with some cases by invoking the DOS
38602d9f452Stholo  * "attrib" command via system().  */
38702d9f452Stholo #define CHMOD_BROKEN 1
38802d9f452Stholo 
38902d9f452Stholo /* Rule Number 1 of OS/2 Programming: If the function you're looking
390461cc63eStholo    for doesn't exist, try putting "Dos" in front of it.
391461cc63eStholo    Do not forget to include the os2 header file if we use DosSleep. */
39202d9f452Stholo #ifndef sleep
393461cc63eStholo #include "os2inc.h"
39402d9f452Stholo #define sleep(x) DosSleep(((long)(x))*1000L)
39502d9f452Stholo #endif /* sleep */
39602d9f452Stholo 
39702d9f452Stholo /* Set to 1 for some debugging messages. */
39802d9f452Stholo #if 0
39902d9f452Stholo #define KFF_DEBUG(call) printf("*** %s:%d: ", __FILE__, __LINE__); \
40002d9f452Stholo                         call; fflush(stdout);
40102d9f452Stholo #else
40202d9f452Stholo #define KFF_DEBUG(call)
40302d9f452Stholo #endif
404