blob: e339d3aad20fcf31963ba40bd160fd0017488d2d [file] [log] [blame]
Gerhard Riegerdf493f12008-01-28 22:37:16 +01001/* source: xioconfig.h */
Gerhard Riegerd34493c2016-07-22 08:54:31 +02002/* Copyright Gerhard Rieger and contributors (see file CHANGES) */
Gerhard Riegerb8195722008-01-27 13:00:08 +01003/* Published under the GNU General Public License V.2, see file COPYING */
4
5#ifndef __xioconfig_h_included
6#define __xioconfig_h_included 1
7
8/* ensure some dependencies between configure WITH defines. must be included
9 past config.h */
10
11#if WITH_STDIO || WITH_FDNUM
12# define WITH_FD 1
13#endif
14
15#if WITH_FILE || WITH_GOPEN || WITH_CREAT || WITH_PIPE
16# define WITH_OPEN 1
17#endif
18
19#if WITH_OPEN || WITH_PIPE || WITH_UNIX || WITH_PTY
20# define WITH_NAMED 1
21#endif
22
Gerhard Riegerb7dc4562008-09-24 08:31:00 +020023#if WITH_TERMIOS || WITH_PTY || WITH_READLINE
24# define _WITH_TERMIOS 1
25#endif
26
Gerhard Riegerb8195722008-01-27 13:00:08 +010027#if WITH_SOCKS4A
28# define WITH_SOCKS4 1
29#endif
30
31#if WITH_SOCKS4 || WITH_PROXY
32# define WITH_TCP 1
33# define WITH_IP4 1 /* currently this socks implementation does not work
34 with IP6 */
35#endif
36
37#if WITH_OPENSSL
38# define WITH_TCP 1
39# define WITH_IP4 1
40#endif
41
Gerhard Rieger967e2b22022-01-02 13:08:29 +010042#if 0
Gerhard Riegerb8195722008-01-27 13:00:08 +010043#if WITH_IP6
44# if !defined(HAVE_NETINET_IP6_H)
45# undef WITH_IP6
46# endif
47#endif
Gerhard Rieger967e2b22022-01-02 13:08:29 +010048#endif
Gerhard Riegerb8195722008-01-27 13:00:08 +010049
50#if !WITH_IP4 && !WITH_IP6
51# if WITH_TCP || WITH_UDP || WITH_RAWIP
52# define WITH_IP4 1
53# endif
54#endif
55
Gerhard Rieger13b73772008-08-17 23:28:11 +020056#if WITH_UNIX || WITH_IP4 || WITH_IP6 || WITH_SOCKS4 || WITH_RAWIP || WITH_GENERICSOCKET
57# define _WITH_SOCKET 1
Gerhard Riegerb8195722008-01-27 13:00:08 +010058#else
Gerhard Rieger13b73772008-08-17 23:28:11 +020059# undef _WITH_SOCKET
Gerhard Riegerb8195722008-01-27 13:00:08 +010060#endif
61
Gerhard Rieger13b73772008-08-17 23:28:11 +020062#if !_WITH_SOCKET
Gerhard Riegerb8195722008-01-27 13:00:08 +010063# undef WITH_LISTEN
64#endif
65
66#if !WITH_LISTEN
67# undef WITH_LIBWRAP
68#endif
69
Gerhard Rieger13b73772008-08-17 23:28:11 +020070#if WITH_GENERICSOCKET || WITH_TUN
Gerhard Riegerb8195722008-01-27 13:00:08 +010071# define _WITH_SOCKET 1
72#endif
73
74#if WITH_IP4 || WITH_TUN
75# define _WITH_IP4 1
76#endif
77
78#if WITH_IP6 || WITH_TUN
79# define _WITH_IP6 1
80#endif
81
82#if WITH_NAMED || WITH_TUN
83# define _WITH_NAMED 1
84#endif
85
86#if WITH_FILE || WITH_TUN
87# define _WITH_FILE 1
88#endif
89
90
Gerhard Riegerfbb521e2014-03-01 15:58:06 +010091#if HAVE_DEV_PTMX && HAVE_GRANTPT && HAVE_UNLOCKPT && HAVE_PROTOTYPE_LIB_ptsname
Gerhard Riegerb8195722008-01-27 13:00:08 +010092#else
93# undef HAVE_DEV_PTMX
94#endif
95
Gerhard Riegerfbb521e2014-03-01 15:58:06 +010096#if HAVE_DEV_PTC /* && HAVE_GRANTPT && HAVE_UNLOCKPT && HAVE_PROTOTYPE_LIB_ptsname */
Gerhard Riegerb8195722008-01-27 13:00:08 +010097#else
98# undef HAVE_DEV_PTC
99#endif
100
101
102/* MacOS does not seem to have any pty implementation */
103#if WITH_PTY && (HAVE_DEV_PTC || HAVE_DEV_PTMX || HAVE_OPENPTY)
104# define HAVE_PTY 1
105#else
106# undef HAVE_PTY
107#endif
108
109#ifndef HAVE_TYPE_SOCKLEN
110 typedef int socklen_t;
111#endif /* !defined(HAVE_TYPE_SOCKLEN) */
112
113#ifndef HAVE_TYPE_UINT8
114 typedef unsigned char uint8_t;
115#endif
116
117#ifndef HAVE_TYPE_UINT16
118 typedef unsigned short uint16_t;
119#endif
120
121#ifndef HAVE_TYPE_UINT32
122 typedef unsigned int uint32_t;
123#endif
124
Gerhard Riegerb2d61842008-10-12 12:01:00 +0200125#ifndef HAVE_TYPE_SA_FAMILY_T
126 typedef uint16_t sa_family_t;
127#endif
128
Gerhard Riegerb8195722008-01-27 13:00:08 +0100129#endif /* !defined(__xioconfig_h_included) */