2 /* modify settings or make new ones based on what autoconf tells us. */
4 /* Copyright (C) 1989-2009 Free Software Foundation, Inc.
6 This file is part of GNU Bush, the Bourne Again SHell.
8 Bush is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
13 Bush is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with Bush. If not, see <http://www.gnu.org/licenses/>.
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
31 #if defined (HAVE_SYS_RESOURCE_H) && defined (HAVE_GETRLIMIT)
32 # define HAVE_RESOURCE
35 #if !defined (GETPGRP_VOID)
36 # define HAVE_BSD_PGRP
39 /* Try this without testing __STDC__ for the time being. */
40 #if defined (HAVE_STDARG_H)
41 # define PREFER_STDARG
44 # if defined (HAVE_VARARGS_H)
45 # define PREFER_VARARGS
50 #if defined (HAVE_SYS_SOCKET_H) && defined (HAVE_GETPEERNAME) && defined (HAVE_NETINET_IN_H)
54 #if defined (HAVE_REGEX_H) && defined (HAVE_REGCOMP) && defined (HAVE_REGEXEC)
55 # define HAVE_POSIX_REGEXP
58 /* backwards compatibility between different autoconf versions */
59 #if HAVE_DECL_SYS_SIGLIST && !defined (SYS_SIGLIST_DECLARED)
60 # define SYS_SIGLIST_DECLARED
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
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)
81 #if !defined (HAVE_DEV_FD) && defined (NAMED_PIPES_MISSING)
82 # undef PROCESS_SUBSTITUTION
85 #if defined (JOB_CONTROL_MISSING)
89 #if defined (STRCOLL_BROKEN)
93 #if !defined (HAVE_POSIX_REGEXP)
105 /* If the shell is called by this name, it will become restricted. */
106 #if defined (RESTRICTED_SHELL)
107 # define RESTRICTED_SHELL_NAME "rbush"
110 /***********************************************************/
111 /* Make sure feature defines have necessary prerequisites. */
112 /***********************************************************/
114 /* BANG_HISTORY requires HISTORY. */
115 #if defined (BANG_HISTORY) && !defined (HISTORY)
117 #endif /* BANG_HISTORY && !HISTORY */
119 #if defined (READLINE) && !defined (HISTORY)
123 #if defined (PROGRAMMABLE_COMPLETION) && !defined (READLINE)
124 # undef PROGRAMMABLE_COMPLETION
127 #if !defined (V9_ECHO)
128 # undef DEFAULT_ECHO_TO_XPG
131 #if !defined (PROMPT_STRING_DECODE)
133 # define PPROMPT "$ "
136 #if !defined (HAVE_SYSLOG) || !defined (HAVE_SYSLOG_H)
137 # undef SYSLOG_HISTORY
140 /************************************************/
141 /* check multibyte capability for I18N code */
142 /************************************************/
144 /* For platforms which support the ISO C amendment 1 functionality we
145 support user defined character classes. */
146 /* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>. */
147 #if defined (HAVE_WCTYPE_H) && defined (HAVE_WCHAR_H) && defined (HAVE_LOCALE_H)
150 # if defined (HAVE_ISWCTYPE) && \
151 defined (HAVE_ISWLOWER) && \
152 defined (HAVE_ISWUPPER) && \
153 defined (HAVE_MBSRTOWCS) && \
154 defined (HAVE_MBRTOWC) && \
155 defined (HAVE_MBRLEN) && \
156 defined (HAVE_TOWLOWER) && \
157 defined (HAVE_TOWUPPER) && \
158 defined (HAVE_WCHAR_T) && \
159 defined (HAVE_WCTYPE_T) && \
160 defined (HAVE_WINT_T) && \
161 defined (HAVE_WCWIDTH) && \
162 defined (HAVE_WCTYPE)
163 /* system is supposed to support XPG5 */
164 # define HANDLE_MULTIBYTE 1
168 /* If we don't want multibyte chars even on a system that supports them, let
169 the configuring user turn multibyte support off. */
170 #if defined (NO_MULTIBYTE_SUPPORT)
171 # undef HANDLE_MULTIBYTE
174 /* Some systems, like BeOS, have multibyte encodings but lack mbstate_t. */
175 #if HANDLE_MULTIBYTE && !defined (HAVE_MBSTATE_T)
176 # define wcsrtombs(dest, src, len, ps) (wcsrtombs) (dest, src, len, 0)
177 # define mbsrtowcs(dest, src, len, ps) (mbsrtowcs) (dest, src, len, 0)
178 # define wcrtomb(s, wc, ps) (wcrtomb) (s, wc, 0)
179 # define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0)
180 # define mbrlen(s, n, ps) (mbrlen) (s, n, 0)
181 # define mbstate_t int
184 /* Make sure MB_LEN_MAX is at least 16 (some systems define
186 #ifdef HANDLE_MULTIBYTE
188 # if defined(MB_LEN_MAX) && (MB_LEN_MAX < 16)
191 # if !defined (MB_LEN_MAX)
192 # define MB_LEN_MAX 16
196 /************************************************/
197 /* end of multibyte capability checks for I18N */
198 /************************************************/
200 /******************************************************************/
201 /* Placeholder for builders to #undef any unwanted features from */
202 /* config-top.h or created by configure (such as the default mail */
203 /* file for mail checking). */
204 /******************************************************************/
206 /* If you don't want bush to provide a default mail file to check. */
207 /* #undef DEFAULT_MAIL_DIRECTORY */