Commit | Line | Data |
---|---|---|
ef346f1a ILT |
1 | dnl Process this file with autoconf to produce a configure script |
2 | dnl | |
b9a5c27f | 3 | AC_PREREG(2.5) |
ef346f1a ILT |
4 | AC_INIT(ldmain.c) |
5 | ||
49c009b5 ILT |
6 | AC_CANONICAL_SYSTEM |
7 | ||
eb8061bf | 8 | AM_INIT_AUTOMAKE(ld, 2.9.4) |
49c009b5 ILT |
9 | |
10 | AM_PROG_LIBTOOL | |
11 | ||
ef346f1a ILT |
12 | AC_ARG_ENABLE(targets, |
13 | [ --enable-targets alternative target configurations], | |
14 | [case "${enableval}" in | |
15 | yes | "") AC_ERROR(enable-targets option must specify target names or 'all') | |
16 | ;; | |
17 | no) enable_targets= ;; | |
18 | *) enable_targets=$enableval ;; | |
19 | esac])dnl | |
b9a5c27f RS |
20 | AC_ARG_ENABLE(64-bit-bfd, |
21 | [ --enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes)], | |
22 | [case "${enableval}" in | |
23 | yes) want64=true ;; | |
24 | no) want64=false ;; | |
25 | *) AC_MSG_ERROR(bad value ${enableval} for 64-bit-bfd option) ;; | |
26 | esac],[want64=false])dnl | |
ef346f1a | 27 | |
49c009b5 | 28 | AM_CONFIG_HEADER(config.h:config.in) |
ef346f1a | 29 | |
ef346f1a ILT |
30 | if test -z "$target" ; then |
31 | AC_MSG_ERROR(Unrecognized target system type; please check config.sub.) | |
32 | fi | |
33 | if test -z "$host" ; then | |
34 | AC_MSG_ERROR(Unrecognized host system type; please check config.sub.) | |
35 | fi | |
02757e59 | 36 | |
ef346f1a | 37 | # host-specific stuff: |
02757e59 | 38 | |
7e19f60e | 39 | AC_PROG_CC |
49c009b5 | 40 | AM_PROG_INSTALL |
8bc8f4bc TT |
41 | |
42 | ALL_LINGUAS= | |
43 | CY_GNU_GETTEXT | |
44 | ||
49c009b5 ILT |
45 | AM_EXEEXT |
46 | ||
47 | AC_PROG_YACC | |
8bc8f4bc | 48 | AM_PROG_LEX |
49c009b5 ILT |
49 | |
50 | AM_MAINTAINER_MODE | |
7e19f60e | 51 | |
ef346f1a | 52 | . ${srcdir}/configure.host |
02757e59 | 53 | |
ef346f1a ILT |
54 | AC_SUBST(HDEFINES) |
55 | AC_SUBST(HOSTING_CRT0) | |
56 | AC_SUBST(HOSTING_LIBS) | |
57 | AC_SUBST(NATIVE_LIB_DIRS) | |
8ddef552 | 58 | |
ef346f1a ILT |
59 | AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h) |
60 | AC_CHECK_FUNCS(sbrk) | |
2e598345 | 61 | AC_HEADER_DIRENT |
ab57b174 | 62 | |
ef346f1a | 63 | BFD_BINARY_FOPEN |
02757e59 | 64 | |
b9a5c27f | 65 | BFD_NEED_DECLARATION(strstr) |
2e598345 | 66 | BFD_NEED_DECLARATION(free) |
b9a5c27f RS |
67 | BFD_NEED_DECLARATION(sbrk) |
68 | BFD_NEED_DECLARATION(getenv) | |
2e598345 | 69 | |
ef346f1a | 70 | # target-specific stuff: |
02757e59 | 71 | |
95d31c3c | 72 | all_targets= |
ef346f1a ILT |
73 | EMUL= |
74 | all_emuls= | |
eb8061bf | 75 | all_emul_extras= |
03abc2bd ILT |
76 | |
77 | dnl We need to get an arbitrary number of tdir definitions into | |
78 | dnl Makefile. We can't do it using AC_SUBST, because autoconf does | |
79 | dnl not permit literal newlines in an AC_SUBST variables. So we use a | |
80 | dnl file. | |
81 | rm -f tdirs | |
1c4b3cda | 82 | |
95d31c3c | 83 | for targ_alias in `echo $target_alias $enable_targets | sed 's/,/ /g'` |
1c4b3cda | 84 | do |
95d31c3c ILT |
85 | if test "$targ_alias" = "all"; then |
86 | all_targets=true | |
87 | else | |
88 | # Canonicalize the secondary target names. | |
b9a5c27f | 89 | result=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $targ_alias 2>/dev/null` |
95d31c3c ILT |
90 | if test -n "$result"; then |
91 | targ=$result | |
1c4b3cda | 92 | else |
95d31c3c ILT |
93 | targ=$targ_alias |
94 | fi | |
7f2649bb | 95 | |
95d31c3c | 96 | . ${srcdir}/configure.tgt |
ef346f1a | 97 | |
95d31c3c ILT |
98 | if test "$targ" = "$target"; then |
99 | EMUL=$targ_emul | |
1c4b3cda | 100 | fi |
1c4b3cda | 101 | |
95d31c3c ILT |
102 | for i in $targ_emul $targ_extra_emuls; do |
103 | case " $all_emuls " in | |
104 | *" e${i}.o "*) ;; | |
105 | *) | |
106 | all_emuls="$all_emuls e${i}.o" | |
107 | eval result=\$tdir_$i | |
108 | test -z "$result" && result=$targ_alias | |
03abc2bd | 109 | echo tdir_$i=$result >> tdirs |
95d31c3c | 110 | ;; |
1c4b3cda ILT |
111 | esac |
112 | done | |
eb8061bf DD |
113 | |
114 | for i in $targ_extra_ofiles; do | |
115 | case " $all_emul_extras " in | |
116 | *" ${i} "*) ;; | |
117 | *) | |
118 | all_emul_extras="$all_emul_extras ${i}" | |
119 | ;; | |
120 | esac | |
121 | done | |
95d31c3c ILT |
122 | fi |
123 | done | |
1c4b3cda | 124 | |
95d31c3c | 125 | AC_SUBST(EMUL) |
03abc2bd ILT |
126 | |
127 | TDIRS=tdirs | |
128 | AC_SUBST_FILE(TDIRS) | |
1c4b3cda | 129 | |
b9a5c27f RS |
130 | dnl FIXME: We will build a 64 bit BFD for a 64 bit host or a 64 bit |
131 | dnl target, and in those cases we should also build the 64 bit | |
132 | dnl emulations. | |
95d31c3c | 133 | if test x${all_targets} = xtrue; then |
b9a5c27f RS |
134 | if test x${want64} = xtrue; then |
135 | EMULATION_OFILES='$(ALL_EMULATIONS) $(ALL_64_EMULATIONS)' | |
136 | else | |
137 | EMULATION_OFILES='$(ALL_EMULATIONS)' | |
138 | fi | |
e1dfd97d | 139 | EMUL_EXTRA_OFILES='$(ALL_EMUL_EXTRA_OFILES)' |
95d31c3c ILT |
140 | else |
141 | EMULATION_OFILES=$all_emuls | |
eb8061bf | 142 | EMUL_EXTRA_OFILES=$all_emul_extras |
95d31c3c | 143 | fi |
ef346f1a | 144 | AC_SUBST(EMULATION_OFILES) |
eb8061bf | 145 | AC_SUBST(EMUL_EXTRA_OFILES) |
8ddef552 | 146 | |
8bc8f4bc TT |
147 | if test x${enable_static} = xno; then |
148 | TESTBFDLIB="--rpath ../bfd/.libs ../bfd/.libs/libbfd.so" | |
149 | else | |
150 | TESTBFDLIB="../bfd/.libs/libbfd.a" | |
151 | fi | |
152 | AC_SUBST(TESTBFDLIB) | |
153 | ||
154 | AC_OUTPUT(Makefile po/Makefile.in:po/Make-in, | |
155 | [sed -e '/POTFILES =/r po/POTFILES' po/Makefile.in > po/Makefile]) |