Imported from ../bash-3.1.tar.gz.
[platform/upstream/bash.git] / config-bot.h
1 /* config-bot.h */
2 /* modify settings or make new ones based on what autoconf tells us. */
3
4 /* Copyright (C) 1989-2002 Free Software Foundation, Inc.
5
6    This file is part of GNU Bash, the Bourne Again SHell.
7
8    Bash is free software; you can redistribute it and/or modify it under
9    the terms of the GNU General Public License as published by the Free
10    Software Foundation; either version 2, or (at your option) any later
11    version.
12
13    Bash is distributed in the hope that it will be useful, but WITHOUT ANY
14    WARRANTY; without even the implied warranty of MERCHANTABILITY or
15    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
16    for more details.
17
18    You should have received a copy of the GNU General Public License along
19    with Bash; see the file COPYING.  If not, write to the Free Software
20    Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
21
22 /*********************************************************/
23 /* Modify or set defines based on the configure results. */
24 /*********************************************************/
25
26 #if !defined (HAVE_VPRINTF) && defined (HAVE_DOPRNT)
27 #  define USE_VFPRINTF_EMULATION
28 #  define HAVE_VPRINTF
29 #endif
30
31 #if defined (HAVE_SYS_RESOURCE_H) && defined (HAVE_GETRLIMIT)
32 #  define HAVE_RESOURCE
33 #endif
34
35 #if !defined (GETPGRP_VOID)
36 #  define HAVE_BSD_PGRP
37 #endif
38
39 /* Try this without testing __STDC__ for the time being. */
40 #if defined (HAVE_STDARG_H)
41 #  define PREFER_STDARG
42 #  define USE_VARARGS
43 #else
44 #  if defined (HAVE_VARARGS_H)
45 #    define PREFER_VARARGS
46 #    define USE_VARARGS
47 #  endif
48 #endif
49
50 #if defined (HAVE_SYS_SOCKET_H) && defined (HAVE_GETPEERNAME) && defined (HAVE_NETINET_IN_H)
51 #  define HAVE_NETWORK
52 #endif
53
54 #if defined (HAVE_REGEX_H) && defined (HAVE_REGCOMP) && defined (HAVE_REGEXEC)
55 #  define HAVE_POSIX_REGEXP
56 #endif
57
58 /* backwards compatibility between different autoconf versions */
59 #if HAVE_DECL_SYS_SIGLIST && !defined (SYS_SIGLIST_DECLARED)
60 #  define SYS_SIGLIST_DECLARED
61 #endif
62
63 /***********************************************************************/
64 /* Unset defines based on what configure reports as missing or broken. */
65 /***********************************************************************/
66
67 /* Ultrix botches type-ahead when switching from canonical to
68    non-canonical mode, at least through version 4.3 */
69 #if !defined (HAVE_TERMIOS_H) || !defined (HAVE_TCGETATTR) || defined (ultrix)
70 #  define TERMIOS_MISSING
71 #endif
72
73 /* If we have a getcwd(3), but it calls popen(), #undef HAVE_GETCWD so
74    the replacement in getcwd.c will be built. */
75 #if defined (HAVE_GETCWD) && defined (GETCWD_BROKEN)
76 #  undef HAVE_GETCWD
77 #endif
78
79 #if !defined (HAVE_DEV_FD) && defined (NAMED_PIPES_MISSING)
80 #  undef PROCESS_SUBSTITUTION
81 #endif
82
83 #if defined (JOB_CONTROL_MISSING)
84 #  undef JOB_CONTROL
85 #endif
86
87 #if defined (STRCOLL_BROKEN)
88 #  undef HAVE_STRCOLL
89 #endif
90
91 #if !defined (HAVE_POSIX_REGEXP)
92 #  undef COND_REGEXP
93 #endif
94
95 /* If the shell is called by this name, it will become restricted. */
96 #if defined (RESTRICTED_SHELL)
97 #  define RESTRICTED_SHELL_NAME "rbash"
98 #endif
99
100 /***********************************************************/
101 /* Make sure feature defines have necessary prerequisites. */
102 /***********************************************************/
103
104 /* BANG_HISTORY requires HISTORY. */
105 #if defined (BANG_HISTORY) && !defined (HISTORY)
106 #  define HISTORY
107 #endif /* BANG_HISTORY && !HISTORY */
108
109 #if defined (READLINE) && !defined (HISTORY)
110 #  define HISTORY
111 #endif
112
113 #if defined (PROGRAMMABLE_COMPLETION) && !defined (READLINE)
114 #  undef PROGRAMMABLE_COMPLETION
115 #endif
116
117 #if !defined (V9_ECHO)
118 #  undef DEFAULT_ECHO_TO_XPG
119 #endif
120
121 #if !defined (PROMPT_STRING_DECODE)
122 #  undef PPROMPT
123 #  define PPROMPT "$ "
124 #endif
125
126 /************************************************/
127 /* check multibyte capability for I18N code     */
128 /************************************************/
129
130 /* For platforms which support the ISO C amendement 1 functionality we
131    support user defined character classes.  */
132 /* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>.  */
133 #if defined (HAVE_WCTYPE_H) && defined (HAVE_WCHAR_H)
134 #  include <wchar.h>
135 #  include <wctype.h>
136 #  if defined (HAVE_MBSRTOWCS) && defined (HAVE_MBRTOWC) && defined (HAVE_MBRLEN) && defined (HAVE_WCWIDTH)
137      /* system is supposed to support XPG5 */
138 #    define HANDLE_MULTIBYTE      1
139 #  endif
140 #endif
141
142 /* If we don't want multibyte chars even on a system that supports them, let
143    the configuring user turn multibyte support off. */
144 #if defined (NO_MULTIBYTE_SUPPORT)
145 #  undef HANDLE_MULTIBYTE
146 #endif
147
148 /* Some systems, like BeOS, have multibyte encodings but lack mbstate_t.  */
149 #if HANDLE_MULTIBYTE && !defined (HAVE_MBSTATE_T)
150 #  define wcsrtombs(dest, src, len, ps) (wcsrtombs) (dest, src, len, 0)
151 #  define mbsrtowcs(dest, src, len, ps) (mbsrtowcs) (dest, src, len, 0)
152 #  define wcrtomb(s, wc, ps) (wcrtomb) (s, wc, 0)
153 #  define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0)
154 #  define mbrlen(s, n, ps) (mbrlen) (s, n, 0)
155 #  define mbstate_t int
156 #endif
157
158 /* Make sure MB_LEN_MAX is at least 16 (some systems define
159    MB_LEN_MAX as 1) */
160 #ifdef HANDLE_MULTIBYTE
161 #  include <limits.h>
162 #  if defined(MB_LEN_MAX) && (MB_LEN_MAX < 16)
163 #    undef MB_LEN_MAX
164 #  endif
165 #  if !defined (MB_LEN_MAX)
166 #    define MB_LEN_MAX 16
167 #  endif
168 #endif
169
170 /************************************************/
171 /* end of multibyte capability checks for I18N  */
172 /************************************************/
173
174 /******************************************************************/
175 /* Placeholder for builders to #undef any unwanted features from  */
176 /* config-top.h or created by configure (such as the default mail */
177 /* file for mail checking).                                       */
178 /******************************************************************/
179
180 /* If you don't want bash to provide a default mail file to check. */
181 /* #undef DEFAULT_MAIL_DIRECTORY */