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