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