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