]>
Commit | Line | Data |
---|---|---|
ccc6cda3 | 1 | dnl |
495aee44 | 2 | dnl Configure script for bash-4.2 |
ccc6cda3 JA |
3 | dnl |
4 | dnl report bugs to chet@po.cwru.edu | |
5 | dnl | |
6 | dnl Process this file with autoconf to produce a configure script. | |
d166f048 | 7 | |
495aee44 | 8 | # Copyright (C) 1987-2011 Free Software Foundation, Inc. |
f73dda09 | 9 | |
3185942a JA |
10 | # |
11 | # This program is free software: you can redistribute it and/or modify | |
12 | # it under the terms of the GNU General Public License as published by | |
13 | # the Free Software Foundation, either version 3 of the License, or | |
14 | # (at your option) any later version. | |
15 | # | |
16 | # This program is distributed in the hope that it will be useful, | |
17 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 | # GNU General Public License for more details. | |
20 | # | |
21 | # You should have received a copy of the GNU General Public License | |
22 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
ccc6cda3 | 23 | |
495aee44 | 24 | AC_REVISION([for Bash 4.2, version 4.037])dnl |
f73dda09 | 25 | |
495aee44 | 26 | define(bashvers, 4.2) |
17345e5a | 27 | define(relstatus, release) |
b80f6443 | 28 | |
0628567a | 29 | AC_INIT([bash], bashvers-relstatus, [bug-bash@gnu.org]) |
ccc6cda3 JA |
30 | |
31 | dnl make sure we are using a recent autoconf version | |
f73dda09 | 32 | AC_PREREQ(2.50) |
ccc6cda3 | 33 | |
f73dda09 | 34 | AC_CONFIG_SRCDIR(shell.h) |
ccc6cda3 JA |
35 | dnl where to find install.sh, config.sub, and config.guess |
36 | AC_CONFIG_AUX_DIR(./support) | |
f73dda09 JA |
37 | AC_CONFIG_HEADERS(config.h) |
38 | ||
39 | dnl checks for version info | |
b80f6443 JA |
40 | BASHVERS=bashvers |
41 | RELSTATUS=relstatus | |
7117c2d2 JA |
42 | |
43 | dnl defaults for debug settings | |
44 | case "$RELSTATUS" in | |
3185942a | 45 | alp*|bet*|dev*|rc*|maint*) DEBUG='-DDEBUG' MALLOC_DEBUG='-DMALLOC_DEBUG' ;; |
7117c2d2 JA |
46 | *) DEBUG= MALLOC_DEBUG= ;; |
47 | esac | |
ccc6cda3 JA |
48 | |
49 | dnl canonicalize the host and os so we can do some tricky things before | |
50 | dnl parsing options | |
51 | AC_CANONICAL_HOST | |
52 | ||
53 | dnl configure defaults | |
bb70624e | 54 | opt_bash_malloc=yes |
ccc6cda3 | 55 | opt_purify=no |
d166f048 | 56 | opt_purecov=no |
ccc6cda3 | 57 | opt_afs=no |
d166f048 | 58 | opt_curses=no |
b72432fd | 59 | opt_with_installed_readline=no |
ccc6cda3 | 60 | |
bb70624e JA |
61 | #htmldir= |
62 | ||
28ef6c31 | 63 | dnl some systems should be configured without the bash malloc by default |
ccc6cda3 JA |
64 | dnl and some need a special compiler or loader |
65 | dnl look in the NOTES file for more | |
66 | case "${host_cpu}-${host_os}" in | |
bb70624e | 67 | alpha*-*) opt_bash_malloc=no ;; # alpha running osf/1 or linux |
28ef6c31 | 68 | *[[Cc]]ray*-*) opt_bash_malloc=no ;; # Crays |
bb70624e JA |
69 | *-osf1*) opt_bash_malloc=no ;; # other osf/1 machines |
70 | sparc-svr4*) opt_bash_malloc=no ;; # sparc SVR4, SVR4.2 | |
71 | sparc-netbsd*) opt_bash_malloc=no ;; # needs 8-byte alignment | |
72 | mips-irix6*) opt_bash_malloc=no ;; # needs 8-byte alignment | |
73 | m68k-sysv) opt_bash_malloc=no ;; # fixes file descriptor leak in closedir | |
74 | sparc-linux*) opt_bash_malloc=no ;; # sparc running linux; requires ELF | |
95732b49 | 75 | #*-freebsd*-gnu) opt_bash_malloc=no ;; # there's some undetermined problem here |
7117c2d2 | 76 | #*-freebsd*) opt_bash_malloc=no ;; # they claim it's better; I disagree |
f73dda09 | 77 | *-openbsd*) opt_bash_malloc=no ;; # they claim it needs eight-bit alignment |
bb70624e JA |
78 | *-aix*) opt_bash_malloc=no ;; # AIX machines |
79 | *-nextstep*) opt_bash_malloc=no ;; # NeXT machines running NeXTstep | |
28ef6c31 JA |
80 | *-macos*) opt_bash_malloc=no ;; # Apple MacOS X |
81 | *-rhapsody*) opt_bash_malloc=no ;; # Apple Rhapsody (MacOS X) | |
82 | *-darwin*) opt_bash_malloc=no ;; # Apple Darwin (MacOS X) | |
bb70624e | 83 | *-dgux*) opt_bash_malloc=no ;; # DG/UX machines |
95732b49 | 84 | *-qnx*) opt_bash_malloc=no ;; # QNX 4.2, QNX 6.x |
bb70624e JA |
85 | *-machten4) opt_bash_malloc=no ;; # MachTen 4.x |
86 | *-bsdi2.1|*-bsdi3.?) opt_bash_malloc=no ; : ${CC:=shlicc2} ;; # for loadable builtins | |
87 | *-beos*) opt_bash_malloc=no ;; # they say it's suitable | |
28ef6c31 JA |
88 | *-cygwin*) opt_bash_malloc=no ;; # Cygnus's CYGWIN environment |
89 | *-opennt*|*-interix*) opt_bash_malloc=no ;; # Interix, now owned by Microsoft | |
ccc6cda3 JA |
90 | esac |
91 | ||
7117c2d2 JA |
92 | # memory scrambling on free() |
93 | case "${host_os}" in | |
94 | sco3.2v5*|sco3.2v4*) opt_memscramble=no ;; | |
95 | *) opt_memscramble=yes ;; | |
96 | esac | |
97 | ||
b80f6443 JA |
98 | dnl |
99 | dnl macros for the bash debugger | |
100 | dnl | |
495aee44 | 101 | dnl AM_PATH_LISPDIR |
b80f6443 JA |
102 | AC_ARG_VAR(DEBUGGER_START_FILE, [location of bash debugger initialization file]) |
103 | ||
ccc6cda3 JA |
104 | dnl arguments to configure |
105 | dnl packages | |
7117c2d2 JA |
106 | AC_ARG_WITH(afs, AC_HELP_STRING([--with-afs], [if you are running AFS]), opt_afs=$withval) |
107 | AC_ARG_WITH(bash-malloc, AC_HELP_STRING([--with-bash-malloc], [use the Bash version of malloc]), opt_bash_malloc=$withval) | |
108 | AC_ARG_WITH(curses, AC_HELP_STRING([--with-curses], [use the curses library instead of the termcap library]), opt_curses=$withval) | |
109 | AC_ARG_WITH(gnu-malloc, AC_HELP_STRING([--with-gnu-malloc], [synonym for --with-bash-malloc]), opt_bash_malloc=$withval) | |
110 | AC_ARG_WITH(installed-readline, AC_HELP_STRING([--with-installed-readline], [use a version of the readline library that is already installed]), opt_with_installed_readline=$withval) | |
111 | AC_ARG_WITH(purecov, AC_HELP_STRING([--with-purecov], [configure to postprocess with pure coverage]), opt_purecov=$withval) | |
112 | AC_ARG_WITH(purify, AC_HELP_STRING([--with-purify], [configure to postprocess with purify]), opt_purify=$withval) | |
ccc6cda3 | 113 | |
f73dda09 | 114 | if test "$opt_bash_malloc" = yes; then |
d166f048 JA |
115 | MALLOC_TARGET=malloc |
116 | MALLOC_SRC=malloc.c | |
f73dda09 JA |
117 | |
118 | MALLOC_LIB='-lmalloc' | |
119 | MALLOC_LIBRARY='$(ALLOC_LIBDIR)/libmalloc.a' | |
120 | MALLOC_LDFLAGS='-L$(ALLOC_LIBDIR)' | |
121 | MALLOC_DEP='$(MALLOC_LIBRARY)' | |
122 | ||
bb70624e | 123 | AC_DEFINE(USING_BASH_MALLOC) |
ccc6cda3 | 124 | else |
f73dda09 JA |
125 | MALLOC_LIB= |
126 | MALLOC_LIBRARY= | |
127 | MALLOC_LDFLAGS= | |
128 | MALLOC_DEP= | |
ccc6cda3 JA |
129 | fi |
130 | ||
131 | if test "$opt_purify" = yes; then | |
d166f048 | 132 | PURIFY="purify " |
7117c2d2 | 133 | AC_DEFINE(DISABLE_MALLOC_WRAPPERS) |
ccc6cda3 JA |
134 | else |
135 | PURIFY= | |
136 | fi | |
137 | ||
d166f048 JA |
138 | if test "$opt_purecov" = yes; then |
139 | PURIFY="${PURIFY}purecov" | |
140 | fi | |
141 | ||
ccc6cda3 JA |
142 | if test "$opt_afs" = yes; then |
143 | AC_DEFINE(AFS) | |
144 | fi | |
145 | ||
d166f048 JA |
146 | if test "$opt_curses" = yes; then |
147 | prefer_curses=yes | |
148 | fi | |
149 | ||
b80f6443 | 150 | if test -z "${DEBUGGER_START_FILE}"; then |
3185942a | 151 | DEBUGGER_START_FILE='${datadir}/bashdb/bashdb-main.inc' |
b80f6443 JA |
152 | fi |
153 | ||
ccc6cda3 JA |
154 | dnl optional shell features in config.h.in |
155 | opt_minimal_config=no | |
156 | ||
157 | opt_job_control=yes | |
158 | opt_alias=yes | |
159 | opt_readline=yes | |
160 | opt_history=yes | |
161 | opt_bang_history=yes | |
162 | opt_dirstack=yes | |
163 | opt_restricted=yes | |
164 | opt_process_subst=yes | |
165 | opt_prompt_decoding=yes | |
166 | opt_select=yes | |
167 | opt_help=yes | |
168 | opt_array_variables=yes | |
169 | opt_dparen_arith=yes | |
cce855bc | 170 | opt_extended_glob=yes |
ccc6cda3 JA |
171 | opt_brace_expansion=yes |
172 | opt_disabled_builtins=no | |
173 | opt_command_timing=yes | |
bb70624e | 174 | opt_xpg_echo=no |
95732b49 | 175 | opt_strict_posix=no |
cce855bc | 176 | opt_cond_command=yes |
b80f6443 | 177 | opt_cond_regexp=yes |
3185942a | 178 | opt_coproc=yes |
bb70624e JA |
179 | opt_arith_for_command=yes |
180 | opt_net_redirs=yes | |
181 | opt_progcomp=yes | |
7117c2d2 | 182 | opt_separate_help=no |
b80f6443 JA |
183 | opt_multibyte=yes |
184 | opt_debugger=yes | |
95732b49 | 185 | opt_single_longdoc_strings=yes |
3185942a JA |
186 | opt_casemod_attrs=yes |
187 | opt_casemod_expansions=yes | |
0001803f | 188 | opt_extglob_default=no |
cce855bc JA |
189 | |
190 | dnl options that affect how bash is compiled and linked | |
191 | opt_static_link=no | |
192 | opt_profiling=no | |
ccc6cda3 JA |
193 | |
194 | dnl argument parsing for optional features | |
7117c2d2 | 195 | AC_ARG_ENABLE(minimal-config, AC_HELP_STRING([--enable-minimal-config], [a minimal sh-like configuration]), opt_minimal_config=$enableval) |
ccc6cda3 JA |
196 | |
197 | dnl a minimal configuration turns everything off, but features can be | |
198 | dnl added individually | |
199 | if test $opt_minimal_config = yes; then | |
200 | opt_job_control=no opt_alias=no opt_readline=no | |
201 | opt_history=no opt_bang_history=no opt_dirstack=no | |
202 | opt_restricted=no opt_process_subst=no opt_prompt_decoding=no | |
203 | opt_select=no opt_help=no opt_array_variables=no opt_dparen_arith=no | |
204 | opt_brace_expansion=no opt_disabled_builtins=no opt_command_timing=no | |
bb70624e | 205 | opt_extended_glob=no opt_cond_command=no opt_arith_for_command=no |
7117c2d2 | 206 | opt_net_redirs=no opt_progcomp=no opt_separate_help=no |
3185942a | 207 | opt_multibyte=yes opt_cond_regexp=no opt_coproc=no |
0001803f | 208 | opt_casemod_attrs=no opt_casemod_expansions=no opt_extglob_default=no |
7117c2d2 JA |
209 | fi |
210 | ||
211 | AC_ARG_ENABLE(alias, AC_HELP_STRING([--enable-alias], [enable shell aliases]), opt_alias=$enableval) | |
212 | AC_ARG_ENABLE(arith-for-command, AC_HELP_STRING([--enable-arith-for-command], [enable arithmetic for command]), opt_arith_for_command=$enableval) | |
213 | AC_ARG_ENABLE(array-variables, AC_HELP_STRING([--enable-array-variables], [include shell array variables]), opt_array_variables=$enableval) | |
214 | AC_ARG_ENABLE(bang-history, AC_HELP_STRING([--enable-bang-history], [turn on csh-style history substitution]), opt_bang_history=$enableval) | |
215 | AC_ARG_ENABLE(brace-expansion, AC_HELP_STRING([--enable-brace-expansion], [include brace expansion]), opt_brace_expansion=$enableval) | |
3185942a JA |
216 | AC_ARG_ENABLE(casemod-attributes, AC_HELP_STRING([--enable-casemod-attributes], [include case-modifying variable attributes]), opt_casemod_attrs=$enableval) |
217 | AC_ARG_ENABLE(casemod-expansions, AC_HELP_STRING([--enable-casemod-expansions], [include case-modifying word expansions]), opt_casemod_expansions=$enableval) | |
7117c2d2 JA |
218 | AC_ARG_ENABLE(command-timing, AC_HELP_STRING([--enable-command-timing], [enable the time reserved word and command timing]), opt_command_timing=$enableval) |
219 | AC_ARG_ENABLE(cond-command, AC_HELP_STRING([--enable-cond-command], [enable the conditional command]), opt_cond_command=$enableval) | |
3185942a JA |
220 | AC_ARG_ENABLE(cond-regexp, AC_HELP_STRING([--enable-cond-regexp], [enable extended regular expression matching in conditional commands]), opt_cond_regexp=$enableval) |
221 | AC_ARG_ENABLE(coprocesses, AC_HELP_STRING([--enable-coprocesses], [enable coprocess support and the coproc reserved word]), opt_coproc=$enableval) | |
b80f6443 | 222 | AC_ARG_ENABLE(debugger, AC_HELP_STRING([--enable-debugger], [enable support for bash debugger]), opt_debugger=$enableval) |
7117c2d2 JA |
223 | AC_ARG_ENABLE(directory-stack, AC_HELP_STRING([--enable-directory-stack], [enable builtins pushd/popd/dirs]), opt_dirstack=$enableval) |
224 | AC_ARG_ENABLE(disabled-builtins, AC_HELP_STRING([--enable-disabled-builtins], [allow disabled builtins to still be invoked]), opt_disabled_builtins=$enableval) | |
225 | AC_ARG_ENABLE(dparen-arithmetic, AC_HELP_STRING([--enable-dparen-arithmetic], [include ((...)) command]), opt_dparen_arith=$enableval) | |
226 | AC_ARG_ENABLE(extended-glob, AC_HELP_STRING([--enable-extended-glob], [include ksh-style extended pattern matching]), opt_extended_glob=$enableval) | |
0001803f | 227 | AC_ARG_ENABLE(extended-glob-default, AC_HELP_STRING([--enable-extended-glob-default], [force extended pattern matching to be enabled by default]), opt_extglob_default=$enableval) |
7117c2d2 JA |
228 | AC_ARG_ENABLE(help-builtin, AC_HELP_STRING([--enable-help-builtin], [include the help builtin]), opt_help=$enableval) |
229 | AC_ARG_ENABLE(history, AC_HELP_STRING([--enable-history], [turn on command history]), opt_history=$enableval) | |
230 | AC_ARG_ENABLE(job-control, AC_HELP_STRING([--enable-job-control], [enable job control features]), opt_job_control=$enableval) | |
b80f6443 | 231 | AC_ARG_ENABLE(multibyte, AC_HELP_STRING([--enable-multibyte], [enable multibyte characters if OS supports them]), opt_multibyte=$enableval) |
7117c2d2 JA |
232 | AC_ARG_ENABLE(net-redirections, AC_HELP_STRING([--enable-net-redirections], [enable /dev/tcp/host/port redirection]), opt_net_redirs=$enableval) |
233 | AC_ARG_ENABLE(process-substitution, AC_HELP_STRING([--enable-process-substitution], [enable process substitution]), opt_process_subst=$enableval) | |
234 | AC_ARG_ENABLE(progcomp, AC_HELP_STRING([--enable-progcomp], [enable programmable completion and the complete builtin]), opt_progcomp=$enableval) | |
235 | AC_ARG_ENABLE(prompt-string-decoding, AC_HELP_STRING([--enable-prompt-string-decoding], [turn on escape character decoding in prompts]), opt_prompt_decoding=$enableval) | |
236 | AC_ARG_ENABLE(readline, AC_HELP_STRING([--enable-readline], [turn on command line editing]), opt_readline=$enableval) | |
237 | AC_ARG_ENABLE(restricted, AC_HELP_STRING([--enable-restricted], [enable a restricted shell]), opt_restricted=$enableval) | |
238 | AC_ARG_ENABLE(select, AC_HELP_STRING([--enable-select], [include select command]), opt_select=$enableval) | |
239 | AC_ARG_ENABLE(separate-helpfiles, AC_HELP_STRING([--enable-separate-helpfiles], [use external files for help builtin documentation]), opt_separate_help=$enableval) | |
95732b49 JA |
240 | AC_ARG_ENABLE(single-help-strings, AC_HELP_STRING([--enable-single-help-strings], [store help documentation as a single string to ease translation]), opt_single_longdoc_strings=$enableval) |
241 | AC_ARG_ENABLE(strict-posix-default, AC_HELP_STRING([--enable-strict-posix-default], [configure bash to be posix-conformant by default]), opt_strict_posix=$enableval) | |
7117c2d2 JA |
242 | AC_ARG_ENABLE(usg-echo-default, AC_HELP_STRING([--enable-usg-echo-default], [a synonym for --enable-xpg-echo-default]), opt_xpg_echo=$enableval) |
243 | AC_ARG_ENABLE(xpg-echo-default, AC_HELP_STRING([--enable-xpg-echo-default], [make the echo builtin expand escape sequences by default]), opt_xpg_echo=$enableval) | |
ccc6cda3 | 244 | |
cce855bc | 245 | dnl options that alter how bash is compiled and linked |
7117c2d2 JA |
246 | AC_ARG_ENABLE(mem-scramble, AC_HELP_STRING([--enable-mem-scramble], [scramble memory on calls to malloc and free]), opt_memscramble=$enableval) |
247 | AC_ARG_ENABLE(profiling, AC_HELP_STRING([--enable-profiling], [allow profiling with gprof]), opt_profiling=$enableval) | |
248 | AC_ARG_ENABLE(static-link, AC_HELP_STRING([--enable-static-link], [link bash statically, for use as a root shell]), opt_static_link=$enableval) | |
cce855bc | 249 | |
ccc6cda3 JA |
250 | dnl opt_job_control is handled later, after BASH_JOB_CONTROL_MISSING runs |
251 | ||
b72432fd JA |
252 | dnl opt_readline and opt_history are handled later, because AC_PROG_CC needs |
253 | dnl to be run before we can check the version of an already-installed readline | |
254 | dnl library | |
255 | ||
ccc6cda3 JA |
256 | if test $opt_alias = yes; then |
257 | AC_DEFINE(ALIAS) | |
258 | fi | |
ccc6cda3 JA |
259 | if test $opt_dirstack = yes; then |
260 | AC_DEFINE(PUSHD_AND_POPD) | |
261 | fi | |
262 | if test $opt_restricted = yes; then | |
263 | AC_DEFINE(RESTRICTED_SHELL) | |
264 | fi | |
265 | if test $opt_process_subst = yes; then | |
266 | AC_DEFINE(PROCESS_SUBSTITUTION) | |
267 | fi | |
268 | if test $opt_prompt_decoding = yes; then | |
269 | AC_DEFINE(PROMPT_STRING_DECODE) | |
270 | fi | |
271 | if test $opt_select = yes; then | |
272 | AC_DEFINE(SELECT_COMMAND) | |
273 | fi | |
274 | if test $opt_help = yes; then | |
275 | AC_DEFINE(HELP_BUILTIN) | |
276 | fi | |
277 | if test $opt_array_variables = yes; then | |
278 | AC_DEFINE(ARRAY_VARS) | |
279 | fi | |
280 | if test $opt_dparen_arith = yes; then | |
281 | AC_DEFINE(DPAREN_ARITHMETIC) | |
282 | fi | |
283 | if test $opt_brace_expansion = yes; then | |
284 | AC_DEFINE(BRACE_EXPANSION) | |
285 | fi | |
286 | if test $opt_disabled_builtins = yes; then | |
287 | AC_DEFINE(DISABLED_BUILTINS) | |
288 | fi | |
289 | if test $opt_command_timing = yes; then | |
290 | AC_DEFINE(COMMAND_TIMING) | |
291 | fi | |
bb70624e JA |
292 | if test $opt_xpg_echo = yes ; then |
293 | AC_DEFINE(DEFAULT_ECHO_TO_XPG) | |
ccc6cda3 | 294 | fi |
95732b49 JA |
295 | if test $opt_strict_posix = yes; then |
296 | AC_DEFINE(STRICT_POSIX) | |
297 | fi | |
cce855bc JA |
298 | if test $opt_extended_glob = yes ; then |
299 | AC_DEFINE(EXTENDED_GLOB) | |
300 | fi | |
0001803f CR |
301 | if test $opt_extglob_default = yes; then |
302 | AC_DEFINE(EXTGLOB_DEFAULT, 1) | |
303 | else | |
304 | AC_DEFINE(EXTGLOB_DEFAULT, 0) | |
305 | fi | |
cce855bc JA |
306 | if test $opt_cond_command = yes ; then |
307 | AC_DEFINE(COND_COMMAND) | |
308 | fi | |
b80f6443 JA |
309 | if test $opt_cond_regexp = yes ; then |
310 | AC_DEFINE(COND_REGEXP) | |
311 | fi | |
3185942a JA |
312 | if test $opt_coproc = yes; then |
313 | AC_DEFINE(COPROCESS_SUPPORT) | |
314 | fi | |
bb70624e JA |
315 | if test $opt_arith_for_command = yes; then |
316 | AC_DEFINE(ARITH_FOR_COMMAND) | |
317 | fi | |
318 | if test $opt_net_redirs = yes; then | |
319 | AC_DEFINE(NETWORK_REDIRECTIONS) | |
320 | fi | |
321 | if test $opt_progcomp = yes; then | |
322 | AC_DEFINE(PROGRAMMABLE_COMPLETION) | |
323 | fi | |
b80f6443 JA |
324 | if test $opt_multibyte = no; then |
325 | AC_DEFINE(NO_MULTIBYTE_SUPPORT) | |
326 | fi | |
327 | if test $opt_debugger = yes; then | |
328 | AC_DEFINE(DEBUGGER) | |
329 | fi | |
3185942a JA |
330 | if test $opt_casemod_attrs = yes; then |
331 | AC_DEFINE(CASEMOD_ATTRS) | |
332 | fi | |
333 | if test $opt_casemod_expansions = yes; then | |
334 | AC_DEFINE(CASEMOD_EXPANSIONS) | |
335 | fi | |
ccc6cda3 | 336 | |
7117c2d2 JA |
337 | if test $opt_memscramble = yes; then |
338 | AC_DEFINE(MEMSCRAMBLE) | |
339 | fi | |
340 | ||
d166f048 JA |
341 | if test "$opt_minimal_config" = yes; then |
342 | TESTSCRIPT=run-minimal | |
343 | else | |
344 | TESTSCRIPT=run-all | |
345 | fi | |
346 | ||
7117c2d2 JA |
347 | HELPDIR= HELPDIRDEFINE= HELPINSTALL= |
348 | if test "$opt_separate_help" != no; then | |
349 | if test "$opt_separate_help" = "yes" ; then | |
350 | HELPDIR='${datadir}/bash' | |
351 | else | |
352 | HELPDIR=$opt_separate_help | |
353 | fi | |
354 | HELPDIRDEFINE='-H ${HELPDIR}' | |
355 | HELPINSTALL='install-help' | |
356 | fi | |
95732b49 JA |
357 | HELPSTRINGS= |
358 | if test "$opt_single_longdoc_strings" != "yes"; then | |
359 | HELPSTRINGS='-S' | |
360 | fi | |
7117c2d2 | 361 | |
ccc6cda3 | 362 | dnl now substitute in the values generated by arguments |
d166f048 | 363 | AC_SUBST(TESTSCRIPT) |
ccc6cda3 | 364 | AC_SUBST(PURIFY) |
d166f048 | 365 | AC_SUBST(MALLOC_TARGET) |
ccc6cda3 | 366 | AC_SUBST(MALLOC_SRC) |
ccc6cda3 | 367 | |
f73dda09 JA |
368 | AC_SUBST(MALLOC_LIB) |
369 | AC_SUBST(MALLOC_LIBRARY) | |
370 | AC_SUBST(MALLOC_LDFLAGS) | |
371 | AC_SUBST(MALLOC_DEP) | |
bb70624e | 372 | |
f73dda09 | 373 | AC_SUBST(htmldir) |
d166f048 | 374 | |
7117c2d2 JA |
375 | AC_SUBST(HELPDIR) |
376 | AC_SUBST(HELPDIRDEFINE) | |
377 | AC_SUBST(HELPINSTALL) | |
95732b49 | 378 | AC_SUBST(HELPSTRINGS) |
7117c2d2 | 379 | |
f73dda09 | 380 | echo "" |
7117c2d2 | 381 | echo "Beginning configuration for bash-$BASHVERS-$RELSTATUS for ${host_cpu}-${host_vendor}-${host_os}" |
f73dda09 | 382 | echo "" |
ccc6cda3 JA |
383 | |
384 | dnl compilation checks | |
cce855bc JA |
385 | dnl AC_PROG_CC sets $cross_compiling to `yes' if cross-compiling for a |
386 | dnl different environment | |
ccc6cda3 | 387 | AC_PROG_CC |
bb70624e JA |
388 | |
389 | dnl test for Unix variants | |
ccc6cda3 JA |
390 | AC_ISC_POSIX |
391 | AC_MINIX | |
392 | ||
f73dda09 | 393 | AC_SYS_LARGEFILE |
bb70624e | 394 | |
95732b49 JA |
395 | dnl BEGIN changes for cross-building (currently cygwin, minGW, and |
396 | dnl (obsolete) BeOS) | |
b72432fd | 397 | |
0628567a | 398 | SIGNAMES_O= |
b72432fd | 399 | SIGNAMES_H=lsignames.h |
cce855bc JA |
400 | |
401 | dnl load up the cross-building cache file -- add more cases and cache | |
402 | dnl files as necessary | |
b72432fd JA |
403 | |
404 | dnl Note that host and target machine are the same, and different than the | |
405 | dnl build machine. | |
406 | dnl Set SIGNAMES_H based on whether or not we're cross-compiling. | |
407 | ||
0628567a | 408 | CROSS_COMPILE= |
cce855bc JA |
409 | if test "x$cross_compiling" = "xyes"; then |
410 | case "${host}" in | |
28ef6c31 | 411 | *-cygwin*) |
cce855bc | 412 | cross_cache=${srcdir}/cross-build/cygwin32.cache |
cce855bc | 413 | ;; |
95732b49 JA |
414 | *-mingw*) |
415 | cross_cache=${srcdir}/cross-build/cygwin32.cache | |
416 | ;; | |
b72432fd JA |
417 | i[[3456]]86-*-beos*) |
418 | cross_cache=${srcdir}/cross-build/x86-beos.cache | |
b72432fd JA |
419 | ;; |
420 | *) echo "configure: cross-compiling for $host is not supported" >&2 | |
cce855bc JA |
421 | ;; |
422 | esac | |
b72432fd JA |
423 | if test -n "${cross_cache}" && test -r "${cross_cache}"; then |
424 | echo "loading cross-build cache file ${cross_cache}" | |
425 | . ${cross_cache} | |
426 | fi | |
427 | unset cross_cache | |
0628567a | 428 | SIGNAMES_O='signames.o' |
95732b49 JA |
429 | CROSS_COMPILE='-DCROSS_COMPILING' |
430 | AC_SUBST(CROSS_COMPILE) | |
cce855bc | 431 | fi |
b72432fd | 432 | AC_SUBST(SIGNAMES_H) |
0628567a | 433 | AC_SUBST(SIGNAMES_O) |
cce855bc JA |
434 | |
435 | if test -z "$CC_FOR_BUILD"; then | |
436 | if test "x$cross_compiling" = "xno"; then | |
437 | CC_FOR_BUILD='$(CC)' | |
438 | else | |
439 | CC_FOR_BUILD=gcc | |
440 | fi | |
441 | fi | |
442 | AC_SUBST(CC_FOR_BUILD) | |
443 | ||
b72432fd | 444 | dnl END changes for cross-building |
cce855bc | 445 | |
ccc6cda3 JA |
446 | dnl We want these before the checks, so the checks can modify their values. |
447 | test -z "$CFLAGS" && CFLAGS=-g auto_cflags=1 | |
448 | ||
449 | dnl If we're using gcc and the user hasn't specified CFLAGS, add -O2 to CFLAGS. | |
450 | test -n "$GCC" && test -n "$auto_cflags" && CFLAGS="$CFLAGS -O2" | |
451 | ||
cce855bc JA |
452 | dnl handle options that alter how bash is compiled and linked |
453 | dnl these must come after the test for cc/gcc | |
454 | if test "$opt_profiling" = "yes"; then | |
455 | PROFILE_FLAGS=-pg | |
b72432fd JA |
456 | case "$host_os" in |
457 | solaris2*) ;; | |
458 | *) opt_static_link=yes ;; | |
459 | esac | |
7117c2d2 | 460 | DEBUG= MALLOC_DEBUG= |
cce855bc JA |
461 | fi |
462 | ||
463 | if test "$opt_static_link" = yes; then | |
f73dda09 | 464 | # if we're using gcc, add `-static' to LDFLAGS, except on Solaris >= 2 |
cce855bc | 465 | if test -n "$GCC" || test "$ac_cv_prog_gcc" = "yes"; then |
f73dda09 JA |
466 | STATIC_LD="-static" |
467 | case "$host_os" in | |
468 | solaris2*) ;; | |
469 | *) LDFLAGS="$LDFLAGS -static" ;; # XXX experimental | |
470 | esac | |
cce855bc JA |
471 | fi |
472 | fi | |
473 | ||
b80f6443 JA |
474 | if test "X$cross_compiling" = "Xno"; then |
475 | CPPFLAGS_FOR_BUILD=${CPPFLAGS_FOR_BUILD-"$CPPFLAGS"} | |
476 | LDFLAGS_FOR_BUILD=${LDFLAGS_FOR_BUILD-'$(LDFLAGS)'} | |
477 | else | |
478 | CPPFLAGS_FOR_BUILD=${CPPFLAGS_FOR_BUILD-""} | |
479 | LDFLAGS_FOR_BUILD=${LDFLAGS_FOR_BUILD-""} | |
480 | fi | |
481 | ||
7117c2d2 JA |
482 | test -z "$CFLAGS_FOR_BUILD" && CFLAGS_FOR_BUILD="-g" |
483 | ||
ccc6cda3 JA |
484 | AC_SUBST(CFLAGS) |
485 | AC_SUBST(CPPFLAGS) | |
486 | AC_SUBST(LDFLAGS) | |
b72432fd | 487 | AC_SUBST(STATIC_LD) |
ccc6cda3 | 488 | |
7117c2d2 JA |
489 | AC_SUBST(CFLAGS_FOR_BUILD) |
490 | AC_SUBST(CPPFLAGS_FOR_BUILD) | |
491 | AC_SUBST(LDFLAGS_FOR_BUILD) | |
492 | ||
ccc6cda3 JA |
493 | AC_PROG_GCC_TRADITIONAL |
494 | ||
b72432fd JA |
495 | dnl BEGIN READLINE and HISTORY LIBRARY SECTION |
496 | dnl prepare to allow bash to be linked against an already-installed readline | |
497 | ||
498 | dnl first test that the readline version is new enough to link bash against | |
f73dda09 | 499 | if test "$opt_readline" = yes && test "$opt_with_installed_readline" != "no" |
b72432fd | 500 | then |
f73dda09 JA |
501 | # If the user specified --with-installed-readline=PREFIX and PREFIX |
502 | # is not `yes', set ac_cv_rl_prefix to PREFIX | |
503 | test $opt_with_installed_readline != "yes" && ac_cv_rl_prefix=$opt_with_installed_readline | |
b72432fd | 504 | |
f73dda09 | 505 | RL_LIB_READLINE_VERSION |
b72432fd | 506 | |
f73dda09 | 507 | case "$ac_cv_rl_version" in |
b80f6443 | 508 | 5*|6*|7*|8*|9*) ;; |
b72432fd | 509 | *) opt_with_installed_readline=no |
0001803f CR |
510 | AC_MSG_WARN([installed readline library is too old to be linked with bash]) |
511 | AC_MSG_WARN([using private bash version]) | |
b72432fd JA |
512 | ;; |
513 | esac | |
b72432fd JA |
514 | fi |
515 | ||
95732b49 | 516 | TILDE_LIB=-ltilde |
b72432fd JA |
517 | if test $opt_readline = yes; then |
518 | AC_DEFINE(READLINE) | |
f73dda09 | 519 | if test "$opt_with_installed_readline" != "no" ; then |
b80f6443 JA |
520 | case "$opt_with_installed_readline" in |
521 | yes) RL_INCLUDE= ;; | |
522 | *) case "$RL_INCLUDEDIR" in | |
523 | /usr/include) ;; | |
524 | *) RL_INCLUDE='-I${RL_INCLUDEDIR}' ;; | |
525 | esac | |
526 | ;; | |
f73dda09 | 527 | esac |
b72432fd | 528 | READLINE_DEP= |
95732b49 JA |
529 | READLINE_LIB=-lreadline |
530 | # section for OS versions that don't allow unresolved symbols | |
531 | # to be compiled into dynamic libraries. | |
532 | case "$host_os" in | |
533 | cygwin*) TILDE_LIB= ;; | |
534 | esac | |
b72432fd JA |
535 | else |
536 | RL_LIBDIR='$(dot)/$(LIBSUBDIR)/readline' | |
537 | READLINE_DEP='$(READLINE_LIBRARY)' | |
95732b49 JA |
538 | # section for OS versions that ship an older/broken version of |
539 | # readline as a standard dynamic library and don't allow a | |
540 | # static version specified as -llibname to override the | |
541 | # dynamic version | |
542 | case "${host_os}" in | |
89a92869 | 543 | darwin[[89]]*|darwin10*) READLINE_LIB='${READLINE_LIBRARY}' ;; |
95732b49 JA |
544 | *) READLINE_LIB=-lreadline ;; |
545 | esac | |
b72432fd JA |
546 | fi |
547 | else | |
548 | RL_LIBDIR='$(dot)/$(LIBSUBDIR)/readline' | |
549 | READLINE_LIB= READLINE_DEP= | |
550 | fi | |
551 | if test $opt_history = yes || test $opt_bang_history = yes; then | |
552 | if test $opt_history = yes; then | |
553 | AC_DEFINE(HISTORY) | |
554 | fi | |
555 | if test $opt_bang_history = yes; then | |
556 | AC_DEFINE(BANG_HISTORY) | |
557 | fi | |
f73dda09 JA |
558 | if test "$opt_with_installed_readline" != "no"; then |
559 | HIST_LIBDIR=$RL_LIBDIR | |
b72432fd | 560 | HISTORY_DEP= |
95732b49 | 561 | HISTORY_LIB=-lhistory |
b80f6443 JA |
562 | case "$opt_with_installed_readline" in |
563 | yes) RL_INCLUDE= ;; | |
564 | *) case "$RL_INCLUDEDIR" in | |
565 | /usr/include) ;; | |
566 | *) RL_INCLUDE='-I${RL_INCLUDEDIR}' ;; | |
567 | esac | |
568 | ;; | |
f73dda09 | 569 | esac |
b72432fd JA |
570 | else |
571 | HIST_LIBDIR='$(dot)/$(LIBSUBDIR)/readline' | |
572 | HISTORY_DEP='$(HISTORY_LIBRARY)' | |
95732b49 JA |
573 | # section for OS versions that ship an older version of |
574 | # readline as a standard dynamic library and don't allow a | |
575 | # static version specified as -llibname to override the | |
576 | # dynamic version | |
577 | case "${host_os}" in | |
89a92869 | 578 | darwin[[89]]*|darwin10*) HISTORY_LIB='${HISTORY_LIBRARY}' ;; |
95732b49 JA |
579 | *) HISTORY_LIB=-lhistory ;; |
580 | esac | |
b72432fd JA |
581 | fi |
582 | else | |
583 | HIST_LIBDIR='$(dot)/$(LIBSUBDIR)/readline' | |
584 | HISTORY_LIB= HISTORY_DEP= | |
585 | fi | |
586 | AC_SUBST(READLINE_LIB) | |
587 | AC_SUBST(READLINE_DEP) | |
588 | AC_SUBST(RL_LIBDIR) | |
f73dda09 | 589 | AC_SUBST(RL_INCLUDEDIR) |
b72432fd JA |
590 | AC_SUBST(RL_INCLUDE) |
591 | AC_SUBST(HISTORY_LIB) | |
592 | AC_SUBST(HISTORY_DEP) | |
593 | AC_SUBST(HIST_LIBDIR) | |
95732b49 | 594 | AC_SUBST(TILDE_LIB) |
b72432fd JA |
595 | |
596 | dnl END READLINE and HISTORY LIBRARY SECTION | |
597 | ||
ccc6cda3 JA |
598 | dnl programs needed by the build and install process |
599 | AC_PROG_INSTALL | |
f73dda09 | 600 | AC_CHECK_PROG(AR, ar, , ar) |
b72432fd JA |
601 | dnl Set default for ARFLAGS, since autoconf does not have a macro for it. |
602 | dnl This allows people to set it when running configure or make | |
603 | test -n "$ARFLAGS" || ARFLAGS="cr" | |
ccc6cda3 JA |
604 | AC_PROG_RANLIB |
605 | AC_PROG_YACC | |
606 | AC_PROG_MAKE_SET | |
607 | ||
b72432fd | 608 | case "$host_os" in |
bb70624e | 609 | opennt*|interix*) MAKE_SHELL="$INTERIX_ROOT/bin/sh" ;; |
b72432fd JA |
610 | *) MAKE_SHELL=/bin/sh ;; |
611 | esac | |
612 | AC_SUBST(MAKE_SHELL) | |
613 | ||
95732b49 JA |
614 | dnl this is similar to the expanded AC_PROG_RANLIB |
615 | if test x$SIZE = x; then | |
616 | if test x$ac_tool_prefix = x; then | |
617 | SIZE=size | |
618 | else | |
619 | SIZE=${ac_tool_prefix}size | |
620 | save_IFS=$IFS ; IFS=: | |
621 | size_found=0 | |
622 | for dir in $PATH; do | |
623 | if test -x $dir/$SIZE ; then | |
624 | size_found=1 | |
625 | break | |
626 | fi | |
627 | done | |
628 | if test $size_found -eq 0; then | |
629 | SIZE=: | |
630 | fi | |
631 | IFS=$save_IFS | |
632 | fi | |
633 | fi | |
634 | AC_SUBST(SIZE) | |
635 | ||
f73dda09 JA |
636 | dnl Turn on any extensions available in the GNU C library. |
637 | AC_DEFINE(_GNU_SOURCE, 1) | |
638 | ||
639 | dnl C compiler characteristics | |
640 | AC_C_CONST | |
641 | AC_C_INLINE | |
642 | AC_C_BIGENDIAN | |
643 | AC_C_STRINGIZE | |
644 | AC_C_LONG_DOUBLE | |
645 | AC_C_PROTOTYPES | |
646 | AC_C_CHAR_UNSIGNED | |
17345e5a JA |
647 | AC_C_VOLATILE |
648 | AC_C_RESTRICT | |
f73dda09 | 649 | |
b80f6443 JA |
650 | dnl initialize GNU gettext |
651 | AM_GNU_GETTEXT([no-libtool], [need-ngettext], [lib/intl]) | |
652 | ||
f73dda09 JA |
653 | dnl header files |
654 | AC_HEADER_DIRENT | |
655 | AC_HEADER_TIME | |
656 | ||
657 | BASH_HEADER_INTTYPES | |
658 | ||
659 | AC_CHECK_HEADERS(unistd.h stdlib.h stdarg.h varargs.h limits.h string.h \ | |
660 | memory.h locale.h termcap.h termio.h termios.h dlfcn.h \ | |
0001803f | 661 | stddef.h stdint.h netdb.h pwd.h grp.h strings.h regex.h \ |
495aee44 | 662 | syslog.h ulimit.h) |
95732b49 | 663 | AC_CHECK_HEADERS(sys/pte.h sys/stream.h sys/select.h sys/file.h \ |
b80f6443 JA |
664 | sys/resource.h sys/param.h sys/socket.h sys/stat.h \ |
665 | sys/time.h sys/times.h sys/types.h sys/wait.h) | |
f73dda09 JA |
666 | AC_CHECK_HEADERS(netinet/in.h arpa/inet.h) |
667 | ||
95732b49 JA |
668 | dnl sys/ptem.h requires definitions from sys/stream.h on systems where it |
669 | dnl exists | |
670 | AC_CHECK_HEADER(sys/ptem.h, , ,[[ | |
671 | #if HAVE_SYS_STREAM_H | |
672 | # include <sys/stream.h> | |
673 | #endif | |
674 | ]]) | |
675 | ||
ccc6cda3 JA |
676 | dnl special checks for libc functions |
677 | AC_FUNC_ALLOCA | |
678 | AC_FUNC_GETPGRP | |
679 | AC_FUNC_SETVBUF_REVERSED | |
680 | AC_FUNC_VPRINTF | |
ccc6cda3 JA |
681 | AC_FUNC_STRCOLL |
682 | ||
f73dda09 JA |
683 | dnl if we're not using the bash malloc but require the C alloca, set things |
684 | dnl up to build a libmalloc.a containing only alloca.o | |
685 | ||
686 | if test "$ac_cv_func_alloca_works" = "no" && test "$opt_bash_malloc" = "no"; then | |
687 | MALLOC_TARGET=alloca | |
688 | MALLOC_SRC=alloca.c | |
689 | ||
690 | MALLOC_LIB='-lmalloc' | |
691 | MALLOC_LIBRARY='$(ALLOC_LIBDIR)/libmalloc.a' | |
692 | MALLOC_LDFLAGS='-L$(ALLOC_LIBDIR)' | |
693 | MALLOC_DEP='$(MALLOC_LIBRARY)' | |
694 | fi | |
695 | ||
ccc6cda3 JA |
696 | dnl if vprintf is not in libc, see if it's defined in stdio.h |
697 | if test "$ac_cv_func_vprintf" = no; then | |
698 | AC_MSG_CHECKING(for declaration of vprintf in stdio.h) | |
699 | AC_EGREP_HEADER([[int[ ]*vprintf[^a-zA-Z0-9]]],stdio.h,ac_cv_func_vprintf=yes) | |
700 | AC_MSG_RESULT($ac_cv_func_vprintf) | |
701 | if test $ac_cv_func_vprintf = yes; then | |
702 | AC_DEFINE(HAVE_VPRINTF) | |
703 | fi | |
704 | fi | |
705 | ||
f73dda09 JA |
706 | if test "$ac_cv_func_vprintf" = no && test "$ac_cv_func__doprnt" = "yes"; then |
707 | AC_LIBOBJ(vprint) | |
708 | fi | |
709 | ||
ccc6cda3 | 710 | dnl signal stuff |
f73dda09 | 711 | AC_TYPE_SIGNAL |
ccc6cda3 JA |
712 | |
713 | dnl checks for certain version-specific system calls and libc functions | |
714 | AC_CHECK_FUNC(__setostype, AC_DEFINE(HAVE_SETOSTYPE)) | |
715 | AC_CHECK_FUNC(wait3, AC_DEFINE(HAVE_WAIT3)) | |
7117c2d2 | 716 | AC_CHECK_FUNC(isinf, AC_DEFINE(HAVE_ISINF_IN_LIBC)) |
0628567a | 717 | AC_CHECK_FUNC(isnan, AC_DEFINE(HAVE_ISNAN_IN_LIBC)) |
ccc6cda3 JA |
718 | |
719 | dnl checks for missing libc functions | |
720 | AC_CHECK_FUNC(mkfifo,AC_DEFINE(HAVE_MKFIFO),AC_DEFINE(MKFIFO_MISSING)) | |
721 | ||
722 | dnl checks for system calls | |
0628567a JA |
723 | AC_CHECK_FUNCS(dup2 eaccess fcntl getdtablesize getgroups gethostname \ |
724 | getpagesize getpeername getrlimit getrusage gettimeofday \ | |
725 | kill killpg lstat readlink sbrk select setdtablesize \ | |
3185942a | 726 | setitimer tcgetpgrp uname ulimit waitpid) |
f73dda09 | 727 | AC_REPLACE_FUNCS(rename) |
ccc6cda3 JA |
728 | |
729 | dnl checks for c library functions | |
495aee44 | 730 | AC_CHECK_FUNCS(bcopy bzero confstr faccessat fnmatch \ |
7117c2d2 | 731 | getaddrinfo gethostbyname getservbyname getservent inet_aton \ |
95732b49 JA |
732 | memmove pathconf putenv raise regcomp regexec \ |
733 | setenv setlinebuf setlocale setvbuf siginterrupt strchr \ | |
0001803f | 734 | sysconf syslog tcgetattr times ttyname tzset unsetenv) |
95732b49 | 735 | |
0001803f | 736 | AC_CHECK_FUNCS(vasprintf asprintf) |
f73dda09 | 737 | AC_CHECK_FUNCS(isascii isblank isgraph isprint isspace isxdigit) |
95732b49 | 738 | AC_CHECK_FUNCS(getpwent getpwnam getpwuid) |
0001803f CR |
739 | AC_REPLACE_FUNCS(getcwd memset) |
740 | AC_REPLACE_FUNCS(strcasecmp strcasestr strerror strftime strnlen strpbrk strstr) | |
7117c2d2 | 741 | AC_REPLACE_FUNCS(strtod strtol strtoul strtoll strtoull strtoimax strtoumax) |
495aee44 CR |
742 | AC_REPLACE_FUNCS(dprintf) |
743 | AC_REPLACE_FUNCS(strchrnul) | |
f73dda09 | 744 | |
f73dda09 | 745 | AC_CHECK_DECLS([confstr]) |
f73dda09 | 746 | AC_CHECK_DECLS([printf]) |
7117c2d2 | 747 | AC_CHECK_DECLS([sbrk]) |
0628567a | 748 | AC_CHECK_DECLS([setregid]) |
7117c2d2 | 749 | AC_CHECK_DECLS([strcpy]) |
f73dda09 | 750 | AC_CHECK_DECLS([strsignal]) |
b80f6443 JA |
751 | |
752 | dnl Extra test to detect the horribly broken HP/UX 11.00 strtold(3) | |
753 | AC_CHECK_DECLS([strtold], [ | |
754 | AC_MSG_CHECKING([for broken strtold]) | |
755 | AC_CACHE_VAL(bash_cv_strtold_broken, | |
756 | [AC_TRY_COMPILE( | |
757 | [#include <stdlib.h>], | |
758 | [int main() { long double r; char *foo, bar; r = strtold(foo, &bar);}], | |
759 | bash_cv_strtold_broken=no, bash_cv_strtold_broken=yes, | |
760 | [AC_MSG_WARN(cannot check for broken strtold if cross-compiling, defaulting to no)]) | |
761 | ] | |
762 | ) | |
763 | AC_MSG_RESULT($bash_cv_strtold_broken) | |
764 | if test "$bash_cv_strtold_broken" = "yes" ; then | |
765 | AC_DEFINE(STRTOLD_BROKEN) | |
766 | fi | |
767 | ]) | |
768 | ||
f73dda09 JA |
769 | |
770 | BASH_CHECK_DECL(strtoimax) | |
771 | BASH_CHECK_DECL(strtol) | |
772 | BASH_CHECK_DECL(strtoll) | |
773 | BASH_CHECK_DECL(strtoul) | |
774 | BASH_CHECK_DECL(strtoull) | |
775 | BASH_CHECK_DECL(strtoumax) | |
ccc6cda3 | 776 | |
7117c2d2 JA |
777 | AC_FUNC_MKTIME |
778 | ||
b80f6443 JA |
779 | dnl |
780 | dnl Checks for lib/intl and related code (uses some of the output from | |
781 | dnl AM_GNU_GETTEXT) | |
782 | dnl | |
ccc6cda3 | 783 | |
b80f6443 JA |
784 | AC_CHECK_HEADERS([argz.h errno.h fcntl.h malloc.h stdio_ext.h]) |
785 | ||
786 | dnl AC_FUNC_MALLOC | |
787 | AC_FUNC_MMAP | |
788 | AC_CHECK_FUNCS([__argz_count __argz_next __argz_stringify dcgettext mempcpy \ | |
789 | munmap stpcpy strcspn strdup]) | |
790 | ||
791 | INTL_DEP= INTL_INC= LIBINTL_H= | |
792 | if test "x$USE_INCLUDED_LIBINTL" = "xyes"; then | |
793 | INTL_DEP='${INTL_LIBDIR}/libintl.a' | |
794 | INTL_INC='-I${INTL_LIBSRC} -I${INTL_BUILDDIR}' | |
795 | LIBINTL_H='${INTL_BUILDDIR}/libintl.h' | |
ccc6cda3 | 796 | fi |
b80f6443 JA |
797 | AC_SUBST(INTL_DEP) |
798 | AC_SUBST(INTL_INC) | |
799 | AC_SUBST(LIBINTL_H) | |
800 | ||
801 | dnl | |
802 | dnl End of checks needed by files in lib/intl | |
803 | dnl | |
ccc6cda3 | 804 | |
7117c2d2 JA |
805 | BASH_CHECK_MULTIBYTE |
806 | ||
ccc6cda3 | 807 | dnl checks for the dynamic loading library functions in libc and libdl |
cce855bc | 808 | if test "$opt_static_link" != yes; then |
ccc6cda3 JA |
809 | AC_CHECK_LIB(dl, dlopen) |
810 | AC_CHECK_FUNCS(dlopen dlclose dlsym) | |
cce855bc | 811 | fi |
ccc6cda3 | 812 | |
3185942a | 813 | dnl this defines HAVE_DECL_SYS_SIGLIST |
ccc6cda3 JA |
814 | AC_DECL_SYS_SIGLIST |
815 | ||
bb70624e JA |
816 | dnl network functions -- check for inet_aton again |
817 | if test "$ac_cv_func_inet_aton" != 'yes'; then | |
818 | BASH_FUNC_INET_ATON | |
819 | fi | |
ccc6cda3 JA |
820 | |
821 | dnl libraries | |
822 | dnl this is reportedly no longer necessary for irix[56].? | |
bb70624e JA |
823 | case "$host_os" in |
824 | irix4*) AC_CHECK_LIB(sun, getpwent) ;; | |
825 | esac | |
826 | ||
d166f048 JA |
827 | dnl check for getpeername in the socket library only if it's not in libc |
828 | if test "$ac_cv_func_getpeername" = no; then | |
f73dda09 | 829 | BASH_CHECK_LIB_SOCKET |
d166f048 | 830 | fi |
bb70624e JA |
831 | dnl check for gethostbyname in socket libraries if it's not in libc |
832 | if test "$ac_cv_func_gethostbyname" = no; then | |
833 | BASH_FUNC_GETHOSTBYNAME | |
834 | fi | |
ccc6cda3 JA |
835 | |
836 | dnl system types | |
837 | AC_TYPE_GETGROUPS | |
838 | AC_TYPE_OFF_T | |
839 | AC_TYPE_MODE_T | |
840 | AC_TYPE_UID_T | |
841 | AC_TYPE_PID_T | |
842 | AC_TYPE_SIZE_T | |
f73dda09 | 843 | AC_CHECK_TYPE(ssize_t, int) |
ccc6cda3 JA |
844 | AC_CHECK_TYPE(time_t, long) |
845 | ||
f73dda09 JA |
846 | BASH_TYPE_LONG_LONG |
847 | BASH_TYPE_UNSIGNED_LONG_LONG | |
848 | ||
ccc6cda3 | 849 | AC_TYPE_SIGNAL |
17345e5a | 850 | BASH_TYPE_SIG_ATOMIC_T |
ccc6cda3 | 851 | |
bb70624e JA |
852 | AC_CHECK_SIZEOF(char, 1) |
853 | AC_CHECK_SIZEOF(short, 2) | |
b72432fd JA |
854 | AC_CHECK_SIZEOF(int, 4) |
855 | AC_CHECK_SIZEOF(long, 4) | |
856 | AC_CHECK_SIZEOF(char *, 4) | |
857 | AC_CHECK_SIZEOF(double, 8) | |
f73dda09 | 858 | AC_CHECK_SIZEOF([long long], 8) |
cce855bc | 859 | |
f73dda09 JA |
860 | AC_CHECK_TYPE(u_int, [unsigned int]) |
861 | AC_CHECK_TYPE(u_long, [unsigned long]) | |
bb70624e JA |
862 | |
863 | BASH_TYPE_BITS16_T | |
864 | BASH_TYPE_U_BITS16_T | |
865 | BASH_TYPE_BITS32_T | |
866 | BASH_TYPE_U_BITS32_T | |
b72432fd | 867 | BASH_TYPE_BITS64_T |
cce855bc | 868 | |
bb70624e JA |
869 | BASH_TYPE_PTRDIFF_T |
870 | ||
ccc6cda3 JA |
871 | dnl structures |
872 | AC_HEADER_STAT | |
ccc6cda3 | 873 | |
ccc6cda3 JA |
874 | dnl system services |
875 | AC_SYS_INTERPRETER | |
876 | if test $ac_cv_sys_interpreter = yes; then | |
877 | AC_DEFINE(HAVE_HASH_BANG_EXEC) | |
878 | fi | |
ccc6cda3 JA |
879 | |
880 | dnl Miscellaneous Bash tests | |
881 | if test "$ac_cv_func_lstat" = "no"; then | |
882 | BASH_FUNC_LSTAT | |
883 | fi | |
884 | ||
d166f048 | 885 | dnl behavior of system calls and library functions |
b80f6443 | 886 | BASH_FUNC_CTYPE_NONASCII |
f73dda09 JA |
887 | BASH_FUNC_DUP2_CLOEXEC_CHECK |
888 | BASH_SYS_PGRP_SYNC | |
889 | BASH_SYS_SIGNAL_VINTAGE | |
cce855bc | 890 | |
d166f048 | 891 | dnl checking for the presence of certain library symbols |
ccc6cda3 JA |
892 | BASH_SYS_ERRLIST |
893 | BASH_SYS_SIGLIST | |
894 | BASH_UNDER_SYS_SIGLIST | |
d166f048 JA |
895 | |
896 | dnl various system types | |
ccc6cda3 JA |
897 | BASH_TYPE_SIGHANDLER |
898 | BASH_CHECK_TYPE(clock_t, [#include <sys/times.h>], long) | |
899 | BASH_CHECK_TYPE(sigset_t, [#include <signal.h>], int) | |
900 | BASH_CHECK_TYPE(quad_t, , long, HAVE_QUAD_T) | |
f73dda09 JA |
901 | BASH_CHECK_TYPE(intmax_t, , $bash_cv_type_long_long) |
902 | BASH_CHECK_TYPE(uintmax_t, , $bash_cv_type_unsigned_long_long) | |
903 | if test "$ac_cv_header_sys_socket_h" = "yes"; then | |
904 | BASH_CHECK_TYPE(socklen_t, [#include <sys/socket.h>], int, HAVE_SOCKLEN_T) | |
905 | fi | |
906 | BASH_TYPE_RLIMIT | |
d166f048 | 907 | |
495aee44 CR |
908 | AC_CHECK_SIZEOF(intmax_t, 8) |
909 | ||
d166f048 | 910 | dnl presence and contents of structures used by system calls |
ccc6cda3 JA |
911 | BASH_STRUCT_TERMIOS_LDISC |
912 | BASH_STRUCT_TERMIO_LDISC | |
913 | BASH_STRUCT_DIRENT_D_INO | |
d166f048 | 914 | BASH_STRUCT_DIRENT_D_FILENO |
b80f6443 | 915 | BASH_STRUCT_DIRENT_D_NAMLEN |
d166f048 | 916 | BASH_STRUCT_WINSIZE |
bb70624e | 917 | BASH_STRUCT_TIMEVAL |
f73dda09 | 918 | AC_CHECK_MEMBERS([struct stat.st_blocks]) |
7117c2d2 JA |
919 | AC_STRUCT_TM |
920 | AC_STRUCT_TIMEZONE | |
b80f6443 | 921 | BASH_STRUCT_TIMEZONE |
d166f048 | 922 | |
495aee44 CR |
923 | BASH_STRUCT_WEXITSTATUS_OFFSET |
924 | ||
d166f048 | 925 | dnl presence and behavior of C library functions |
ccc6cda3 JA |
926 | BASH_FUNC_STRSIGNAL |
927 | BASH_FUNC_OPENDIR_CHECK | |
ccc6cda3 | 928 | BASH_FUNC_ULIMIT_MAXFDS |
3185942a | 929 | BASH_FUNC_FPURGE |
ccc6cda3 | 930 | BASH_FUNC_GETENV |
7117c2d2 | 931 | if test "$ac_cv_func_getcwd" = "yes"; then |
ccc6cda3 | 932 | BASH_FUNC_GETCWD |
f73dda09 | 933 | fi |
ccc6cda3 | 934 | BASH_FUNC_POSIX_SETJMP |
d166f048 | 935 | BASH_FUNC_STRCOLL |
0001803f CR |
936 | BASH_FUNC_SNPRINTF |
937 | BASH_FUNC_VSNPRINTF | |
d166f048 | 938 | |
7117c2d2 JA |
939 | dnl If putenv or unsetenv is not present, set the right define so the |
940 | dnl prototype and declaration in lib/sh/getenv.c will be standard-conformant | |
941 | ||
942 | if test "$ac_cv_func_putenv" = "yes"; then | |
943 | BASH_FUNC_STD_PUTENV | |
944 | else | |
945 | AC_DEFINE(HAVE_STD_PUTENV) | |
946 | fi | |
947 | if test "$ac_cv_func_unsetenv" = "yes"; then | |
948 | BASH_FUNC_STD_UNSETENV | |
949 | else | |
950 | AC_DEFINE(HAVE_STD_UNSETENV) | |
951 | fi | |
952 | ||
f73dda09 JA |
953 | BASH_FUNC_PRINTF_A_FORMAT |
954 | ||
d166f048 | 955 | dnl presence and behavior of OS functions |
f73dda09 JA |
956 | BASH_SYS_REINSTALL_SIGHANDLERS |
957 | BASH_SYS_JOB_CONTROL_MISSING | |
ccc6cda3 | 958 | BASH_SYS_NAMED_PIPES |
d166f048 JA |
959 | |
960 | dnl presence of certain CPP defines | |
f73dda09 | 961 | AC_HEADER_TIOCGWINSZ |
ccc6cda3 JA |
962 | BASH_HAVE_TIOCSTAT |
963 | BASH_HAVE_FIONREAD | |
d166f048 | 964 | |
95732b49 JA |
965 | BASH_CHECK_WCONTINUED |
966 | ||
d166f048 | 967 | dnl miscellaneous |
f73dda09 | 968 | BASH_CHECK_SPEED_T |
ccc6cda3 | 969 | BASH_CHECK_GETPW_FUNCS |
28ef6c31 | 970 | BASH_CHECK_RTSIGS |
f73dda09 | 971 | BASH_CHECK_SYS_SIGLIST |
ccc6cda3 | 972 | |
d166f048 | 973 | dnl special checks |
ccc6cda3 | 974 | case "$host_os" in |
f73dda09 | 975 | hpux*) BASH_CHECK_KERNEL_RLIMIT ;; |
ccc6cda3 JA |
976 | esac |
977 | ||
978 | if test "$opt_readline" = yes; then | |
d166f048 JA |
979 | dnl yuck |
980 | case "$host_os" in | |
981 | aix*) prefer_curses=yes ;; | |
982 | esac | |
ccc6cda3 JA |
983 | BASH_CHECK_LIB_TERMCAP |
984 | fi | |
985 | AC_SUBST(TERMCAP_LIB) | |
986 | AC_SUBST(TERMCAP_DEP) | |
987 | ||
d166f048 | 988 | BASH_CHECK_DEV_FD |
bb70624e | 989 | BASH_CHECK_DEV_STDIN |
f73dda09 | 990 | BASH_SYS_DEFAULT_MAIL_DIR |
ccc6cda3 JA |
991 | |
992 | if test "$bash_cv_job_control_missing" = missing; then | |
993 | opt_job_control=no | |
994 | fi | |
995 | ||
996 | if test "$opt_job_control" = yes; then | |
997 | AC_DEFINE(JOB_CONTROL) | |
998 | JOBS_O=jobs.o | |
999 | else | |
1000 | JOBS_O=nojobs.o | |
1001 | fi | |
1002 | ||
1003 | AC_SUBST(JOBS_O) | |
1004 | ||
d166f048 JA |
1005 | dnl Defines that we want to propagate to the Makefiles in subdirectories, |
1006 | dnl like glob and readline | |
1007 | ||
1008 | LOCAL_DEFS=-DSHELL | |
1009 | ||
ccc6cda3 | 1010 | dnl use this section to possibly define more cpp variables, specify local |
3185942a | 1011 | dnl libraries, and specify any additional local cc or ld flags |
ccc6cda3 JA |
1012 | dnl |
1013 | dnl this should really go away someday | |
1014 | ||
b72432fd | 1015 | case "${host_os}" in |
e8ce775d | 1016 | sysv4.2*) AC_DEFINE(SVR4_2) |
ccc6cda3 JA |
1017 | AC_DEFINE(SVR4) ;; |
1018 | sysv4*) AC_DEFINE(SVR4) ;; | |
b72432fd JA |
1019 | sysv5*) AC_DEFINE(SVR5) ;; |
1020 | hpux9*) LOCAL_CFLAGS="-DHPUX9 -DHPUX" ;; | |
ccc6cda3 JA |
1021 | hpux*) LOCAL_CFLAGS=-DHPUX ;; |
1022 | dgux*) LOCAL_CFLAGS=-D_DGUX_SOURCE; LOCAL_LIBS=-ldgc ;; | |
bb70624e JA |
1023 | isc*) LOCAL_CFLAGS=-Disc386 ;; |
1024 | rhapsody*) LOCAL_CFLAGS=-DRHAPSODY ;; | |
f73dda09 | 1025 | darwin*) LOCAL_CFLAGS=-DMACOSX ;; |
7117c2d2 JA |
1026 | sco3.2v5*) LOCAL_CFLAGS="-b elf -DWAITPID_BROKEN -DPATH_MAX=1024" ;; |
1027 | sco3.2v4*) LOCAL_CFLAGS="-DMUST_UNBLOCK_CHLD -DPATH_MAX=1024" ;; | |
ccc6cda3 | 1028 | sco3.2*) LOCAL_CFLAGS=-DMUST_UNBLOCK_CHLD ;; |
d166f048 | 1029 | sunos4*) LOCAL_CFLAGS=-DSunOS4 ;; |
f1be666c | 1030 | solaris2.5*) LOCAL_CFLAGS="-DSunOS5 -DSOLARIS" ;; |
17345e5a JA |
1031 | solaris2.8*) LOCAL_CFLAGS=-DSOLARIS ;; |
1032 | solaris2.9*) LOCAL_CFLAGS=-DSOLARIS ;; | |
1033 | solaris2.10*) LOCAL_CFLAGS=-DSOLARIS ;; | |
f1be666c | 1034 | solaris2*) LOCAL_CFLAGS=-DSOLARIS ;; |
b72432fd | 1035 | lynxos*) LOCAL_CFLAGS=-DRECYCLES_PIDS ;; |
95732b49 JA |
1036 | linux*) LOCAL_LDFLAGS=-rdynamic # allow dynamic loading |
1037 | case "`uname -r`" in | |
1038 | 2.[[456789]]*|3*) AC_DEFINE(PGRP_PIPE) ;; | |
1039 | esac ;; | |
1040 | *qnx6*) LOCAL_CFLAGS="-Dqnx -Dqnx6" LOCAL_LIBS="-lncurses" ;; | |
7117c2d2 | 1041 | *qnx*) LOCAL_CFLAGS="-Dqnx -F -3s" LOCAL_LDFLAGS="-3s" LOCAL_LIBS="-lunix -lncurses" ;; |
b72432fd | 1042 | powerux*) LOCAL_LIBS="-lgen" ;; |
b80f6443 | 1043 | cygwin*) LOCAL_CFLAGS=-DRECYCLES_PIDS ;; |
0001803f | 1044 | opennt*|interix*) LOCAL_CFLAGS="-DNO_MAIN_ENV_ARG -DBROKEN_DIRENT_D_INO -D_POSIX_SOURCE -D_ALL_SOURCE" ;; |
b72432fd JA |
1045 | esac |
1046 | ||
1047 | dnl Stanza for OS/compiler pair-specific flags | |
1048 | case "${host_os}-${CC}" in | |
1049 | aix4.2*-*gcc*) LOCAL_LDFLAGS="-Xlinker -bexpall -Xlinker -brtl" ;; | |
1050 | aix4.2*) LOCAL_LDFLAGS="-bexpall -brtl" ;; | |
1051 | bsdi4*-*gcc*) LOCAL_LDFLAGS="-rdynamic" ;; # allow dynamic loading, like Linux | |
ccc6cda3 JA |
1052 | esac |
1053 | ||
bb70624e JA |
1054 | dnl FreeBSD-3.x can have either a.out or ELF |
1055 | case "${host_os}" in | |
28ef6c31 JA |
1056 | freebsd[[3-9]]*) |
1057 | if test -x /usr/bin/objformat && test "`/usr/bin/objformat`" = "elf" ; then | |
bb70624e JA |
1058 | LOCAL_LDFLAGS=-rdynamic # allow dynamic loading |
1059 | fi ;; | |
28ef6c31 | 1060 | freebsdelf*) LOCAL_LDFLAGS=-rdynamic ;; # allow dynamic loading |
95732b49 | 1061 | dragonfly*) LOCAL_LDFLAGS=-rdynamic ;; # allow dynamic loading |
bb70624e JA |
1062 | esac |
1063 | ||
ccc6cda3 JA |
1064 | case "$host_cpu" in |
1065 | *cray*) LOCAL_CFLAGS="-DCRAY" ;; # shell var so config.h can use it | |
1066 | esac | |
1067 | ||
1068 | case "$host_cpu-$host_os" in | |
1069 | ibmrt-*bsd4*) LOCAL_CFLAGS="-ma -U__STDC__" ;; | |
1070 | esac | |
1071 | ||
1072 | case "$host_cpu-$host_vendor-$host_os" in | |
1073 | m88k-motorola-sysv3) LOCAL_CFLAGS=-DWAITPID_BROKEN ;; | |
1074 | mips-pyramid-sysv4) LOCAL_CFLAGS=-Xa ;; | |
1075 | esac | |
1076 | ||
b72432fd JA |
1077 | # |
1078 | # Shared object configuration section. These values are generated by | |
1079 | # ${srcdir}/support/shobj-conf | |
1080 | # | |
1081 | if test "$ac_cv_func_dlopen" = "yes" && test -f ${srcdir}/support/shobj-conf | |
1082 | then | |
1083 | AC_MSG_CHECKING(shared object configuration for loadable builtins) | |
28ef6c31 | 1084 | eval `${CONFIG_SHELL-/bin/sh} ${srcdir}/support/shobj-conf -C "${CC}" -c "${host_cpu}" -o "${host_os}" -v "${host_vendor}"` |
b72432fd JA |
1085 | AC_SUBST(SHOBJ_CC) |
1086 | AC_SUBST(SHOBJ_CFLAGS) | |
1087 | AC_SUBST(SHOBJ_LD) | |
1088 | AC_SUBST(SHOBJ_LDFLAGS) | |
1089 | AC_SUBST(SHOBJ_XLDFLAGS) | |
1090 | AC_SUBST(SHOBJ_LIBS) | |
1091 | AC_SUBST(SHOBJ_STATUS) | |
1092 | AC_MSG_RESULT($SHOBJ_STATUS) | |
1093 | fi | |
1094 | ||
ccc6cda3 JA |
1095 | # try to create a directory tree if the source is elsewhere |
1096 | # this should be packaged into a script accessible via ${srcdir}/support | |
1097 | case "$srcdir" in | |
1098 | .) ;; | |
cce855bc | 1099 | *) for d in doc tests support lib examples; do # dirs |
ccc6cda3 JA |
1100 | test -d $d || mkdir $d |
1101 | done | |
cce855bc | 1102 | for ld in readline glob tilde malloc sh termcap; do # libdirs |
ccc6cda3 JA |
1103 | test -d lib/$ld || mkdir lib/$ld |
1104 | done | |
cce855bc | 1105 | test -d examples/loadables || mkdir examples/loadables # loadable builtins |
bb70624e | 1106 | test -d examples/loadables/perl || mkdir examples/loadables/perl |
ccc6cda3 JA |
1107 | ;; |
1108 | esac | |
1109 | ||
1110 | BUILD_DIR=`pwd` | |
95732b49 JA |
1111 | case "$BUILD_DIR" in |
1112 | *\ *) BUILD_DIR=`echo "$BUILD_DIR" | sed 's: :\\\\ :g'` ;; | |
1113 | *) ;; | |
1114 | esac | |
ccc6cda3 | 1115 | |
3185942a JA |
1116 | if test -z "$localedir"; then |
1117 | localedir='${datarootdir}/locale' | |
1118 | fi | |
1119 | if test -z "$datarootdir"; then | |
1120 | datarootdir='${prefix}/share' | |
1121 | fi | |
1122 | ||
cce855bc JA |
1123 | AC_SUBST(PROFILE_FLAGS) |
1124 | ||
ccc6cda3 JA |
1125 | AC_SUBST(incdir) |
1126 | AC_SUBST(BUILD_DIR) | |
1127 | ||
3185942a JA |
1128 | # Some versions of autoconf don't substitute these automatically |
1129 | AC_SUBST(datarootdir) | |
1130 | AC_SUBST(localedir) | |
1131 | ||
ccc6cda3 JA |
1132 | AC_SUBST(YACC) |
1133 | AC_SUBST(AR) | |
b72432fd | 1134 | AC_SUBST(ARFLAGS) |
ccc6cda3 | 1135 | |
d166f048 | 1136 | AC_SUBST(BASHVERS) |
7117c2d2 JA |
1137 | AC_SUBST(RELSTATUS) |
1138 | AC_SUBST(DEBUG) | |
1139 | AC_SUBST(MALLOC_DEBUG) | |
d166f048 | 1140 | |
ccc6cda3 | 1141 | AC_SUBST(host_cpu) |
b72432fd | 1142 | AC_SUBST(host_vendor) |
ccc6cda3 JA |
1143 | AC_SUBST(host_os) |
1144 | ||
1145 | AC_SUBST(LOCAL_LIBS) | |
1146 | AC_SUBST(LOCAL_CFLAGS) | |
1147 | AC_SUBST(LOCAL_LDFLAGS) | |
d166f048 | 1148 | AC_SUBST(LOCAL_DEFS) |
ccc6cda3 | 1149 | |
d166f048 JA |
1150 | #AC_SUBST(ALLOCA_SOURCE) |
1151 | #AC_SUBST(ALLOCA_OBJECT) | |
ccc6cda3 JA |
1152 | |
1153 | AC_OUTPUT([Makefile builtins/Makefile lib/readline/Makefile lib/glob/Makefile \ | |
b80f6443 | 1154 | lib/intl/Makefile \ |
cce855bc | 1155 | lib/malloc/Makefile lib/sh/Makefile lib/termcap/Makefile \ |
b80f6443 | 1156 | lib/tilde/Makefile doc/Makefile support/Makefile po/Makefile.in \ |
3185942a | 1157 | examples/loadables/Makefile examples/loadables/perl/Makefile], |
ccc6cda3 JA |
1158 | [ |
1159 | # Makefile uses this timestamp file to record whether config.h is up to date. | |
1160 | echo timestamp > stamp-h | |
1161 | ]) |