Patch-ID: bash32-028
[bash.git] / config-bot.h
blob4efa63c590d1b854f6d1b878d4ce9e1853d389a9
1 /* config-bot.h */
2 /* modify settings or make new ones based on what autoconf tells us. */
4 /* Copyright (C) 1989-2007 Free Software Foundation, Inc.
6 This file is part of GNU Bash, the Bourne Again SHell.
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.
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.
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. */
22 /*********************************************************/
23 /* Modify or set defines based on the configure results. */
24 /*********************************************************/
26 #if !defined (HAVE_VPRINTF) && defined (HAVE_DOPRNT)
27 # define USE_VFPRINTF_EMULATION
28 # define HAVE_VPRINTF
29 #endif
31 #if defined (HAVE_SYS_RESOURCE_H) && defined (HAVE_GETRLIMIT)
32 # define HAVE_RESOURCE
33 #endif
35 #if !defined (GETPGRP_VOID)
36 # define HAVE_BSD_PGRP
37 #endif
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
50 #if defined (HAVE_SYS_SOCKET_H) && defined (HAVE_GETPEERNAME) && defined (HAVE_NETINET_IN_H)
51 # define HAVE_NETWORK
52 #endif
54 #if defined (HAVE_REGEX_H) && defined (HAVE_REGCOMP) && defined (HAVE_REGEXEC)
55 # define HAVE_POSIX_REGEXP
56 #endif
58 /* backwards compatibility between different autoconf versions */
59 #if HAVE_DECL_SYS_SIGLIST && !defined (SYS_SIGLIST_DECLARED)
60 # define SYS_SIGLIST_DECLARED
61 #endif
63 /***********************************************************************/
64 /* Unset defines based on what configure reports as missing or broken. */
65 /***********************************************************************/
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
73 /* If we have a getcwd(3), but one that does not dynamically allocate memory,
74 #undef HAVE_GETCWD so the replacement in getcwd.c will be built. We do
75 not do this on Solaris, because their implementation of loopback mounts
76 breaks the traditional file system assumptions that getcwd uses. */
77 #if defined (HAVE_GETCWD) && defined (GETCWD_BROKEN) && !defined (SOLARIS)
78 # undef HAVE_GETCWD
79 #endif
81 #if !defined (HAVE_DEV_FD) && defined (NAMED_PIPES_MISSING)
82 # undef PROCESS_SUBSTITUTION
83 #endif
85 #if defined (JOB_CONTROL_MISSING)
86 # undef JOB_CONTROL
87 #endif
89 #if defined (STRCOLL_BROKEN)
90 # undef HAVE_STRCOLL
91 #endif
93 #if !defined (HAVE_POSIX_REGEXP)
94 # undef COND_REGEXP
95 #endif
97 /* If the shell is called by this name, it will become restricted. */
98 #if defined (RESTRICTED_SHELL)
99 # define RESTRICTED_SHELL_NAME "rbash"
100 #endif
102 /***********************************************************/
103 /* Make sure feature defines have necessary prerequisites. */
104 /***********************************************************/
106 /* BANG_HISTORY requires HISTORY. */
107 #if defined (BANG_HISTORY) && !defined (HISTORY)
108 # define HISTORY
109 #endif /* BANG_HISTORY && !HISTORY */
111 #if defined (READLINE) && !defined (HISTORY)
112 # define HISTORY
113 #endif
115 #if defined (PROGRAMMABLE_COMPLETION) && !defined (READLINE)
116 # undef PROGRAMMABLE_COMPLETION
117 #endif
119 #if !defined (V9_ECHO)
120 # undef DEFAULT_ECHO_TO_XPG
121 #endif
123 #if !defined (PROMPT_STRING_DECODE)
124 # undef PPROMPT
125 # define PPROMPT "$ "
126 #endif
128 /************************************************/
129 /* check multibyte capability for I18N code */
130 /************************************************/
132 /* For platforms which support the ISO C amendement 1 functionality we
133 support user defined character classes. */
134 /* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>. */
135 #if defined (HAVE_WCTYPE_H) && defined (HAVE_WCHAR_H) && defined (HAVE_LOCALE_H)
136 # include <wchar.h>
137 # include <wctype.h>
138 # if defined (HAVE_ISWCTYPE) && \
139 defined (HAVE_ISWLOWER) && \
140 defined (HAVE_ISWUPPER) && \
141 defined (HAVE_MBSRTOWCS) && \
142 defined (HAVE_MBRTOWC) && \
143 defined (HAVE_MBRLEN) && \
144 defined (HAVE_TOWLOWER) && \
145 defined (HAVE_TOWUPPER) && \
146 defined (HAVE_WCHAR_T) && \
147 defined (HAVE_WCTYPE_T) && \
148 defined (HAVE_WINT_T) && \
149 defined (HAVE_WCWIDTH) && \
150 defined (HAVE_WCTYPE)
151 /* system is supposed to support XPG5 */
152 # define HANDLE_MULTIBYTE 1
153 # endif
154 #endif
156 /* If we don't want multibyte chars even on a system that supports them, let
157 the configuring user turn multibyte support off. */
158 #if defined (NO_MULTIBYTE_SUPPORT)
159 # undef HANDLE_MULTIBYTE
160 #endif
162 /* Some systems, like BeOS, have multibyte encodings but lack mbstate_t. */
163 #if HANDLE_MULTIBYTE && !defined (HAVE_MBSTATE_T)
164 # define wcsrtombs(dest, src, len, ps) (wcsrtombs) (dest, src, len, 0)
165 # define mbsrtowcs(dest, src, len, ps) (mbsrtowcs) (dest, src, len, 0)
166 # define wcrtomb(s, wc, ps) (wcrtomb) (s, wc, 0)
167 # define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0)
168 # define mbrlen(s, n, ps) (mbrlen) (s, n, 0)
169 # define mbstate_t int
170 #endif
172 /* Make sure MB_LEN_MAX is at least 16 (some systems define
173 MB_LEN_MAX as 1) */
174 #ifdef HANDLE_MULTIBYTE
175 # include <limits.h>
176 # if defined(MB_LEN_MAX) && (MB_LEN_MAX < 16)
177 # undef MB_LEN_MAX
178 # endif
179 # if !defined (MB_LEN_MAX)
180 # define MB_LEN_MAX 16
181 # endif
182 #endif
184 /************************************************/
185 /* end of multibyte capability checks for I18N */
186 /************************************************/
188 /******************************************************************/
189 /* Placeholder for builders to #undef any unwanted features from */
190 /* config-top.h or created by configure (such as the default mail */
191 /* file for mail checking). */
192 /******************************************************************/
194 /* If you don't want bash to provide a default mail file to check. */
195 /* #undef DEFAULT_MAIL_DIRECTORY */