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