PR 14072
[deliverable/binutils-gdb.git] / binutils / configure.in
1 dnl Process this file with autoconf to produce a configure script.
2 dnl
3 AC_PREREQ(2.59)
4 AC_INIT
5 AC_CONFIG_SRCDIR(ar.c)
6
7 AC_CANONICAL_TARGET
8 AC_ISC_POSIX
9
10 changequote(,)dnl
11 BFD_VERSION=`sed -n -e 's/^.._INIT_AUTOMAKE.*,[ ]*\([^ ]*\)[ ]*).*/\1/p' < ${srcdir}/../bfd/configure.in`
12 changequote([,])dnl
13 AM_INIT_AUTOMAKE(binutils, ${BFD_VERSION})
14
15 AC_PROG_CC
16 AC_GNU_SOURCE
17 AC_USE_SYSTEM_EXTENSIONS
18
19 ACX_LARGEFILE
20 LT_INIT
21
22 AC_ARG_ENABLE(targets,
23 [ --enable-targets alternative target configurations],
24 [case "${enableval}" in
25 yes | "") AC_MSG_ERROR(enable-targets option must specify target names or 'all')
26 ;;
27 no) enable_targets= ;;
28 *) enable_targets=$enableval ;;
29 esac])dnl
30
31 AC_ARG_ENABLE(deterministic-archives,
32 [AS_HELP_STRING([--enable-deterministic-archives],
33 [ar and ranlib default to -D behavior])], [
34 if test "${enableval}" = no; then
35 default_ar_deterministic=0
36 else
37 default_ar_deterministic=1
38 fi], [default_ar_deterministic=0])
39
40 AC_DEFINE_UNQUOTED(DEFAULT_AR_DETERMINISTIC, $default_ar_deterministic,
41 [Should ar and ranlib use -D behavior by default?])
42
43 AM_BINUTILS_WARNINGS
44
45 AC_CONFIG_HEADERS(config.h:config.in)
46
47 AH_VERBATIM([00_CONFIG_H_CHECK],
48 [/* Check that config.h is #included before system headers
49 (this works only for glibc, but that should be enough). */
50 #if defined(__GLIBC__)
51 # error config.h must be #included before system headers
52 #endif])
53
54 if test -z "$target" ; then
55 AC_MSG_ERROR(Unrecognized target system type; please check config.sub.)
56 fi
57 if test -z "$host" ; then
58 AC_MSG_ERROR(Unrecognized host system type; please check config.sub.)
59 fi
60
61 AC_PROG_YACC
62 AM_PROG_LEX
63
64 ALL_LINGUAS="bg da es fi fr id it ja ro ru rw sk sv tr uk vi zh_CN zh_TW"
65 ZW_GNU_GETTEXT_SISTER_DIR
66 AM_PO_SUBDIRS
67
68 AM_MAINTAINER_MODE
69 AM_CONDITIONAL(GENINSRC_NEVER, false)
70 AC_EXEEXT
71 if test -n "$EXEEXT"; then
72 AC_DEFINE(HAVE_EXECUTABLE_SUFFIX, 1,
73 [Does the platform use an executable suffix?])
74 fi
75 AC_DEFINE_UNQUOTED(EXECUTABLE_SUFFIX, "${EXEEXT}",
76 [Suffix used for executables, if any.])
77
78 # host-specific stuff:
79
80 HDEFINES=
81
82 . ${srcdir}/../bfd/configure.host
83
84 AC_SUBST(HDEFINES)
85 AR=${AR-ar}
86 AC_SUBST(AR)
87 AC_PROG_RANLIB
88 AC_PROG_INSTALL
89
90 BFD_CC_FOR_BUILD
91
92 DEMANGLER_NAME=c++filt
93 case "${host}" in
94 *-*-go32* | *-*-msdos*)
95 DEMANGLER_NAME=cxxfilt
96 esac
97 AC_SUBST(DEMANGLER_NAME)
98
99 AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h limits.h locale.h sys/param.h)
100 AC_HEADER_SYS_WAIT
101 ACX_HEADER_STRING
102 AC_FUNC_ALLOCA
103 AC_CHECK_FUNCS(sbrk utimes setmode getc_unlocked strcoll setlocale)
104 AC_CHECK_FUNC([mkstemp],
105 AC_DEFINE([HAVE_MKSTEMP], 1,
106 [Define to 1 if you have the `mkstemp' function.]))
107 AC_CHECK_FUNC([mkdtemp],
108 AC_DEFINE([HAVE_MKDTEMP], 1,
109 [Define to 1 if you have the `mkdtemp' function.]))
110
111 # Some systems have frexp only in -lm, not in -lc.
112 AC_SEARCH_LIBS(frexp, m)
113
114 AM_LC_MESSAGES
115
116 AC_MSG_CHECKING(for time_t in time.h)
117 AC_CACHE_VAL(bu_cv_decl_time_t_time_h,
118 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <time.h>], [time_t i;])],
119 bu_cv_decl_time_t_time_h=yes, bu_cv_decl_time_t_time_h=no)])
120 AC_MSG_RESULT($bu_cv_decl_time_t_time_h)
121 if test $bu_cv_decl_time_t_time_h = yes; then
122 AC_DEFINE([HAVE_TIME_T_IN_TIME_H], 1,
123 [Is the type time_t defined in <time.h>?])
124 fi
125
126 AC_MSG_CHECKING(for time_t in sys/types.h)
127 AC_CACHE_VAL(bu_cv_decl_time_t_types_h,
128 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/types.h>], [time_t i;])],
129 bu_cv_decl_time_t_types_h=yes, bu_cv_decl_time_t_types_h=no)])
130 AC_MSG_RESULT($bu_cv_decl_time_t_types_h)
131 if test $bu_cv_decl_time_t_types_h = yes; then
132 AC_DEFINE([HAVE_TIME_T_IN_TYPES_H], 1,
133 [Is the type time_t defined in <sys/types.h>?])
134 fi
135
136 AC_MSG_CHECKING(for a known getopt prototype in unistd.h)
137 AC_CACHE_VAL(bu_cv_decl_getopt_unistd_h,
138 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <unistd.h>], [extern int getopt (int, char *const*, const char *);])],
139 bu_cv_decl_getopt_unistd_h=yes, bu_cv_decl_getopt_unistd_h=no)])
140 AC_MSG_RESULT($bu_cv_decl_getopt_unistd_h)
141 if test $bu_cv_decl_getopt_unistd_h = yes; then
142 AC_DEFINE([HAVE_DECL_GETOPT], 1,
143 [Is the prototype for getopt in <unistd.h> in the expected format?])
144 fi
145
146 # Under Next 3.2 <utime.h> apparently does not define struct utimbuf
147 # by default.
148 AC_MSG_CHECKING([for utime.h])
149 AC_CACHE_VAL(bu_cv_header_utime_h,
150 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/types.h>
151 #ifdef HAVE_TIME_H
152 #include <time.h>
153 #endif
154 #include <utime.h>],
155 [struct utimbuf s;])],
156 bu_cv_header_utime_h=yes, bu_cv_header_utime_h=no)])
157 AC_MSG_RESULT($bu_cv_header_utime_h)
158 if test $bu_cv_header_utime_h = yes; then
159 AC_DEFINE(HAVE_GOOD_UTIME_H, 1, [Does <utime.h> define struct utimbuf?])
160 fi
161
162 AC_CHECK_DECLS([fprintf, stpcpy, strstr, sbrk, getenv, environ, getc_unlocked,
163 snprintf, vsnprintf])
164
165 # Link in zlib if we can. This allows us to read compressed debug
166 # sections. This is used only by readelf.c (objdump uses bfd for
167 # reading compressed sections).
168 AM_ZLIB
169
170 BFD_BINARY_FOPEN
171
172 # target-specific stuff:
173
174 # Canonicalize the secondary target names.
175 if test -n "$enable_targets"; then
176 for targ in `echo $enable_targets | sed 's/,/ /g'`
177 do
178 result=`$ac_config_sub $targ 2>/dev/null`
179 if test -n "$result"; then
180 canon_targets="$canon_targets $result"
181 else
182 # Allow targets that config.sub doesn't recognize, like "all".
183 canon_targets="$canon_targets $targ"
184 fi
185 done
186 fi
187
188 AC_CHECK_HEADER(iconv.h)
189 AM_ICONV
190
191 all_targets=false
192 BUILD_NLMCONV=
193 NLMCONV_DEFS=
194 BUILD_SRCONV=
195 BUILD_DLLTOOL=
196 DLLTOOL_DEFS=
197 DLLTOOL_DEFAULT=
198 BUILD_WINDRES=
199 BUILD_WINDMC=
200 BUILD_DLLWRAP=
201 BUILD_MISC=
202 BUILD_INSTALL_MISC=
203 OBJDUMP_DEFS=
204 OBJDUMP_PRIVATE_VECTORS=
205 OBJDUMP_PRIVATE_OFILES=
206 od_vectors=
207
208 for targ in $target $canon_targets
209 do
210 if test "x$targ" = "xall"; then
211 all_targets=true
212 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
213 BUILD_SRCONV='$(SRCONV_PROG)'
214 NLMCONV_DEFS="-DNLMCONV_I386 -DNLMCONV_ALPHA -DNLMCONV_POWERPC -DNLMCONV_SPARC"
215 BUILD_MISC="${BUILD_MISC} "'bin2c$(EXEEXT_FOR_BUILD)'
216 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
217 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
218 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
219 if test -z "$DLLTOOL_DEFAULT"; then
220 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_I386"
221 fi
222 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
223 BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
224 od_vectors="$od_vectors objdump_private_desc_xcoff"
225 else
226 case $targ in
227 changequote(,)dnl
228 i[3-7]86*-*-netware*)
229 changequote([,])dnl
230 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
231 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_I386"
232 ;;
233 alpha*-*-netware*)
234 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
235 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_ALPHA"
236 ;;
237 powerpc*-*-netware*)
238 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
239 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_POWERPC"
240 ;;
241 sparc*-*-netware*)
242 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
243 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_SPARC"
244 ;;
245 esac
246
247 case $targ in
248 *-*-hms*) BUILD_SRCONV='$(SRCONV_PROG)' ;;
249 esac
250
251 case $targ in
252 arm-epoc-pe*)
253 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
254 if test -z "$DLLTOOL_DEFAULT"; then
255 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM_EPOC"
256 fi
257 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM_EPOC -DDLLTOOL_ARM"
258 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
259 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
260 ;;
261 arm-wince-pe* | arm-*-wince | arm*-*-cegcc* | arm*-*-mingw32ce*)
262 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
263 if test -z "$DLLTOOL_DEFAULT"; then
264 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM_WINCE"
265 fi
266 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM_WINCE -DDLLTOOL_ARM"
267 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
268 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
269 ;;
270 arm-*-pe*)
271 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
272 if test -z "$DLLTOOL_DEFAULT"; then
273 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM"
274 fi
275 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
276 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
277 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
278 ;;
279 x86_64-*-mingw*)
280 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
281 if test -z "$DLLTOOL_DEFAULT"; then
282 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MX86_64"
283 fi
284 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MX86_64"
285 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
286 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
287 BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
288 ;;
289 changequote(,)dnl
290 i[3-7]86-*-pe* | i[3-7]86-*-cygwin* | i[3-7]86-*-mingw32** | i[3-7]86-*-netbsdpe*)
291 changequote([,])dnl
292 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
293 if test -z "$DLLTOOL_DEFAULT"; then
294 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_I386"
295 fi
296 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
297 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
298 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
299 BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
300 ;;
301 changequote(,)dnl
302 i[3-7]86-*-interix)
303 changequote([,])dnl
304 BUILD_DLLTOOL='$(DLLTOOL_PROG)'
305 if test -z "$DLLTOOL_DEFAULT"; then
306 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_I386"
307 fi
308 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
309 ;;
310 changequote(,)dnl
311 powerpc*-aix5.[01])
312 changequote([,])dnl
313 ;;
314 changequote(,)dnl
315 powerpc*-aix[5-9].*)
316 changequote([,])dnl
317 OBJDUMP_DEFS="-DAIX_WEAK_SUPPORT"
318 ;;
319 powerpc*-*-pe* | powerpc*-*-cygwin*)
320 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
321 if test -z "$DLLTOOL_DEFAULT"; then
322 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_PPC"
323 fi
324 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_PPC"
325 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
326 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
327 ;;
328 powerpc*-*-linux* | powerpc*-*-elf* | powerpc*-*-eabi*)
329 case "$BUILD_INSTALL_MISC" in
330 *embedspu*) ;;
331 *) BUILD_INSTALL_MISC="${BUILD_INSTALL_MISC} embedspu"
332 esac
333 ;;
334 sh*-*-pe)
335 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
336 if test -z "$DLLTOOL_DEFAULT"; then
337 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_SH"
338 fi
339 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_SH"
340 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
341 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
342 ;;
343 spu-*-*)
344 BUILD_MISC="${BUILD_MISC} "'bin2c$(EXEEXT_FOR_BUILD)'
345 ;;
346 mips*-*-pe)
347 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
348 if test -z "$DLLTOOL_DEFAULT"; then
349 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MIPS"
350 fi
351 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MIPS"
352 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
353 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
354 ;;
355 mcore-*-pe)
356 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
357 if test -z "$DLLTOOL_DEFAULT"; then
358 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MCORE"
359 fi
360 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE"
361 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
362 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
363 ;;
364 mcore-*-elf)
365 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
366 if test -z "$DLLTOOL_DEFAULT"; then
367 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MCORE_ELF"
368 fi
369 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE_ELF"
370 ;;
371 mep-*)
372 OBJDUMP_DEFS="-DSKIP_ZEROES=256 -DSKIP_ZEROES_AT_END=0"
373 ;;
374 esac
375
376 # Add objdump private vectors.
377 case $targ in
378 powerpc-*-aix*)
379 od_vectors="$od_vectors objdump_private_desc_xcoff"
380 ;;
381 *-*-darwin*)
382 od_vectors="$od_vectors objdump_private_desc_mach_o"
383 ;;
384 esac
385 fi
386 done
387
388 # Uniq objdump private vector, build objdump target ofiles.
389 od_files=
390 f=""
391 for i in $od_vectors ; do
392 case " $f " in
393 *" $i "*) ;;
394 *)
395 f="$f $i"
396 OBJDUMP_PRIVATE_VECTORS="$OBJDUMP_PRIVATE_VECTORS &$i,"
397 case $i in
398 objdump_private_desc_xcoff)
399 od_files="$od_files od-xcoff" ;;
400 objdump_private_desc_mach_o)
401 od_files="$od_files od-macho" ;;
402 *) AC_MSG_ERROR(*** unknown private vector $i) ;;
403 esac
404 ;;
405 esac
406 done
407
408 # Uniq objdump target ofiles
409 f=""
410 for i in $od_files ; do
411 case " $f " in
412 *" $i "*) ;;
413 *)
414 f="$f $i"
415 OBJDUMP_PRIVATE_OFILES="$OBJDUMP_PRIVATE_OFILES $i.$objext"
416 ;;
417 esac
418 done
419
420 DLLTOOL_DEFS="$DLLTOOL_DEFS $DLLTOOL_DEFAULT"
421
422 if test "${with_windres+set}" = set; then
423 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
424 fi
425
426 if test "${with_windmc+set}" = set; then
427 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
428 fi
429
430 OBJDUMP_DEFS="${OBJDUMP_DEFS} -DOBJDUMP_PRIVATE_VECTORS=\"${OBJDUMP_PRIVATE_VECTORS}\""
431
432 AC_SUBST(NLMCONV_DEFS)
433 AC_SUBST(BUILD_NLMCONV)
434 AC_SUBST(BUILD_SRCONV)
435 AC_SUBST(BUILD_DLLTOOL)
436 AC_SUBST(DLLTOOL_DEFS)
437 AC_SUBST(BUILD_WINDRES)
438 AC_SUBST(BUILD_WINDMC)
439 AC_SUBST(BUILD_DLLWRAP)
440 AC_SUBST(BUILD_MISC)
441 AC_SUBST(BUILD_INSTALL_MISC)
442 AC_SUBST(OBJDUMP_DEFS)
443 AC_SUBST(OBJDUMP_PRIVATE_OFILES)
444
445 AC_DEFINE_UNQUOTED(TARGET, "${target}", [Configured target name.])
446
447 targ=$target
448 . $srcdir/../bfd/config.bfd
449 if test "x$targ_underscore" = "xyes"; then
450 UNDERSCORE=1
451 else
452 UNDERSCORE=0
453 fi
454 AC_DEFINE_UNQUOTED(TARGET_PREPENDS_UNDERSCORE, $UNDERSCORE,
455 [Define to 1 if user symbol names have a leading underscore, 0 if not.])
456
457 # Emulation
458 targ=$target
459 . ${srcdir}/configure.tgt
460 EMULATION=$targ_emul
461 EMULATION_VECTOR=$targ_emul_vector
462
463 AC_SUBST(EMULATION)
464 AC_SUBST(EMULATION_VECTOR)
465
466 # Required for html and install-html
467 AC_SUBST(datarootdir)
468 AC_SUBST(docdir)
469 AC_SUBST(htmldir)
470 AC_SUBST(pdfdir)
471
472 AC_CONFIG_FILES(Makefile doc/Makefile po/Makefile.in:po/Make-in)
473 AC_OUTPUT
This page took 0.039552 seconds and 4 git commands to generate.