Commit | Line | Data |
---|---|---|
bae7f79e ILT |
1 | dnl Process this file with autoconf to produce a configure script. |
2 | ||
3 | AC_PREREQ(2.59) | |
4 | AC_INIT | |
5 | AC_CONFIG_SRCDIR([gold.cc]) | |
6 | ||
7 | AC_CANONICAL_TARGET | |
8 | ||
9 | AM_INIT_AUTOMAKE(gold, 0.1) | |
10 | ||
11 | AM_CONFIG_HEADER(config.h:config.in) | |
12 | ||
193a53d9 ILT |
13 | AC_ARG_ENABLE([targets], |
14 | [ --enable-targets alternative target configurations], | |
15 | [case "${enableval}" in | |
16 | yes | "") | |
17 | AC_MSG_ERROR([--enable-targets option must specify target names or 'all']) | |
18 | ;; | |
19 | no) | |
20 | enable_targets= | |
21 | ;; | |
22 | *) | |
23 | enable_targets=$enableval | |
24 | ;; | |
25 | esac], | |
26 | [# For now, enable all targets by default | |
27 | enable_targets=all | |
28 | ]) | |
29 | ||
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" | |
36 | else | |
37 | # Permit unrecognized target names, like "all". | |
38 | canon_targets="$canon_targets $targ" | |
39 | fi | |
40 | done | |
41 | fi | |
42 | ||
43 | # See which specific instantiations we need. | |
44 | for targ in $target $canon_targets; do | |
45 | targ_32_little= | |
46 | targ_32_big= | |
47 | targ_64_little= | |
48 | targ_64_big= | |
49 | if test "$targ" = "all"; then | |
50 | targ_32_little=yes | |
51 | targ_32_big=yes | |
52 | targ_64_little=yes | |
53 | targ_64_big=yes | |
54 | else | |
55 | case "$targ" in | |
56 | i?86-*) targ_32_little=yes ;; | |
57 | x86_64-*) targ_64_little=yes ;; | |
58 | *) | |
59 | AC_MSG_ERROR("target $targ: unknown size and endianness") | |
60 | ;; | |
61 | esac | |
62 | fi | |
63 | done | |
64 | ||
65 | if test -n "$targ_32_little"; then | |
66 | AC_DEFINE(HAVE_TARGET_32_LITTLE, 1, | |
67 | [Define to support 32-bit little-endian targets]) | |
68 | fi | |
69 | if test -n "$targ_32_big"; then | |
70 | AC_DEFINE(HAVE_TARGET_32_BIG, 1, | |
71 | [Define to support 32-bit big-endian targets]) | |
72 | fi | |
73 | if test -n "$targ_64_little"; then | |
74 | AC_DEFINE(HAVE_TARGET_64_LITTLE, 1, | |
75 | [Define to support 64-bit little-endian targets]) | |
76 | fi | |
77 | if test -n "$targ_64_big"; then | |
78 | AC_DEFINE(HAVE_TARGET_64_BIG, 1, | |
79 | [Define to support 64-bit big-endian targets]) | |
80 | fi | |
81 | ||
bae7f79e ILT |
82 | AC_PROG_CC |
83 | AC_PROG_CXX | |
dbe717ef | 84 | AC_PROG_YACC |
5a6f7e2d | 85 | AC_PROG_RANLIB |
bae7f79e ILT |
86 | AC_PROG_INSTALL |
87 | ZW_GNU_GETTEXT_SISTER_DIR | |
88 | AM_PO_SUBDIRS | |
89 | ||
92e059d8 ILT |
90 | AC_C_BIGENDIAN |
91 | ||
bae7f79e ILT |
92 | AC_EXEEXT |
93 | ||
94 | AM_BINUTILS_WARNINGS | |
95 | ||
96 | WARN_CXXFLAGS=`echo ${WARN_CFLAGS} | sed -e 's/-Wstrict-prototypes//' -e 's/-Wmissing-prototypes//'` | |
97 | AC_SUBST(WARN_CXXFLAGS) | |
98 | ||
99 | dnl Force support for large files by default. This may need to be | |
100 | dnl host dependent. If build == host, we can check getconf LFS_CFLAGS. | |
101 | LFS_CXXFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" | |
102 | AC_SUBST(LFS_CXXFLAGS) | |
103 | ||
54dc6425 | 104 | AC_LANG_PUSH(C++) |
d288e464 | 105 | |
54dc6425 ILT |
106 | AC_CHECK_HEADERS(tr1/unordered_set tr1/unordered_map) |
107 | AC_CHECK_HEADERS(ext/hash_map ext/hash_set) | |
d288e464 ILT |
108 | |
109 | dnl Test whether the compiler can specify a member templates to call. | |
110 | AC_COMPILE_IFELSE([ | |
111 | class c { public: template<int i> void fn(); }; | |
112 | template<int i> void foo(c cv) { cv.fn<i>(); } | |
113 | template void foo<1>(c cv);], | |
114 | [AC_DEFINE(HAVE_MEMBER_TEMPLATE_SPECIFICATIONS, [], | |
115 | [Whether the C++ compiler can call a template member with no arguments])]) | |
116 | ||
54dc6425 ILT |
117 | AC_LANG_POP(C++) |
118 | ||
bae7f79e ILT |
119 | AM_MAINTAINER_MODE |
120 | ||
5a6f7e2d | 121 | AC_OUTPUT(Makefile testsuite/Makefile po/Makefile.in:po/Make-in) |