* powerpc.cc (Stub_table::do_write): Delete redundant Address
[deliverable/binutils-gdb.git] / gold / configure.ac
CommitLineData
bae7f79e
ILT
1dnl Process this file with autoconf to produce a configure script.
2
3AC_PREREQ(2.59)
8486ee48
ILT
4
5AC_INIT(gold, 0.1)
6AC_CONFIG_SRCDIR(gold.cc)
bae7f79e
ILT
7
8AC_CANONICAL_TARGET
9
6ea55b82 10AM_INIT_AUTOMAKE([no-dist parallel-tests])
bae7f79e
ILT
11
12AM_CONFIG_HEADER(config.h:config.in)
13
df7b86aa
NC
14# PR 14072
15AH_VERBATIM([00_CONFIG_H_CHECK],
16[/* Check that config.h is #included before system headers
17 (this works only for glibc, but that should be enough). */
0a6f1bf2 18#if defined(__GLIBC__) && !defined(__FreeBSD_kernel__) && !defined(__CONFIG_H__)
df7b86aa
NC
19# error config.h must be #included before system headers
20#endif
21#define __CONFIG_H__ 1])
22
ad2d6943
ILT
23AC_ARG_WITH(sysroot,
24[ --with-sysroot[=DIR] search for usr/lib et al within DIR],
25[sysroot=$withval], [sysroot=no])
26
27if test "$sysroot" = "yes"; then
28 sysroot='${exec_prefix}/${target_alias}/sys-root'
29elif test "$sysroot" = "no"; then
30 sysroot=
31fi
32
33sysroot_relocatable=0
34if test -n "$sysroot"; then
35 case "sysroot" in
36 "${prefix}" | "${prefix}/"* | \
37 "${exec_prefix}" | "${exec_prefix}/"* | \
38 '${prefix}' | '${prefix}/'*| \
39 '${exec_prefix}' | '${exec_prefix}/'*)
40 sysroot_relocatable=1
41 ;;
42 esac
43fi
44
45AC_DEFINE_UNQUOTED(TARGET_SYSTEM_ROOT, "$sysroot",
46 [System root for target files])
47AC_DEFINE_UNQUOTED(TARGET_SYSTEM_ROOT_RELOCATABLE, $sysroot_relocatable,
48 [Whether the system root can be relocated])
49
4fda8867
NC
50dnl "install_as_default" is true if the linker to be installed as the
51dnl default linker, ld.
52dnl "installed_linker" is the installed gold linker name.
c7791212
NC
53
54default_ld=
55AC_ARG_ENABLE(ld,
56[[ --enable-ld[=ARG] build ld [ARG={default,yes,no}]]],
58797674 57[case "${enableval}" in
c7791212
NC
58 default)
59 default_ld=ld.bfd
60 ;;
61esac])
62
63AC_ARG_ENABLE(gold,
64[[ --enable-gold[=ARG] build gold [ARG={default,yes,no}]]],
65[case "${enableval}" in
66 yes|default)
67 if test x${default_ld} = x; then
68 install_as_default=yes
69 fi
4fda8867
NC
70 installed_linker=ld.gold
71 ;;
c7791212 72 no)
4fda8867
NC
73 ;;
74 *)
75 AC_MSG_ERROR([invalid --enable-gold argument])
76 ;;
77 esac],
c7791212
NC
78[install_as_default=no
79 installed_linker=ld.gold])
4fda8867
NC
80AC_SUBST(install_as_default)
81AC_SUBST(installed_linker)
82
fe9a4c12
ILT
83dnl For now threads are a configure time option.
84AC_ARG_ENABLE([threads],
85[ --enable-threads multi-threaded linking],
86[case "${enableval}" in
87 yes | "") threads=yes ;;
88 no) threads=no ;;
89 *) threads=yes ;;
90 esac],
91[threads=no])
92if test "$threads" = "yes"; then
93 AC_DEFINE(ENABLE_THREADS, 1,
94 [Define to do multi-threaded linking])
95fi
96AM_CONDITIONAL(THREADS, test "$threads" = "yes")
89fc3421
CC
97
98AC_ARG_ENABLE([plugins],
99[ --enable-plugins linker plugins],
100[case "${enableval}" in
101 yes | "") plugins=yes ;;
102 no) plugins=no ;;
103 *) plugins=yes ;;
104 esac],
105[plugins=no])
106if test "$plugins" = "yes"; then
107 AC_DEFINE(ENABLE_PLUGINS, 1,
108 [Define to enable linker plugins])
109fi
110AM_CONDITIONAL(PLUGINS, test "$plugins" = "yes")
fe9a4c12 111
193a53d9
ILT
112AC_ARG_ENABLE([targets],
113[ --enable-targets alternative target configurations],
114[case "${enableval}" in
115 yes | "")
116 AC_MSG_ERROR([--enable-targets option must specify target names or 'all'])
117 ;;
118 no)
119 enable_targets=
120 ;;
121 *)
122 enable_targets=$enableval
123 ;;
124esac],
125[# For now, enable all targets by default
126 enable_targets=all
127])
128
129# Canonicalize the enabled targets.
130if test -n "$enable_targets"; then
131 for targ in `echo $enable_targets | sed -e 's/,/ /g'`; do
132 result=`$ac_config_sub $targ 2>/dev/null`
133 if test -n "$result"; then
134 canon_targets="$canon_targets $result"
135 else
136 # Permit unrecognized target names, like "all".
137 canon_targets="$canon_targets $targ"
138 fi
139 done
140fi
141
142# See which specific instantiations we need.
6df6da4a
ILT
143targetobjs=
144all_targets=
fbfba508
ILT
145default_machine=
146default_size=
147default_big_endian=
36959681 148default_osabi=ELFOSABI_NONE
fbfba508
ILT
149targ_32_little=
150targ_32_big=
151targ_64_little=
152targ_64_big=
193a53d9 153for targ in $target $canon_targets; do
193a53d9
ILT
154 if test "$targ" = "all"; then
155 targ_32_little=yes
156 targ_32_big=yes
157 targ_64_little=yes
158 targ_64_big=yes
6df6da4a 159 all_targets=yes
193a53d9 160 else
fbfba508
ILT
161 . ${srcdir}/configure.tgt
162
163 if test "$targ_obj" = "UNKNOWN"; then
6df6da4a 164 AC_MSG_ERROR("unsupported target $targ")
fbfba508
ILT
165 else
166 targetobjs="$targetobjs ${targ_obj}.\$(OBJEXT)"
60b2b4e7
ILT
167 if test "$targ_extra_obj" != ""; then
168 targetobjs="$targetobjs ${targ_extra_obj}.\$(OBJEXT)"
169 fi
f5314dd5
DM
170 if test "$targ_size" = "32" -o "$targ_extra_size" = "32"; then
171 if test "$targ_big_endian" = "true" \
172 -o "$targ_extra_big_endian" = "true"; then
173 targ_32_big=yes
174 fi
175 if test "$targ_big_endian" = "false" \
176 -o "$targ_extra_big_endian" = "false"; then
177 targ_32_little=yes
178 fi
179 fi
180 if test "$targ_size" = "64" -o "$targ_extra_size" = "64"; then
181 if test "$targ_big_endian" = "true" \
182 -o "$targ_extra_big_endian" = "true"; then
183 targ_64_big=yes
184 fi
185 if test "$targ_big_endian" = "false" \
186 -o "$targ_extra_big_endian" = "false"; then
187 targ_64_little=yes
188 fi
fbfba508
ILT
189 fi
190
191 if test "$target" = "$targ"; then
192 default_machine=$targ_machine
193 default_size=$targ_size
194 default_big_endian=$targ_big_endian
36959681 195 default_osabi=$targ_osabi
364c7fa5
ILT
196
197 AM_CONDITIONAL(DEFAULT_TARGET_ARM, test "$targ_obj" = "arm")
198 AM_CONDITIONAL(DEFAULT_TARGET_I386, test "$targ_obj" = "i386")
199 AM_CONDITIONAL(DEFAULT_TARGET_POWERPC, test "$targ_obj" = "powerpc")
200 AM_CONDITIONAL(DEFAULT_TARGET_SPARC, test "$targ_obj" = "sparc")
201 AM_CONDITIONAL(DEFAULT_TARGET_X86_64, test "$targ_obj" = "x86_64")
5c0b3823 202 AM_CONDITIONAL(DEFAULT_TARGET_TILEGX, test "$targ_obj" = "tilegx")
fbfba508
ILT
203 fi
204 fi
193a53d9
ILT
205 fi
206done
207
6cfaf60b 208# Remove any duplicates.
9109c078
ILT
209to=""
210for t in $targetobjs; do
211 case " $to " in
212 *" $t "*) ;;
213 *) to="$to $t" ;;
214 esac
215done
216targetobjs=$to
6cfaf60b 217
193a53d9
ILT
218if test -n "$targ_32_little"; then
219 AC_DEFINE(HAVE_TARGET_32_LITTLE, 1,
220 [Define to support 32-bit little-endian targets])
221fi
222if test -n "$targ_32_big"; then
223 AC_DEFINE(HAVE_TARGET_32_BIG, 1,
224 [Define to support 32-bit big-endian targets])
225fi
226if test -n "$targ_64_little"; then
227 AC_DEFINE(HAVE_TARGET_64_LITTLE, 1,
228 [Define to support 64-bit little-endian targets])
229fi
230if test -n "$targ_64_big"; then
231 AC_DEFINE(HAVE_TARGET_64_BIG, 1,
232 [Define to support 64-bit big-endian targets])
233fi
234
6df6da4a
ILT
235if test -n "$all_targets"; then
236 TARGETOBJS='$(ALL_TARGETOBJS)'
237else
238 TARGETOBJS="$targetobjs"
239fi
240AC_SUBST(TARGETOBJS)
241
fbfba508
ILT
242AC_DEFINE_UNQUOTED(GOLD_DEFAULT_MACHINE, $default_machine,
243 [Default machine code])
244AC_DEFINE_UNQUOTED(GOLD_DEFAULT_SIZE, $default_size,
245 [Default size (32 or 64)])
246AC_DEFINE_UNQUOTED(GOLD_DEFAULT_BIG_ENDIAN, $default_big_endian,
247 [Default big endian (true or false)])
36959681
ILT
248AC_DEFINE_UNQUOTED(GOLD_DEFAULT_OSABI, $default_osabi,
249 [Default OSABI code])
fbfba508 250
3f3cddf1
ILT
251AC_ARG_WITH(lib-path,
252[ --with-lib-path=dir1:dir2... set default LIB_PATH],
253[case "$withval" in
254 yes) LIB_PATH='"/lib:/usr/lib"' ;;
255 no) LIB_PATH='""' ;;
256 *) LIB_PATH='"'"$withval"'"' ;;
257 esac],
258[LIB_PATH='"::DEFAULT::"'])
259AC_DEFINE_UNQUOTED(LIB_PATH, $LIB_PATH,
260 [Default library search path])
261if test "x$target_alias" = "x" -o "x$host_alias" = "x$target_alias"; then
262 AC_DEFINE(NATIVE_LINKER, 1, [Whether configured as a native linker])
263fi
264
ebb300b2
CC
265AC_CHECK_TOOL(NM, nm)
266
bae7f79e
ILT
267AC_PROG_CC
268AC_PROG_CXX
dbe717ef 269AC_PROG_YACC
5a6f7e2d 270AC_PROG_RANLIB
bae7f79e 271AC_PROG_INSTALL
537b5f51 272AC_PROG_LN_S
fa99aa09
ILT
273
274AC_GNU_SOURCE
275
bae7f79e
ILT
276ZW_GNU_GETTEXT_SISTER_DIR
277AM_PO_SUBDIRS
278
92e059d8
ILT
279AC_C_BIGENDIAN
280
bae7f79e
ILT
281AC_EXEEXT
282
537b5f51
ILT
283AM_CONDITIONAL(NATIVE_LINKER,
284 test "x$target_alias" = "x" -o "x$host_alias" = "x$target_alias")
285AM_CONDITIONAL(GCC, test "$GCC" = yes)
286
eb373049
ILT
287AM_CONDITIONAL(NATIVE_OR_CROSS_LINKER,
288 test "x$target_alias" = "x" -o "x$host_alias" = "x$target_alias" -o "x$host_alias" = "x$build_alias")
289
328c7c2f
ILT
290dnl Test for whether static linking is supported. Some systems do not
291dnl install static libraries. This only affects the set of tests that
292dnl we run.
293AC_CACHE_CHECK([whether static linking works], [gold_cv_lib_static],
dd7af074 294[LDFLAGS_hold=$LDFLAGS
328c7c2f 295LDFLAGS="$LDFLAGS -static"
dd7af074 296AC_LINK_IFELSE([
328c7c2f 297AC_LANG_PROGRAM([[void f() { }]])],
dd7af074
ILT
298[gold_cv_lib_static=yes], [gold_cv_lib_static=no])
299LDFLAGS=$LDFLAGS_hold])
328c7c2f
ILT
300AM_CONDITIONAL(HAVE_STATIC, test "$gold_cv_lib_static" = "yes")
301
63402fe4
ILT
302dnl Some architectures do not support taking pointers of functions
303dnl defined in shared libraries except in -fPIC mode. We need to
304dnl tell the unittest framework if we're compiling for one of those
305dnl targets, so it doesn't try to run the tests that do that.
306AM_CONDITIONAL(FN_PTRS_IN_SO_WITHOUT_PIC, [
307 case $target_cpu in
864a1b56 308 powerpc*) false;;
63402fe4 309 x86_64) false;;
11936fb1 310 sparc64) false;;
63402fe4
ILT
311 *) true;;
312 esac])
313
084e2665
ILT
314dnl Test for gcc 4.1 or later. Full support for -mcmodel=medium is
315dnl only available in gcc 4.1.
316AC_CACHE_CHECK([for gcc >= 4.1], [gold_cv_prog_gcc41],
317[AC_COMPILE_IFELSE([
318#if !defined __GNUC__
319error
320#elif __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 1)
321error
322#endif
323], [gold_cv_prog_gcc41=yes], [gold_cv_prog_gcc41=no])])
324
24482ca0
L
325save_CFLAGS="$CFLAGS"
326CFLAGS="$CFLAGS -mcmodel=medium"
327AC_COMPILE_IFELSE([int i;], [have_mcmodel_medium=yes], [have_mcmodel_medium=no])
328CFLAGS="$save_CFLAGS"
8a5e3e08 329dnl Whether we can test -mcmodel=medium.
084e2665 330AM_CONDITIONAL(MCMODEL_MEDIUM,
24482ca0 331[test "$target_cpu" = "x86_64" -a "$have_mcmodel_medium" = "yes" -a "$gold_cv_prog_gcc41" = "yes"])
8a5e3e08 332
6eee141f 333dnl Test for __thread support.
097ec620
ILT
334AC_CACHE_CHECK([for thread support], [gold_cv_c_thread],
335[AC_COMPILE_IFELSE([__thread int i = 1;],
336[gold_cv_c_thread=yes], [gold_cv_c_thread=no])])
337
338AM_CONDITIONAL(TLS, test "$gold_cv_c_thread" = "yes")
339
340dnl On GNU/Linux TLS in static programs only works when using glibc
341dnl 2.4 or later.
342AC_CACHE_CHECK([for glibc >= 2.4], [gold_cv_lib_glibc24],
343[AC_COMPILE_IFELSE([
344#include <features.h>
345#if !defined __GLIBC__
346error
347#elif __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 4)
348error
349#endif
350], [gold_cv_lib_glibc24=yes], [gold_cv_lib_glibc24=no])])
351
352AM_CONDITIONAL(STATIC_TLS, test "$gold_cv_lib_glibc24" = "yes")
6eee141f 353
155a0dd7
ILT
354dnl Test for #pragma omp threadprivate
355AC_CACHE_CHECK([for omp support], [gold_cv_c_threadprivate],
356[save_CFLAGS="$CFLAGS"
357CFLAGS="$CFLAGS -fopenmp"
358AC_COMPILE_IFELSE([
359#include <omp.h>
360int i;
361#pragma omp threadprivate (i)
362], [gold_cv_c_threadprivate=yes], [gold_cv_c_threadprivate=no])
363CFLAGS="$save_CFLAGS"])
364if test "$gold_cv_c_threadprivate" = "yes"; then
365 AC_DEFINE(HAVE_OMP_SUPPORT, 1,
366 [Define if compiler supports #pragma omp threadprivate])
367fi
368AM_CONDITIONAL(OMP_SUPPORT, test "$gold_cv_c_threadprivate" = "yes")
369
c2b45e22
CC
370dnl Test for the -ftls-dialect=gnu2 option.
371save_CFLAGS="$CFLAGS"
63887f3d
L
372CFLAGS="$CFLAGS -fpic -mtls-dialect=gnu2"
373AC_COMPILE_IFELSE([
374__thread int i;
375void foo (void)
376{
377 i = 10;
378}
379], [have_tls_gnu2=yes], [have_tls_gnu2=no])
c2b45e22
CC
380CFLAGS="$save_CFLAGS"
381AM_CONDITIONAL(TLS_GNU2_DIALECT, test "$have_tls_gnu2" = "yes")
382
383dnl On GNU/Linux TLS descriptors are supported by the dynamic loader
b0074644
ILT
384dnl only with glibc 2.9 or later.
385AC_CACHE_CHECK([for glibc >= 2.9], [gold_cv_lib_glibc29],
c2b45e22
CC
386[AC_COMPILE_IFELSE([
387#include <features.h>
388#if !defined __GLIBC__
389error
b0074644 390#elif __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 9)
c2b45e22
CC
391error
392#endif
b0074644 393], [gold_cv_lib_glibc29=yes], [gold_cv_lib_glibc29=no])])
c2b45e22 394
b0074644 395AM_CONDITIONAL(TLS_DESCRIPTORS, test "$gold_cv_lib_glibc29" = "yes")
c2b45e22 396
1d1f116d
CD
397dnl Test for the -frandom-seed option.
398AC_CACHE_CHECK([for -frandom-seed support], [gold_cv_c_random_seed],
399[save_CFLAGS="$CFLAGS"
400CFLAGS="$CFLAGS -frandom-seed=foo"
401AC_COMPILE_IFELSE([int i;], [gold_cv_c_random_seed=yes],
402[gold_cv_c_random_seed=no])
403CFLAGS="$save_CFLAGS"])
404if test "$gold_cv_c_random_seed" = "yes"; then
405 # In Makefile, '$@' will be expanded to be the name of the file
406 # being built, providing a unique seed for each file.
407 RANDOM_SEED_CFLAGS=-frandom-seed=\$@
408fi
409AC_SUBST(RANDOM_SEED_CFLAGS)
410
7223e9ca 411dnl On GNU/Linux ifunc is supported by the dynamic linker in glibc
d0773f31 412dnl 2.11 or later, and by binutils 2.20.1 or later.
ebb300b2
CC
413AC_CACHE_CHECK([for glibc ifunc support], [gold_cv_lib_glibc_ifunc],
414[save_LDFLAGS="$LDFLAGS"
415LDFLAGS="$LDFLAGS -static"
416AC_LINK_IFELSE([AC_LANG_PROGRAM([[
7223e9ca
ILT
417#include <features.h>
418#if !defined __GLIBC__
419error
420#elif __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 11)
421error
422#endif
ebb300b2
CC
423void func (void) { }
424void invoke (void);
425__asm__(".type invoke, %gnu_indirect_function");
426typedef void (*funcptr) (void);
427funcptr dispatch (void) __asm__ ("invoke");
428funcptr dispatch (void) { return &func; }]],
429[[invoke();]])
430], [
431if ${NM} conftest$EXEEXT | grep "__rela\?_iplt_start" >/dev/null 2>&1; then
432 gold_cv_lib_glibc_ifunc=both
433else
434 gold_cv_lib_glibc_ifunc=dyn
435fi], [gold_cv_lib_glibc_ifunc=no])
436LDFLAGS="$save_LDFLAGS"])
7223e9ca 437
ebb300b2
CC
438AM_CONDITIONAL(IFUNC, test "$gold_cv_lib_glibc_ifunc" != "no")
439AM_CONDITIONAL(IFUNC_STATIC, test "$gold_cv_lib_glibc_ifunc" = "both")
7223e9ca 440
bae7f79e
ILT
441AM_BINUTILS_WARNINGS
442
2ea97941 443WARN_CXXFLAGS=`echo ${WARN_CFLAGS} | sed -e 's/-Wstrict-prototypes//' -e 's/-Wmissing-prototypes//' -e 's/-Wshadow//'`
bae7f79e
ILT
444AC_SUBST(WARN_CXXFLAGS)
445
dc87f620
ILT
446AC_ARG_WITH(gold-ldflags,
447[ --with-gold-ldflags=FLAGS additional link flags for gold],
448[if test "$withval" = "no" -o "$withval" = "yes"; then
449 GOLD_LDFLAGS=
450 else
451 GOLD_LDFLAGS=$withval
452 fi],
453[GOLD_LDFLAGS=])
454AC_SUBST(GOLD_LDFLAGS)
455
456AC_ARG_WITH(gold-ldadd,
457[ --with-gold-ldadd=LIBS additional libraries for gold],
458[if test "$withval" = "no" -o "$withval" = "yes"; then
459 GOLD_LDADD=
460 else
461 GOLD_LDADD=$withval
462 fi],
463[GOLD_LDADD=])
464AC_SUBST(GOLD_LDADD)
465
bae7f79e
ILT
466dnl Force support for large files by default. This may need to be
467dnl host dependent. If build == host, we can check getconf LFS_CFLAGS.
494e05f4
ILT
468LFS_CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
469AC_SUBST(LFS_CFLAGS)
bae7f79e 470
88597d34
ILT
471AC_CHECK_HEADERS(sys/mman.h)
472AC_CHECK_FUNCS(chsize mmap)
473AC_REPLACE_FUNCS(pread ftruncate ffsll)
474
475AC_CACHE_CHECK([mremap with MREMAP_MAYMOVE], [gold_cv_lib_mremap_maymove],
476[AC_LINK_IFELSE([
477AC_LANG_PROGRAM([[
478#include <sys/mman.h>
479void f() { mremap (0, 0, 0, MREMAP_MAYMOVE); }
480]])], [gold_cv_lib_mremap_maymove=yes], [gold_cv_lib_mremap_maymove=no])])
481if test "$gold_cv_lib_mremap_maymove" = "yes"; then
482 AC_DEFINE(HAVE_MREMAP, 1,
483 [Define to 1 if you have the mremap function with MREMAP_MAYMOVE support])
484else
485 AC_LIBOBJ(mremap)
486fi
82dcae9d 487
9a0910c3
ILT
488# Link in zlib if we can. This allows us to write compressed sections.
489AC_SEARCH_LIBS(zlibVersion, z, [AC_CHECK_HEADERS(zlib.h)])
7fcd0256 490AM_CONDITIONAL(HAVE_ZLIB, test "$ac_cv_search_zlibVersion" != "no")
9a0910c3 491
0639a6f6
ILT
492dnl We have to check these in C, not C++, because autoconf generates
493dnl tests which have no type information, and current glibc provides
494dnl multiple declarations of functions like basename when compiling
495dnl with C++.
496AC_CHECK_DECLS([basename, ffs, asprintf, vasprintf, snprintf, vsnprintf, strverscmp])
497
54dc6425 498AC_LANG_PUSH(C++)
d288e464 499
54dc6425
ILT
500AC_CHECK_HEADERS(tr1/unordered_set tr1/unordered_map)
501AC_CHECK_HEADERS(ext/hash_map ext/hash_set)
15d5fa16 502AC_CHECK_HEADERS(byteswap.h)
7c0640fa 503AC_CHECK_FUNCS(mallinfo posix_fallocate fallocate readv sysconf times)
3d857b98 504AC_CHECK_DECLS([basename, ffs, asprintf, vasprintf, snprintf, vsnprintf, strverscmp, strndup, memmem])
d288e464 505
40fde488
CD
506# Use of ::std::tr1::unordered_map::rehash causes undefined symbols
507# at link time with some versions of GCC.
508AC_CACHE_CHECK([whether ::std::tr1::unordered_map::rehash is usable.],
509[gold_cv_unordered_map_rehash],
510[AC_LINK_IFELSE([AC_LANG_PROGRAM([[
511#include <tr1/unordered_map>
512void bar() { ::std::tr1::unordered_map<int, int> x; x.rehash(10); }
513]])], [gold_cv_unordered_map_rehash=yes], [gold_cv_unordered_map_rehash=no])])
514if test "$gold_cv_unordered_map_rehash" = "yes"; then
515 AC_DEFINE(HAVE_TR1_UNORDERED_MAP_REHASH, 1,
516 [Define if ::std::tr1::unordered_map::rehash is usable])
517fi
518
81c82a68
ILT
519# Use of tr1/unordered_map with off_t as a key is not supported on GCC
520# 4.1.xx when compiling in 32-bit mode with a 64-bit off_t type.
521AC_CACHE_CHECK([whether std::tr1::hash<off_t> is defined],
522[gold_cv_hash_off_t],
523[CXXFLAGS_hold=$CXXFLAGS
524CXXFLAGS="$CXXFLAGS $LFS_CFLAGS"
525AC_COMPILE_IFELSE([
526#include <sys/types.h>
527#include <tr1/unordered_map>
528std::tr1::hash<off_t> h;
529],
530[gold_cv_hash_off_t=yes],
531[gold_cv_hash_off_t=no])
532CXXFLAGS=$CFLAGS_hold])
533if test "$gold_cv_hash_off_t" = "yes"; then
534 AC_DEFINE(HAVE_TR1_HASH_OFF_T, 1,
535 [Define if std::tr1::hash<off_t> is usable])
536fi
537
04bf7072
ILT
538# gcc 4.3.0 doesn't recognize the printf attribute on a template
539# function. Check for that. This is gcc bug 35546. This test can
540# probably be removed after the bug has been fixed for a while.
541AC_CACHE_CHECK([whether we can use attributes with template functions],
542[gold_cv_template_attribute],
543[AC_COMPILE_IFELSE([
544template<typename T> extern void foo(const char*, ...)
545 __attribute__ ((__format__ (__printf__, 1, 2)));
546template<typename T> void foo(const char* format, ...) {}
547void bar() { foo<int>("%s\n", "foo"); }
548], [gold_cv_template_attribute=yes], [gold_cv_template_attribute=no])])
549if test "$gold_cv_template_attribute" = "yes"; then
550 AC_DEFINE(HAVE_TEMPLATE_ATTRIBUTES, 1,
551 [Define if attributes work on C++ templates])
552fi
553
5d329b7d
ILT
554dnl Check if the system has struct stat::st_mtim.
555AC_CACHE_CHECK([for struct stat::st_mtim.],
556[gold_cv_stat_st_mtim],
557[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
558#include <sys/stat.h>
559long bar() { struct stat s; return (long)(s.st_mtim.tv_sec + s.st_mtim.tv_sec);}
560]])], [gold_cv_stat_st_mtim=yes], [gold_cv_stat_st_mtim=no])])
561if test "$gold_cv_stat_st_mtim" = "yes"; then
562 AC_DEFINE(HAVE_STAT_ST_MTIM, 1,
563 [Define if struct stat has a field st_mtim with timespec for mtime])
564fi
565
f1415016
CC
566dnl Check if gcc supports the -gpubnames option.
567save_CXXFLAGS="$CXXFLAGS"
568CXXFLAGS="$CXXFLAGS -gpubnames"
569AC_COMPILE_IFELSE([int i;], [have_pubnames=yes], [have_pubnames=no])
570CXXFLAGS="$save_CXXFLAGS"
571AM_CONDITIONAL(HAVE_PUBNAMES, test "$have_pubnames" = "yes")
572
54dc6425
ILT
573AC_LANG_POP(C++)
574
58797674 575AC_CHECK_HEADERS(locale.h)
44350750
NC
576AC_CHECK_FUNCS(setlocale)
577AM_LC_MESSAGES
578
bae7f79e
ILT
579AM_MAINTAINER_MODE
580
5a6f7e2d 581AC_OUTPUT(Makefile testsuite/Makefile po/Makefile.in:po/Make-in)
This page took 0.370767 seconds and 4 git commands to generate.