Gerhard Rieger | df493f1 | 2008-01-28 22:37:16 +0100 | [diff] [blame] | 1 | /* source: xioconfig.h */ |
Gerhard Rieger | d34493c | 2016-07-22 08:54:31 +0200 | [diff] [blame] | 2 | /* Copyright Gerhard Rieger and contributors (see file CHANGES) */ |
Gerhard Rieger | b819572 | 2008-01-27 13:00:08 +0100 | [diff] [blame] | 3 | /* 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 Rieger | b7dc456 | 2008-09-24 08:31:00 +0200 | [diff] [blame] | 23 | #if WITH_TERMIOS || WITH_PTY || WITH_READLINE |
| 24 | # define _WITH_TERMIOS 1 |
| 25 | #endif |
| 26 | |
Gerhard Rieger | b819572 | 2008-01-27 13:00:08 +0100 | [diff] [blame] | 27 | #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 Rieger | 967e2b2 | 2022-01-02 13:08:29 +0100 | [diff] [blame] | 42 | #if 0 |
Gerhard Rieger | b819572 | 2008-01-27 13:00:08 +0100 | [diff] [blame] | 43 | #if WITH_IP6 |
| 44 | # if !defined(HAVE_NETINET_IP6_H) |
| 45 | # undef WITH_IP6 |
| 46 | # endif |
| 47 | #endif |
Gerhard Rieger | 967e2b2 | 2022-01-02 13:08:29 +0100 | [diff] [blame] | 48 | #endif |
Gerhard Rieger | b819572 | 2008-01-27 13:00:08 +0100 | [diff] [blame] | 49 | |
| 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 Rieger | 13b7377 | 2008-08-17 23:28:11 +0200 | [diff] [blame] | 56 | #if WITH_UNIX || WITH_IP4 || WITH_IP6 || WITH_SOCKS4 || WITH_RAWIP || WITH_GENERICSOCKET |
| 57 | # define _WITH_SOCKET 1 |
Gerhard Rieger | b819572 | 2008-01-27 13:00:08 +0100 | [diff] [blame] | 58 | #else |
Gerhard Rieger | 13b7377 | 2008-08-17 23:28:11 +0200 | [diff] [blame] | 59 | # undef _WITH_SOCKET |
Gerhard Rieger | b819572 | 2008-01-27 13:00:08 +0100 | [diff] [blame] | 60 | #endif |
| 61 | |
Gerhard Rieger | 13b7377 | 2008-08-17 23:28:11 +0200 | [diff] [blame] | 62 | #if !_WITH_SOCKET |
Gerhard Rieger | b819572 | 2008-01-27 13:00:08 +0100 | [diff] [blame] | 63 | # undef WITH_LISTEN |
| 64 | #endif |
| 65 | |
| 66 | #if !WITH_LISTEN |
| 67 | # undef WITH_LIBWRAP |
| 68 | #endif |
| 69 | |
Gerhard Rieger | 13b7377 | 2008-08-17 23:28:11 +0200 | [diff] [blame] | 70 | #if WITH_GENERICSOCKET || WITH_TUN |
Gerhard Rieger | b819572 | 2008-01-27 13:00:08 +0100 | [diff] [blame] | 71 | # 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 Rieger | fbb521e | 2014-03-01 15:58:06 +0100 | [diff] [blame] | 91 | #if HAVE_DEV_PTMX && HAVE_GRANTPT && HAVE_UNLOCKPT && HAVE_PROTOTYPE_LIB_ptsname |
Gerhard Rieger | b819572 | 2008-01-27 13:00:08 +0100 | [diff] [blame] | 92 | #else |
| 93 | # undef HAVE_DEV_PTMX |
| 94 | #endif |
| 95 | |
Gerhard Rieger | fbb521e | 2014-03-01 15:58:06 +0100 | [diff] [blame] | 96 | #if HAVE_DEV_PTC /* && HAVE_GRANTPT && HAVE_UNLOCKPT && HAVE_PROTOTYPE_LIB_ptsname */ |
Gerhard Rieger | b819572 | 2008-01-27 13:00:08 +0100 | [diff] [blame] | 97 | #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 Rieger | b2d6184 | 2008-10-12 12:01:00 +0200 | [diff] [blame] | 125 | #ifndef HAVE_TYPE_SA_FAMILY_T |
| 126 | typedef uint16_t sa_family_t; |
| 127 | #endif |
| 128 | |
Gerhard Rieger | b819572 | 2008-01-27 13:00:08 +0100 | [diff] [blame] | 129 | #endif /* !defined(__xioconfig_h_included) */ |