]>
Commit | Line | Data |
---|---|---|
252b5132 RH |
1 | dnl Process this file with autoconf to produce a configure script |
2 | dnl | |
d87bef3a | 3 | dnl Copyright (C) 2012-2023 Free Software Foundation, Inc. |
5bf135a7 NC |
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. | |
995da1ff | 9 | dnl |
5bf135a7 NC |
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. | |
995da1ff | 14 | dnl |
5bf135a7 NC |
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 | ||
2e98a7bd AM |
20 | m4_include([../bfd/version.m4]) |
21 | AC_INIT([ld], BFD_VERSION) | |
da594c4a | 22 | AC_CONFIG_SRCDIR(ldmain.c) |
252b5132 | 23 | |
da594c4a | 24 | AC_CANONICAL_TARGET |
02ecc8e9 | 25 | AC_CANONICAL_BUILD |
252b5132 | 26 | |
2e98a7bd | 27 | AM_INIT_AUTOMAKE |
48b5f33a | 28 | AM_SILENT_RULES([yes]) |
64ac50ac | 29 | AM_MAINTAINER_MODE |
252b5132 | 30 | |
b879806f AM |
31 | AC_PROG_CC |
32 | AC_PROG_CXX | |
68880f31 | 33 | AC_PROG_GREP |
b879806f AM |
34 | AC_GNU_SOURCE |
35 | AC_USE_SYSTEM_EXTENSIONS | |
36 | AC_PROG_INSTALL | |
2cac01e3 | 37 | PKG_PROG_PKG_CONFIG |
b879806f AM |
38 | |
39 | LT_INIT | |
40 | ACX_LARGEFILE | |
41 | ||
43e05cd4 AM |
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 | ||
8e523c23 | 55 | AC_ARG_WITH(lib-path, [ --with-lib-path=dir1:dir2... set default LIB_PATH],LIB_PATH=$withval) |
252b5132 RH |
56 | AC_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 ;; | |
63 | esac])dnl | |
1d5269c9 MF |
64 | |
65 | BFD_64_BIT | |
252b5132 | 66 | |
9c8ebd6a DJ |
67 | AC_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 | ]) | |
102 | AC_SUBST(use_sysroot) | |
103 | AC_SUBST(TARGET_SYSTEM_ROOT) | |
104 | AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE) | |
105 | ||
4fda8867 NC |
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, | |
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 |
126 | AC_SUBST(install_as_default) |
127 | AC_SUBST(installed_linker) | |
128 | ||
7fb9f789 NC |
129 | AC_ARG_ENABLE([got], |
130 | AS_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 |
135 | esac], |
136 | [got_handling=target]) | |
137 | ||
138 | case "${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 |
152 | esac |
153 | ||
6c3bc0f8 NC |
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, | |
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 |
164 | esac])dnl |
165 | ||
b0c295e1 ML |
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 | ||
6734f10a SB |
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 | ||
647e4d46 L |
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 | ||
b32632c4 L |
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 | ||
f6aec96d L |
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 | ||
ba951afb | 216 | |
bd7d326d AM |
217 | # By default warn when an executable stack is created due to object files |
218 | # requesting such, not when the user specifies -z execstack. | |
ed1c7ad8 | 219 | ac_default_ld_warn_execstack=2 |
ba951afb NC |
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 ;; | |
bd7d326d | 225 | no) ac_default_ld_warn_execstack=0 ;; |
ba951afb NC |
226 | esac]) |
227 | ||
228 | ac_default_ld_warn_rwx_segments=unset | |
229 | AC_ARG_ENABLE(warn-rwx-segments, | |
230 | AS_HELP_STRING([--enable-warn-rwx-segments], | |
b5c37946 | 231 | [enable warnings when creating segments with RWX permissions]), |
ba951afb NC |
232 | [case "${enableval}" in |
233 | yes) ac_default_ld_warn_rwx_segments=1 ;; | |
234 | no) ac_default_ld_warn_rwx_segments=0 ;; | |
235 | esac]) | |
236 | ||
237 | ac_default_ld_default_execstack=unset | |
238 | AC_ARG_ENABLE(default-execstack, | |
239 | AS_HELP_STRING([--enable-default-execstack], | |
240 | [create an executable stack if an input file is missing a .note.GNU-stack section]), | |
241 | [case "${enableval}" in | |
242 | yes) ac_default_ld_default_execstack=1 ;; | |
243 | no) ac_default_ld_default_execstack=0 ;; | |
244 | esac]) | |
245 | ||
246 | ||
23ae20f5 NC |
247 | # Decide if --error-handling-script should be supported. |
248 | ac_support_error_handling_script=unset | |
249 | AC_ARG_ENABLE(error-handling-script, | |
250 | AS_HELP_STRING([--enable-error-handling-script], | |
251 | [enable/disable support for the --error-handling-script option]), | |
252 | [case "${enableval}" in | |
253 | yes) ac_support_error_handling_script=1 ;; | |
254 | no) ac_support_error_handling_script=0 ;; | |
255 | esac]) | |
256 | ||
2760f24c RG |
257 | # Decide which "--hash-style" to use by default |
258 | # Provide a configure time option to override our default. | |
259 | AC_ARG_ENABLE([default-hash-style], | |
260 | AS_HELP_STRING([--enable-default-hash-style={sysv,gnu,both}], | |
261 | [use this default hash style]), | |
262 | [case "${enable_default_hash_style}" in | |
263 | sysv | gnu | both) ;; | |
264 | *) AC_MSG_ERROR([bad value ${enable_default_hash_style} for enable-default-hash-style option]) ;; | |
265 | esac], | |
266 | [case "${target}" in | |
267 | # Enable gnu hash only on GNU targets, but not mips | |
268 | mips*-*-*) enable_default_hash_style=sysv ;; | |
269 | *-*-gnu* | *-*-linux* | *-*-nacl*) enable_default_hash_style=both ;; | |
270 | *) enable_default_hash_style=sysv ;; | |
271 | esac]) | |
272 | ||
273 | case "${enable_default_hash_style}" in | |
274 | sysv | both) ac_default_emit_sysv_hash=1 ;; | |
275 | *) ac_default_emit_sysv_hash=0 ;; | |
276 | esac | |
277 | ||
278 | case "${enable_default_hash_style}" in | |
279 | gnu | both) ac_default_emit_gnu_hash=1 ;; | |
280 | *) ac_default_emit_gnu_hash=0 ;; | |
281 | esac | |
282 | ||
c774eab1 AM |
283 | AC_ARG_ENABLE(initfini-array, |
284 | [ --disable-initfini-array do not use .init_array/.fini_array sections], | |
285 | [case "${enableval}" in | |
286 | yes|no) ;; | |
287 | *) AC_MSG_ERROR([invalid --enable-initfini-array argument]) ;; | |
288 | esac], [enable_initfini_array=yes]) | |
289 | AC_SUBST(enable_initfini_array) | |
290 | if test $enable_initfini_array = yes; then | |
291 | AC_DEFINE(HAVE_INITFINI_ARRAY, 1, | |
292 | [Define .init_array/.fini_array sections are available and working.]) | |
293 | fi | |
294 | ||
094e34f2 NA |
295 | GCC_ENABLE([libctf], [yes], [], [Handle .ctf type-info sections]) |
296 | if test "${enable_libctf}" = yes; then | |
297 | AC_DEFINE(ENABLE_LIBCTF, 1, [Handle .ctf type-info sections]) | |
298 | fi | |
299 | AM_CONDITIONAL(ENABLE_LIBCTF, test "${enable_libctf}" = yes) | |
7cdfc346 | 300 | AC_SUBST(enable_libctf) |
094e34f2 | 301 | |
9e2bb0cb LB |
302 | # Used to validate --package-metadata= input. Disabled by default. |
303 | AC_ARG_ENABLE([jansson], | |
304 | [AS_HELP_STRING([--enable-jansson], | |
305 | [enable jansson [default=no]])], | |
306 | [enable_jansson=$enableval], | |
307 | [enable_jansson="no"]) | |
308 | ||
544c5619 AM |
309 | AS_IF([test "x$enable_jansson" != "xno"], |
310 | [PKG_CHECK_MODULES(JANSSON, [jansson], | |
9e2bb0cb | 311 | [ |
544c5619 AM |
312 | AC_DEFINE(HAVE_JANSSON, 1, [The jansson library is to be used]) |
313 | AC_SUBST([JANSSON_CFLAGS]) | |
314 | AC_SUBST([JANSSON_LIBS]) | |
9e2bb0cb | 315 | ], |
544c5619 AM |
316 | [AC_MSG_ERROR([Cannot find jansson library])]) |
317 | ]) | |
9e2bb0cb | 318 | |
502bdb00 | 319 | AM_BINUTILS_WARNINGS |
a2d91340 | 320 | |
44350750 NC |
321 | AM_LC_MESSAGES |
322 | ||
da594c4a | 323 | AC_CONFIG_HEADERS([config.h:config.in]) |
252b5132 | 324 | |
df7b86aa NC |
325 | # PR 14072 |
326 | AH_VERBATIM([00_CONFIG_H_CHECK], | |
327 | [/* Check that config.h is #included before system headers | |
328 | (this works only for glibc, but that should be enough). */ | |
d17dce55 | 329 | #if defined(__GLIBC__) && !defined(__FreeBSD_kernel__) && !defined(__CONFIG_H__) |
df7b86aa NC |
330 | # error config.h must be #included before system headers |
331 | #endif | |
332 | #define __CONFIG_H__ 1]) | |
333 | ||
252b5132 RH |
334 | if test -z "$target" ; then |
335 | AC_MSG_ERROR(Unrecognized target system type; please check config.sub.) | |
336 | fi | |
337 | if test -z "$host" ; then | |
338 | AC_MSG_ERROR(Unrecognized host system type; please check config.sub.) | |
339 | fi | |
340 | ||
341 | # host-specific stuff: | |
342 | ||
e184813f | 343 | ALL_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 |
344 | ZW_GNU_GETTEXT_SISTER_DIR |
345 | AM_PO_SUBDIRS | |
252b5132 RH |
346 | |
347 | AC_EXEEXT | |
348 | ||
349 | AC_PROG_YACC | |
350 | AM_PROG_LEX | |
351 | ||
352 | AM_MAINTAINER_MODE | |
d5fbea21 | 353 | AM_CONDITIONAL(GENINSRC_NEVER, false) |
eccbf555 | 354 | ACX_PROG_CMP_IGNORE_INITIAL |
252b5132 RH |
355 | |
356 | . ${srcdir}/configure.host | |
357 | ||
358 | AC_SUBST(HDEFINES) | |
252b5132 RH |
359 | AC_SUBST(NATIVE_LIB_DIRS) |
360 | ||
c774eab1 AM |
361 | # We use headers from include/ that check various HAVE_*_H macros, thus |
362 | # should ensure they are set by configure. This is true even when C99 | |
363 | # guarantees they are available. | |
364 | # sha1.h and md4.h test HAVE_LIMITS_H, HAVE_SYS_TYPES_H and HAVE_STDINT_H | |
365 | # plugin-api.h tests HAVE_STDINT_H and HAVE_INTTYPES_H | |
366 | # Besides those, we need to check anything used in ld/ not in C99. | |
367 | AC_CHECK_HEADERS(fcntl.h elf-hints.h limits.h inttypes.h stdint.h \ | |
368 | sys/file.h sys/mman.h sys/param.h sys/stat.h sys/time.h \ | |
369 | sys/types.h unistd.h) | |
6577f365 | 370 | AC_CHECK_FUNCS(close glob lseek mkstemp open realpath waitpid) |
c774eab1 AM |
371 | |
372 | BFD_BINARY_FOPEN | |
373 | ||
eaf1fa5a | 374 | AC_CHECK_DECLS([asprintf, environ, stpcpy]) |
252b5132 | 375 | |
2aec968d L |
376 | AC_FUNC_MMAP |
377 | ||
b879806f | 378 | AC_SEARCH_LIBS([dlopen], [dl]) |
5d3236ee | 379 | |
34875e64 NC |
380 | AC_MSG_CHECKING(for a known getopt prototype in unistd.h) |
381 | AC_CACHE_VAL(ld_cv_decl_getopt_unistd_h, | |
da594c4a | 382 | [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <unistd.h>], [extern int getopt (int, char *const*, const char *);])], |
34875e64 NC |
383 | ld_cv_decl_getopt_unistd_h=yes, ld_cv_decl_getopt_unistd_h=no)]) |
384 | AC_MSG_RESULT($ld_cv_decl_getopt_unistd_h) | |
385 | if test $ld_cv_decl_getopt_unistd_h = yes; then | |
386 | AC_DEFINE([HAVE_DECL_GETOPT], 1, | |
387 | [Is the prototype for getopt in <unistd.h> in the expected format?]) | |
388 | fi | |
bf9ef603 | 389 | |
2cac01e3 FS |
390 | # Link in zlib/zstd if we can. This allows us to read and write |
391 | # compressed debug sections. | |
1ff6de03 | 392 | AM_ZLIB |
2cac01e3 | 393 | AC_ZSTD |
1ff6de03 | 394 | |
252b5132 RH |
395 | # target-specific stuff: |
396 | ||
397 | all_targets= | |
398 | EMUL= | |
399 | all_emuls= | |
400 | all_emul_extras= | |
ba2be581 | 401 | all_libpath= |
50ff67e6 | 402 | TDIRS= |
252b5132 | 403 | |
f38a2680 AM |
404 | elf_list_options=false |
405 | elf_shlib_list_options=false | |
406 | elf_plt_unwind_list_options=false | |
252b5132 RH |
407 | for targ_alias in `echo $target_alias $enable_targets | sed 's/,/ /g'` |
408 | do | |
409 | if test "$targ_alias" = "all"; then | |
410 | all_targets=true | |
f38a2680 AM |
411 | elf_list_options=true |
412 | elf_shlib_list_options=true | |
413 | elf_plt_unwind_list_options=true | |
252b5132 RH |
414 | else |
415 | # Canonicalize the secondary target names. | |
42ecbf5e | 416 | result=`$ac_config_sub $targ_alias 2>/dev/null` |
252b5132 RH |
417 | if test -n "$result"; then |
418 | targ=$result | |
419 | else | |
420 | targ=$targ_alias | |
421 | fi | |
422 | ||
423 | . ${srcdir}/configure.tgt | |
424 | ||
425 | if test "$targ" = "$target"; then | |
426 | EMUL=$targ_emul | |
427 | fi | |
428 | ||
1d5269c9 | 429 | if test x${enable_64_bit_bfd} = xno; then |
314e9a4e L |
430 | . ${srcdir}/../bfd/config.bfd |
431 | fi | |
432 | ||
1d5269c9 | 433 | if test x${enable_64_bit_bfd} = xyes; then |
534d3119 L |
434 | targ_extra_emuls="$targ_extra_emuls $targ64_extra_emuls" |
435 | targ_extra_libpath="$targ_extra_libpath $targ64_extra_libpath" | |
436 | fi | |
437 | ||
3336653a | 438 | for i in $targ_emul $targ_extra_emuls $targ_extra_libpath; do |
252b5132 | 439 | case " $all_emuls " in |
8c3fff59 AM |
440 | *" e${i}.o "*) ;; |
441 | *) | |
442 | all_emuls="$all_emuls e${i}.o" | |
443 | eval result=\$tdir_$i | |
444 | test -z "$result" && result=$targ_alias | |
50ff67e6 AM |
445 | TDIRS="$TDIRS |
446 | tdir_$i=$result" | |
c58212ea L |
447 | case "${i}" in |
448 | *elf*) | |
f38a2680 | 449 | elf_list_options=true |
68880f31 CLT |
450 | ;; |
451 | *) | |
075a2b89 | 452 | if $GREP "TEMPLATE_NAME=elf" ${srcdir}/emulparams/${i}.sh >/dev/null 2>/dev/null; then |
f38a2680 | 453 | elf_list_options=true |
68880f31 CLT |
454 | fi |
455 | ;; | |
456 | esac | |
f38a2680 | 457 | if test "$elf_list_options" = "true"; then |
c40e31a1 AM |
458 | source_sh() |
459 | { | |
460 | . $1 | |
461 | } | |
462 | source_sh ${srcdir}/emulparams/${i}.sh | |
c58212ea | 463 | if test x${GENERATE_SHLIB_SCRIPT} = xyes; then |
f38a2680 | 464 | elf_shlib_list_options=true |
c58212ea L |
465 | fi |
466 | if test x${PLT_UNWIND} = xyes; then | |
f38a2680 | 467 | elf_plt_unwind_list_options=true |
c58212ea | 468 | fi |
68880f31 | 469 | fi |
c58212ea | 470 | ;; |
252b5132 RH |
471 | esac |
472 | done | |
473 | ||
ba2be581 | 474 | for i in $targ_emul $targ_extra_libpath; do |
3336653a RH |
475 | case " $all_libpath " in |
476 | *" ${i} "*) ;; | |
477 | *) | |
ba2be581 RH |
478 | if test -z "$all_libpath"; then |
479 | all_libpath=${i} | |
480 | else | |
481 | all_libpath="$all_libpath ${i}" | |
482 | fi | |
3336653a RH |
483 | ;; |
484 | esac | |
485 | done | |
486 | ||
252b5132 RH |
487 | for i in $targ_extra_ofiles; do |
488 | case " $all_emul_extras " in | |
489 | *" ${i} "*) ;; | |
490 | *) | |
491 | all_emul_extras="$all_emul_extras ${i}" | |
492 | ;; | |
493 | esac | |
494 | done | |
5063daf7 | 495 | |
252b5132 RH |
496 | fi |
497 | done | |
498 | ||
621ff761 | 499 | if test x$ac_default_compressed_debug_sections = xyes ; then |
6c3bc0f8 NC |
500 | AC_DEFINE(DEFAULT_FLAG_COMPRESS_DEBUG, 1, [Define if you want compressed debug sections by default.]) |
501 | fi | |
502 | ||
b0c295e1 ML |
503 | AC_DEFINE_UNQUOTED(DEFAULT_COMPRESSED_DEBUG_ALGORITHM, $ac_default_compressed_debug_sections_algorithm, |
504 | [Default compression algorithm for --enable-compressed-debug-sections.]) | |
505 | ||
6734f10a SB |
506 | if test "${ac_default_new_dtags}" = unset; then |
507 | ac_default_new_dtags=0 | |
508 | fi | |
509 | AC_DEFINE_UNQUOTED(DEFAULT_NEW_DTAGS, | |
510 | $ac_default_new_dtags, | |
511 | [Define to 1 if you want to set DT_RUNPATH instead of DT_RPATH by default.]) | |
512 | ||
647e4d46 L |
513 | if test "${ac_default_ld_z_relro}" = unset; then |
514 | ac_default_ld_z_relro=0 | |
515 | fi | |
516 | AC_DEFINE_UNQUOTED(DEFAULT_LD_Z_RELRO, | |
517 | $ac_default_ld_z_relro, | |
518 | [Define to 1 if you want to enable -z relro in ELF linker by default.]) | |
519 | ||
b32632c4 L |
520 | ac_default_ld_textrel_check_warning=0 |
521 | case "${ac_default_ld_textrel_check}" in | |
522 | unset|no) | |
523 | ac_default_ld_textrel_check=textrel_check_none | |
524 | ;; | |
525 | yes|warning) | |
526 | ac_default_ld_textrel_check=textrel_check_warning | |
527 | ac_default_ld_textrel_check_warning=1 | |
528 | ;; | |
529 | error) | |
530 | ac_default_ld_textrel_check=textrel_check_error | |
531 | ;; | |
532 | esac | |
533 | AC_DEFINE_UNQUOTED(DEFAULT_LD_TEXTREL_CHECK, | |
534 | $ac_default_ld_textrel_check, | |
535 | [The default method for DT_TEXTREL check in ELF linker.]) | |
536 | AC_DEFINE_UNQUOTED(DEFAULT_LD_TEXTREL_CHECK_WARNING, | |
537 | $ac_default_ld_textrel_check_warning, | |
538 | [Define to 1 if DT_TEXTREL check is warning in ELF linker by default.]) | |
539 | ||
f6aec96d L |
540 | if test "${ac_default_ld_z_separate_code}" = unset; then |
541 | ac_default_ld_z_separate_code=0 | |
542 | fi | |
543 | AC_DEFINE_UNQUOTED(DEFAULT_LD_Z_SEPARATE_CODE, | |
544 | $ac_default_ld_z_separate_code, | |
545 | [Define to 1 if you want to enable -z separate-code in ELF linker by default.]) | |
546 | ||
ba951afb | 547 | |
ba951afb NC |
548 | AC_DEFINE_UNQUOTED(DEFAULT_LD_WARN_EXECSTACK, |
549 | $ac_default_ld_warn_execstack, | |
550 | [Define to 1 if you want to enable --warn-execstack in ELF linker by default.]) | |
551 | ||
552 | if test "${ac_default_ld_warn_rwx_segments}" = unset; then | |
8bddb52e | 553 | ac_default_ld_warn_rwx_segments=1 |
ba951afb NC |
554 | fi |
555 | AC_DEFINE_UNQUOTED(DEFAULT_LD_WARN_RWX_SEGMENTS, | |
556 | $ac_default_ld_warn_rwx_segments, | |
557 | [Define to 0 if you want to disable --warn-rwx-segments in ELF linker by default.]) | |
558 | ||
559 | if test "${ac_default_ld_default_execstack}" = unset; then | |
560 | ac_default_ld_default_execstack=1 | |
561 | fi | |
562 | AC_DEFINE_UNQUOTED(DEFAULT_LD_EXECSTACK, | |
563 | $ac_default_ld_default_execstack, | |
564 | [Define to 0 if you want to disable the generation of an executable stack when a .note-GNU-stack section is missing.]) | |
565 | ||
566 | ||
23ae20f5 NC |
567 | if test "${ac_support_error_handling_script}" = unset; then |
568 | ac_support_error_handling_script=1 | |
569 | fi | |
570 | AC_DEFINE_UNQUOTED(SUPPORT_ERROR_HANDLING_SCRIPT, | |
571 | $ac_support_error_handling_script, | |
572 | [Define to 1 if you want to support the --error-handling-script command line option.]) | |
573 | ||
2760f24c RG |
574 | AC_DEFINE_UNQUOTED([DEFAULT_EMIT_SYSV_HASH], |
575 | [$ac_default_emit_sysv_hash], | |
576 | [Define to 1 if you want to emit sysv hash in the ELF linker by default.]) | |
577 | ||
578 | AC_DEFINE_UNQUOTED([DEFAULT_EMIT_GNU_HASH], | |
579 | [$ac_default_emit_gnu_hash], | |
580 | [Define to 1 if you want to emit gnu hash in the ELF linker by default.]) | |
581 | ||
c58212ea L |
582 | AC_SUBST(elf_list_options) |
583 | AC_SUBST(elf_shlib_list_options) | |
584 | AC_SUBST(elf_plt_unwind_list_options) | |
252b5132 RH |
585 | AC_SUBST(EMUL) |
586 | ||
50ff67e6 AM |
587 | AC_SUBST(TDIRS) |
588 | AM_SUBST_NOTMAKE(TDIRS) | |
252b5132 | 589 | |
252b5132 | 590 | if test x${all_targets} = xtrue; then |
1d5269c9 | 591 | if test x${enable_64_bit_bfd} = xyes; then |
252b5132 | 592 | EMULATION_OFILES='$(ALL_EMULATIONS) $(ALL_64_EMULATIONS)' |
9d069ac3 | 593 | EMUL_EXTRA_OFILES='$(ALL_EMUL_EXTRA_OFILES) $(ALL_64_EMUL_EXTRA_OFILES)' |
252b5132 RH |
594 | else |
595 | EMULATION_OFILES='$(ALL_EMULATIONS)' | |
9d069ac3 | 596 | EMUL_EXTRA_OFILES='$(ALL_EMUL_EXTRA_OFILES)' |
252b5132 | 597 | fi |
252b5132 RH |
598 | else |
599 | EMULATION_OFILES=$all_emuls | |
600 | EMUL_EXTRA_OFILES=$all_emul_extras | |
601 | fi | |
602 | AC_SUBST(EMULATION_OFILES) | |
603 | AC_SUBST(EMUL_EXTRA_OFILES) | |
8e523c23 | 604 | AC_SUBST(LIB_PATH) |
252b5132 | 605 | |
3336653a RH |
606 | EMULATION_LIBPATH=$all_libpath |
607 | AC_SUBST(EMULATION_LIBPATH) | |
608 | ||
252b5132 | 609 | if test x${enable_static} = xno; then |
9165f454 | 610 | TESTBFDLIB="-Wl,--rpath,../bfd/.libs ../bfd/.libs/libbfd.so" |
87279e3c | 611 | TESTCTFLIB="-Wl,--rpath,../libctf/.libs ../libctf/.libs/libctf.so" |
cf0e0a0b | 612 | TESTSFRAMELIB="-Wl,--rpath,../libsframe/.libs ../libsframe/.libs/libsframe.so" |
252b5132 RH |
613 | else |
614 | TESTBFDLIB="../bfd/.libs/libbfd.a" | |
87279e3c | 615 | TESTCTFLIB="../libctf/.libs/libctf.a" |
cf0e0a0b | 616 | TESTSFRAMELIB="../libsframe/.libs/libsframe.a" |
252b5132 | 617 | fi |
094e34f2 NA |
618 | if test "${enable_libctf}" = no; then |
619 | TESTCTFLIB= | |
620 | fi | |
252b5132 | 621 | AC_SUBST(TESTBFDLIB) |
87279e3c | 622 | AC_SUBST(TESTCTFLIB) |
cf0e0a0b | 623 | AC_SUBST(TESTSFRAMELIB) |
252b5132 | 624 | |
93a6d436 JL |
625 | target_vendor=${target_vendor=$host_vendor} |
626 | case "$target_vendor" in | |
627 | hp) EXTRA_SHLIB_EXTENSION=".sl" ;; | |
628 | *) EXTRA_SHLIB_EXTENSION= ;; | |
629 | esac | |
f234d5fe NC |
630 | |
631 | case "$target_os" in | |
632 | lynxos) EXTRA_SHLIB_EXTENSION=".a" ;; | |
633 | esac | |
634 | ||
93a6d436 JL |
635 | if test x${EXTRA_SHLIB_EXTENSION} != x ; then |
636 | AC_DEFINE_UNQUOTED(EXTRA_SHLIB_EXTENSION, "$EXTRA_SHLIB_EXTENSION", | |
637 | [Additional extension a shared object might have.]) | |
638 | fi | |
639 | ||
33589acb AM |
640 | AC_CONFIG_COMMANDS([default], |
641 | [[ | |
642 | case "$srcdir" in | |
643 | .) srcdirpre= ;; | |
644 | *) srcdirpre='$(srcdir)/' ;; | |
645 | esac | |
646 | POFILES= | |
647 | GMOFILES= | |
648 | for lang in dummy $OBSOLETE_ALL_LINGUAS; do | |
649 | if test $lang != dummy; then | |
650 | POFILES="$POFILES $srcdirpre$lang.po" | |
651 | GMOFILES="$GMOFILES $srcdirpre$lang.gmo" | |
652 | fi | |
653 | done | |
654 | sed -e '/^SRC-POTFILES =/r po/SRC-POTFILES' \ | |
655 | -e '/^BLD-POTFILES =/r po/BLD-POTFILES' \ | |
656 | -e "s,@POFILES@,$POFILES," \ | |
657 | -e "s,@GMOFILES@,$GMOFILES," \ | |
658 | po/Makefile.in > po/Makefile]],[[]]) | |
659 | ||
31dd3154 | 660 | dnl Required by html, pdf, install-pdf and install-html |
108a6f8e CD |
661 | AC_SUBST(datarootdir) |
662 | AC_SUBST(docdir) | |
663 | AC_SUBST(htmldir) | |
31dd3154 | 664 | AC_SUBST(pdfdir) |
108a6f8e | 665 | |
da594c4a AM |
666 | AC_CONFIG_FILES(Makefile po/Makefile.in:po/Make-in) |
667 | AC_OUTPUT | |
d546b610 L |
668 | |
669 | GNU_MAKE_JOBSERVER |