1 dnl Process this file with autoconf to produce a configure script.
11 BFD_VERSION=`sed -n -e 's/^.._INIT_AUTOMAKE.*,[ ]*\([^ ]*\)[ ]*).*/\1/p' < ${srcdir}/../bfd/configure.in`
13 AM_INIT_AUTOMAKE(binutils, ${BFD_VERSION})
17 AC_USE_SYSTEM_EXTENSIONS
19 AC_ARG_ENABLE([plugins],
20 AS_HELP_STRING([--enable-plugins], [linker plugins (defaults no)]),
21 [case "${enableval}" in
22 yes | "") plugins=yes ;;
30 sparc-*-solaris*|i[3-7]86-*-solaris*)
32 # See comment in bfd/configure.in for the reason for this test.
33 # PR 9992/binutils: We have to duplicate the behaviour of bfd's
34 # configure script so that the utilities in this directory agree
35 # on the size of structures used to describe files.
36 if test "${target}" = "${host}" -a "$enable_largefile" != 'yes'; then
37 if test "$plugins" = "no"; then
47 AC_ARG_ENABLE(targets,
48 [ --enable-targets alternative target configurations],
49 [case "${enableval}" in
50 yes | "") AC_MSG_ERROR(enable-targets option must specify target names or 'all')
52 no) enable_targets= ;;
53 *) enable_targets=$enableval ;;
58 AC_CONFIG_HEADERS(config.h:config.in)
60 if test -z "$target" ; then
61 AC_MSG_ERROR(Unrecognized target system type; please check config.sub.)
63 if test -z "$host" ; then
64 AC_MSG_ERROR(Unrecognized host system type; please check config.sub.)
70 ALL_LINGUAS="da es fi fr id ja ro ru rw sk sv tr uk vi zh_CN zh_TW"
71 ZW_GNU_GETTEXT_SISTER_DIR
75 AM_CONDITIONAL(GENINSRC_NEVER, false)
77 if test -n "$EXEEXT"; then
78 AC_DEFINE(HAVE_EXECUTABLE_SUFFIX, 1,
79 [Does the platform use an executable suffix?])
81 AC_DEFINE_UNQUOTED(EXECUTABLE_SUFFIX, "${EXEEXT}",
82 [Suffix used for executables, if any.])
84 # host-specific stuff:
88 . ${srcdir}/../bfd/configure.host
98 DEMANGLER_NAME=c++filt
100 *-*-go32* | *-*-msdos*)
101 DEMANGLER_NAME=cxxfilt
103 AC_SUBST(DEMANGLER_NAME)
105 AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h limits.h sys/param.h)
108 AC_CHECK_FUNCS(sbrk utimes setmode getc_unlocked strcoll)
109 AC_CHECK_FUNC([mkstemp],
110 AC_DEFINE([HAVE_MKSTEMP], 1,
111 [Define to 1 if you have the `mkstemp' function.]))
112 AC_CHECK_FUNC([mkdtemp],
113 AC_DEFINE([HAVE_MKDTEMP], 1,
114 [Define to 1 if you have the `mkdtemp' function.]))
116 # Check whether fopen64 is available and whether _LARGEFILE64_SOURCE
117 # needs to be defined for it
118 AC_MSG_CHECKING([for fopen64])
119 AC_CACHE_VAL(bu_cv_have_fopen64,
120 [AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <stdio.h>], [FILE *f = fopen64 ("/tmp/foo","r");])],
121 bu_cv_have_fopen64=yes,
122 [saved_CPPFLAGS=$CPPFLAGS
123 CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE"
124 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <stdio.h>], [FILE *f = fopen64 ("/tmp/foo","r");])],
125 bu_cv_have_fopen64="need -D_LARGEFILE64_SOURCE",
126 bu_cv_have_fopen64=no)
127 CPPFLAGS=$saved_CPPFLAGS])])
128 AC_MSG_RESULT($bu_cv_have_fopen64)
129 if test "$bu_cv_have_fopen64" != no; then
130 AC_DEFINE([HAVE_FOPEN64], 1,
131 [Is fopen64 available?])
133 AC_MSG_CHECKING([for stat64])
134 AC_CACHE_VAL(bu_cv_have_stat64,
135 [AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <sys/stat.h>], [struct stat64 st; stat64 ("/tmp/foo", &st);])],
136 bu_cv_have_stat64=yes,
137 [saved_CPPFLAGS=$CPPFLAGS
138 CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE"
139 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <sys/stat.h>], [struct stat64 st; stat64 ("/tmp/foo", &st);])],
140 bu_cv_have_stat64="need -D_LARGEFILE64_SOURCE",
141 bu_cv_have_stat64=no)
142 CPPFLAGS=$saved_CPPFLAGS])])
143 AC_MSG_RESULT($bu_cv_have_stat64)
144 if test "$bu_cv_have_stat64" != no; then
145 AC_DEFINE([HAVE_STAT64], 1,
146 [Is stat64 available?])
148 if test "$bu_cv_have_fopen64" = "need -D_LARGEFILE64_SOURCE" \
149 || test "$bu_cv_have_stat64" = "need -D_LARGEFILE64_SOURCE"; then
150 AC_DEFINE([_LARGEFILE64_SOURCE], 1,
152 CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE"
155 # Some systems have frexp only in -lm, not in -lc.
156 AC_SEARCH_LIBS(frexp, m)
158 AC_MSG_CHECKING(for time_t in time.h)
159 AC_CACHE_VAL(bu_cv_decl_time_t_time_h,
160 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <time.h>], [time_t i;])],
161 bu_cv_decl_time_t_time_h=yes, bu_cv_decl_time_t_time_h=no)])
162 AC_MSG_RESULT($bu_cv_decl_time_t_time_h)
163 if test $bu_cv_decl_time_t_time_h = yes; then
164 AC_DEFINE([HAVE_TIME_T_IN_TIME_H], 1,
165 [Is the type time_t defined in <time.h>?])
168 AC_MSG_CHECKING(for time_t in sys/types.h)
169 AC_CACHE_VAL(bu_cv_decl_time_t_types_h,
170 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/types.h>], [time_t i;])],
171 bu_cv_decl_time_t_types_h=yes, bu_cv_decl_time_t_types_h=no)])
172 AC_MSG_RESULT($bu_cv_decl_time_t_types_h)
173 if test $bu_cv_decl_time_t_types_h = yes; then
174 AC_DEFINE([HAVE_TIME_T_IN_TYPES_H], 1,
175 [Is the type time_t defined in <sys/types.h>?])
178 AC_MSG_CHECKING(for a known getopt prototype in unistd.h)
179 AC_CACHE_VAL(bu_cv_decl_getopt_unistd_h,
180 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <unistd.h>], [extern int getopt (int, char *const*, const char *);])],
181 bu_cv_decl_getopt_unistd_h=yes, bu_cv_decl_getopt_unistd_h=no)])
182 AC_MSG_RESULT($bu_cv_decl_getopt_unistd_h)
183 if test $bu_cv_decl_getopt_unistd_h = yes; then
184 AC_DEFINE([HAVE_DECL_GETOPT], 1,
185 [Is the prototype for getopt in <unistd.h> in the expected format?])
188 # Under Next 3.2 <utime.h> apparently does not define struct utimbuf
190 AC_MSG_CHECKING([for utime.h])
191 AC_CACHE_VAL(bu_cv_header_utime_h,
192 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/types.h>
197 [struct utimbuf s;])],
198 bu_cv_header_utime_h=yes, bu_cv_header_utime_h=no)])
199 AC_MSG_RESULT($bu_cv_header_utime_h)
200 if test $bu_cv_header_utime_h = yes; then
201 AC_DEFINE(HAVE_GOOD_UTIME_H, 1, [Does <utime.h> define struct utimbuf?])
204 AC_CHECK_DECLS([fprintf, stpcpy, strstr, sbrk, getenv, environ, getc_unlocked,
205 snprintf, vsnprintf])
207 # Link in zlib if we can. This allows us to read compressed debug
208 # sections. This is used only by readelf.c (objdump uses bfd for
209 # reading compressed sections).
210 AC_SEARCH_LIBS(zlibVersion, z, [AC_CHECK_HEADERS(zlib.h)])
214 # target-specific stuff:
216 # Canonicalize the secondary target names.
217 if test -n "$enable_targets"; then
218 for targ in `echo $enable_targets | sed 's/,/ /g'`
220 result=`$ac_config_sub $targ 2>/dev/null`
221 if test -n "$result"; then
222 canon_targets="$canon_targets $result"
224 # Allow targets that config.sub doesn't recognize, like "all".
225 canon_targets="$canon_targets $targ"
230 AC_CHECK_HEADER(iconv.h)
247 for targ in $target $canon_targets
249 if test "x$targ" = "xall"; then
251 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
252 BUILD_SRCONV='$(SRCONV_PROG)'
253 NLMCONV_DEFS="-DNLMCONV_I386 -DNLMCONV_ALPHA -DNLMCONV_POWERPC -DNLMCONV_SPARC"
254 BUILD_MISC="${BUILD_MISC} "'bin2c$(EXEEXT_FOR_BUILD)'
255 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
256 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
257 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
258 if test -z "$DLLTOOL_DEFAULT"; then
259 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_I386"
261 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
262 BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
266 i[3-7]86*-*-netware*)
268 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
269 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_I386"
272 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
273 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_ALPHA"
276 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
277 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_POWERPC"
280 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
281 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_SPARC"
285 *-*-hms*) BUILD_SRCONV='$(SRCONV_PROG)' ;;
289 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
290 if test -z "$DLLTOOL_DEFAULT"; then
291 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM_EPOC"
293 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM_EPOC -DDLLTOOL_ARM"
294 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
295 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
297 arm-wince-pe* | arm-*-wince)
298 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
299 if test -z "$DLLTOOL_DEFAULT"; then
300 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM_WINCE"
302 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM_WINCE -DDLLTOOL_ARM"
303 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
304 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
307 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
308 if test -z "$DLLTOOL_DEFAULT"; then
309 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM"
311 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
312 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
313 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
316 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
317 if test -z "$DLLTOOL_DEFAULT"; then
318 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM"
320 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
321 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
322 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
325 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
326 if test -z "$DLLTOOL_DEFAULT"; then
327 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MX86_64"
329 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MX86_64"
330 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
331 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
332 BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
335 i[3-7]86-*-pe* | i[3-7]86-*-cygwin* | i[3-7]86-*-mingw32** | i[3-7]86-*-netbsdpe*)
337 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
338 if test -z "$DLLTOOL_DEFAULT"; then
339 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_I386"
341 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
342 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
343 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
344 BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
349 BUILD_DLLTOOL='$(DLLTOOL_PROG)'
350 if test -z "$DLLTOOL_DEFAULT"; then
351 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_I386"
353 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
362 OBJDUMP_DEFS="-DAIX_WEAK_SUPPORT"
364 powerpc*-*-pe* | powerpc*-*-cygwin*)
365 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
366 if test -z "$DLLTOOL_DEFAULT"; then
367 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_PPC"
369 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_PPC"
370 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
371 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
373 powerpc*-*-linux* | powerpc*-*-elf* | powerpc*-*-eabi*)
374 BUILD_INSTALL_MISC="${BUILD_INSTALL_MISC} embedspu"
377 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
378 if test -z "$DLLTOOL_DEFAULT"; then
379 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_SH"
381 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_SH"
382 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
383 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
386 BUILD_MISC="${BUILD_MISC} "'bin2c$(EXEEXT_FOR_BUILD)'
389 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
390 if test -z "$DLLTOOL_DEFAULT"; then
391 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MIPS"
393 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MIPS"
394 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
395 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
398 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
399 if test -z "$DLLTOOL_DEFAULT"; then
400 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MCORE"
402 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE"
403 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
404 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
407 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
408 if test -z "$DLLTOOL_DEFAULT"; then
409 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MCORE_ELF"
411 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE_ELF"
414 OBJDUMP_DEFS="-DSKIP_ZEROES=256 -DSKIP_ZEROES_AT_END=0"
420 DLLTOOL_DEFS="$DLLTOOL_DEFS $DLLTOOL_DEFAULT"
422 if test "${with_windres+set}" = set; then
423 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
426 if test "${with_windmc+set}" = set; then
427 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
430 AC_SUBST(NLMCONV_DEFS)
431 AC_SUBST(BUILD_NLMCONV)
432 AC_SUBST(BUILD_SRCONV)
433 AC_SUBST(BUILD_DLLTOOL)
434 AC_SUBST(DLLTOOL_DEFS)
435 AC_SUBST(BUILD_WINDRES)
436 AC_SUBST(BUILD_WINDMC)
437 AC_SUBST(BUILD_DLLWRAP)
439 AC_SUBST(BUILD_INSTALL_MISC)
440 AC_SUBST(OBJDUMP_DEFS)
442 AC_DEFINE_UNQUOTED(TARGET, "${target}", [Configured target name.])
445 . $srcdir/../bfd/config.bfd
446 if test "x$targ_underscore" = "xyes"; then
451 AC_DEFINE_UNQUOTED(TARGET_PREPENDS_UNDERSCORE, $UNDERSCORE,
452 [Define to 1 if user symbol names have a leading underscore, 0 if not.])
455 for targ_alias in `echo $target_alias $enable_targets | sed 's/,/ /g'`
457 # Canonicalize the secondary target names.
458 result=`$ac_config_sub $targ_alias 2>/dev/null`
459 if test -n "$result"; then
465 . ${srcdir}/configure.tgt
468 EMULATION_VECTOR=$targ_emul_vector
472 AC_SUBST(EMULATION_VECTOR)
474 # Required for html and install-html
475 AC_SUBST(datarootdir)
480 AC_CONFIG_FILES(Makefile doc/Makefile po/Makefile.in:po/Make-in)