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