Add ability to change linker warning messages into errors when reporting executable...
[binutils-gdb.git] / ld / configure.ac
1 dnl Process this file with autoconf to produce a configure script
2 dnl
3 dnl Copyright (C) 2012-2023 Free Software Foundation, Inc.
4 dnl
5 dnl This file is free software; you can redistribute it and/or modify
6 dnl it under the terms of the GNU General Public License as published by
7 dnl the Free Software Foundation; either version 3 of the License, or
8 dnl (at your option) any later version.
9 dnl
10 dnl This program is distributed in the hope that it will be useful,
11 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
12 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 dnl GNU General Public License for more details.
14 dnl
15 dnl You should have received a copy of the GNU General Public License
16 dnl along with this program; see the file COPYING3. If not see
17 dnl <http://www.gnu.org/licenses/>.
18 dnl
19
20 m4_include([../bfd/version.m4])
21 AC_INIT([ld], BFD_VERSION)
22 AC_CONFIG_SRCDIR(ldmain.c)
23
24 AC_CANONICAL_TARGET
25 AC_CANONICAL_BUILD
26
27 AM_INIT_AUTOMAKE
28 AM_SILENT_RULES([yes])
29 AM_MAINTAINER_MODE
30
31 AC_PROG_CC
32 AC_PROG_CXX
33 AC_PROG_GREP
34 AC_GNU_SOURCE
35 AC_USE_SYSTEM_EXTENSIONS
36 AC_PROG_INSTALL
37 PKG_PROG_PKG_CONFIG
38
39 LT_INIT
40 ACX_LARGEFILE
41
42 ac_checking=
43 . ${srcdir}/../bfd/development.sh
44 test "$development" = true && ac_checking=yes
45 AC_ARG_ENABLE(checking,
46 [ --enable-checking enable run-time checks],
47 [case "${enableval}" in
48 no|none) ac_checking= ;;
49 *) ac_checking=yes ;;
50 esac])dnl
51 if test x$ac_checking != x ; then
52 AC_DEFINE(ENABLE_CHECKING, 1, [Define if you want run-time sanity checks.])
53 fi
54
55 AC_ARG_WITH(lib-path, [ --with-lib-path=dir1:dir2... set default LIB_PATH],LIB_PATH=$withval)
56 AC_ARG_ENABLE(targets,
57 [ --enable-targets alternative target configurations],
58 [case "${enableval}" in
59 yes | "") AC_MSG_ERROR(enable-targets option must specify target names or 'all')
60 ;;
61 no) enable_targets= ;;
62 *) enable_targets=$enableval ;;
63 esac])dnl
64
65 BFD_64_BIT
66
67 AC_ARG_WITH(sysroot,
68 [ --with-sysroot[=DIR] Search for usr/lib et al within DIR.],
69 [
70 case ${with_sysroot} in
71 yes) TARGET_SYSTEM_ROOT='${exec_prefix}/${target_alias}/sys-root' ;;
72 *) TARGET_SYSTEM_ROOT=$with_sysroot ;;
73 esac
74
75 TARGET_SYSTEM_ROOT_DEFINE='-DTARGET_SYSTEM_ROOT=\"$(TARGET_SYSTEM_ROOT)\"'
76 use_sysroot=yes
77
78 if test "x$prefix" = xNONE; then
79 test_prefix=/usr/local
80 else
81 test_prefix=$prefix
82 fi
83 if test "x$exec_prefix" = xNONE; then
84 test_exec_prefix=$test_prefix
85 else
86 test_exec_prefix=$exec_prefix
87 fi
88 case ${TARGET_SYSTEM_ROOT} in
89 "${test_prefix}"|"${test_prefix}/"*|\
90 "${test_exec_prefix}"|"${test_exec_prefix}/"*|\
91 '${prefix}'|'${prefix}/'*|\
92 '${exec_prefix}'|'${exec_prefix}/'*)
93 t="$TARGET_SYSTEM_ROOT_DEFINE -DTARGET_SYSTEM_ROOT_RELOCATABLE"
94 TARGET_SYSTEM_ROOT_DEFINE="$t"
95 ;;
96 esac
97 ], [
98 use_sysroot=no
99 TARGET_SYSTEM_ROOT=
100 TARGET_SYSTEM_ROOT_DEFINE='-DTARGET_SYSTEM_ROOT=\"\"'
101 ])
102 AC_SUBST(use_sysroot)
103 AC_SUBST(TARGET_SYSTEM_ROOT)
104 AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE)
105
106 dnl Use --enable-gold to decide if this linker should be the default.
107 dnl "install_as_default" is set to false if gold is the default linker.
108 dnl "installed_linker" is the installed BFD linker name.
109 AC_ARG_ENABLE(gold,
110 [[ --enable-gold[=ARG] build gold [ARG={default,yes,no}]]],
111 [case "${enableval}" in
112 default)
113 install_as_default=no
114 installed_linker=ld.bfd
115 ;;
116 yes|no)
117 install_as_default=yes
118 installed_linker=ld.bfd
119 ;;
120 *)
121 AC_MSG_ERROR([invalid --enable-gold argument])
122 ;;
123 esac],
124 [install_as_default=yes
125 installed_linker=ld.bfd])
126 AC_SUBST(install_as_default)
127 AC_SUBST(installed_linker)
128
129 AC_ARG_ENABLE([got],
130 AS_HELP_STRING([--enable-got=<type>],
131 [GOT handling scheme (target, single, negative, multigot)]),
132 [case "${enableval}" in
133 target | single | negative | multigot) got_handling=$enableval ;;
134 *) AC_MSG_ERROR(bad value ${enableval} for --enable-got option) ;;
135 esac],
136 [got_handling=target])
137
138 case "${got_handling}" in
139 target)
140 AC_DEFINE([GOT_HANDLING_DEFAULT], [GOT_HANDLING_TARGET_DEFAULT],
141 [Define to choose default GOT handling scheme]) ;;
142 single)
143 AC_DEFINE([GOT_HANDLING_DEFAULT], [GOT_HANDLING_SINGLE],
144 [Define to choose default GOT handling scheme]) ;;
145 negative)
146 AC_DEFINE([GOT_HANDLING_DEFAULT], [GOT_HANDLING_NEGATIVE],
147 [Define to choose default GOT handling scheme]) ;;
148 multigot)
149 AC_DEFINE([GOT_HANDLING_DEFAULT], [GOT_HANDLING_MULTIGOT],
150 [Define to choose default GOT handling scheme]) ;;
151 *) AC_MSG_ERROR(bad value ${got_handling} for --enable-got option) ;;
152 esac
153
154 # PR gas/19109
155 # Decide the default method for compressing debug sections.
156 ac_default_compressed_debug_sections=unset
157 # Provide a configure time option to override our default.
158 AC_ARG_ENABLE(compressed_debug_sections,
159 AS_HELP_STRING([--enable-compressed-debug-sections={all,ld,none}],
160 [compress debug sections by default])],
161 [case ,"${enableval}", in
162 ,yes, | ,all, | *,ld,*) ac_default_compressed_debug_sections=yes ;;
163 ,no, | ,none,) ac_default_compressed_debug_sections=no ;;
164 esac])dnl
165
166 # Select default compression algorithm.
167 ac_default_compressed_debug_sections_algorithm=COMPRESS_DEBUG_GABI_ZLIB
168 AC_ARG_ENABLE(default_compressed_debug_sections_algorithm,
169 AS_HELP_STRING([--enable-default-compressed-debug-sections-algorithm={zlib,zstd}],
170 [Default compression algorithm for --enable-compressed-debug-sections.]),
171 [case "${enableval}" in
172 zstd) ac_default_compressed_debug_sections_algorithm=COMPRESS_DEBUG_ZSTD ;;
173 esac])dnl
174
175 # Decide setting DT_RUNPATH instead of DT_RPATH by default
176 ac_default_new_dtags=unset
177 # Provide a configure time option to override our default.
178 AC_ARG_ENABLE(new_dtags,
179 AS_HELP_STRING([--enable-new-dtags],
180 [set DT_RUNPATH instead of DT_RPATH by default])],
181 [case "${enableval}" in
182 yes) ac_default_new_dtags=1 ;;
183 no) ac_default_new_dtags=0 ;;
184 esac])dnl
185
186 # Decide if -z relro should be enabled in ELF linker by default.
187 ac_default_ld_z_relro=unset
188 # Provide a configure time option to override our default.
189 AC_ARG_ENABLE(relro,
190 AS_HELP_STRING([--enable-relro],
191 [enable -z relro in ELF linker by default]),
192 [case "${enableval}" in
193 yes) ac_default_ld_z_relro=1 ;;
194 no) ac_default_ld_z_relro=0 ;;
195 esac])dnl
196
197 # Decide if DT_TEXTREL check should be enabled in ELF linker.
198 ac_default_ld_textrel_check=unset
199 AC_ARG_ENABLE([textrel-check],
200 AC_HELP_STRING([--enable-textrel-check=@<:@yes|no|warning|error@:>@],
201 [enable DT_TEXTREL check in ELF linker]),
202 [case "${enableval}" in
203 yes|no|warning|error) ac_default_ld_textrel_check=${enableval} ;;
204 esac])
205
206 # Decide if -z separate-code should be enabled in ELF linker by default.
207 ac_default_ld_z_separate_code=unset
208 AC_ARG_ENABLE(separate-code,
209 AS_HELP_STRING([--enable-separate-code],
210 [enable -z separate-code in ELF linker by default]),
211 [case "${enableval}" in
212 yes) ac_default_ld_z_separate_code=1 ;;
213 no) ac_default_ld_z_separate_code=0 ;;
214 esac])
215
216
217 # By default warn when an executable stack is created due to object files
218 # requesting such, not when the user specifies -z execstack.
219 ac_default_ld_warn_execstack=2
220 AC_ARG_ENABLE(warn-execstack,
221 AS_HELP_STRING([--enable-warn-execstack],
222 [enable warnings when creating an executable stack]),
223 [case "${enableval}" in
224 yes) ac_default_ld_warn_execstack=1 ;;
225 no) ac_default_ld_warn_execstack=0 ;;
226 esac])
227
228 ac_default_ld_error_execstack=0
229 AC_ARG_ENABLE(error-execstack,
230 AS_HELP_STRING([--enable-error-execstack],
231 [turn executable stack warnings into errors]),
232 [case "${enableval}" in
233 yes) ac_default_ld_error_execstack=1 ;;
234 no) ac_default_ld_error_execstack=0 ;;
235 esac])
236
237 ac_default_ld_warn_rwx_segments=unset
238 AC_ARG_ENABLE(warn-rwx-segments,
239 AS_HELP_STRING([--enable-warn-rwx-segments],
240 [enable warnings when creating segments with RWX permissions]),
241 [case "${enableval}" in
242 yes) ac_default_ld_warn_rwx_segments=1 ;;
243 no) ac_default_ld_warn_rwx_segments=0 ;;
244 esac])
245
246 ac_default_ld_error_rwx_segments=0
247 AC_ARG_ENABLE(error-rwx-segments,
248 AS_HELP_STRING([--enable-error-rwx-segments],
249 [turn executable segment warnings into errors]),
250 [case "${enableval}" in
251 yes) ac_default_ld_error_rwx_segments=1 ;;
252 no) ac_default_ld_error_rwx_segments=0 ;;
253 esac])
254
255 ac_default_ld_default_execstack=unset
256 AC_ARG_ENABLE(default-execstack,
257 AS_HELP_STRING([--enable-default-execstack],
258 [create an executable stack if an input file is missing a .note.GNU-stack section]),
259 [case "${enableval}" in
260 yes) ac_default_ld_default_execstack=1 ;;
261 no) ac_default_ld_default_execstack=0 ;;
262 esac])
263
264
265 # Decide if --error-handling-script should be supported.
266 ac_support_error_handling_script=unset
267 AC_ARG_ENABLE(error-handling-script,
268 AS_HELP_STRING([--enable-error-handling-script],
269 [enable/disable support for the --error-handling-script option]),
270 [case "${enableval}" in
271 yes) ac_support_error_handling_script=1 ;;
272 no) ac_support_error_handling_script=0 ;;
273 esac])
274
275 # Decide which "--hash-style" to use by default
276 # Provide a configure time option to override our default.
277 AC_ARG_ENABLE([default-hash-style],
278 AS_HELP_STRING([--enable-default-hash-style={sysv,gnu,both}],
279 [use this default hash style]),
280 [case "${enable_default_hash_style}" in
281 sysv | gnu | both) ;;
282 *) AC_MSG_ERROR([bad value ${enable_default_hash_style} for enable-default-hash-style option]) ;;
283 esac],
284 [case "${target}" in
285 # Enable gnu hash only on GNU targets, but not mips
286 mips*-*-*) enable_default_hash_style=sysv ;;
287 *-*-gnu* | *-*-linux* | *-*-nacl*) enable_default_hash_style=both ;;
288 *) enable_default_hash_style=sysv ;;
289 esac])
290
291 case "${enable_default_hash_style}" in
292 sysv | both) ac_default_emit_sysv_hash=1 ;;
293 *) ac_default_emit_sysv_hash=0 ;;
294 esac
295
296 case "${enable_default_hash_style}" in
297 gnu | both) ac_default_emit_gnu_hash=1 ;;
298 *) ac_default_emit_gnu_hash=0 ;;
299 esac
300
301 AC_ARG_ENABLE(initfini-array,
302 [ --disable-initfini-array do not use .init_array/.fini_array sections],
303 [case "${enableval}" in
304 yes|no) ;;
305 *) AC_MSG_ERROR([invalid --enable-initfini-array argument]) ;;
306 esac], [enable_initfini_array=yes])
307 AC_SUBST(enable_initfini_array)
308 if test $enable_initfini_array = yes; then
309 AC_DEFINE(HAVE_INITFINI_ARRAY, 1,
310 [Define .init_array/.fini_array sections are available and working.])
311 fi
312
313 GCC_ENABLE([libctf], [yes], [], [Handle .ctf type-info sections])
314 if test "${enable_libctf}" = yes; then
315 AC_DEFINE(ENABLE_LIBCTF, 1, [Handle .ctf type-info sections])
316 fi
317 AM_CONDITIONAL(ENABLE_LIBCTF, test "${enable_libctf}" = yes)
318 AC_SUBST(enable_libctf)
319
320 # Used to validate --package-metadata= input. Disabled by default.
321 AC_ARG_ENABLE([jansson],
322 [AS_HELP_STRING([--enable-jansson],
323 [enable jansson [default=no]])],
324 [enable_jansson=$enableval],
325 [enable_jansson="no"])
326
327 AS_IF([test "x$enable_jansson" != "xno"],
328 [PKG_CHECK_MODULES(JANSSON, [jansson],
329 [
330 AC_DEFINE(HAVE_JANSSON, 1, [The jansson library is to be used])
331 AC_SUBST([JANSSON_CFLAGS])
332 AC_SUBST([JANSSON_LIBS])
333 ],
334 [AC_MSG_ERROR([Cannot find jansson library])])
335 ])
336
337 AM_BINUTILS_WARNINGS
338
339 AM_LC_MESSAGES
340
341 AC_CONFIG_HEADERS([config.h:config.in])
342
343 # PR 14072
344 AH_VERBATIM([00_CONFIG_H_CHECK],
345 [/* Check that config.h is #included before system headers
346 (this works only for glibc, but that should be enough). */
347 #if defined(__GLIBC__) && !defined(__FreeBSD_kernel__) && !defined(__CONFIG_H__)
348 # error config.h must be #included before system headers
349 #endif
350 #define __CONFIG_H__ 1])
351
352 if test -z "$target" ; then
353 AC_MSG_ERROR(Unrecognized target system type; please check config.sub.)
354 fi
355 if test -z "$host" ; then
356 AC_MSG_ERROR(Unrecognized host system type; please check config.sub.)
357 fi
358
359 # host-specific stuff:
360
361 ALL_LINGUAS="bg da de es fi fr ga id it ja pt_BR ru sr sv tr uk vi zh_CN zh_TW"
362 ZW_GNU_GETTEXT_SISTER_DIR
363 AM_PO_SUBDIRS
364
365 AC_EXEEXT
366
367 AC_PROG_YACC
368 AM_PROG_LEX
369
370 AM_MAINTAINER_MODE
371 AM_CONDITIONAL(GENINSRC_NEVER, false)
372 ACX_PROG_CMP_IGNORE_INITIAL
373
374 . ${srcdir}/configure.host
375
376 AC_SUBST(HDEFINES)
377 AC_SUBST(NATIVE_LIB_DIRS)
378
379 # We use headers from include/ that check various HAVE_*_H macros, thus
380 # should ensure they are set by configure. This is true even when C99
381 # guarantees they are available.
382 # sha1.h and md4.h test HAVE_LIMITS_H, HAVE_SYS_TYPES_H and HAVE_STDINT_H
383 # plugin-api.h tests HAVE_STDINT_H and HAVE_INTTYPES_H
384 # Besides those, we need to check anything used in ld/ not in C99.
385 AC_CHECK_HEADERS(fcntl.h elf-hints.h limits.h inttypes.h stdint.h \
386 sys/file.h sys/mman.h sys/param.h sys/stat.h sys/time.h \
387 sys/types.h unistd.h)
388 AC_CHECK_FUNCS(close glob lseek mkstemp open realpath waitpid)
389
390 BFD_BINARY_FOPEN
391
392 AC_CHECK_DECLS([asprintf, environ, stpcpy])
393
394 AC_FUNC_MMAP
395
396 AC_SEARCH_LIBS([dlopen], [dl])
397
398 AC_MSG_CHECKING(for a known getopt prototype in unistd.h)
399 AC_CACHE_VAL(ld_cv_decl_getopt_unistd_h,
400 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <unistd.h>], [extern int getopt (int, char *const*, const char *);])],
401 ld_cv_decl_getopt_unistd_h=yes, ld_cv_decl_getopt_unistd_h=no)])
402 AC_MSG_RESULT($ld_cv_decl_getopt_unistd_h)
403 if test $ld_cv_decl_getopt_unistd_h = yes; then
404 AC_DEFINE([HAVE_DECL_GETOPT], 1,
405 [Is the prototype for getopt in <unistd.h> in the expected format?])
406 fi
407
408 # Link in zlib/zstd if we can. This allows us to read and write
409 # compressed debug sections.
410 AM_ZLIB
411 AC_ZSTD
412
413 # target-specific stuff:
414
415 all_targets=
416 EMUL=
417 all_emuls=
418 all_emul_extras=
419 all_libpath=
420 TDIRS=
421
422 elf_list_options=false
423 elf_shlib_list_options=false
424 elf_plt_unwind_list_options=false
425 for targ_alias in `echo $target_alias $enable_targets | sed 's/,/ /g'`
426 do
427 if test "$targ_alias" = "all"; then
428 all_targets=true
429 elf_list_options=true
430 elf_shlib_list_options=true
431 elf_plt_unwind_list_options=true
432 else
433 # Canonicalize the secondary target names.
434 result=`$ac_config_sub $targ_alias 2>/dev/null`
435 if test -n "$result"; then
436 targ=$result
437 else
438 targ=$targ_alias
439 fi
440
441 . ${srcdir}/configure.tgt
442
443 if test "$targ" = "$target"; then
444 EMUL=$targ_emul
445 fi
446
447 if test x${enable_64_bit_bfd} = xno; then
448 . ${srcdir}/../bfd/config.bfd
449 fi
450
451 if test x${enable_64_bit_bfd} = xyes; then
452 targ_extra_emuls="$targ_extra_emuls $targ64_extra_emuls"
453 targ_extra_libpath="$targ_extra_libpath $targ64_extra_libpath"
454 fi
455
456 for i in $targ_emul $targ_extra_emuls $targ_extra_libpath; do
457 case " $all_emuls " in
458 *" e${i}.o "*) ;;
459 *)
460 all_emuls="$all_emuls e${i}.o"
461 eval result=\$tdir_$i
462 test -z "$result" && result=$targ_alias
463 TDIRS="$TDIRS
464 tdir_$i=$result"
465 case "${i}" in
466 *elf*)
467 elf_list_options=true
468 ;;
469 *)
470 if $GREP "TEMPLATE_NAME=elf" ${srcdir}/emulparams/${i}.sh >/dev/null 2>/dev/null; then
471 elf_list_options=true
472 fi
473 ;;
474 esac
475 if test "$elf_list_options" = "true"; then
476 source_sh()
477 {
478 . $1
479 }
480 source_sh ${srcdir}/emulparams/${i}.sh
481 if test x${GENERATE_SHLIB_SCRIPT} = xyes; then
482 elf_shlib_list_options=true
483 fi
484 if test x${PLT_UNWIND} = xyes; then
485 elf_plt_unwind_list_options=true
486 fi
487 fi
488 ;;
489 esac
490 done
491
492 for i in $targ_emul $targ_extra_libpath; do
493 case " $all_libpath " in
494 *" ${i} "*) ;;
495 *)
496 if test -z "$all_libpath"; then
497 all_libpath=${i}
498 else
499 all_libpath="$all_libpath ${i}"
500 fi
501 ;;
502 esac
503 done
504
505 for i in $targ_extra_ofiles; do
506 case " $all_emul_extras " in
507 *" ${i} "*) ;;
508 *)
509 all_emul_extras="$all_emul_extras ${i}"
510 ;;
511 esac
512 done
513
514 fi
515 done
516
517 if test x$ac_default_compressed_debug_sections = xyes ; then
518 AC_DEFINE(DEFAULT_FLAG_COMPRESS_DEBUG, 1, [Define if you want compressed debug sections by default.])
519 fi
520
521 AC_DEFINE_UNQUOTED(DEFAULT_COMPRESSED_DEBUG_ALGORITHM, $ac_default_compressed_debug_sections_algorithm,
522 [Default compression algorithm for --enable-compressed-debug-sections.])
523
524 if test "${ac_default_new_dtags}" = unset; then
525 ac_default_new_dtags=0
526 fi
527 AC_DEFINE_UNQUOTED(DEFAULT_NEW_DTAGS,
528 $ac_default_new_dtags,
529 [Define to 1 if you want to set DT_RUNPATH instead of DT_RPATH by default.])
530
531 if test "${ac_default_ld_z_relro}" = unset; then
532 ac_default_ld_z_relro=0
533 fi
534 AC_DEFINE_UNQUOTED(DEFAULT_LD_Z_RELRO,
535 $ac_default_ld_z_relro,
536 [Define to 1 if you want to enable -z relro in ELF linker by default.])
537
538 ac_default_ld_textrel_check_warning=0
539 case "${ac_default_ld_textrel_check}" in
540 unset|no)
541 ac_default_ld_textrel_check=textrel_check_none
542 ;;
543 yes|warning)
544 ac_default_ld_textrel_check=textrel_check_warning
545 ac_default_ld_textrel_check_warning=1
546 ;;
547 error)
548 ac_default_ld_textrel_check=textrel_check_error
549 ;;
550 esac
551 AC_DEFINE_UNQUOTED(DEFAULT_LD_TEXTREL_CHECK,
552 $ac_default_ld_textrel_check,
553 [The default method for DT_TEXTREL check in ELF linker.])
554 AC_DEFINE_UNQUOTED(DEFAULT_LD_TEXTREL_CHECK_WARNING,
555 $ac_default_ld_textrel_check_warning,
556 [Define to 1 if DT_TEXTREL check is warning in ELF linker by default.])
557
558 if test "${ac_default_ld_z_separate_code}" = unset; then
559 ac_default_ld_z_separate_code=0
560 fi
561 AC_DEFINE_UNQUOTED(DEFAULT_LD_Z_SEPARATE_CODE,
562 $ac_default_ld_z_separate_code,
563 [Define to 1 if you want to enable -z separate-code in ELF linker by default.])
564
565
566 AC_DEFINE_UNQUOTED(DEFAULT_LD_WARN_EXECSTACK,
567 $ac_default_ld_warn_execstack,
568 [Define to 1 if you want to enable --warn-execstack in ELF linker by default.])
569
570 AC_DEFINE_UNQUOTED(DEFAULT_LD_ERROR_EXECSTACK,
571 $ac_default_ld_error_execstack,
572 [Define to 1 if you want to turn executable stack warnings into errors by default.])
573
574 if test "${ac_default_ld_warn_rwx_segments}" = unset; then
575 ac_default_ld_warn_rwx_segments=1
576 fi
577 AC_DEFINE_UNQUOTED(DEFAULT_LD_WARN_RWX_SEGMENTS,
578 $ac_default_ld_warn_rwx_segments,
579 [Define to 0 if you want to disable --warn-rwx-segments in ELF linker by default.])
580
581 AC_DEFINE_UNQUOTED(DEFAULT_LD_ERROR_RWX_SEGMENTS,
582 $ac_default_ld_error_rwx_segments,
583 [Define to 1 if you want to turn executable segment warnings into errors by default.])
584
585 if test "${ac_default_ld_default_execstack}" = unset; then
586 ac_default_ld_default_execstack=1
587 fi
588 AC_DEFINE_UNQUOTED(DEFAULT_LD_EXECSTACK,
589 $ac_default_ld_default_execstack,
590 [Define to 0 if you want to disable the generation of an executable stack when a .note-GNU-stack section is missing.])
591
592
593 if test "${ac_support_error_handling_script}" = unset; then
594 ac_support_error_handling_script=1
595 fi
596 AC_DEFINE_UNQUOTED(SUPPORT_ERROR_HANDLING_SCRIPT,
597 $ac_support_error_handling_script,
598 [Define to 1 if you want to support the --error-handling-script command line option.])
599
600 AC_DEFINE_UNQUOTED([DEFAULT_EMIT_SYSV_HASH],
601 [$ac_default_emit_sysv_hash],
602 [Define to 1 if you want to emit sysv hash in the ELF linker by default.])
603
604 AC_DEFINE_UNQUOTED([DEFAULT_EMIT_GNU_HASH],
605 [$ac_default_emit_gnu_hash],
606 [Define to 1 if you want to emit gnu hash in the ELF linker by default.])
607
608 AC_SUBST(elf_list_options)
609 AC_SUBST(elf_shlib_list_options)
610 AC_SUBST(elf_plt_unwind_list_options)
611 AC_SUBST(EMUL)
612
613 AC_SUBST(TDIRS)
614 AM_SUBST_NOTMAKE(TDIRS)
615
616 if test x${all_targets} = xtrue; then
617 if test x${enable_64_bit_bfd} = xyes; then
618 EMULATION_OFILES='$(ALL_EMULATIONS) $(ALL_64_EMULATIONS)'
619 EMUL_EXTRA_OFILES='$(ALL_EMUL_EXTRA_OFILES) $(ALL_64_EMUL_EXTRA_OFILES)'
620 else
621 EMULATION_OFILES='$(ALL_EMULATIONS)'
622 EMUL_EXTRA_OFILES='$(ALL_EMUL_EXTRA_OFILES)'
623 fi
624 else
625 EMULATION_OFILES=$all_emuls
626 EMUL_EXTRA_OFILES=$all_emul_extras
627 fi
628 AC_SUBST(EMULATION_OFILES)
629 AC_SUBST(EMUL_EXTRA_OFILES)
630 AC_SUBST(LIB_PATH)
631
632 EMULATION_LIBPATH=$all_libpath
633 AC_SUBST(EMULATION_LIBPATH)
634
635 if test x${enable_static} = xno; then
636 TESTBFDLIB="-Wl,--rpath,../bfd/.libs ../bfd/.libs/libbfd.so"
637 TESTCTFLIB="-Wl,--rpath,../libctf/.libs ../libctf/.libs/libctf.so"
638 TESTSFRAMELIB="-Wl,--rpath,../libsframe/.libs ../libsframe/.libs/libsframe.so"
639 else
640 TESTBFDLIB="../bfd/.libs/libbfd.a"
641 TESTCTFLIB="../libctf/.libs/libctf.a"
642 TESTSFRAMELIB="../libsframe/.libs/libsframe.a"
643 fi
644 if test "${enable_libctf}" = no; then
645 TESTCTFLIB=
646 fi
647 AC_SUBST(TESTBFDLIB)
648 AC_SUBST(TESTCTFLIB)
649 AC_SUBST(TESTSFRAMELIB)
650
651 target_vendor=${target_vendor=$host_vendor}
652 case "$target_vendor" in
653 hp) EXTRA_SHLIB_EXTENSION=".sl" ;;
654 *) EXTRA_SHLIB_EXTENSION= ;;
655 esac
656
657 case "$target_os" in
658 lynxos) EXTRA_SHLIB_EXTENSION=".a" ;;
659 esac
660
661 if test x${EXTRA_SHLIB_EXTENSION} != x ; then
662 AC_DEFINE_UNQUOTED(EXTRA_SHLIB_EXTENSION, "$EXTRA_SHLIB_EXTENSION",
663 [Additional extension a shared object might have.])
664 fi
665
666 AC_CONFIG_COMMANDS([default],
667 [[
668 case "$srcdir" in
669 .) srcdirpre= ;;
670 *) srcdirpre='$(srcdir)/' ;;
671 esac
672 POFILES=
673 GMOFILES=
674 for lang in dummy $OBSOLETE_ALL_LINGUAS; do
675 if test $lang != dummy; then
676 POFILES="$POFILES $srcdirpre$lang.po"
677 GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
678 fi
679 done
680 sed -e '/^SRC-POTFILES =/r po/SRC-POTFILES' \
681 -e '/^BLD-POTFILES =/r po/BLD-POTFILES' \
682 -e "s,@POFILES@,$POFILES," \
683 -e "s,@GMOFILES@,$GMOFILES," \
684 po/Makefile.in > po/Makefile]],[[]])
685
686 dnl Required by html, pdf, install-pdf and install-html
687 AC_SUBST(datarootdir)
688 AC_SUBST(docdir)
689 AC_SUBST(htmldir)
690 AC_SUBST(pdfdir)
691
692 AC_CONFIG_FILES(Makefile po/Makefile.in:po/Make-in)
693 AC_OUTPUT
694
695 GNU_MAKE_JOBSERVER