forked from bminor/bash
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
576 lines (496 loc) · 23.9 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
dnl
dnl Configure script for bash-5.2
dnl
dnl report bugs to jake.hamby@gmail.com
dnl
dnl Process this file with autoconf to produce a configure script.
# Copyright (C) 1987-2022 Free Software Foundation, Inc.
# Copyright 2022, Jake Hamby.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
AC_REVISION([for Bash 5.2, version 5.046])dnl
define(bashvers, 5.2)
define(relstatus, dev)
dnl make sure we are using a recent autoconf version
AC_PREREQ([2.69])
AC_CONFIG_SRCDIR(shell.cc)
dnl where to find install.sh, config.sub, and config.guess
AC_CONFIG_AUX_DIR(support)
AC_CONFIG_HEADERS(config.h)
AC_CONFIG_MACRO_DIRS([m4])
AC_INIT([bash],[bashvers-relstatus],[jake.hamby@gmail.com])
AM_INIT_AUTOMAKE([subdir-objects])
dnl checks for version info
BASHVERS=bashvers
RELSTATUS=relstatus
dnl defaults for debug settings
case "$RELSTATUS" in
alp*|bet*|dev*|rc*|releng*|maint*) opt_debug=yes ;;
*) opt_debug=no ;;
esac
dnl configure defaults
opt_curses=no
opt_with_posix_spawn=no
dnl
dnl macros for the bash debugger
dnl
dnl AM_PATH_LISPDIR
AC_ARG_VAR(DEBUGGER_START_FILE, [location of bash debugger initialization file])
dnl arguments to configure
dnl packages
AC_ARG_WITH(curses, AS_HELP_STRING([--with-curses],[use the curses library instead of the termcap library]), opt_curses=$withval)
if test "$opt_curses" = yes; then
prefer_curses=yes
fi
if test -z "${DEBUGGER_START_FILE}"; then
DEBUGGER_START_FILE='${datadir}/bashdb/bashdb-main.inc'
fi
dnl optional shell features in config.h.in
opt_minimal_config=no
opt_job_control=yes
opt_alias=yes
opt_readline=yes
opt_history=yes
opt_bang_history=yes
opt_dirstack=yes
opt_restricted=yes
opt_process_subst=yes
opt_prompt_decoding=yes
opt_select=yes
opt_help=yes
opt_array_variables=yes
opt_dparen_arith=yes
opt_extended_glob=yes
opt_brace_expansion=yes
opt_disabled_builtins=no
opt_command_timing=yes
opt_xpg_echo=no
opt_strict_posix=no
opt_cond_command=yes
opt_cond_regexp=yes
opt_coproc=yes
opt_arith_for_command=yes
opt_net_redirs=yes
opt_progcomp=yes
opt_separate_help=no
opt_multibyte=yes
opt_debugger=yes
opt_single_longdoc_strings=yes
opt_casemod_attrs=yes
opt_casemod_expansions=yes
opt_extglob_default=no
opt_dircomplete_expand_default=no
opt_globascii_default=yes
opt_function_import=yes
opt_dev_fd_stat_broken=no
opt_alt_array_impl=no
opt_translatable_strings=yes
opt_prefer_posix_spawn=yes
dnl modified by alternate array implementation option
dnl ARRAY_O=array.o
dnl options that affect how bash is compiled and linked
opt_static_link=no
opt_profiling=no
dnl argument parsing for optional features
AC_ARG_ENABLE(minimal-config, AS_HELP_STRING([--enable-minimal-config],[a minimal sh-like configuration]), opt_minimal_config=$enableval)
dnl a minimal configuration turns everything off, but features can be
dnl added individually
if test $opt_minimal_config = yes; then
opt_job_control=no opt_alias=no opt_readline=no
opt_history=no opt_bang_history=no opt_dirstack=no
opt_restricted=no opt_process_subst=no opt_prompt_decoding=no
opt_select=no opt_help=no opt_array_variables=no opt_dparen_arith=no
opt_brace_expansion=no opt_disabled_builtins=no opt_command_timing=no
opt_extended_glob=no opt_cond_command=no opt_arith_for_command=no
opt_net_redirs=no opt_progcomp=no opt_separate_help=no
opt_multibyte=yes opt_cond_regexp=no opt_coproc=no
opt_casemod_attrs=no opt_casemod_expansions=no opt_extglob_default=no
opt_translatable_strings=no
opt_globascii_default=yes
fi
AC_ARG_ENABLE(alias, AS_HELP_STRING([--enable-alias],[enable shell aliases]), opt_alias=$enableval)
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)
AC_ARG_ENABLE(arith-for-command, AS_HELP_STRING([--enable-arith-for-command],[enable arithmetic for command]), opt_arith_for_command=$enableval)
AC_ARG_ENABLE(array-variables, AS_HELP_STRING([--enable-array-variables],[include shell array variables]), opt_array_variables=$enableval)
AC_ARG_ENABLE(bang-history, AS_HELP_STRING([--enable-bang-history],[turn on csh-style history substitution]), opt_bang_history=$enableval)
AC_ARG_ENABLE(brace-expansion, AS_HELP_STRING([--enable-brace-expansion],[include brace expansion]), opt_brace_expansion=$enableval)
AC_ARG_ENABLE(casemod-attributes, AS_HELP_STRING([--enable-casemod-attributes],[include case-modifying variable attributes]), opt_casemod_attrs=$enableval)
AC_ARG_ENABLE(casemod-expansions, AS_HELP_STRING([--enable-casemod-expansions],[include case-modifying word expansions]), opt_casemod_expansions=$enableval)
AC_ARG_ENABLE(command-timing, AS_HELP_STRING([--enable-command-timing],[enable the time reserved word and command timing]), opt_command_timing=$enableval)
AC_ARG_ENABLE(cond-command, AS_HELP_STRING([--enable-cond-command],[enable the conditional command]), opt_cond_command=$enableval)
AC_ARG_ENABLE(cond-regexp, AS_HELP_STRING([--enable-cond-regexp],[enable extended regular expression matching in conditional commands]), opt_cond_regexp=$enableval)
AC_ARG_ENABLE(coprocesses, AS_HELP_STRING([--enable-coprocesses],[enable coprocess support and the coproc reserved word]), opt_coproc=$enableval)
AC_ARG_ENABLE(debugger, AS_HELP_STRING([--enable-debugger],[enable support for bash debugger]), opt_debugger=$enableval)
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)
AC_ARG_ENABLE(direxpand-default, AS_HELP_STRING([--enable-direxpand-default],[enable the direxpand shell option by default]), opt_dircomplete_expand_default=$enableval)
AC_ARG_ENABLE(directory-stack, AS_HELP_STRING([--enable-directory-stack],[enable builtins pushd/popd/dirs]), opt_dirstack=$enableval)
AC_ARG_ENABLE(disabled-builtins, AS_HELP_STRING([--enable-disabled-builtins],[allow disabled builtins to still be invoked]), opt_disabled_builtins=$enableval)
AC_ARG_ENABLE(dparen-arithmetic, AS_HELP_STRING([--enable-dparen-arithmetic],[include ((...)) command]), opt_dparen_arith=$enableval)
AC_ARG_ENABLE(extended-glob, AS_HELP_STRING([--enable-extended-glob],[include ksh-style extended pattern matching]), opt_extended_glob=$enableval)
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)
AC_ARG_ENABLE(function-import, AS_HELP_STRING([--enable-function-import],[allow bash to import exported function definitions by default]), opt_function_import=$enableval)
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)
AC_ARG_ENABLE(help-builtin, AS_HELP_STRING([--enable-help-builtin],[include the help builtin]), opt_help=$enableval)
AC_ARG_ENABLE(history, AS_HELP_STRING([--enable-history],[turn on command history]), opt_history=$enableval)
AC_ARG_ENABLE(job-control, AS_HELP_STRING([--enable-job-control],[enable job control features]), opt_job_control=$enableval)
AC_ARG_ENABLE(multibyte, AS_HELP_STRING([--enable-multibyte],[enable multibyte characters if OS supports them]), opt_multibyte=$enableval)
AC_ARG_ENABLE(net-redirections, AS_HELP_STRING([--enable-net-redirections],[enable /dev/tcp/host/port redirection]), opt_net_redirs=$enableval)
AC_ARG_ENABLE(process-substitution, AS_HELP_STRING([--enable-process-substitution],[enable process substitution]), opt_process_subst=$enableval)
AC_ARG_ENABLE(progcomp, AS_HELP_STRING([--enable-progcomp],[enable programmable completion and the complete builtin]), opt_progcomp=$enableval)
AC_ARG_ENABLE(prompt-string-decoding, AS_HELP_STRING([--enable-prompt-string-decoding],[turn on escape character decoding in prompts]), opt_prompt_decoding=$enableval)
AC_ARG_ENABLE(readline, AS_HELP_STRING([--enable-readline],[turn on command line editing]), opt_readline=$enableval)
AC_ARG_ENABLE(restricted, AS_HELP_STRING([--enable-restricted],[enable a restricted shell]), opt_restricted=$enableval)
AC_ARG_ENABLE(select, AS_HELP_STRING([--enable-select],[include select command]), opt_select=$enableval)
AC_ARG_ENABLE(separate-helpfiles, AS_HELP_STRING([--enable-separate-helpfiles],[use external files for help builtin documentation]), opt_separate_help=$enableval)
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)
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)
AC_ARG_ENABLE(translatable-strings, AS_HELP_STRING([--enable-translatable-strings],[include support for $"..." translatable strings]), opt_translatable_strings=$enableval)
AC_ARG_ENABLE(usg-echo-default, AS_HELP_STRING([--enable-usg-echo-default],[a synonym for --enable-xpg-echo-default]), opt_xpg_echo=$enableval)
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)
dnl options that alter how bash is compiled and linked
AC_ARG_ENABLE(profiling, AS_HELP_STRING([--enable-profiling],[allow profiling with gprof]), opt_profiling=$enableval)
AC_ARG_ENABLE(static-link, AS_HELP_STRING([--enable-static-link],[link bash statically, for use as a root shell]), opt_static_link=$enableval)
dnl this is for my future posix_spawn () refactoring work.
AC_ARG_ENABLE(prefer-posix-spawn, AS_HELP_STRING([--enable-prefer-posix-spawn],[prefer posix_spawn or vfork to fork when both are available]), opt_prefer_posix_spawn=$enableval)
dnl So-called `precious' variables
AC_ARG_VAR([CXX_FOR_BUILD], [C++ compiler used when compiling binaries used only at build time])
AC_ARG_VAR([CXXFLAGS_FOR_BUILD], [Compilation options (CXXFLAGS) used when compiling binaries used only at build time])
AC_ARG_VAR([LDFLAGS_FOR_BUILD], [Linker options (LDFLAGS) used when compiling binaries used only at build time])
AC_ARG_VAR([CPPFLAGS_FOR_BUILD], [C preprocessor options (CPPFLAGS) used when compiling binaries used only at build time])
dnl opt_job_control is handled later, after BASH_JOB_CONTROL_MISSING runs
dnl opt_readline and opt_history are handled later, because AC_PROG_CC needs
dnl to be run before we can check the version of an already-installed readline
dnl library
if test $opt_alias = yes; then
AC_DEFINE([ALIAS], [1], [Define if you want the alias feature.])
fi
if test $opt_dirstack = yes; then
AC_DEFINE([PUSHD_AND_POPD], [1], [Define if you want pushd, popd, and dirs commands.])
fi
if test $opt_restricted = yes; then
AC_DEFINE([RESTRICTED_SHELL], [1], [Define if you want restricted shell support ("rbash" or the -r flag).])
fi
if test $opt_process_subst = yes; then
AC_DEFINE([PROCESS_SUBSTITUTION], [1], [Define if you want ksh-like process substitution features with "<(file)". Requires FIFO support.])
fi
if test $opt_prompt_decoding = yes; then
AC_DEFINE([PROMPT_STRING_DECODE], [1], [Define if you want to expand backslash-escaped special characters in PS1 and PS2. Variable expansion will still be performed.])
fi
if test $opt_select = yes; then
AC_DEFINE([SELECT_COMMAND], [1], [Define if you want the ksh-style `select' command: select word in word_list; do command_list; done.])
fi
if test $opt_help = yes; then
AC_DEFINE([HELP_BUILTIN], [1], [Define if you want the `help' shell builtin and long documentation strings compiled into the shell.])
fi
if test $opt_array_variables = yes; then
AC_DEFINE([ARRAY_VARS], [1], [Define if you want ksh-style one-dimensional array variables.])
fi
if test $opt_dparen_arith = yes; then
AC_DEFINE([DPAREN_ARITHMETIC], [1], [Define if you want the ksh-style ((...)) arithmetic evaluation command.])
fi
if test $opt_brace_expansion = yes; then
AC_DEFINE([BRACE_EXPANSION], [1], [Define if you want csh-style curly brace expansion: foo{a,b} -> fooa foob. This feature can be turned off at shell startup with `-nobraceexpansion', or during execution with `set +o braceexpand'.])
fi
if test $opt_disabled_builtins = yes; then
AC_DEFINE([DISABLED_BUILTINS], [1], [Define if you want "builtin foo" to always run the shell builtin "foo", even if it has been disabled with "enable -n foo".])
fi
if test $opt_command_timing = yes; then
AC_DEFINE([COMMAND_TIMING], [1], [Define if you want the ksh-style `time' reserved word and the ability to time pipelines, functions, and builtins.])
fi
if test $opt_xpg_echo = yes ; then
AC_DEFINE([DEFAULT_ECHO_TO_XPG], [1], [Define if you want the echo builtin to interpret the backslash-escape characters by default, like the XPG Single Unix Spec V2 for echo. This requires V9_ECHO to be defined.])
fi
if test $opt_strict_posix = yes; then
AC_DEFINE([STRICT_POSIX], [1], [Define if you want bash to be strictly POSIX.2 conformant by default (except for echo, which is controlled separately).])
fi
if test $opt_extended_glob = yes ; then
AC_DEFINE([EXTENDED_GLOB], [1], [Define if you want ksh-style [*+@?!](patlist) extended pattern matching.])
fi
if test $opt_extglob_default = yes; then
AC_DEFINE([EXTGLOB_DEFAULT], [1], [Define to the value you'd like the extglob shell option to have by default.])
else
AC_DEFINE([EXTGLOB_DEFAULT], [0], [Define to the value you'd like the extglob shell option to have by default.])
fi
if test $opt_cond_command = yes ; then
AC_DEFINE([COND_COMMAND], [1], [Define if you want the ksh-style [[...]] conditional command.])
fi
if test $opt_cond_regexp = yes ; then
AC_DEFINE([COND_REGEXP], [1], [Define if you want extended regular expression matching and the =~ binary operator in the [[..]] conditional command.])
fi
if test $opt_coproc = yes; then
AC_DEFINE([COPROCESS_SUPPORT], [1], [Define if you want support for ksh-like coprocesses and the `coproc' reserved word.])
fi
if test $opt_arith_for_command = yes; then
AC_DEFINE([ARITH_FOR_COMMAND], [1], [Define if you want the ksh93-style for (( init; test; step )) do list; done arithmetic for command.])
fi
if test $opt_net_redirs = yes; then
AC_DEFINE([NETWORK_REDIRECTIONS], [1], [Define if you want /dev/(tcp|udp)/host/port to open socket connections when used in redirections.])
fi
if test $opt_progcomp = yes; then
AC_DEFINE([PROGRAMMABLE_COMPLETION], [1], [Define for the programmable completion features and the complete builtin.])
fi
if test $opt_multibyte = yes; then
AC_DEFINE([HANDLE_MULTIBYTE], [1], [Define to compile in support for multibyte characters, or undefine to remove this support.])
fi
if test $opt_debugger = yes; then
AC_DEFINE([DEBUGGER], [1], [Define if you want to compile in some features used only by the bash debugger.])
fi
if test $opt_casemod_attrs = yes; then
AC_DEFINE([CASEMOD_ATTRS], [1], [Define for case-modifying variable attributes; variables modified on assignment.])
fi
if test $opt_casemod_expansions = yes; then
AC_DEFINE([CASEMOD_EXPANSIONS], [1], [Define for case-modifying word expansions.])
fi
if test $opt_dircomplete_expand_default = yes; then
AC_DEFINE([DIRCOMPLETE_EXPAND_DEFAULT], [1], [Define to make the `direxpand' shopt option enabled by default.])
fi
if test $opt_globascii_default = yes; then
AC_DEFINE([GLOBASCII_DEFAULT], [1], [Define to 1 to make the `globasciiranges' shopt option enabled by default.])
else
AC_DEFINE([GLOBASCII_DEFAULT], [0], [Define to 1 to make the `globasciiranges' shopt option enabled by default.])
fi
if test $opt_function_import = yes; then
AC_DEFINE([FUNCTION_IMPORT], [1], [Define to allow functions to be imported from the environment.])
fi
if test $opt_dev_fd_stat_broken = yes; then
AC_DEFINE([DEV_FD_STAT_BROKEN], [1], [Define if stat on /dev/fd/N and fstat on file descriptor N don't return the same results.])
fi
if test $opt_alt_array_impl = yes; then
AC_DEFINE(ALT_ARRAY_IMPLEMENTATION, [1], [An array implementation that prioritizes speed (O(1) access) over space, in array2.cc.])
fi
if test $opt_translatable_strings = yes; then
AC_DEFINE([TRANSLATABLE_STRINGS], [1], [Support for $"..." translatable strings.])
fi
if test $opt_prefer_posix_spawn = yes; then
AC_DEFINE([PREFER_POSIX_SPAWN], [1], [Define to prefer posix_spawn or vfork to fork when both are available.])
fi
if test $opt_debug = yes; then
AC_DEFINE([DEBUG], [1], [Define for extra debugging checks (enabled for non-release builds).])
fi
if test "$opt_minimal_config" = yes; then
TESTSCRIPT=run-minimal
else
TESTSCRIPT=run-all
fi
HELPDIR= HELPDIRDEFINE= HELPINSTALL= HELPFILES_TARGET=
if test "$opt_separate_help" != no; then
if test "$opt_separate_help" = "yes" ; then
HELPDIR='${datadir}/bash/helpfiles'
else
HELPDIR=$opt_separate_help
fi
HELPDIRDEFINE='-H ${HELPDIR}'
HELPINSTALL='install-help'
HELPFILES_TARGET='helpdoc'
fi
HELPSTRINGS=
if test "$opt_single_longdoc_strings" != "yes"; then
HELPSTRINGS='-S'
fi
dnl now substitute in the values generated by arguments
AC_SUBST(TESTSCRIPT)
AC_SUBST(HELPDIR)
AC_SUBST(HELPDIRDEFINE)
AC_SUBST(HELPINSTALL)
AC_SUBST(HELPFILES_TARGET)
AC_SUBST(HELPSTRINGS)
AC_USE_SYSTEM_EXTENSIONS
# Checks for programs.
AC_PROG_CC
gl_EARLY
AC_PROG_CXX
AC_PROG_YACC
dnl initialize libtool
LT_INIT
echo ""
echo "Beginning configuration for bash-$BASHVERS-$RELSTATUS for ${build_cpu}-${build_vendor}-${build_os}"
echo ""
AC_SYS_LARGEFILE
if test $opt_readline = yes; then
AC_DEFINE([READLINE], [1], [Define to get the nifty/glitzy editing features. This is on by default. You can turn it off interactively with the -nolineediting flag.])
fi
if test $opt_history = yes || test $opt_bang_history = yes; then
if test $opt_history = yes; then
AC_DEFINE([HISTORY], [1], [Define if you want to have access to previously typed commands. If both HISTORY and READLINE are defined, you can manipulate the history with line editing commands. If only HISTORY is defined, the `fc' and `history' builtins are available.])
fi
if test $opt_bang_history = yes; then
AC_DEFINE([BANG_HISTORY], [1], [Define if you want csh-style "!" history expansion. This is unrelated to READLINE.])
fi
fi
case "$ac_cv_prog_YACC" in
*bison*) ;;
*) AC_MSG_WARN([bison not available; needed to process parse.yy]) ;;
esac
dnl include custom bash rules, moved from aclocal.m4.
m4_include([m4/bash-rules.m4])
dnl Turn on any extensions available in the GNU C library.
AC_DEFINE([_GNU_SOURCE], [1], [Enable any available GNU C library extensions.])
dnl initialize GNU gettext
AM_ICONV
AM_GNU_GETTEXT([external], [need-ngettext], [intl])
AM_GNU_GETTEXT_VERSION([0.21])
# Check if we need to include TCP/IP libraries.
BASH_LIB_SOCKET
BASH_LIB_NSL
# Checks for header files.
AC_FUNC_ALLOCA
AC_HEADER_MAJOR
AC_CHECK_HEADERS([grp.h langinfo.h mbstr.h netdb.h pwd.h regex.h wchar.h wctype.h \
sys/dir.h sys/file.h sys/ioctl.h sys/ndir.h sys/param.h \
sys/resource.h sys/wait.h syslog.h termios.h])
gl_INIT
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_UID_T
AC_TYPE_MODE_T
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_CHECK_MEMBERS([struct stat.st_blksize])
AC_STRUCT_ST_BLOCKS
AC_CHECK_MEMBERS([struct stat.st_rdev])
AC_CHECK_DECLS([sys_siglist])
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_TYPE_UINT8_T
AC_TYPE_INT32_T
AC_TYPE_INT64_T
# Checks for library functions.
AC_FUNC_CHOWN
AC_FUNC_FORK
AC_FUNC_GETGROUPS
AC_FUNC_MMAP
AC_FUNC_STRCOLL
AC_CHECK_FUNCS([arc4random asprintf bcopy confstr dprintf dup2 eaccess faccessat fchdir ftruncate \
getaddrinfo getcwd getdtablesize fnmatch getentropy getgroups gethostbyname \
gethostname getpeername getpwent getpwnam getpwuid \
getrandom getrlimit getrusage getservbyname getservent gettimeofday group_member \
iswlower iswupper towlower towupper iswctype kill killpg locale_charset \
localeconv localtime_r lstat mbrlen mbrtowc mbschr mbsnrtowcs mkdir mkdtemp \
mkfifo mknod mkstemp mmap nl_langinfo pathconf pselect putenv random \
readlink regcomp regexec rename select setdtablesize setenv setitimer \
setlocale setpgid setregid setresgid setresuid setvbuf socket stpcpy strcasecmp \
strcasestr strchrnul strerror strncasecmp strnlen strsignal sysconf tcgetattr \
times ttyname tzset ulimit uname vfprintf waitpid wcrtomb wcscoll \
wcswidth wctype wcwidth])
dnl checks for the dynamic loading library functions in libc and libdl
if test "$opt_static_link" != yes; then
AC_CHECK_LIB(dl, dlopen)
AC_CHECK_FUNCS(dlopen dlclose dlsym)
fi
dnl system types
AC_TYPE_GETGROUPS
AC_TYPE_OFF_T
AC_TYPE_MODE_T
AC_TYPE_UID_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_UINTPTR_T
AC_CHECK_TYPE(ssize_t, int)
AC_CHECK_TYPE(time_t, long)
AC_CHECK_SIZEOF(char, 1)
AC_CHECK_SIZEOF(short, 2)
AC_CHECK_SIZEOF(int, 4)
AC_CHECK_SIZEOF(long, 4)
AC_CHECK_SIZEOF(char *, 4)
AC_CHECK_SIZEOF(size_t, 4)
AC_CHECK_SIZEOF(double, 8)
AC_CHECK_SIZEOF([long long], 8)
dnl structures
AC_HEADER_STAT
dnl system services
AC_SYS_INTERPRETER
if test $ac_cv_sys_interpreter = yes; then
AC_DEFINE([HAVE_HASH_BANG_EXEC], [1], [Define if the kernel can exec files beginning with #!.])
fi
dnl behavior of system calls and library functions
BASH_SYS_PGRP_SYNC
dnl various system types
AC_CHECK_TYPES([clock_t], [], [], [[#include <sys/times.h>]])
AC_CHECK_TYPES([sigset_t], [], [], [[#include <signal.h>]])
AC_CHECK_TYPES([sig_atomic_t], [], [], [[#include <signal.h>]])
AC_CHECK_TYPES([quad_t])
AC_CHECK_TYPES([intmax_t])
AC_CHECK_TYPES([uintmax_t])
if test "$ac_cv_header_sys_socket_h" = "yes"; then
AC_CHECK_TYPES([socklen_t], [], [], [[#include <sys/socket.h>]])
fi
AC_CHECK_TYPE(quad_t, AC_DEFINE([HAVE_QUAD_T], [1]), [], )
BASH_TYPE_RLIMIT
AC_TYPE_INTMAX_T
AC_TYPE_UINTMAX_T
AC_CHECK_SIZEOF(intmax_t, 8)
dnl presence and contents of structures used by system calls
BASH_STRUCT_TERMIOS_LDISC
BASH_STRUCT_DIRENT_D_INO
BASH_STRUCT_DIRENT_D_FILENO
BASH_STRUCT_DIRENT_D_NAMLEN
BASH_STRUCT_WINSIZE
BASH_STRUCT_TIMEVAL
BASH_STRUCT_TIMEZONE
BASH_STRUCT_WEXITSTATUS_OFFSET
dnl presence and behavior of C library functions
BASH_FUNC_ULIMIT_MAXFDS
BASH_FUNC_GETENV
BASH_FUNC_STRCOLL
dnl presence and behavior of OS functions
BASH_SYS_JOB_CONTROL_MISSING
BASH_SYS_NAMED_PIPES
dnl presence of certain CPP defines
AC_HEADER_TIOCGWINSZ
BASH_HAVE_TIOCSTAT
BASH_HAVE_FIONREAD
BASH_CHECK_WCONTINUED
dnl miscellaneous
BASH_CHECK_SPEED_T
BASH_CHECK_GETPW_FUNCS
BASH_CHECK_RTSIGS
dnl special checks
case "$host_os" in
hpux*) BASH_CHECK_KERNEL_RLIMIT ;;
esac
if test "$opt_readline" = yes; then
dnl yuck
case "$host_os" in
aix*) prefer_curses=yes ;;
esac
BASH_CHECK_LIB_TERMCAP
fi
AC_SUBST(TERMCAP_LIB)
AC_SUBST(TERMCAP_DEP)
BASH_CHECK_DEV_FD
BASH_CHECK_DEV_STDIN
BASH_SYS_DEFAULT_MAIL_DIR
if test "$bash_cv_job_control_missing" = missing; then
opt_job_control=no
fi
if test "$opt_job_control" = yes; then
AC_DEFINE([JOB_CONTROL], [1], [Define if your operating system supports BSD-like job control.])
fi
# compile either jobs.cc or nojobs.cc, depending on this setting.
AM_CONDITIONAL([JOB_CONTROL], [test x$opt_job_control = xyes])
# compile either array.cc or array2.cc, depending on this setting.
AM_CONDITIONAL([ALT_ARRAY_IMPL], [test x$opt_alt_array_impl = xyes])
AC_DEFINE_UNQUOTED([PROGRAM], ["bash"], [The hardcoded program name.])
AC_DEFINE_UNQUOTED([CONF_CPUTYPE], ["$build_cpu"], [The build target CPU name.])
AC_DEFINE_UNQUOTED([CONF_OSTYPE], ["$build_os"], [The build target OS name.])
AC_DEFINE_UNQUOTED([CONF_MACHTYPE], ["$build"], [The build target machine triplet.])
AC_DEFINE_UNQUOTED([CONF_VENDOR], ["$build_vendor"], [The build target vendor name.])
AC_SUBST(BASHVERS)
AC_SUBST(RELSTATUS)
AC_SUBST(build_cpu)
AC_SUBST(build_vendor)
AC_SUBST(build_os)
AC_CONFIG_FILES([Makefile doc/Makefile po/Makefile.in lib/gnulib/Makefile \
pathnames.hh support/bash.pc support/bashbug.sh])
AC_OUTPUT