oops - omitted from previous delta
[deliverable/binutils-gdb.git] / ld / configure.in
CommitLineData
252b5132
RH
1dnl Process this file with autoconf to produce a configure script
2dnl
68b2fc7a 3AC_PREREQ(2.13)
252b5132
RH
4AC_INIT(ldmain.c)
5
6AC_CANONICAL_SYSTEM
5d64ca4e 7AC_ISC_POSIX
252b5132 8
27b7e12d
AM
9changequote(,)dnl
10BFD_VERSION=`sed -n -e 's/^.._INIT_AUTOMAKE.*,[ ]*\([^ ]*\)[ ]*).*/\1/p' < ${srcdir}/../bfd/configure.in`
11changequote([,])dnl
12AM_INIT_AUTOMAKE(ld, ${BFD_VERSION})
252b5132
RH
13
14AM_PROG_LIBTOOL
15
16AC_ARG_ENABLE(targets,
17[ --enable-targets alternative target configurations],
18[case "${enableval}" in
19 yes | "") AC_ERROR(enable-targets option must specify target names or 'all')
20 ;;
21 no) enable_targets= ;;
22 *) enable_targets=$enableval ;;
23esac])dnl
24AC_ARG_ENABLE(64-bit-bfd,
25[ --enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes)],
26[case "${enableval}" in
27 yes) want64=true ;;
28 no) want64=false ;;
29 *) AC_MSG_ERROR(bad value ${enableval} for 64-bit-bfd option) ;;
30esac],[want64=false])dnl
31
0218d1e4 32build_warnings="-W -Wall -Wstrict-prototypes -Wmissing-prototypes"
a2d91340
AC
33AC_ARG_ENABLE(build-warnings,
34[ --enable-build-warnings Enable build-time compiler warnings if gcc is used],
35[case "${enableval}" in
36 yes) ;;
37 no) build_warnings="-w";;
38 ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"`
39 build_warnings="${build_warnings} ${t}";;
40 *,) t=`echo "${enableval}" | sed -e "s/,/ /g"`
41 build_warnings="${t} ${build_warnings}";;
42 *) build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
43esac
44if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then
45 echo "Setting warning flags = $build_warnings" 6>&1
46fi])dnl
47WARN_CFLAGS=""
48if test "x${build_warnings}" != x -a "x$GCC" = xyes ; then
49 WARN_CFLAGS="${build_warnings}"
50fi
51AC_SUBST(WARN_CFLAGS)
52
252b5132
RH
53AM_CONFIG_HEADER(config.h:config.in)
54
55if test -z "$target" ; then
56 AC_MSG_ERROR(Unrecognized target system type; please check config.sub.)
57fi
58if test -z "$host" ; then
59 AC_MSG_ERROR(Unrecognized host system type; please check config.sub.)
60fi
61
62# host-specific stuff:
63
64AC_PROG_CC
65AC_PROG_INSTALL
66
be2d1673 67ALL_LINGUAS="fr sv tr es"
252b5132
RH
68CY_GNU_GETTEXT
69
70AC_EXEEXT
71
72AC_PROG_YACC
73AM_PROG_LEX
74
75AM_MAINTAINER_MODE
76
77. ${srcdir}/configure.host
78
79AC_SUBST(HDEFINES)
80AC_SUBST(HOSTING_CRT0)
81AC_SUBST(HOSTING_LIBS)
82AC_SUBST(NATIVE_LIB_DIRS)
83
84AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h)
85AC_CHECK_FUNCS(sbrk)
86AC_HEADER_DIRENT
87
88BFD_BINARY_FOPEN
89
90BFD_NEED_DECLARATION(strstr)
91BFD_NEED_DECLARATION(free)
92BFD_NEED_DECLARATION(sbrk)
93BFD_NEED_DECLARATION(getenv)
94BFD_NEED_DECLARATION(environ)
95
597e2591
ILT
96# When converting linker scripts into strings for use in emulation
97# files, use astring.sed if the compiler supports ANSI string
98# concatenation, or ostring.sed otherwise. This is to support the
99# broken Microsoft MSVC compiler, which limits the length of string
100# constants, while still supporting pre-ANSI compilers which do not
101# support string concatenation.
e4dabd0e 102AC_MSG_CHECKING([whether ANSI C string concatenation works])
597e2591
ILT
103AC_CACHE_VAL(ld_cv_string_concatenation,
104[AC_TRY_COMPILE(,[char *a = "a" "a";],
e4dabd0e
AS
105 [ld_cv_string_concatenation=yes],
106 [ld_cv_string_concatenation=no])])
107AC_MSG_RESULT($ld_cv_string_concatenation)
108if test "$ld_cv_string_concatenation" = "yes"; then
597e2591
ILT
109 STRINGIFY=astring.sed
110else
111 STRINGIFY=ostring.sed
112fi
113AC_SUBST(STRINGIFY)
114
252b5132
RH
115# target-specific stuff:
116
117all_targets=
118EMUL=
119all_emuls=
120all_emul_extras=
ba2be581 121all_libpath=
252b5132
RH
122
123dnl We need to get an arbitrary number of tdir definitions into
124dnl Makefile. We can't do it using AC_SUBST, because autoconf does
125dnl not permit literal newlines in an AC_SUBST variables. So we use a
126dnl file.
127rm -f tdirs
128
129for targ_alias in `echo $target_alias $enable_targets | sed 's/,/ /g'`
130do
131 if test "$targ_alias" = "all"; then
132 all_targets=true
133 else
134 # Canonicalize the secondary target names.
a8100d5b 135 result=`$ac_config_sub $targ_alias 2>/dev/null`
252b5132
RH
136 if test -n "$result"; then
137 targ=$result
138 else
139 targ=$targ_alias
140 fi
141
142 . ${srcdir}/configure.tgt
143
144 if test "$targ" = "$target"; then
145 EMUL=$targ_emul
146 fi
147
3336653a 148 for i in $targ_emul $targ_extra_emuls $targ_extra_libpath; do
252b5132
RH
149 case " $all_emuls " in
150 *" e${i}.o "*) ;;
151 *)
152 all_emuls="$all_emuls e${i}.o"
153 eval result=\$tdir_$i
154 test -z "$result" && result=$targ_alias
155 echo tdir_$i=$result >> tdirs
156 ;;
157 esac
158 done
159
ba2be581 160 for i in $targ_emul $targ_extra_libpath; do
3336653a
RH
161 case " $all_libpath " in
162 *" ${i} "*) ;;
163 *)
ba2be581
RH
164 if test -z "$all_libpath"; then
165 all_libpath=${i}
166 else
167 all_libpath="$all_libpath ${i}"
168 fi
3336653a
RH
169 ;;
170 esac
171 done
172
252b5132
RH
173 for i in $targ_extra_ofiles; do
174 case " $all_emul_extras " in
175 *" ${i} "*) ;;
176 *)
177 all_emul_extras="$all_emul_extras ${i}"
178 ;;
179 esac
180 done
181 fi
182done
183
184AC_SUBST(EMUL)
185
186TDIRS=tdirs
187AC_SUBST_FILE(TDIRS)
188
189dnl FIXME: We will build a 64 bit BFD for a 64 bit host or a 64 bit
190dnl target, and in those cases we should also build the 64 bit
191dnl emulations.
192if test x${all_targets} = xtrue; then
193 if test x${want64} = xtrue; then
194 EMULATION_OFILES='$(ALL_EMULATIONS) $(ALL_64_EMULATIONS)'
195 else
196 EMULATION_OFILES='$(ALL_EMULATIONS)'
197 fi
198 EMUL_EXTRA_OFILES='$(ALL_EMUL_EXTRA_OFILES)'
199else
200 EMULATION_OFILES=$all_emuls
201 EMUL_EXTRA_OFILES=$all_emul_extras
202fi
203AC_SUBST(EMULATION_OFILES)
204AC_SUBST(EMUL_EXTRA_OFILES)
205
3336653a
RH
206EMULATION_LIBPATH=$all_libpath
207AC_SUBST(EMULATION_LIBPATH)
208
252b5132
RH
209if test x${enable_static} = xno; then
210 TESTBFDLIB="--rpath ../bfd/.libs ../bfd/.libs/libbfd.so"
211else
212 TESTBFDLIB="../bfd/.libs/libbfd.a"
213fi
214AC_SUBST(TESTBFDLIB)
215
93a6d436
JL
216target_vendor=${target_vendor=$host_vendor}
217case "$target_vendor" in
218 hp) EXTRA_SHLIB_EXTENSION=".sl" ;;
219 *) EXTRA_SHLIB_EXTENSION= ;;
220esac
221if test x${EXTRA_SHLIB_EXTENSION} != x ; then
222 AC_DEFINE_UNQUOTED(EXTRA_SHLIB_EXTENSION, "$EXTRA_SHLIB_EXTENSION",
223 [Additional extension a shared object might have.])
224fi
225
252b5132
RH
226AC_OUTPUT(Makefile po/Makefile.in:po/Make-in,
227[sed -e '/POTFILES =/r po/POTFILES' po/Makefile.in > po/Makefile])
This page took 0.180317 seconds and 4 git commands to generate.