1 dnl Process this file with autoconf to produce a configure script.
5 AC_CONFIG_SRCDIR([gold.cc])
9 AM_INIT_AUTOMAKE(gold, 0.1)
11 AM_CONFIG_HEADER(config.h:config.in)
13 AC_ARG_ENABLE([targets],
14 [ --enable-targets alternative target configurations],
15 [case "${enableval}" in
17 AC_MSG_ERROR([--enable-targets option must specify target names or 'all'])
23 enable_targets=$enableval
26 [# For now, enable all targets by default
30 # Canonicalize the enabled targets.
31 if test -n "$enable_targets"; then
32 for targ in `echo $enable_targets | sed -e 's/,/ /g'`; do
33 result=`$ac_config_sub $targ 2>/dev/null`
34 if test -n "$result"; then
35 canon_targets="$canon_targets $result"
37 # Permit unrecognized target names, like "all".
38 canon_targets="$canon_targets $targ"
43 # See which specific instantiations we need.
46 for targ in $target $canon_targets; do
51 if test "$targ" = "all"; then
61 targetobjs="$targetobjs i386.\$(OBJEXT)"
65 targetobjs="$targetobjs x86_64.\$(OBJEXT)"
68 AC_MSG_ERROR("unsupported target $targ")
74 if test -n "$targ_32_little"; then
75 AC_DEFINE(HAVE_TARGET_32_LITTLE, 1,
76 [Define to support 32-bit little-endian targets])
78 if test -n "$targ_32_big"; then
79 AC_DEFINE(HAVE_TARGET_32_BIG, 1,
80 [Define to support 32-bit big-endian targets])
82 if test -n "$targ_64_little"; then
83 AC_DEFINE(HAVE_TARGET_64_LITTLE, 1,
84 [Define to support 64-bit little-endian targets])
86 if test -n "$targ_64_big"; then
87 AC_DEFINE(HAVE_TARGET_64_BIG, 1,
88 [Define to support 64-bit big-endian targets])
91 if test -n "$all_targets"; then
92 TARGETOBJS='$(ALL_TARGETOBJS)'
94 TARGETOBJS="$targetobjs"
104 ZW_GNU_GETTEXT_SISTER_DIR
111 AM_CONDITIONAL(NATIVE_LINKER,
112 test "x$target_alias" = "x" -o "x$host_alias" = "x$target_alias")
113 AM_CONDITIONAL(GCC, test "$GCC" = yes)
115 dnl Some architectures do not support taking pointers of functions
116 dnl defined in shared libraries except in -fPIC mode. We need to
117 dnl tell the unittest framework if we're compiling for one of those
118 dnl targets, so it doesn't try to run the tests that do that.
119 AM_CONDITIONAL(FN_PTRS_IN_SO_WITHOUT_PIC, [
128 WARN_CXXFLAGS=`echo ${WARN_CFLAGS} | sed -e 's/-Wstrict-prototypes//' -e 's/-Wmissing-prototypes//'`
129 AC_SUBST(WARN_CXXFLAGS)
131 dnl Force support for large files by default. This may need to be
132 dnl host dependent. If build == host, we can check getconf LFS_CFLAGS.
133 LFS_CXXFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
134 AC_SUBST(LFS_CXXFLAGS)
136 AC_REPLACE_FUNCS(pread)
140 AC_CHECK_HEADERS(tr1/unordered_set tr1/unordered_map)
141 AC_CHECK_HEADERS(ext/hash_map ext/hash_set)
143 dnl Test whether the compiler can specify a member templates to call.
145 class c { public: template<int i> void fn(); };
146 template<int i> void foo(c cv) { cv.fn<i>(); }
147 template void foo<1>(c cv);],
148 [AC_DEFINE(HAVE_MEMBER_TEMPLATE_SPECIFICATIONS, [],
149 [Whether the C++ compiler can call a template member with no arguments])])
155 AC_OUTPUT(Makefile testsuite/Makefile po/Makefile.in:po/Make-in)