Replace i[3456]86 with i[3-7]86
[deliverable/binutils-gdb.git] / binutils / configure.in
CommitLineData
252b5132
RH
1dnl Process this file with autoconf to produce a configure script.
2dnl
3AC_PREREQ(2.13)
4AC_INIT(ar.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(binutils, ${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(commonbfdlib,
25[ --enable-commonbfdlib build shared BFD/opcodes/libiberty library],
26[case "${enableval}" in
27 yes) commonbfdlib=true ;;
28 no) commonbfdlib=false ;;
29 *) AC_MSG_ERROR([bad value ${enableval} for BFD commonbfdlib option]) ;;
30esac])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
62AC_PROG_CC
63
64AC_PROG_YACC
65AM_PROG_LEX
66
3c92310f 67ALL_LINGUAS="fr tr ja es sv da zh_CN"
252b5132
RH
68CY_GNU_GETTEXT
69
70AM_MAINTAINER_MODE
71AC_EXEEXT
2481e6a2
ILT
72if test -n "$EXEEXT"; then
73 AC_DEFINE(HAVE_EXECUTABLE_SUFFIX, 1,
74 [Does the platform use an executable suffix?])
75fi
bb0cb4db
ILT
76AC_DEFINE_UNQUOTED(EXECUTABLE_SUFFIX, "${EXEEXT}",
77 [Suffix used for executables, if any.])
252b5132
RH
78
79# host-specific stuff:
80
81HDEFINES=
82
83. ${srcdir}/../bfd/configure.host
84
85AC_SUBST(HDEFINES)
86AR=${AR-ar}
87AC_SUBST(AR)
88AC_PROG_RANLIB
89AC_PROG_INSTALL
90
91BFD_CC_FOR_BUILD
92
8a965946
ILT
93DEMANGLER_NAME=c++filt
94case "${host}" in
95 *-*-go32* | *-*-msdos*)
96 DEMANGLER_NAME=cxxfilt
97esac
98AC_SUBST(DEMANGLER_NAME)
99
252b5132
RH
100AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h)
101AC_HEADER_SYS_WAIT
102AC_FUNC_ALLOCA
9710509e 103AC_CHECK_FUNCS(sbrk utimes setmode getc_unlocked strcoll)
cedd9a58
JJ
104
105# Check whether fopen64 is available and whether _LARGEFILE64_SOURCE
106# needs to be defined for it
107AC_MSG_CHECKING([for fopen64])
108AC_CACHE_VAL(bu_cv_have_fopen64,
109[AC_TRY_LINK([#include <stdio.h>], [FILE *f = fopen64 ("/tmp/foo","r");],
110bu_cv_have_fopen64=yes,
111[saved_CPPFLAGS=$CPPFLAGS
112 CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE"
113 AC_TRY_LINK([#include <stdio.h>], [FILE *f = fopen64 ("/tmp/foo","r");],
114bu_cv_have_fopen64="need -D_LARGEFILE64_SOURCE",
115bu_cv_have_fopen64=no)
116 CPPFLAGS=$saved_CPPFLAGS])])
117AC_MSG_RESULT($bu_cv_have_fopen64)
6db7a086 118if test "$bu_cv_have_fopen64" != no; then
cedd9a58
JJ
119 AC_DEFINE([HAVE_FOPEN64], 1,
120 [Is fopen64 available?])
6db7a086 121 if test "$bu_cv_have_fopen64" = "need -D_LARGEFILE64_SOURCE"; then
cedd9a58
JJ
122 AC_DEFINE([_LARGEFILE64_SOURCE], 1,
123 [Enable LFS])
124 fi
125fi
252b5132 126
f353eb8a 127# Some systems have frexp only in -lm, not in -lc.
07735828 128AC_SEARCH_LIBS(frexp, m)
f353eb8a 129
252b5132
RH
130AC_MSG_CHECKING(for time_t in time.h)
131AC_CACHE_VAL(bu_cv_decl_time_t_time_h,
132[AC_TRY_COMPILE([#include <time.h>], [time_t i;],
133bu_cv_decl_time_t_time_h=yes, bu_cv_decl_time_t_time_h=no)])
134AC_MSG_RESULT($bu_cv_decl_time_t_time_h)
135if test $bu_cv_decl_time_t_time_h = yes; then
136 AC_DEFINE([HAVE_TIME_T_IN_TIME_H], 1,
137 [Is the type time_t defined in <time.h>?])
138fi
139
140AC_MSG_CHECKING(for time_t in sys/types.h)
141AC_CACHE_VAL(bu_cv_decl_time_t_types_h,
142[AC_TRY_COMPILE([#include <sys/types.h>], [time_t i;],
143bu_cv_decl_time_t_types_h=yes, bu_cv_decl_time_t_types_h=no)])
144AC_MSG_RESULT($bu_cv_decl_time_t_types_h)
145if test $bu_cv_decl_time_t_types_h = yes; then
146 AC_DEFINE([HAVE_TIME_T_IN_TYPES_H], 1,
147 [Is the type time_t defined in <sys/types.h>?])
148fi
149
150# Under Next 3.2 <utime.h> apparently does not define struct utimbuf
151# by default.
152AC_MSG_CHECKING([for utime.h])
153AC_CACHE_VAL(bu_cv_header_utime_h,
154[AC_TRY_COMPILE([#include <sys/types.h>
155#ifdef HAVE_TIME_H
156#include <time.h>
157#endif
158#include <utime.h>],
159[struct utimbuf s;],
160bu_cv_header_utime_h=yes, bu_cv_header_utime_h=no)])
161AC_MSG_RESULT($bu_cv_header_utime_h)
162if test $bu_cv_header_utime_h = yes; then
163 AC_DEFINE(HAVE_GOOD_UTIME_H, 1, [Does <utime.h> define struct utimbuf?])
164fi
165
166BFD_NEED_DECLARATION(fprintf)
167BFD_NEED_DECLARATION(strstr)
168BFD_NEED_DECLARATION(sbrk)
169BFD_NEED_DECLARATION(getenv)
170BFD_NEED_DECLARATION(environ)
171
172BFD_BINARY_FOPEN
173
174# target-specific stuff:
175
176# Canonicalize the secondary target names.
177if test -n "$enable_targets"; then
178 for targ in `echo $enable_targets | sed 's/,/ /g'`
179 do
6d83c84b 180 result=`$ac_config_sub $targ 2>/dev/null`
252b5132
RH
181 if test -n "$result"; then
182 canon_targets="$canon_targets $result"
183 else
184 # Allow targets that config.sub doesn't recognize, like "all".
185 canon_targets="$canon_targets $targ"
186 fi
187 done
188fi
189
190all_targets=false
191BUILD_NLMCONV=
192NLMCONV_DEFS=
193BUILD_SRCONV=
194BUILD_DLLTOOL=
195DLLTOOL_DEFS=
196BUILD_WINDRES=
197BUILD_DLLWRAP=
198BUILD_MISC=
8b1e6df3 199OBJDUMP_DEFS=
252b5132
RH
200
201for targ in $target $canon_targets
202do
203 if test "x$targ" = "xall"; then
204 all_targets=true
205 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
206 BUILD_SRCONV='$(SRCONV_PROG)'
207 NLMCONV_DEFS="-DNLMCONV_I386 -DNLMCONV_ALPHA -DNLMCONV_POWERPC -DNLMCONV_SPARC"
208 else
209 case $targ in
210changequote(,)dnl
80c7c40a 211 i[3-7]86*-*-netware*)
252b5132
RH
212changequote([,])dnl
213 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
214 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_I386"
215 ;;
216 alpha*-*-netware*)
217 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
218 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_ALPHA"
219 ;;
220 powerpc*-*-netware*)
221 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
222 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_POWERPC"
223 ;;
224 sparc*-*-netware*)
225 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
226 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_SPARC"
227 ;;
228 esac
229 case $targ in
230 *-*-hms*) BUILD_SRCONV='$(SRCONV_PROG)' ;;
231 esac
232 case $targ in
a8c548cb
NC
233 arm-epoc-pe*)
234 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
235 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM_EPOC -DDLLTOOL_ARM"
236 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
237 ;;
27a710e5 238 arm-*-pe* | arm-*-wince)
252b5132
RH
239 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
240 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
241 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
7a7b06ef 242 ;;
27a710e5 243 thumb-*-pe*)
252b5132
RH
244 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
245 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
246 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
7a7b06ef 247 ;;
c7217458 248 arm*-* | xscale-* | strongarm-* | d10v-*)
8b1e6df3
NC
249 OBJDUMP_DEFS="-DDISASSEMBLER_NEEDS_RELOCS"
250 ;;
252b5132 251changequote(,)dnl
80c7c40a 252 i[3-7]86-*-pe* | i[3-7]86-*-cygwin* | i[3-7]86-*-mingw32** | i[3-7]86-*-netbsdpe*)
252b5132
RH
253changequote([,])dnl
254 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
255 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
256 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
257 BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
7a7b06ef 258 ;;
80c7c40a
NC
259changequote(,)dnl
260 i[3-7]86-*-interix)
261changequote([,])dnl
7a7b06ef
ILT
262 BUILD_DLLTOOL='$(DLLTOOL_PROG)'
263 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
264 ;;
e1d5b1e7 265 powerpc*-*-pe* | powerpc*-*-cygwin*)
252b5132
RH
266 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
267 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_PPC"
268 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
7a7b06ef 269 ;;
e1d5b1e7 270 sh*-*-pe)
8a0e0f38
NC
271 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
272 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_SH"
273 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
274 ;;
e1d5b1e7 275 mips*-*-pe)
8a0e0f38
NC
276 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
277 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MIPS"
278 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
279 ;;
27a710e5 280 mcore-*-pe)
661016bb
NC
281 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
282 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE"
283 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
7a7b06ef 284 ;;
27a710e5 285 mcore-*-elf)
661016bb
NC
286 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
287 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE_ELF"
7a7b06ef 288 ;;
1a09a22c
NC
289 c4x-*-* | tic4x-*-*)
290 OBJDUMP_DEFS="$OBJDUMP_DEFS -DSKIP_ZEROES=32"
291 ;;
d070dab9
JW
292 ia64-*-*)
293 OBJDUMP_DEFS="$OBJDUMP_DEFS -DSKIP_ZEROES=16"
294 ;;
252b5132
RH
295 esac
296 fi
297done
298
c918cb96
DD
299if test "${with_windres+set}" = set; then
300 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
301fi
302
252b5132
RH
303AC_SUBST(NLMCONV_DEFS)
304AC_SUBST(BUILD_NLMCONV)
305AC_SUBST(BUILD_SRCONV)
306AC_SUBST(BUILD_DLLTOOL)
307AC_SUBST(DLLTOOL_DEFS)
308AC_SUBST(BUILD_WINDRES)
309AC_SUBST(BUILD_DLLWRAP)
310AC_SUBST(BUILD_MISC)
8b1e6df3 311AC_SUBST(OBJDUMP_DEFS)
252b5132
RH
312
313AC_DEFINE_UNQUOTED(TARGET, "${target}", [Configured target name.])
314
315targ=$target
316. $srcdir/../bfd/config.bfd
317if test "x$targ_underscore" = "xyes"; then
318 UNDERSCORE=1
319else
320 UNDERSCORE=0
321fi
bb279dc0
ZW
322AC_DEFINE_UNQUOTED(TARGET_PREPENDS_UNDERSCORE, $UNDERSCORE,
323 [Define to 1 if user symbol names have a leading underscore, 0 if not.])
252b5132 324
eb1e0e80
NC
325# Emulation
326for targ_alias in `echo $target_alias $enable_targets | sed 's/,/ /g'`
327do
328 # Canonicalize the secondary target names.
329 result=`$ac_config_sub $targ_alias 2>/dev/null`
330 if test -n "$result"; then
331 targ=$result
332 else
333 targ=$targ_alias
334 fi
335
336 . ${srcdir}/configure.tgt
337
338 EMULATION=$targ_emul
339 EMULATION_VECTOR=$targ_emul_vector
340done
341
342AC_SUBST(EMULATION)
343AC_SUBST(EMULATION_VECTOR)
344
c45021f2 345AC_OUTPUT(Makefile doc/Makefile po/Makefile.in:po/Make-in,
252b5132
RH
346[
347case "x$CONFIG_FILES" in
348*) sed -e '/POTFILES =/r po/POTFILES' po/Makefile.in > po/Makefile ;;
349esac
350])
This page took 0.166967 seconds and 4 git commands to generate.