]>
Commit | Line | Data |
---|---|---|
a7ad477f | 1 | dnl |
50ffbc9d | 2 | dnl Configure script for bash-5.3 |
a7ad477f CR |
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. | |
7 | ||
315095ad | 8 | # Copyright (C) 1987-2023 Free Software Foundation, Inc. |
a7ad477f CR |
9 | |
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/>. | |
23 | ||
55a224da | 24 | AC_REVISION([for Bash 5.3, version 5.059])dnl |
a7ad477f | 25 | |
b91488b5 CR |
26 | define(bashvers, 5.3) |
27 | define(relstatus, devel) | |
a7ad477f CR |
28 | |
29 | AC_INIT([bash], bashvers-relstatus, [bug-bash@gnu.org]) | |
30 | ||
31 | dnl make sure we are using a recent autoconf version | |
44107840 | 32 | AC_PREREQ(2.69) |
a7ad477f CR |
33 | |
34 | AC_CONFIG_SRCDIR(shell.h) | |
35 | dnl where to find install.sh, config.sub, and config.guess | |
36 | AC_CONFIG_AUX_DIR(./support) | |
37 | AC_CONFIG_HEADERS(config.h) | |
38 | ||
39 | dnl checks for version info | |
40 | BASHVERS=bashvers | |
41 | RELSTATUS=relstatus | |
42 | ||
43 | dnl defaults for debug settings | |
44 | case "$RELSTATUS" in | |
79eedac4 | 45 | alp*|bet*|dev*|rc*|releng*|maint*) DEBUG='-DDEBUG' MALLOC_DEBUG='-DMALLOC_DEBUG' ;; |
a7ad477f CR |
46 | *) DEBUG= MALLOC_DEBUG= ;; |
47 | esac | |
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 | AC_CANONICAL_BUILD | |
53 | ||
54 | dnl configure defaults | |
55 | opt_bash_malloc=yes | |
a7ad477f CR |
56 | opt_afs=no |
57 | opt_curses=no | |
58 | opt_with_installed_readline=no | |
59 | ||
60 | #htmldir= | |
61 | ||
62 | dnl some systems should be configured without the bash malloc by default | |
63 | dnl and some need a special compiler or loader | |
64 | dnl look in the NOTES file for more | |
65 | case "${host_cpu}-${host_os}" in | |
a078e04c | 66 | # mostly obsolete platforms |
a7ad477f CR |
67 | alpha*-*) opt_bash_malloc=no ;; # alpha running osf/1 or linux |
68 | *[[Cc]]ray*-*) opt_bash_malloc=no ;; # Crays | |
69 | *-osf1*) opt_bash_malloc=no ;; # other osf/1 machines | |
a078e04c | 70 | *-dgux*) opt_bash_malloc=no ;; # DG/UX machines |
a7ad477f | 71 | sparc-svr4*) opt_bash_malloc=no ;; # sparc SVR4, SVR4.2 |
a7ad477f | 72 | m68k-sysv) opt_bash_malloc=no ;; # fixes file descriptor leak in closedir |
a078e04c CR |
73 | *-bsdi2.1|*-bsdi3.?) opt_bash_malloc=no ; : ${CC:=shlicc2} ;; # for loadable builtins |
74 | *-opennt*|*-interix*) opt_bash_malloc=no ;; # Interix, now owned by Microsoft | |
75 | *-beos*) opt_bash_malloc=no ;; # they say it's suitable | |
76 | # These need additional investigation | |
a7ad477f | 77 | sparc-linux*) opt_bash_malloc=no ;; # sparc running linux; requires ELF |
a7ad477f | 78 | *-aix*) opt_bash_malloc=no ;; # AIX machines |
a078e04c | 79 | *-cygwin*) opt_bash_malloc=no ;; # Cygnus's CYGWIN environment |
dd4e3abc CR |
80 | # These lack a working sbrk(2) |
81 | aarch64-freebsd*) opt_bash_malloc=no ;; | |
82 | riscv*-freebsd*) opt_bash_malloc=no ;; | |
a078e04c | 83 | # Mach-derived systems have a ton of extra malloc functions and lack sbrk(2) |
a7ad477f | 84 | *-nextstep*) opt_bash_malloc=no ;; # NeXT machines running NeXTstep |
10e78433 | 85 | *-openstep*) opt_bash_malloc=no ;; # i386/Sparc/HP machines running Openstep |
a7ad477f CR |
86 | *-macos*) opt_bash_malloc=no ;; # Apple MacOS X |
87 | *-rhapsody*) opt_bash_malloc=no ;; # Apple Rhapsody (MacOS X) | |
88 | *-darwin*) opt_bash_malloc=no ;; # Apple Darwin (MacOS X) | |
a7ad477f | 89 | *-machten4) opt_bash_malloc=no ;; # MachTen 4.x |
a078e04c CR |
90 | # Niche or non-mainstream-shell-user systems |
91 | *-qnx*) opt_bash_malloc=no ;; # QNX 4.2, QNX [67].x | |
f14388d3 | 92 | *-nsk*) opt_bash_malloc=no ;; # HP NonStop |
c51b384f | 93 | *-haiku*) opt_bash_malloc=no ;; # Haiku OS |
fc94d474 | 94 | *-genode*) opt_bash_malloc=no ;; # Genode has no sbrk |
a629483b CR |
95 | i370-openedition*) opt_bash_malloc=no LOCAL_LIBS=-lzoslib LIBS_FOR_BUILD=-lzoslib ;; # IBM z/OS machines |
96 | i370-*) opt_bash_malloc=no ;; # generic (?) IBM 370 machines | |
a7ad477f CR |
97 | esac |
98 | ||
99 | # memory scrambling on free() | |
100 | case "${host_os}" in | |
101 | sco3.2v5*|sco3.2v4*) opt_memscramble=no ;; | |
102 | *) opt_memscramble=yes ;; | |
103 | esac | |
104 | ||
105 | dnl | |
106 | dnl macros for the bash debugger | |
107 | dnl | |
108 | dnl AM_PATH_LISPDIR | |
109 | AC_ARG_VAR(DEBUGGER_START_FILE, [location of bash debugger initialization file]) | |
110 | ||
111 | dnl arguments to configure | |
112 | dnl packages | |
a67031fe CR |
113 | AC_ARG_WITH(afs, AS_HELP_STRING([--with-afs], [if you are running AFS]), opt_afs=$withval) |
114 | AC_ARG_WITH(bash-malloc, AS_HELP_STRING([--with-bash-malloc], [use the Bash version of malloc]), opt_bash_malloc=$withval) | |
115 | AC_ARG_WITH(curses, AS_HELP_STRING([--with-curses], [use the curses library instead of the termcap library]), opt_curses=$withval) | |
116 | AC_ARG_WITH(gnu-malloc, AS_HELP_STRING([--with-gnu-malloc], [synonym for --with-bash-malloc]), opt_bash_malloc=$withval) | |
117 | AC_ARG_WITH(installed-readline, AS_HELP_STRING([--with-installed-readline], [use a version of the readline library that is already installed]), opt_with_installed_readline=$withval) | |
a7ad477f CR |
118 | |
119 | if test "$opt_bash_malloc" = yes; then | |
120 | MALLOC_TARGET=malloc | |
121 | MALLOC_SRC=malloc.c | |
122 | ||
123 | MALLOC_LIB='-lmalloc' | |
124 | MALLOC_LIBRARY='$(ALLOC_LIBDIR)/libmalloc.a' | |
125 | MALLOC_LDFLAGS='-L$(ALLOC_LIBDIR)' | |
126 | MALLOC_DEP='$(MALLOC_LIBRARY)' | |
127 | ||
128 | AC_DEFINE(USING_BASH_MALLOC) | |
129 | else | |
130 | MALLOC_LIB= | |
131 | MALLOC_LIBRARY= | |
132 | MALLOC_LDFLAGS= | |
133 | MALLOC_DEP= | |
134 | fi | |
135 | ||
a7ad477f CR |
136 | if test "$opt_afs" = yes; then |
137 | AC_DEFINE(AFS) | |
138 | fi | |
139 | ||
140 | if test "$opt_curses" = yes; then | |
141 | prefer_curses=yes | |
142 | fi | |
143 | ||
144 | if test -z "${DEBUGGER_START_FILE}"; then | |
145 | DEBUGGER_START_FILE='${datadir}/bashdb/bashdb-main.inc' | |
146 | fi | |
147 | ||
148 | dnl optional shell features in config.h.in | |
149 | opt_minimal_config=no | |
150 | ||
151 | opt_job_control=yes | |
152 | opt_alias=yes | |
153 | opt_readline=yes | |
154 | opt_history=yes | |
155 | opt_bang_history=yes | |
156 | opt_dirstack=yes | |
157 | opt_restricted=yes | |
158 | opt_process_subst=yes | |
159 | opt_prompt_decoding=yes | |
160 | opt_select=yes | |
161 | opt_help=yes | |
162 | opt_array_variables=yes | |
163 | opt_dparen_arith=yes | |
164 | opt_extended_glob=yes | |
165 | opt_brace_expansion=yes | |
166 | opt_disabled_builtins=no | |
167 | opt_command_timing=yes | |
168 | opt_xpg_echo=no | |
169 | opt_strict_posix=no | |
170 | opt_cond_command=yes | |
171 | opt_cond_regexp=yes | |
172 | opt_coproc=yes | |
173 | opt_arith_for_command=yes | |
174 | opt_net_redirs=yes | |
175 | opt_progcomp=yes | |
176 | opt_separate_help=no | |
177 | opt_multibyte=yes | |
178 | opt_debugger=yes | |
179 | opt_single_longdoc_strings=yes | |
180 | opt_casemod_attrs=yes | |
181 | opt_casemod_expansions=yes | |
182 | opt_extglob_default=no | |
f14388d3 | 183 | opt_dircomplete_expand_default=no |
07f38782 | 184 | opt_globascii_default=yes |
f3aad56d | 185 | opt_function_import=yes |
a57ed9e9 | 186 | opt_dev_fd_stat_broken=no |
a67031fe | 187 | opt_alt_array_impl=no |
006856ed | 188 | opt_translatable_strings=yes |
a7ad477f | 189 | |
72206eb2 CR |
190 | dnl modified by alternate array implementation option |
191 | ARRAY_O=array.o | |
192 | ||
a7ad477f CR |
193 | dnl options that affect how bash is compiled and linked |
194 | opt_static_link=no | |
195 | opt_profiling=no | |
196 | ||
197 | dnl argument parsing for optional features | |
a67031fe | 198 | AC_ARG_ENABLE(minimal-config, AS_HELP_STRING([--enable-minimal-config], [a minimal sh-like configuration]), opt_minimal_config=$enableval) |
a7ad477f CR |
199 | |
200 | dnl a minimal configuration turns everything off, but features can be | |
201 | dnl added individually | |
202 | if test $opt_minimal_config = yes; then | |
203 | opt_job_control=no opt_alias=no opt_readline=no | |
204 | opt_history=no opt_bang_history=no opt_dirstack=no | |
205 | opt_restricted=no opt_process_subst=no opt_prompt_decoding=no | |
206 | opt_select=no opt_help=no opt_array_variables=no opt_dparen_arith=no | |
207 | opt_brace_expansion=no opt_disabled_builtins=no opt_command_timing=no | |
208 | opt_extended_glob=no opt_cond_command=no opt_arith_for_command=no | |
209 | opt_net_redirs=no opt_progcomp=no opt_separate_help=no | |
210 | opt_multibyte=yes opt_cond_regexp=no opt_coproc=no | |
211 | opt_casemod_attrs=no opt_casemod_expansions=no opt_extglob_default=no | |
006856ed | 212 | opt_translatable_strings=no |
07f38782 | 213 | opt_globascii_default=yes |
a7ad477f CR |
214 | fi |
215 | ||
a67031fe CR |
216 | AC_ARG_ENABLE(alias, AS_HELP_STRING([--enable-alias], [enable shell aliases]), opt_alias=$enableval) |
217 | AC_ARG_ENABLE(alt-array-implementation, AS_HELP_STRING([--enable-alt-array-implementation], [enable an alternate array implementation that optimizes speed at the cost of space]), opt_alt_array_impl=$enableval) | |
218 | AC_ARG_ENABLE(arith-for-command, AS_HELP_STRING([--enable-arith-for-command], [enable arithmetic for command]), opt_arith_for_command=$enableval) | |
219 | AC_ARG_ENABLE(array-variables, AS_HELP_STRING([--enable-array-variables], [include shell array variables]), opt_array_variables=$enableval) | |
220 | AC_ARG_ENABLE(bang-history, AS_HELP_STRING([--enable-bang-history], [turn on csh-style history substitution]), opt_bang_history=$enableval) | |
221 | AC_ARG_ENABLE(brace-expansion, AS_HELP_STRING([--enable-brace-expansion], [include brace expansion]), opt_brace_expansion=$enableval) | |
222 | AC_ARG_ENABLE(casemod-attributes, AS_HELP_STRING([--enable-casemod-attributes], [include case-modifying variable attributes]), opt_casemod_attrs=$enableval) | |
223 | AC_ARG_ENABLE(casemod-expansions, AS_HELP_STRING([--enable-casemod-expansions], [include case-modifying word expansions]), opt_casemod_expansions=$enableval) | |
224 | AC_ARG_ENABLE(command-timing, AS_HELP_STRING([--enable-command-timing], [enable the time reserved word and command timing]), opt_command_timing=$enableval) | |
225 | AC_ARG_ENABLE(cond-command, AS_HELP_STRING([--enable-cond-command], [enable the conditional command]), opt_cond_command=$enableval) | |
226 | AC_ARG_ENABLE(cond-regexp, AS_HELP_STRING([--enable-cond-regexp], [enable extended regular expression matching in conditional commands]), opt_cond_regexp=$enableval) | |
227 | AC_ARG_ENABLE(coprocesses, AS_HELP_STRING([--enable-coprocesses], [enable coprocess support and the coproc reserved word]), opt_coproc=$enableval) | |
228 | AC_ARG_ENABLE(debugger, AS_HELP_STRING([--enable-debugger], [enable support for bash debugger]), opt_debugger=$enableval) | |
229 | AC_ARG_ENABLE(dev-fd-stat-broken, AS_HELP_STRING([--enable-dev-fd-stat-broken], [enable this option if stat on /dev/fd/N and fstat on file descriptor N don't return the same results]), opt_dev_fd_stat_broken=$enableval) | |
230 | AC_ARG_ENABLE(direxpand-default, AS_HELP_STRING([--enable-direxpand-default], [enable the direxpand shell option by default]), opt_dircomplete_expand_default=$enableval) | |
231 | AC_ARG_ENABLE(directory-stack, AS_HELP_STRING([--enable-directory-stack], [enable builtins pushd/popd/dirs]), opt_dirstack=$enableval) | |
232 | AC_ARG_ENABLE(disabled-builtins, AS_HELP_STRING([--enable-disabled-builtins], [allow disabled builtins to still be invoked]), opt_disabled_builtins=$enableval) | |
233 | AC_ARG_ENABLE(dparen-arithmetic, AS_HELP_STRING([--enable-dparen-arithmetic], [include ((...)) command]), opt_dparen_arith=$enableval) | |
234 | AC_ARG_ENABLE(extended-glob, AS_HELP_STRING([--enable-extended-glob], [include ksh-style extended pattern matching]), opt_extended_glob=$enableval) | |
235 | AC_ARG_ENABLE(extended-glob-default, AS_HELP_STRING([--enable-extended-glob-default], [force extended pattern matching to be enabled by default]), opt_extglob_default=$enableval) | |
236 | AC_ARG_ENABLE(function-import, AS_HELP_STRING([--enable-function-import], [allow bash to import exported function definitions by default]), opt_function_import=$enableval) | |
237 | AC_ARG_ENABLE(glob-asciiranges-default, AS_HELP_STRING([--enable-glob-asciiranges-default], [force bracket range expressions in pattern matching to use the C locale by default]), opt_globascii_default=$enableval) | |
238 | AC_ARG_ENABLE(help-builtin, AS_HELP_STRING([--enable-help-builtin], [include the help builtin]), opt_help=$enableval) | |
239 | AC_ARG_ENABLE(history, AS_HELP_STRING([--enable-history], [turn on command history]), opt_history=$enableval) | |
240 | AC_ARG_ENABLE(job-control, AS_HELP_STRING([--enable-job-control], [enable job control features]), opt_job_control=$enableval) | |
241 | AC_ARG_ENABLE(multibyte, AS_HELP_STRING([--enable-multibyte], [enable multibyte characters if OS supports them]), opt_multibyte=$enableval) | |
242 | AC_ARG_ENABLE(net-redirections, AS_HELP_STRING([--enable-net-redirections], [enable /dev/tcp/host/port redirection]), opt_net_redirs=$enableval) | |
243 | AC_ARG_ENABLE(process-substitution, AS_HELP_STRING([--enable-process-substitution], [enable process substitution]), opt_process_subst=$enableval) | |
244 | AC_ARG_ENABLE(progcomp, AS_HELP_STRING([--enable-progcomp], [enable programmable completion and the complete builtin]), opt_progcomp=$enableval) | |
245 | AC_ARG_ENABLE(prompt-string-decoding, AS_HELP_STRING([--enable-prompt-string-decoding], [turn on escape character decoding in prompts]), opt_prompt_decoding=$enableval) | |
246 | AC_ARG_ENABLE(readline, AS_HELP_STRING([--enable-readline], [turn on command line editing]), opt_readline=$enableval) | |
247 | AC_ARG_ENABLE(restricted, AS_HELP_STRING([--enable-restricted], [enable a restricted shell]), opt_restricted=$enableval) | |
248 | AC_ARG_ENABLE(select, AS_HELP_STRING([--enable-select], [include select command]), opt_select=$enableval) | |
249 | AC_ARG_ENABLE(separate-helpfiles, AS_HELP_STRING([--enable-separate-helpfiles], [use external files for help builtin documentation]), opt_separate_help=$enableval) | |
250 | AC_ARG_ENABLE(single-help-strings, AS_HELP_STRING([--enable-single-help-strings], [store help documentation as a single string to ease translation]), opt_single_longdoc_strings=$enableval) | |
251 | AC_ARG_ENABLE(strict-posix-default, AS_HELP_STRING([--enable-strict-posix-default], [configure bash to be posix-conformant by default]), opt_strict_posix=$enableval) | |
006856ed | 252 | AC_ARG_ENABLE(translatable-strings, AS_HELP_STRING([--enable-translatable-strings], [include support for $"..." translatable strings]), opt_translatable_strings=$enableval) |
a67031fe CR |
253 | AC_ARG_ENABLE(usg-echo-default, AS_HELP_STRING([--enable-usg-echo-default], [a synonym for --enable-xpg-echo-default]), opt_xpg_echo=$enableval) |
254 | AC_ARG_ENABLE(xpg-echo-default, AS_HELP_STRING([--enable-xpg-echo-default], [make the echo builtin expand escape sequences by default]), opt_xpg_echo=$enableval) | |
a7ad477f CR |
255 | |
256 | dnl options that alter how bash is compiled and linked | |
a67031fe CR |
257 | AC_ARG_ENABLE(mem-scramble, AS_HELP_STRING([--enable-mem-scramble], [scramble memory on calls to malloc and free]), opt_memscramble=$enableval) |
258 | AC_ARG_ENABLE(profiling, AS_HELP_STRING([--enable-profiling], [allow profiling with gprof]), opt_profiling=$enableval) | |
259 | AC_ARG_ENABLE(static-link, AS_HELP_STRING([--enable-static-link], [link bash statically, for use as a root shell]), opt_static_link=$enableval) | |
a7ad477f CR |
260 | |
261 | dnl So-called `precious' variables | |
262 | AC_ARG_VAR([CC_FOR_BUILD], [C compiler used when compiling binaries used only at build time]) | |
f886015a | 263 | AC_ARG_VAR([CFLAGS_FOR_BUILD], [Compilation options (CFLAGS) used when compiling binaries used only at build time]) |
a7ad477f CR |
264 | AC_ARG_VAR([LDFLAGS_FOR_BUILD], [Linker options (LDFLAGS) used when compiling binaries used only at build time]) |
265 | AC_ARG_VAR([CPPFLAGS_FOR_BUILD], [C preprocessor options (CPPFLAGS) used when compiling binaries used only at build time]) | |
266 | ||
267 | dnl opt_job_control is handled later, after BASH_JOB_CONTROL_MISSING runs | |
268 | ||
269 | dnl opt_readline and opt_history are handled later, because AC_PROG_CC needs | |
270 | dnl to be run before we can check the version of an already-installed readline | |
271 | dnl library | |
272 | ||
273 | if test $opt_alias = yes; then | |
274 | AC_DEFINE(ALIAS) | |
275 | fi | |
276 | if test $opt_dirstack = yes; then | |
277 | AC_DEFINE(PUSHD_AND_POPD) | |
278 | fi | |
279 | if test $opt_restricted = yes; then | |
280 | AC_DEFINE(RESTRICTED_SHELL) | |
281 | fi | |
282 | if test $opt_process_subst = yes; then | |
283 | AC_DEFINE(PROCESS_SUBSTITUTION) | |
284 | fi | |
285 | if test $opt_prompt_decoding = yes; then | |
286 | AC_DEFINE(PROMPT_STRING_DECODE) | |
287 | fi | |
288 | if test $opt_select = yes; then | |
289 | AC_DEFINE(SELECT_COMMAND) | |
290 | fi | |
291 | if test $opt_help = yes; then | |
292 | AC_DEFINE(HELP_BUILTIN) | |
293 | fi | |
294 | if test $opt_array_variables = yes; then | |
295 | AC_DEFINE(ARRAY_VARS) | |
296 | fi | |
297 | if test $opt_dparen_arith = yes; then | |
298 | AC_DEFINE(DPAREN_ARITHMETIC) | |
299 | fi | |
300 | if test $opt_brace_expansion = yes; then | |
301 | AC_DEFINE(BRACE_EXPANSION) | |
302 | fi | |
303 | if test $opt_disabled_builtins = yes; then | |
304 | AC_DEFINE(DISABLED_BUILTINS) | |
305 | fi | |
306 | if test $opt_command_timing = yes; then | |
307 | AC_DEFINE(COMMAND_TIMING) | |
308 | fi | |
309 | if test $opt_xpg_echo = yes ; then | |
310 | AC_DEFINE(DEFAULT_ECHO_TO_XPG) | |
311 | fi | |
312 | if test $opt_strict_posix = yes; then | |
313 | AC_DEFINE(STRICT_POSIX) | |
314 | fi | |
315 | if test $opt_extended_glob = yes ; then | |
316 | AC_DEFINE(EXTENDED_GLOB) | |
317 | fi | |
318 | if test $opt_extglob_default = yes; then | |
319 | AC_DEFINE(EXTGLOB_DEFAULT, 1) | |
320 | else | |
321 | AC_DEFINE(EXTGLOB_DEFAULT, 0) | |
322 | fi | |
323 | if test $opt_cond_command = yes ; then | |
324 | AC_DEFINE(COND_COMMAND) | |
325 | fi | |
326 | if test $opt_cond_regexp = yes ; then | |
327 | AC_DEFINE(COND_REGEXP) | |
328 | fi | |
329 | if test $opt_coproc = yes; then | |
330 | AC_DEFINE(COPROCESS_SUPPORT) | |
331 | fi | |
332 | if test $opt_arith_for_command = yes; then | |
333 | AC_DEFINE(ARITH_FOR_COMMAND) | |
334 | fi | |
335 | if test $opt_net_redirs = yes; then | |
336 | AC_DEFINE(NETWORK_REDIRECTIONS) | |
337 | fi | |
338 | if test $opt_progcomp = yes; then | |
339 | AC_DEFINE(PROGRAMMABLE_COMPLETION) | |
340 | fi | |
341 | if test $opt_multibyte = no; then | |
342 | AC_DEFINE(NO_MULTIBYTE_SUPPORT) | |
343 | fi | |
344 | if test $opt_debugger = yes; then | |
345 | AC_DEFINE(DEBUGGER) | |
346 | fi | |
347 | if test $opt_casemod_attrs = yes; then | |
348 | AC_DEFINE(CASEMOD_ATTRS) | |
349 | fi | |
350 | if test $opt_casemod_expansions = yes; then | |
351 | AC_DEFINE(CASEMOD_EXPANSIONS) | |
352 | fi | |
f14388d3 CR |
353 | if test $opt_dircomplete_expand_default = yes; then |
354 | AC_DEFINE(DIRCOMPLETE_EXPAND_DEFAULT) | |
355 | fi | |
c111d992 CR |
356 | if test $opt_globascii_default = yes; then |
357 | AC_DEFINE(GLOBASCII_DEFAULT, 1) | |
358 | else | |
359 | AC_DEFINE(GLOBASCII_DEFAULT, 0) | |
360 | fi | |
f3aad56d CR |
361 | if test $opt_function_import = yes; then |
362 | AC_DEFINE(FUNCTION_IMPORT) | |
363 | fi | |
a57ed9e9 CR |
364 | if test $opt_dev_fd_stat_broken = yes; then |
365 | AC_DEFINE(DEV_FD_STAT_BROKEN) | |
366 | fi | |
a67031fe CR |
367 | if test $opt_alt_array_impl = yes; then |
368 | AC_DEFINE(ALT_ARRAY_IMPLEMENTATION) | |
72206eb2 | 369 | ARRAY_O=array2.o |
a67031fe | 370 | fi |
006856ed CR |
371 | if test $opt_translatable_strings = yes; then |
372 | AC_DEFINE(TRANSLATABLE_STRINGS) | |
373 | fi | |
a7ad477f CR |
374 | |
375 | if test $opt_memscramble = yes; then | |
376 | AC_DEFINE(MEMSCRAMBLE) | |
377 | fi | |
378 | ||
379 | if test "$opt_minimal_config" = yes; then | |
380 | TESTSCRIPT=run-minimal | |
381 | else | |
382 | TESTSCRIPT=run-all | |
383 | fi | |
384 | ||
385 | HELPDIR= HELPDIRDEFINE= HELPINSTALL= HELPFILES_TARGET= | |
386 | if test "$opt_separate_help" != no; then | |
387 | if test "$opt_separate_help" = "yes" ; then | |
08871a77 | 388 | HELPDIR='${datadir}/bash/helpfiles' |
a7ad477f CR |
389 | else |
390 | HELPDIR=$opt_separate_help | |
391 | fi | |
392 | HELPDIRDEFINE='-H ${HELPDIR}' | |
393 | HELPINSTALL='install-help' | |
394 | HELPFILES_TARGET='helpdoc' | |
395 | fi | |
396 | HELPSTRINGS= | |
397 | if test "$opt_single_longdoc_strings" != "yes"; then | |
398 | HELPSTRINGS='-S' | |
399 | fi | |
400 | ||
401 | dnl now substitute in the values generated by arguments | |
402 | AC_SUBST(TESTSCRIPT) | |
a7ad477f CR |
403 | AC_SUBST(MALLOC_TARGET) |
404 | AC_SUBST(MALLOC_SRC) | |
405 | ||
406 | AC_SUBST(MALLOC_LIB) | |
407 | AC_SUBST(MALLOC_LIBRARY) | |
408 | AC_SUBST(MALLOC_LDFLAGS) | |
409 | AC_SUBST(MALLOC_DEP) | |
410 | ||
72206eb2 CR |
411 | AC_SUBST(ARRAY_O) |
412 | ||
a7ad477f CR |
413 | AC_SUBST(htmldir) |
414 | ||
415 | AC_SUBST(HELPDIR) | |
416 | AC_SUBST(HELPDIRDEFINE) | |
417 | AC_SUBST(HELPINSTALL) | |
418 | AC_SUBST(HELPFILES_TARGET) | |
419 | AC_SUBST(HELPSTRINGS) | |
420 | ||
8f50a023 CR |
421 | dnl We want these before the checks, so the checks can modify their values. |
422 | if test -z "$CFLAGS"; then | |
46305251 | 423 | want_auto_cflags=1 |
8f50a023 CR |
424 | fi |
425 | ||
a7ad477f CR |
426 | echo "" |
427 | echo "Beginning configuration for bash-$BASHVERS-$RELSTATUS for ${host_cpu}-${host_vendor}-${host_os}" | |
428 | echo "" | |
429 | ||
430 | dnl compilation checks | |
431 | dnl AC_PROG_CC sets $cross_compiling to `yes' if cross-compiling for a | |
432 | dnl different environment | |
433 | AC_PROG_CC | |
434 | ||
46305251 | 435 | if test -n "$want_auto_cflags"; then |
5a0e5b7b CR |
436 | AUTO_CFLAGS="-g ${GCC:+-O2}" |
437 | AUTO_LDFLAGS="-g ${GCC:+-O2}" | |
a67031fe | 438 | # STYLE_CFLAGS="${GCC:+-Wno-parentheses} ${GCC:+-Wno-format-security} ${GCC:+-Wno-tautological-constant-out-of-range-compare}" |
5a0e5b7b | 439 | STYLE_CFLAGS="${GCC:+-Wno-parentheses} ${GCC:+-Wno-format-security}" |
46305251 CR |
440 | else |
441 | AUTO_CFLAGS= AUTO_LDFLAGS= STYLE_CFLAGS= | |
442 | fi | |
443 | ||
a7ad477f | 444 | dnl test for Unix variants |
a67031fe | 445 | AC_USE_SYSTEM_EXTENSIONS |
a7ad477f CR |
446 | AC_SYS_LARGEFILE |
447 | ||
448 | dnl BEGIN changes for cross-building (currently cygwin, minGW, and | |
449 | dnl (obsolete) BeOS) | |
450 | ||
451 | SIGNAMES_O= | |
452 | SIGNAMES_H=lsignames.h | |
453 | ||
454 | dnl load up the cross-building cache file -- add more cases and cache | |
455 | dnl files as necessary | |
456 | ||
457 | dnl Note that host and target machine are the same, and different than the | |
458 | dnl build machine. | |
459 | dnl Set SIGNAMES_H based on whether or not we're cross-compiling. | |
460 | ||
461 | CROSS_COMPILE= | |
462 | if test "x$cross_compiling" = "xyes"; then | |
463 | case "${host}" in | |
464 | *-cygwin*) | |
465 | cross_cache=${srcdir}/cross-build/cygwin32.cache | |
466 | ;; | |
467 | *-mingw*) | |
468 | cross_cache=${srcdir}/cross-build/cygwin32.cache | |
469 | ;; | |
470 | i[[3456]]86-*-beos*) | |
471 | cross_cache=${srcdir}/cross-build/x86-beos.cache | |
472 | ;; | |
89149ec0 CR |
473 | *-qnx*) |
474 | cross_cache=${srcdir}/cross-build/qnx.cache | |
475 | ;; | |
a7ad477f CR |
476 | *) echo "configure: cross-compiling for $host is not supported" >&2 |
477 | ;; | |
478 | esac | |
479 | if test -n "${cross_cache}" && test -r "${cross_cache}"; then | |
480 | echo "loading cross-build cache file ${cross_cache}" | |
481 | . ${cross_cache} | |
482 | fi | |
483 | unset cross_cache | |
484 | SIGNAMES_O='signames.o' | |
485 | CROSS_COMPILE='-DCROSS_COMPILING' | |
486 | AC_SUBST(CROSS_COMPILE) | |
487 | fi | |
488 | AC_SUBST(SIGNAMES_H) | |
489 | AC_SUBST(SIGNAMES_O) | |
490 | ||
491 | dnl END changes for cross-building | |
492 | ||
a7ad477f CR |
493 | dnl default values |
494 | CFLAGS=${CFLAGS-"$AUTO_CFLAGS"} | |
495 | # LDFLAGS=${LDFLAGS="$AUTO_LDFLAGS"} # XXX | |
496 | ||
497 | dnl handle options that alter how bash is compiled and linked | |
498 | dnl these must come after the test for cc/gcc | |
499 | if test "$opt_profiling" = "yes"; then | |
500 | PROFILE_FLAGS=-pg | |
501 | case "$host_os" in | |
eb2d46d7 | 502 | solaris2*|linux*|darwin*) ;; |
a7ad477f CR |
503 | *) opt_static_link=yes ;; |
504 | esac | |
505 | DEBUG= MALLOC_DEBUG= | |
506 | fi | |
507 | ||
508 | prefer_shared=yes | |
509 | prefer_static=no | |
510 | ||
511 | if test "$opt_static_link" = yes; then | |
512 | prefer_static=yes | |
513 | prefer_shared=no | |
514 | # if we're using gcc, add `-static' to LDFLAGS, except on Solaris >= 2 | |
a67031fe | 515 | if test "$GCC" = "yes"; then |
a7ad477f CR |
516 | STATIC_LD="-static" |
517 | case "$host_os" in | |
6a9e77e8 CR |
518 | solaris2*) ;; |
519 | linux*) test "$opt_profiling" = "no" && LDFLAGS="$LDFLAGS -static" ;; | |
a7ad477f CR |
520 | *) LDFLAGS="$LDFLAGS -static" ;; # XXX experimental |
521 | esac | |
522 | fi | |
523 | fi | |
524 | ||
525 | # set the appropriate make variables for building the "build tools" | |
526 | # modify defaults based on whether or not we are cross compiling, since the | |
527 | # options for the target host may not be appropriate for the build host | |
528 | if test "X$cross_compiling" = "Xno"; then | |
529 | CC_FOR_BUILD=${CC_FOR_BUILD-'$(CC)'} | |
530 | CPPFLAGS_FOR_BUILD=${CPPFLAGS_FOR_BUILD-"$CPPFLAGS"} # XXX - should it be '$(CPPFLAGS)' | |
216e2e9b CR |
531 | if test X"$opt_profiling" = Xyes; then |
532 | LDFLAGS_FOR_BUILD=${LDFLAGS_FOR_BUILD-'$(BASE_LDFLAGS)'} | |
533 | else | |
534 | LDFLAGS_FOR_BUILD=${LDFLAGS_FOR_BUILD-'$(LDFLAGS)'} | |
535 | fi | |
a7ad477f | 536 | # CFLAGS set above to default value if not passed in environment |
46305251 | 537 | if test -n "$want_auto_cflags" ; then |
5a0e5b7b CR |
538 | CFLAGS_FOR_BUILD="${CFLAGS}" |
539 | BASE_CFLAGS_FOR_BUILD="${CFLAGS}" | |
46305251 | 540 | else |
5a0e5b7b | 541 | # passed in environment |
46305251 | 542 | CFLAGS_FOR_BUILD=${CFLAGS-'$(CFLAGS)'} |
5a0e5b7b | 543 | BASE_CFLAGS_FOR_BUILD=${CFLAGS-'$(CFLAGS)'} |
46305251 | 544 | fi |
a7ad477f CR |
545 | LIBS_FOR_BUILD=${LIBS_FOR_BUILD-'$(LIBS)'} |
546 | else | |
547 | CC_FOR_BUILD=${CC_FOR_BUILD-"gcc"} | |
548 | CPPFLAGS_FOR_BUILD=${CPPFLAGS_FOR_BUILD-""} | |
549 | LDFLAGS_FOR_BUILD=${LDFLAGS_FOR_BUILD-""} | |
550 | CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD="-g"} | |
5a0e5b7b | 551 | BASE_CFLAGS_FOR_BUILD=${BASE_CFLAGS_FOR_BUILD="-g"} |
a7ad477f CR |
552 | LIBS_FOR_BUILD=${LIBS_FOR_BUILD-""} |
553 | fi | |
554 | ||
555 | AC_SUBST(CFLAGS) | |
556 | AC_SUBST(CPPFLAGS) | |
557 | AC_SUBST(LDFLAGS) | |
558 | AC_SUBST(STATIC_LD) | |
559 | ||
560 | AC_SUBST(CC_FOR_BUILD) | |
561 | AC_SUBST(CFLAGS_FOR_BUILD) | |
5a0e5b7b CR |
562 | AC_SUBST(BASE_CFLAGS_FOR_BUILD) |
563 | AC_SUBST(STYLE_CFLAGS) | |
a7ad477f CR |
564 | AC_SUBST(CPPFLAGS_FOR_BUILD) |
565 | AC_SUBST(LDFLAGS_FOR_BUILD) | |
566 | AC_SUBST(LIBS_FOR_BUILD) | |
567 | ||
568 | AC_PROG_GCC_TRADITIONAL | |
569 | ||
570 | dnl BEGIN READLINE and HISTORY LIBRARY SECTION | |
571 | dnl prepare to allow bash to be linked against an already-installed readline | |
572 | ||
573 | dnl first test that the readline version is new enough to link bash against | |
574 | if test "$opt_readline" = yes && test "$opt_with_installed_readline" != "no" | |
575 | then | |
576 | # If the user specified --with-installed-readline=PREFIX and PREFIX | |
577 | # is not `yes', set ac_cv_rl_prefix to PREFIX | |
578 | test $opt_with_installed_readline != "yes" && ac_cv_rl_prefix=$opt_with_installed_readline | |
579 | ||
580 | RL_LIB_READLINE_VERSION | |
581 | ||
582 | case "$ac_cv_rl_version" in | |
12beeabf | 583 | 8*|9*) ;; |
a7ad477f CR |
584 | *) opt_with_installed_readline=no |
585 | AC_MSG_WARN([installed readline library is too old to be linked with bash]) | |
586 | AC_MSG_WARN([using private bash version]) | |
587 | ;; | |
588 | esac | |
589 | fi | |
590 | ||
591 | TILDE_LIB=-ltilde | |
592 | if test $opt_readline = yes; then | |
593 | AC_DEFINE(READLINE) | |
594 | if test "$opt_with_installed_readline" != "no" ; then | |
595 | case "$opt_with_installed_readline" in | |
596 | yes) RL_INCLUDE= ;; | |
597 | *) case "$RL_INCLUDEDIR" in | |
598 | /usr/include) ;; | |
599 | *) RL_INCLUDE='-I${RL_INCLUDEDIR}' ;; | |
600 | esac | |
601 | ;; | |
602 | esac | |
603 | READLINE_DEP= | |
604 | READLINE_LIB=-lreadline | |
605 | # section for OS versions that don't allow unresolved symbols | |
606 | # to be compiled into dynamic libraries. | |
607 | case "$host_os" in | |
608 | cygwin*) TILDE_LIB= ;; | |
609 | esac | |
610 | else | |
611 | RL_LIBDIR='$(dot)/$(LIBSUBDIR)/readline' | |
612 | READLINE_DEP='$(READLINE_LIBRARY)' | |
613 | # section for OS versions that ship an older/broken version of | |
614 | # readline as a standard dynamic library and don't allow a | |
615 | # static version specified as -llibname to override the | |
616 | # dynamic version | |
617 | case "${host_os}" in | |
618 | darwin[[89]]*|darwin10*) READLINE_LIB='${READLINE_LIBRARY}' ;; | |
619 | *) READLINE_LIB=-lreadline ;; | |
620 | esac | |
621 | fi | |
622 | else | |
623 | RL_LIBDIR='$(dot)/$(LIBSUBDIR)/readline' | |
624 | READLINE_LIB= READLINE_DEP= | |
625 | fi | |
626 | if test $opt_history = yes || test $opt_bang_history = yes; then | |
627 | if test $opt_history = yes; then | |
628 | AC_DEFINE(HISTORY) | |
629 | fi | |
630 | if test $opt_bang_history = yes; then | |
631 | AC_DEFINE(BANG_HISTORY) | |
632 | fi | |
633 | if test "$opt_with_installed_readline" != "no"; then | |
634 | HIST_LIBDIR=$RL_LIBDIR | |
635 | HISTORY_DEP= | |
636 | HISTORY_LIB=-lhistory | |
637 | case "$opt_with_installed_readline" in | |
638 | yes) RL_INCLUDE= ;; | |
639 | *) case "$RL_INCLUDEDIR" in | |
640 | /usr/include) ;; | |
641 | *) RL_INCLUDE='-I${RL_INCLUDEDIR}' ;; | |
642 | esac | |
643 | ;; | |
644 | esac | |
645 | else | |
646 | HIST_LIBDIR='$(dot)/$(LIBSUBDIR)/readline' | |
647 | HISTORY_DEP='$(HISTORY_LIBRARY)' | |
648 | # section for OS versions that ship an older version of | |
649 | # readline as a standard dynamic library and don't allow a | |
650 | # static version specified as -llibname to override the | |
651 | # dynamic version | |
652 | case "${host_os}" in | |
653 | darwin[[89]]*|darwin10*) HISTORY_LIB='${HISTORY_LIBRARY}' ;; | |
654 | *) HISTORY_LIB=-lhistory ;; | |
655 | esac | |
656 | fi | |
657 | else | |
658 | HIST_LIBDIR='$(dot)/$(LIBSUBDIR)/readline' | |
659 | HISTORY_LIB= HISTORY_DEP= | |
660 | fi | |
661 | AC_SUBST(READLINE_LIB) | |
662 | AC_SUBST(READLINE_DEP) | |
663 | AC_SUBST(RL_LIBDIR) | |
664 | AC_SUBST(RL_INCLUDEDIR) | |
665 | AC_SUBST(RL_INCLUDE) | |
666 | AC_SUBST(HISTORY_LIB) | |
667 | AC_SUBST(HISTORY_DEP) | |
668 | AC_SUBST(HIST_LIBDIR) | |
669 | AC_SUBST(TILDE_LIB) | |
670 | ||
671 | dnl END READLINE and HISTORY LIBRARY SECTION | |
672 | ||
673 | dnl programs needed by the build and install process | |
674 | AC_PROG_INSTALL | |
208fdb50 | 675 | AC_CHECK_TOOL(AR, ar) |
a7ad477f CR |
676 | dnl Set default for ARFLAGS, since autoconf does not have a macro for it. |
677 | dnl This allows people to set it when running configure or make | |
678 | test -n "$ARFLAGS" || ARFLAGS="cr" | |
679 | AC_PROG_RANLIB | |
680 | AC_PROG_YACC | |
681 | AC_PROG_MAKE_SET | |
682 | ||
41d203e2 CR |
683 | case "$ac_cv_prog_YACC" in |
684 | *bison*) ;; | |
685 | *) AC_MSG_WARN([bison not available; needed to process parse.y]) ;; | |
686 | esac | |
687 | ||
a7ad477f CR |
688 | case "$host_os" in |
689 | opennt*|interix*) MAKE_SHELL="$INTERIX_ROOT/bin/sh" ;; | |
690 | *) MAKE_SHELL=/bin/sh ;; | |
691 | esac | |
692 | AC_SUBST(MAKE_SHELL) | |
693 | ||
694 | dnl this is similar to the expanded AC_PROG_RANLIB | |
695 | if test x$SIZE = x; then | |
696 | if test x$ac_tool_prefix = x; then | |
697 | SIZE=size | |
698 | else | |
699 | SIZE=${ac_tool_prefix}size | |
700 | save_IFS=$IFS ; IFS=: | |
701 | size_found=0 | |
702 | for dir in $PATH; do | |
703 | if test -x $dir/$SIZE ; then | |
704 | size_found=1 | |
705 | break | |
706 | fi | |
707 | done | |
708 | if test $size_found -eq 0; then | |
709 | SIZE=: | |
710 | fi | |
711 | IFS=$save_IFS | |
712 | fi | |
713 | fi | |
714 | AC_SUBST(SIZE) | |
715 | ||
716 | m4_include([m4/stat-time.m4]) | |
717 | m4_include([m4/timespec.m4]) | |
718 | ||
3be2a2ca CR |
719 | m4_include([m4/strtoimax.m4]) |
720 | ||
be4078d2 CR |
721 | dnl include files for gettext |
722 | ||
723 | m4_include([m4/codeset.m4]) | |
724 | m4_include([m4/extern-inline.m4]) | |
50ffbc9d CR |
725 | |
726 | m4_include([m4/bison.m4]) | |
be4078d2 | 727 | m4_include([m4/fcntl-o.m4]) |
50ffbc9d | 728 | m4_include([m4/flexmember.m4]) |
be4078d2 CR |
729 | m4_include([m4/gettext.m4]) |
730 | m4_include([m4/glibc2.m4]) | |
be4078d2 CR |
731 | m4_include([m4/iconv.m4]) |
732 | m4_include([m4/intdiv0.m4]) | |
733 | m4_include([m4/intl.m4]) | |
734 | m4_include([m4/intlmacosx.m4]) | |
735 | m4_include([m4/intl-thread-locale.m4]) | |
736 | m4_include([m4/intmax.m4]) | |
737 | m4_include([m4/inttypes-pri.m4]) | |
738 | m4_include([m4/inttypes.m4]) | |
739 | m4_include([m4/inttypes_h.m4]) | |
740 | m4_include([m4/lcmessage.m4]) | |
741 | m4_include([m4/lib-ld.m4]) | |
742 | m4_include([m4/lib-link.m4]) | |
743 | m4_include([m4/lib-prefix.m4]) | |
50ffbc9d | 744 | m4_include([m4/locale_h.m4]) |
be4078d2 CR |
745 | m4_include([m4/lock.m4]) |
746 | m4_include([m4/nls.m4]) | |
747 | m4_include([m4/po.m4]) | |
748 | m4_include([m4/printf-posix.m4]) | |
749 | m4_include([m4/progtest.m4]) | |
9e48f856 | 750 | m4_include([m4/pthread_rwlock_rdlock.m4]) |
be4078d2 CR |
751 | m4_include([m4/size_max.m4]) |
752 | m4_include([m4/stdint_h.m4]) | |
753 | m4_include([m4/threadlib.m4]) | |
754 | m4_include([m4/uintmax_t.m4]) | |
755 | m4_include([m4/ulonglong.m4]) | |
756 | m4_include([m4/visibility.m4]) | |
757 | m4_include([m4/wchar_t.m4]) | |
758 | m4_include([m4/wint_t.m4]) | |
759 | m4_include([m4/xsize.m4]) | |
760 | ||
50ffbc9d CR |
761 | m4_include([m4/glibc21.m4]) |
762 | m4_include([m4/host-cpu-c-abi.m4]) | |
763 | ||
a7ad477f CR |
764 | dnl C compiler characteristics |
765 | AC_C_CONST | |
766 | AC_C_INLINE | |
767 | AC_C_BIGENDIAN | |
768 | AC_C_STRINGIZE | |
a67031fe | 769 | AC_TYPE_LONG_DOUBLE |
a7ad477f CR |
770 | AC_C_CHAR_UNSIGNED |
771 | AC_C_VOLATILE | |
772 | AC_C_RESTRICT | |
773 | ||
774 | dnl initialize GNU gettext | |
50ffbc9d CR |
775 | dnl the use-libtool is a lie, we just use the standard Unix tools |
776 | BASH_GNU_GETTEXT([use-libtool], [need-ngettext], [lib/intl]) | |
a7ad477f CR |
777 | |
778 | dnl header files | |
779 | AC_HEADER_DIRENT | |
5e061bb0 | 780 | AC_HEADER_MAJOR |
a7ad477f CR |
781 | |
782 | BASH_HEADER_INTTYPES | |
783 | ||
d267701a | 784 | AC_CHECK_HEADERS(unistd.h stdlib.h varargs.h limits.h string.h \ |
a7ad477f CR |
785 | memory.h locale.h termcap.h termio.h termios.h dlfcn.h \ |
786 | stdbool.h stddef.h stdint.h netdb.h pwd.h grp.h strings.h \ | |
787 | regex.h syslog.h ulimit.h) | |
48abf0fd | 788 | AC_CHECK_HEADERS(sys/pte.h sys/stream.h sys/select.h sys/file.h sys/ioctl.h \ |
e76c7327 | 789 | sys/mman.h sys/param.h sys/random.h sys/socket.h sys/stat.h \ |
a7ad477f CR |
790 | sys/time.h sys/times.h sys/types.h sys/wait.h) |
791 | AC_CHECK_HEADERS(netinet/in.h arpa/inet.h) | |
792 | ||
793 | dnl sys/ptem.h requires definitions from sys/stream.h on systems where it | |
794 | dnl exists | |
795 | AC_CHECK_HEADER(sys/ptem.h, , ,[[ | |
796 | #if HAVE_SYS_STREAM_H | |
797 | # include <sys/stream.h> | |
798 | #endif | |
799 | ]]) | |
800 | ||
07357ec2 CR |
801 | dnl SunOS 4 needs to include <sys/time.h> before <sys/resource.h> to compile |
802 | dnl autoconf complains about presence but inability to compile | |
803 | AC_CHECK_HEADER(sys/resource.h, AC_DEFINE(HAVE_SYS_RESOURCE_H), [], [[ | |
804 | #if HAVE_SYS_TIME_H | |
805 | # include <sys/time.h> | |
806 | #endif | |
807 | ]]) | |
808 | ||
a7ad477f CR |
809 | dnl special checks for libc functions |
810 | AC_FUNC_ALLOCA | |
03d922b1 | 811 | AC_FUNC_CHOWN |
a7ad477f | 812 | AC_FUNC_GETPGRP |
a7ad477f CR |
813 | AC_FUNC_VPRINTF |
814 | AC_FUNC_STRCOLL | |
815 | ||
816 | dnl if we're not using the bash malloc but require the C alloca, set things | |
817 | dnl up to build a libmalloc.a containing only alloca.o | |
818 | ||
819 | if test "$ac_cv_func_alloca_works" = "no" && test "$opt_bash_malloc" = "no"; then | |
820 | MALLOC_TARGET=alloca | |
821 | MALLOC_SRC=alloca.c | |
822 | ||
823 | MALLOC_LIB='-lmalloc' | |
824 | MALLOC_LIBRARY='$(ALLOC_LIBDIR)/libmalloc.a' | |
825 | MALLOC_LDFLAGS='-L$(ALLOC_LIBDIR)' | |
826 | MALLOC_DEP='$(MALLOC_LIBRARY)' | |
827 | fi | |
828 | ||
829 | dnl if vprintf is not in libc, see if it's defined in stdio.h | |
830 | if test "$ac_cv_func_vprintf" = no; then | |
831 | AC_MSG_CHECKING(for declaration of vprintf in stdio.h) | |
832 | AC_EGREP_HEADER([[int[ ]*vprintf[^a-zA-Z0-9]]],stdio.h,ac_cv_func_vprintf=yes) | |
833 | AC_MSG_RESULT($ac_cv_func_vprintf) | |
834 | if test $ac_cv_func_vprintf = yes; then | |
835 | AC_DEFINE(HAVE_VPRINTF) | |
836 | fi | |
837 | fi | |
838 | ||
839 | if test "$ac_cv_func_vprintf" = no && test "$ac_cv_func__doprnt" = "yes"; then | |
840 | AC_LIBOBJ(vprint) | |
841 | fi | |
842 | ||
a7ad477f CR |
843 | dnl checks for certain version-specific system calls and libc functions |
844 | AC_CHECK_FUNC(__setostype, AC_DEFINE(HAVE_SETOSTYPE)) | |
845 | AC_CHECK_FUNC(wait3, AC_DEFINE(HAVE_WAIT3)) | |
846 | ||
847 | dnl checks for missing libc functions | |
44107840 | 848 | AC_CHECK_FUNC(mkfifo, AC_DEFINE(HAVE_MKFIFO), AC_DEFINE(MKFIFO_MISSING)) |
a7ad477f CR |
849 | |
850 | dnl checks for system calls | |
e76c7327 CR |
851 | AC_CHECK_FUNCS(dup2 eaccess fcntl getdtablesize getentropy getgroups \ |
852 | gethostname getpagesize getpeername getrandom getrlimit \ | |
6a9e77e8 CR |
853 | getrusage gettimeofday kill killpg lstat nanosleep \ |
854 | pselect readlink \ | |
e76c7327 | 855 | select setdtablesize setitimer tcgetpgrp uname ulimit waitpid) |
a7ad477f CR |
856 | AC_REPLACE_FUNCS(rename) |
857 | ||
858 | dnl checks for c library functions | |
fc29a024 | 859 | AC_CHECK_FUNCS(bcopy bzero clock_gettime confstr faccessat fnmatch \ |
a7ad477f | 860 | getaddrinfo gethostbyname getservbyname getservent inet_aton \ |
e6f5e0c8 | 861 | imaxdiv memmove pathconf putenv raise random regcomp regexec \ |
a7ad477f CR |
862 | setenv setlinebuf setlocale setvbuf siginterrupt strchr \ |
863 | sysconf syslog tcgetattr times ttyname tzset unsetenv) | |
864 | ||
865 | AC_CHECK_FUNCS(vasprintf asprintf) | |
866 | AC_CHECK_FUNCS(isascii isblank isgraph isprint isspace isxdigit) | |
867 | AC_CHECK_FUNCS(getpwent getpwnam getpwuid) | |
befdddcb | 868 | AC_CHECK_FUNCS(mkstemp mkdtemp) |
376c9fe5 | 869 | AC_CHECK_FUNCS(arc4random) |
d06fefb2 CR |
870 | AC_CHECK_FUNCS(strlcat) |
871 | ||
872 | AC_CHECK_FUNCS(memfd_create shm_open shm_mkstemp) | |
376c9fe5 | 873 | |
a7ad477f CR |
874 | AC_REPLACE_FUNCS(getcwd memset) |
875 | AC_REPLACE_FUNCS(strcasecmp strcasestr strerror strftime strnlen strpbrk strstr) | |
3be2a2ca | 876 | AC_REPLACE_FUNCS(strtod strtol strtoul strtoll strtoull strtoumax) |
a7ad477f CR |
877 | AC_REPLACE_FUNCS(dprintf) |
878 | AC_REPLACE_FUNCS(strchrnul) | |
67440bc5 | 879 | AC_REPLACE_FUNCS(strdup) |
d06fefb2 | 880 | AC_REPLACE_FUNCS(strlcpy) |
a7ad477f | 881 | |
dcb2f448 | 882 | AC_CHECK_HEADERS(libaudit.h) |
a7ad477f CR |
883 | AC_CHECK_DECLS([AUDIT_USER_TTY],,, [[#include <linux/audit.h>]]) |
884 | ||
885 | AC_CHECK_DECLS([confstr]) | |
886 | AC_CHECK_DECLS([printf]) | |
55a224da | 887 | AC_CHECK_DECLS([brk]) |
a7ad477f CR |
888 | AC_CHECK_DECLS([sbrk]) |
889 | AC_CHECK_DECLS([setregid]) | |
890 | AC_CHECK_DECLS([strcpy]) | |
891 | AC_CHECK_DECLS([strsignal]) | |
892 | ||
db26b1cf CR |
893 | AC_CHECK_FUNCS(setresuid setresgid) |
894 | ||
a7ad477f CR |
895 | dnl Extra test to detect the horribly broken HP/UX 11.00 strtold(3) |
896 | AC_CHECK_DECLS([strtold], [ | |
897 | AC_MSG_CHECKING([for broken strtold]) | |
898 | AC_CACHE_VAL(bash_cv_strtold_broken, | |
44107840 CR |
899 | [AC_COMPILE_IFELSE( |
900 | [AC_LANG_PROGRAM( | |
901 | [[#include <stdlib.h>]], | |
55a224da | 902 | [[long double r; char *foo, *bar; r = strtold(foo, &bar);]] |
44107840 CR |
903 | )], |
904 | [bash_cv_strtold_broken=no],[bash_cv_strtold_broken=yes]) | |
905 | ] | |
a7ad477f CR |
906 | ) |
907 | AC_MSG_RESULT($bash_cv_strtold_broken) | |
908 | if test "$bash_cv_strtold_broken" = "yes" ; then | |
909 | AC_DEFINE(STRTOLD_BROKEN) | |
910 | fi | |
911 | ]) | |
912 | ||
44107840 CR |
913 | AC_CHECK_DECLS(strtol) |
914 | AC_CHECK_DECLS(strtoll) | |
915 | AC_CHECK_DECLS(strtoul) | |
916 | AC_CHECK_DECLS(strtoull) | |
917 | AC_CHECK_DECLS(strtoumax) | |
a7ad477f CR |
918 | |
919 | AC_FUNC_MKTIME | |
920 | ||
921 | dnl | |
922 | dnl Checks for lib/intl and related code (uses some of the output from | |
70a158ed | 923 | dnl BASH_GNU_GETTEXT) |
a7ad477f CR |
924 | dnl |
925 | ||
926 | AC_CHECK_HEADERS([argz.h errno.h fcntl.h malloc.h stdio_ext.h]) | |
927 | ||
928 | dnl AC_FUNC_MALLOC | |
50ffbc9d | 929 | AC_DEFINE([HAVE_MALLOC]) |
a7ad477f | 930 | AC_FUNC_MMAP |
b64a7d8c CR |
931 | AC_CHECK_FUNCS([__argz_count __argz_next __argz_stringify dcgettext \ |
932 | locale_charset mempcpy \ | |
d58f7f88 | 933 | munmap mremap stpcpy strcspn]) |
a7ad477f CR |
934 | |
935 | INTL_DEP= INTL_INC= LIBINTL_H= | |
936 | if test "x$USE_INCLUDED_LIBINTL" = "xyes"; then | |
937 | INTL_DEP='${INTL_LIBDIR}/libintl.a' | |
938 | INTL_INC='-I${INTL_LIBSRC} -I${INTL_BUILDDIR}' | |
939 | LIBINTL_H='${INTL_BUILDDIR}/libintl.h' | |
b64a7d8c CR |
940 | |
941 | AC_DEFINE([HAVE_LOCALE_CHARSET], 1) | |
a7ad477f CR |
942 | fi |
943 | AC_SUBST(INTL_DEP) | |
944 | AC_SUBST(INTL_INC) | |
945 | AC_SUBST(LIBINTL_H) | |
946 | ||
947 | dnl | |
948 | dnl End of checks needed by files in lib/intl | |
949 | dnl | |
950 | ||
951 | BASH_CHECK_MULTIBYTE | |
952 | ||
953 | dnl checks for the dynamic loading library functions in libc and libdl | |
954 | if test "$opt_static_link" != yes; then | |
955 | AC_CHECK_LIB(dl, dlopen) | |
956 | AC_CHECK_FUNCS(dlopen dlclose dlsym) | |
957 | fi | |
958 | ||
a7ad477f CR |
959 | dnl network functions -- check for inet_aton again |
960 | if test "$ac_cv_func_inet_aton" != 'yes'; then | |
961 | BASH_FUNC_INET_ATON | |
962 | fi | |
963 | ||
964 | dnl libraries | |
965 | dnl this is reportedly no longer necessary for irix[56].? | |
966 | case "$host_os" in | |
967 | irix4*) AC_CHECK_LIB(sun, getpwent) ;; | |
968 | esac | |
969 | ||
970 | dnl check for getpeername in the socket library only if it's not in libc | |
971 | if test "$ac_cv_func_getpeername" = no; then | |
972 | BASH_CHECK_LIB_SOCKET | |
973 | fi | |
974 | dnl check for gethostbyname in socket libraries if it's not in libc | |
975 | if test "$ac_cv_func_gethostbyname" = no; then | |
976 | BASH_FUNC_GETHOSTBYNAME | |
977 | fi | |
978 | ||
979 | dnl system types | |
980 | AC_TYPE_GETGROUPS | |
981 | AC_TYPE_OFF_T | |
982 | AC_TYPE_MODE_T | |
983 | AC_TYPE_UID_T | |
984 | AC_TYPE_PID_T | |
985 | AC_TYPE_SIZE_T | |
727e92c8 | 986 | AC_TYPE_INTPTR_T |
f8c5768e CR |
987 | AC_TYPE_UINTPTR_T |
988 | ||
a7ad477f CR |
989 | AC_CHECK_TYPE(ssize_t, int) |
990 | AC_CHECK_TYPE(time_t, long) | |
991 | ||
44107840 CR |
992 | AC_TYPE_LONG_LONG_INT |
993 | AC_TYPE_UNSIGNED_LONG_LONG_INT | |
a7ad477f | 994 | |
a7ad477f CR |
995 | BASH_TYPE_SIG_ATOMIC_T |
996 | ||
997 | AC_CHECK_SIZEOF(char, 1) | |
998 | AC_CHECK_SIZEOF(short, 2) | |
999 | AC_CHECK_SIZEOF(int, 4) | |
1000 | AC_CHECK_SIZEOF(long, 4) | |
1001 | AC_CHECK_SIZEOF(char *, 4) | |
220a95cd | 1002 | AC_CHECK_SIZEOF(size_t, 4) |
a7ad477f CR |
1003 | AC_CHECK_SIZEOF(double, 8) |
1004 | AC_CHECK_SIZEOF([long long], 8) | |
1005 | ||
1006 | AC_CHECK_TYPE(u_int, [unsigned int]) | |
1007 | AC_CHECK_TYPE(u_long, [unsigned long]) | |
1008 | ||
1009 | BASH_TYPE_BITS16_T | |
1010 | BASH_TYPE_U_BITS16_T | |
1011 | BASH_TYPE_BITS32_T | |
1012 | BASH_TYPE_U_BITS32_T | |
1013 | BASH_TYPE_BITS64_T | |
1014 | ||
1015 | BASH_TYPE_PTRDIFF_T | |
1016 | ||
1017 | dnl structures | |
1018 | AC_HEADER_STAT | |
1019 | ||
1020 | dnl system services | |
1021 | AC_SYS_INTERPRETER | |
1022 | if test $ac_cv_sys_interpreter = yes; then | |
1023 | AC_DEFINE(HAVE_HASH_BANG_EXEC) | |
1024 | fi | |
1025 | ||
1026 | dnl Miscellaneous Bash tests | |
1027 | if test "$ac_cv_func_lstat" = "no"; then | |
1028 | BASH_FUNC_LSTAT | |
1029 | fi | |
1030 | ||
1031 | dnl behavior of system calls and library functions | |
a7ad477f CR |
1032 | BASH_FUNC_DUP2_CLOEXEC_CHECK |
1033 | BASH_SYS_PGRP_SYNC | |
1034 | BASH_SYS_SIGNAL_VINTAGE | |
1035 | ||
1036 | dnl checking for the presence of certain library symbols | |
1037 | BASH_SYS_ERRLIST | |
1038 | BASH_SYS_SIGLIST | |
1039 | BASH_UNDER_SYS_SIGLIST | |
1040 | ||
1041 | dnl various system types | |
a7ad477f CR |
1042 | BASH_CHECK_TYPE(clock_t, [#include <sys/times.h>], long) |
1043 | BASH_CHECK_TYPE(sigset_t, [#include <signal.h>], int) | |
a7ad477f | 1044 | if test "$ac_cv_header_sys_socket_h" = "yes"; then |
c2fa6583 | 1045 | BASH_CHECK_TYPE(socklen_t, [#include <sys/socket.h>], [unsigned int], HAVE_SOCKLEN_T) |
a7ad477f | 1046 | fi |
44107840 CR |
1047 | |
1048 | AC_CHECK_TYPE(quad_t, AC_DEFINE([HAVE_QUAD_T], [1]), [], ) | |
a7ad477f CR |
1049 | BASH_TYPE_RLIMIT |
1050 | ||
44107840 CR |
1051 | AC_TYPE_INTMAX_T |
1052 | AC_TYPE_UINTMAX_T | |
1053 | ||
a7ad477f CR |
1054 | AC_CHECK_SIZEOF(intmax_t, 8) |
1055 | ||
1056 | dnl presence and contents of structures used by system calls | |
1057 | BASH_STRUCT_TERMIOS_LDISC | |
1058 | BASH_STRUCT_TERMIO_LDISC | |
1059 | BASH_STRUCT_DIRENT_D_INO | |
1060 | BASH_STRUCT_DIRENT_D_FILENO | |
1061 | BASH_STRUCT_DIRENT_D_NAMLEN | |
1062 | BASH_STRUCT_WINSIZE | |
1063 | BASH_STRUCT_TIMEVAL | |
1064 | AC_CHECK_MEMBERS([struct stat.st_blocks]) | |
1065 | AC_STRUCT_TM | |
1066 | AC_STRUCT_TIMEZONE | |
1067 | BASH_STRUCT_TIMEZONE | |
1068 | ||
1069 | BASH_STRUCT_WEXITSTATUS_OFFSET | |
1070 | ||
1071 | BASH_CHECK_TYPE_STRUCT_TIMESPEC | |
1072 | BASH_STAT_TIME | |
1073 | ||
216e2e9b CR |
1074 | dnl checks for system calls |
1075 | BASH_FUNC_SBRK | |
55a224da | 1076 | BASH_FUNC_BRK |
216e2e9b | 1077 | |
a7ad477f CR |
1078 | dnl presence and behavior of C library functions |
1079 | BASH_FUNC_STRSIGNAL | |
1080 | BASH_FUNC_OPENDIR_CHECK | |
1081 | BASH_FUNC_ULIMIT_MAXFDS | |
1082 | BASH_FUNC_FPURGE | |
1083 | BASH_FUNC_GETENV | |
1084 | if test "$ac_cv_func_getcwd" = "yes"; then | |
1085 | BASH_FUNC_GETCWD | |
1086 | fi | |
50ffbc9d CR |
1087 | dnl either way this is correct |
1088 | AC_DEFINE([HAVE_GETCWD]) | |
a7ad477f CR |
1089 | BASH_FUNC_POSIX_SETJMP |
1090 | BASH_FUNC_STRCOLL | |
1091 | BASH_FUNC_SNPRINTF | |
1092 | BASH_FUNC_VSNPRINTF | |
1093 | ||
3be2a2ca CR |
1094 | BASH_FUNC_STRTOIMAX |
1095 | ||
a7ad477f CR |
1096 | dnl If putenv or unsetenv is not present, set the right define so the |
1097 | dnl prototype and declaration in lib/sh/getenv.c will be standard-conformant | |
1098 | ||
1099 | if test "$ac_cv_func_putenv" = "yes"; then | |
1100 | BASH_FUNC_STD_PUTENV | |
1101 | else | |
1102 | AC_DEFINE(HAVE_STD_PUTENV) | |
1103 | fi | |
1104 | if test "$ac_cv_func_unsetenv" = "yes"; then | |
1105 | BASH_FUNC_STD_UNSETENV | |
1106 | else | |
1107 | AC_DEFINE(HAVE_STD_UNSETENV) | |
1108 | fi | |
1109 | ||
1110 | BASH_FUNC_PRINTF_A_FORMAT | |
1111 | ||
3669b0ba CR |
1112 | BASH_FUNC_FNMATCH_EQUIV_FALLBACK |
1113 | ||
a7ad477f CR |
1114 | dnl presence and behavior of OS functions |
1115 | BASH_SYS_REINSTALL_SIGHANDLERS | |
1116 | BASH_SYS_JOB_CONTROL_MISSING | |
1117 | BASH_SYS_NAMED_PIPES | |
1118 | ||
1119 | dnl presence of certain CPP defines | |
1120 | AC_HEADER_TIOCGWINSZ | |
1121 | BASH_HAVE_TIOCSTAT | |
1122 | BASH_HAVE_FIONREAD | |
1123 | ||
1124 | BASH_CHECK_WCONTINUED | |
1125 | ||
1126 | dnl miscellaneous | |
1127 | BASH_CHECK_SPEED_T | |
1128 | BASH_CHECK_GETPW_FUNCS | |
1129 | BASH_CHECK_RTSIGS | |
1130 | BASH_CHECK_SYS_SIGLIST | |
1131 | ||
1132 | dnl special checks | |
1133 | case "$host_os" in | |
1134 | hpux*) BASH_CHECK_KERNEL_RLIMIT ;; | |
1135 | esac | |
1136 | ||
1137 | if test "$opt_readline" = yes; then | |
1138 | dnl yuck | |
1139 | case "$host_os" in | |
1140 | aix*) prefer_curses=yes ;; | |
1141 | esac | |
1142 | BASH_CHECK_LIB_TERMCAP | |
1143 | fi | |
1144 | AC_SUBST(TERMCAP_LIB) | |
1145 | AC_SUBST(TERMCAP_DEP) | |
1146 | ||
1147 | BASH_CHECK_DEV_FD | |
1148 | BASH_CHECK_DEV_STDIN | |
1149 | BASH_SYS_DEFAULT_MAIL_DIR | |
1150 | ||
1151 | if test "$bash_cv_job_control_missing" = missing; then | |
1152 | opt_job_control=no | |
1153 | fi | |
1154 | ||
1155 | if test "$opt_job_control" = yes; then | |
1156 | AC_DEFINE(JOB_CONTROL) | |
1157 | JOBS_O=jobs.o | |
1158 | else | |
1159 | JOBS_O=nojobs.o | |
1160 | fi | |
1161 | ||
1162 | AC_SUBST(JOBS_O) | |
1163 | ||
1164 | dnl Defines that we want to propagate to the Makefiles in subdirectories, | |
1165 | dnl like glob and readline | |
1166 | ||
1167 | LOCAL_DEFS=-DSHELL | |
1168 | ||
1169 | dnl use this section to possibly define more cpp variables, specify local | |
1170 | dnl libraries, and specify any additional local cc or ld flags | |
1171 | dnl | |
d37a4722 | 1172 | dnl most of these are really old; this should really go away someday |
a7ad477f CR |
1173 | |
1174 | case "${host_os}" in | |
1175 | sysv4.2*) AC_DEFINE(SVR4_2) | |
1176 | AC_DEFINE(SVR4) ;; | |
1177 | sysv4*) AC_DEFINE(SVR4) ;; | |
1178 | sysv5*) AC_DEFINE(SVR5) ;; | |
969496e5 CR |
1179 | hpux9*) LOCAL_CFLAGS="-DHPUX9 -DHPUX -DTGETENT_BROKEN -DTGETFLAG_BROKEN" ;; |
1180 | hpux*) LOCAL_CFLAGS="-DHPUX -DTGETENT_BROKEN -DTGETFLAG_BROKEN" ;; | |
a7ad477f CR |
1181 | dgux*) LOCAL_CFLAGS=-D_DGUX_SOURCE; LOCAL_LIBS=-ldgc ;; |
1182 | isc*) LOCAL_CFLAGS=-Disc386 ;; | |
1183 | rhapsody*) LOCAL_CFLAGS=-DRHAPSODY ;; | |
1184 | darwin*) LOCAL_CFLAGS=-DMACOSX ;; | |
1185 | sco3.2v5*) LOCAL_CFLAGS="-b elf -DWAITPID_BROKEN -DPATH_MAX=1024" ;; | |
1186 | sco3.2v4*) LOCAL_CFLAGS="-DMUST_UNBLOCK_CHLD -DPATH_MAX=1024" ;; | |
1187 | sco3.2*) LOCAL_CFLAGS=-DMUST_UNBLOCK_CHLD ;; | |
1188 | sunos4*) LOCAL_CFLAGS=-DSunOS4 ;; | |
1189 | solaris2.5*) LOCAL_CFLAGS="-DSunOS5 -DSOLARIS" ;; | |
1190 | solaris2.8*) LOCAL_CFLAGS=-DSOLARIS ;; | |
1191 | solaris2.9*) LOCAL_CFLAGS=-DSOLARIS ;; | |
1192 | solaris2.10*) LOCAL_CFLAGS=-DSOLARIS ;; | |
1193 | solaris2*) LOCAL_CFLAGS=-DSOLARIS ;; | |
1194 | lynxos*) LOCAL_CFLAGS=-DRECYCLES_PIDS ;; | |
1195 | linux*) LOCAL_LDFLAGS=-rdynamic # allow dynamic loading | |
1196 | case "`uname -r`" in | |
e297b059 CR |
1197 | 1.*|2.[[0123]]*) : ;; |
1198 | *) AC_DEFINE(PGRP_PIPE) ;; | |
a7ad477f | 1199 | esac ;; |
9282e182 | 1200 | netbsd*|openbsd*) LOCAL_CFLAGS="-DDEV_FD_STAT_BROKEN" ;; |
e58dc557 | 1201 | freebsd*|midnightbsd*) LOCAL_CFLAGS='-DHEREDOC_PIPESIZE=4096' ;; |
89149ec0 | 1202 | *qnx[[67]]*) LOCAL_LIBS="-lncurses" ;; |
a7ad477f CR |
1203 | *qnx*) LOCAL_CFLAGS="-Dqnx -F -3s" LOCAL_LDFLAGS="-3s" LOCAL_LIBS="-lunix -lncurses" ;; |
1204 | powerux*) LOCAL_LIBS="-lgen" ;; | |
1205 | cygwin*) LOCAL_CFLAGS=-DRECYCLES_PIDS ;; | |
1206 | opennt*|interix*) LOCAL_CFLAGS="-DNO_MAIN_ENV_ARG -DBROKEN_DIRENT_D_INO -D_POSIX_SOURCE -D_ALL_SOURCE -DRECYCLES_PIDS" ;; | |
10e78433 | 1207 | *openstep*) LOCAL_CFLAGS="-D__APPLE_CC__" ;; |
a7ad477f CR |
1208 | esac |
1209 | ||
1210 | dnl Stanza for OS/compiler pair-specific flags | |
1211 | case "${host_os}-${CC}" in | |
1212 | aix4.2*-*gcc*) LOCAL_LDFLAGS="-Xlinker -bexpall -Xlinker -brtl" ;; | |
1213 | aix4.2*) LOCAL_LDFLAGS="-bexpall -brtl" ;; | |
1214 | bsdi4*-*gcc*) LOCAL_LDFLAGS="-rdynamic" ;; # allow dynamic loading, like Linux | |
f542be5d CR |
1215 | bsdi5*-*gcc*) LOCAL_LDFLAGS="-rdynamic" ;; # allow dynamic loading, like Linux |
1216 | hpux11*-gcc*) LOCAL_LDFLAGS="-Wl,-E" ;; # allow dynamic loading | |
a7ad477f CR |
1217 | esac |
1218 | ||
1219 | dnl FreeBSD-3.x can have either a.out or ELF | |
1220 | case "${host_os}" in | |
1221 | freebsd[[3-9]]*) | |
1222 | if test -x /usr/bin/objformat && test "`/usr/bin/objformat`" = "elf" ; then | |
1223 | LOCAL_LDFLAGS=-rdynamic # allow dynamic loading | |
1224 | fi ;; | |
49918d90 CR |
1225 | freebsd*) LOCAL_LDFLAGS=-rdynamic ;; # allow dynamic loading |
1226 | openbsd*) LOCAL_LDFLAGS=-rdynamic ;; # allow dynamic loading | |
1227 | netbsd*) LOCAL_LDFLAGS=-rdynamic ;; # allow dynamic loading | |
a7ad477f | 1228 | dragonfly*) LOCAL_LDFLAGS=-rdynamic ;; # allow dynamic loading |
e58dc557 | 1229 | midnightbsd*) LOCAL_LDFLAGS=-rdynamic ;; # allow dynamic loading |
a7ad477f CR |
1230 | esac |
1231 | ||
1232 | case "$host_cpu" in | |
1233 | *cray*) LOCAL_CFLAGS="-DCRAY" ;; # shell var so config.h can use it | |
1234 | esac | |
1235 | ||
1236 | case "$host_cpu-$host_os" in | |
1237 | ibmrt-*bsd4*) LOCAL_CFLAGS="-ma -U__STDC__" ;; | |
1238 | esac | |
1239 | ||
1240 | case "$host_cpu-$host_vendor-$host_os" in | |
1241 | m88k-motorola-sysv3) LOCAL_CFLAGS=-DWAITPID_BROKEN ;; | |
1242 | mips-pyramid-sysv4) LOCAL_CFLAGS=-Xa ;; | |
1243 | esac | |
1244 | ||
9d80be9a | 1245 | # turn off paren warnings in gcc |
5a0e5b7b | 1246 | #CFLAGS="$CFLAGS ${STYLE_CFLAGS}" |
9d80be9a | 1247 | |
a7ad477f CR |
1248 | # |
1249 | # Shared object configuration section. These values are generated by | |
1250 | # ${srcdir}/support/shobj-conf | |
1251 | # | |
1252 | if test "$ac_cv_func_dlopen" = "yes" && test -f ${srcdir}/support/shobj-conf | |
1253 | then | |
1254 | AC_MSG_CHECKING(shared object configuration for loadable builtins) | |
1255 | eval `${CONFIG_SHELL-/bin/sh} ${srcdir}/support/shobj-conf -C "${CC}" -c "${host_cpu}" -o "${host_os}" -v "${host_vendor}"` | |
1256 | AC_SUBST(SHOBJ_CC) | |
1257 | AC_SUBST(SHOBJ_CFLAGS) | |
1258 | AC_SUBST(SHOBJ_LD) | |
1259 | AC_SUBST(SHOBJ_LDFLAGS) | |
1260 | AC_SUBST(SHOBJ_XLDFLAGS) | |
1261 | AC_SUBST(SHOBJ_LIBS) | |
1262 | AC_SUBST(SHOBJ_STATUS) | |
1263 | AC_MSG_RESULT($SHOBJ_STATUS) | |
ff293129 CR |
1264 | else |
1265 | SHOBJ_STATUS=unsupported | |
1266 | AC_SUBST(SHOBJ_STATUS) | |
a7ad477f CR |
1267 | fi |
1268 | ||
1269 | # try to create a directory tree if the source is elsewhere | |
1270 | # this should be packaged into a script accessible via ${srcdir}/support | |
1271 | case "$srcdir" in | |
1272 | .) ;; | |
1273 | *) for d in doc tests support lib examples; do # dirs | |
1274 | test -d $d || mkdir $d | |
1275 | done | |
1276 | for ld in readline glob tilde malloc sh termcap; do # libdirs | |
1277 | test -d lib/$ld || mkdir lib/$ld | |
1278 | done | |
1279 | test -d examples/loadables || mkdir examples/loadables # loadable builtins | |
1280 | test -d examples/loadables/perl || mkdir examples/loadables/perl | |
1281 | ;; | |
1282 | esac | |
1283 | ||
1284 | BUILD_DIR=`pwd` | |
1285 | case "$BUILD_DIR" in | |
1286 | *\ *) BUILD_DIR=`echo "$BUILD_DIR" | sed 's: :\\\\ :g'` ;; | |
1287 | *) ;; | |
1288 | esac | |
1289 | ||
1290 | if test -z "$localedir"; then | |
1291 | localedir='${datarootdir}/locale' | |
1292 | fi | |
1293 | if test -z "$datarootdir"; then | |
1294 | datarootdir='${prefix}/share' | |
1295 | fi | |
1296 | ||
1297 | AC_SUBST(PROFILE_FLAGS) | |
1298 | ||
1299 | AC_SUBST(incdir) | |
1300 | AC_SUBST(BUILD_DIR) | |
1301 | ||
1302 | # Some versions of autoconf don't substitute these automatically | |
1303 | AC_SUBST(datarootdir) | |
1304 | AC_SUBST(localedir) | |
1305 | ||
f2d7e1a3 CR |
1306 | # directory where we install dynamically loadable builtins |
1307 | if test -z "$loadablesdir"; then | |
1308 | loadablesdir='${libdir}/bash' | |
1309 | fi | |
1310 | AC_SUBST(loadablesdir) | |
4eb81d59 CR |
1311 | if test -z "$headersdir"; then |
1312 | headersdir='$(includedir)/$(PACKAGE_NAME)' | |
1313 | fi | |
1314 | AC_SUBST(headersdir) | |
f2d7e1a3 | 1315 | |
a7ad477f CR |
1316 | AC_SUBST(YACC) |
1317 | AC_SUBST(AR) | |
1318 | AC_SUBST(ARFLAGS) | |
1319 | ||
1320 | AC_SUBST(BASHVERS) | |
1321 | AC_SUBST(RELSTATUS) | |
1322 | AC_SUBST(DEBUG) | |
1323 | AC_SUBST(MALLOC_DEBUG) | |
1324 | ||
1325 | AC_SUBST(host_cpu) | |
1326 | AC_SUBST(host_vendor) | |
1327 | AC_SUBST(host_os) | |
1328 | ||
1329 | AC_SUBST(LOCAL_LIBS) | |
1330 | AC_SUBST(LOCAL_CFLAGS) | |
1331 | AC_SUBST(LOCAL_LDFLAGS) | |
1332 | AC_SUBST(LOCAL_DEFS) | |
1333 | ||
1334 | #AC_SUBST(ALLOCA_SOURCE) | |
1335 | #AC_SUBST(ALLOCA_OBJECT) | |
1336 | ||
a67031fe CR |
1337 | AC_CONFIG_FILES([Makefile builtins/Makefile lib/readline/Makefile \ |
1338 | lib/glob/Makefile lib/intl/Makefile \ | |
1339 | lib/malloc/Makefile lib/sh/Makefile lib/termcap/Makefile \ | |
1340 | lib/tilde/Makefile doc/Makefile support/Makefile \ | |
1341 | po/Makefile.in examples/loadables/Makefile \ | |
1342 | examples/loadables/Makefile.inc \ | |
f9ed510a | 1343 | examples/loadables/Makefile.sample \ |
a67031fe CR |
1344 | examples/loadables/perl/Makefile \ |
1345 | support/bash.pc support/bashbug.sh]) | |
1346 | ||
1347 | dnl Makefile uses this timestamp file to record whether config.h is up to date. | |
1348 | AC_CONFIG_COMMANDS([stamp-h], [echo timestamp > stamp-h]) | |
1349 | ||
1350 | AC_OUTPUT |