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
21 AC_ARG_ENABLE(targets,
22 [ --enable-targets alternative target configurations],
23 [case "${enableval}" in
24 yes | "") AC_MSG_ERROR(enable-targets option must specify target names or 'all')
26 no) enable_targets= ;;
27 *) enable_targets=$enableval ;;
29 AC_ARG_ENABLE(commonbfdlib,
30 [ --enable-commonbfdlib build shared BFD/opcodes/libiberty library],
31 [case "${enableval}" in
32 yes) commonbfdlib=true ;;
33 no) commonbfdlib=false ;;
34 *) AC_MSG_ERROR([bad value ${enableval} for BFD commonbfdlib option]) ;;
39 AC_CONFIG_HEADERS(config.h:config.in)
41 if test -z "$target" ; then
42 AC_MSG_ERROR(Unrecognized target system type; please check config.sub.)
44 if test -z "$host" ; then
45 AC_MSG_ERROR(Unrecognized host system type; please check config.sub.)
51 ALL_LINGUAS="da es fi fr id ja ro ru rw sk sv tr uk vi zh_CN zh_TW"
52 ZW_GNU_GETTEXT_SISTER_DIR
56 AM_CONDITIONAL(GENINSRC_NEVER, false)
58 if test -n "$EXEEXT"; then
59 AC_DEFINE(HAVE_EXECUTABLE_SUFFIX, 1,
60 [Does the platform use an executable suffix?])
62 AC_DEFINE_UNQUOTED(EXECUTABLE_SUFFIX, "${EXEEXT}",
63 [Suffix used for executables, if any.])
65 # host-specific stuff:
69 . ${srcdir}/../bfd/configure.host
79 DEMANGLER_NAME=c++filt
81 *-*-go32* | *-*-msdos*)
82 DEMANGLER_NAME=cxxfilt
84 AC_SUBST(DEMANGLER_NAME)
86 AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h limits.h sys/param.h)
89 AC_CHECK_FUNCS(sbrk utimes setmode getc_unlocked strcoll)
90 AC_CHECK_FUNC([mkstemp],
91 AC_DEFINE([HAVE_MKSTEMP], 1,
92 [Define to 1 if you have the `mkstemp' function.]))
93 AC_CHECK_FUNC([mkdtemp],
94 AC_DEFINE([HAVE_MKDTEMP], 1,
95 [Define to 1 if you have the `mkdtemp' function.]))
97 # Check whether fopen64 is available and whether _LARGEFILE64_SOURCE
98 # needs to be defined for it
99 AC_MSG_CHECKING([for fopen64])
100 AC_CACHE_VAL(bu_cv_have_fopen64,
101 [AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <stdio.h>], [FILE *f = fopen64 ("/tmp/foo","r");])],
102 bu_cv_have_fopen64=yes,
103 [saved_CPPFLAGS=$CPPFLAGS
104 CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE"
105 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <stdio.h>], [FILE *f = fopen64 ("/tmp/foo","r");])],
106 bu_cv_have_fopen64="need -D_LARGEFILE64_SOURCE",
107 bu_cv_have_fopen64=no)
108 CPPFLAGS=$saved_CPPFLAGS])])
109 AC_MSG_RESULT($bu_cv_have_fopen64)
110 if test "$bu_cv_have_fopen64" != no; then
111 AC_DEFINE([HAVE_FOPEN64], 1,
112 [Is fopen64 available?])
114 AC_MSG_CHECKING([for stat64])
115 AC_CACHE_VAL(bu_cv_have_stat64,
116 [AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <sys/stat.h>], [struct stat64 st; stat64 ("/tmp/foo", &st);])],
117 bu_cv_have_stat64=yes,
118 [saved_CPPFLAGS=$CPPFLAGS
119 CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE"
120 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <sys/stat.h>], [struct stat64 st; stat64 ("/tmp/foo", &st);])],
121 bu_cv_have_stat64="need -D_LARGEFILE64_SOURCE",
122 bu_cv_have_stat64=no)
123 CPPFLAGS=$saved_CPPFLAGS])])
124 AC_MSG_RESULT($bu_cv_have_stat64)
125 if test "$bu_cv_have_stat64" != no; then
126 AC_DEFINE([HAVE_STAT64], 1,
127 [Is stat64 available?])
129 if test "$bu_cv_have_fopen64" = "need -D_LARGEFILE64_SOURCE" \
130 || test "$bu_cv_have_stat64" = "need -D_LARGEFILE64_SOURCE"; then
131 AC_DEFINE([_LARGEFILE64_SOURCE], 1,
133 CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE"
136 # Some systems have frexp only in -lm, not in -lc.
137 AC_SEARCH_LIBS(frexp, m)
139 AC_MSG_CHECKING(for time_t in time.h)
140 AC_CACHE_VAL(bu_cv_decl_time_t_time_h,
141 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <time.h>], [time_t i;])],
142 bu_cv_decl_time_t_time_h=yes, bu_cv_decl_time_t_time_h=no)])
143 AC_MSG_RESULT($bu_cv_decl_time_t_time_h)
144 if test $bu_cv_decl_time_t_time_h = yes; then
145 AC_DEFINE([HAVE_TIME_T_IN_TIME_H], 1,
146 [Is the type time_t defined in <time.h>?])
149 AC_MSG_CHECKING(for time_t in sys/types.h)
150 AC_CACHE_VAL(bu_cv_decl_time_t_types_h,
151 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/types.h>], [time_t i;])],
152 bu_cv_decl_time_t_types_h=yes, bu_cv_decl_time_t_types_h=no)])
153 AC_MSG_RESULT($bu_cv_decl_time_t_types_h)
154 if test $bu_cv_decl_time_t_types_h = yes; then
155 AC_DEFINE([HAVE_TIME_T_IN_TYPES_H], 1,
156 [Is the type time_t defined in <sys/types.h>?])
159 AC_MSG_CHECKING(for a known getopt prototype in unistd.h)
160 AC_CACHE_VAL(bu_cv_decl_getopt_unistd_h,
161 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <unistd.h>], [extern int getopt (int, char *const*, const char *);])],
162 bu_cv_decl_getopt_unistd_h=yes, bu_cv_decl_getopt_unistd_h=no)])
163 AC_MSG_RESULT($bu_cv_decl_getopt_unistd_h)
164 if test $bu_cv_decl_getopt_unistd_h = yes; then
165 AC_DEFINE([HAVE_DECL_GETOPT], 1,
166 [Is the prototype for getopt in <unistd.h> in the expected format?])
169 # Under Next 3.2 <utime.h> apparently does not define struct utimbuf
171 AC_MSG_CHECKING([for utime.h])
172 AC_CACHE_VAL(bu_cv_header_utime_h,
173 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/types.h>
178 [struct utimbuf s;])],
179 bu_cv_header_utime_h=yes, bu_cv_header_utime_h=no)])
180 AC_MSG_RESULT($bu_cv_header_utime_h)
181 if test $bu_cv_header_utime_h = yes; then
182 AC_DEFINE(HAVE_GOOD_UTIME_H, 1, [Does <utime.h> define struct utimbuf?])
185 AC_CHECK_DECLS([fprintf, stpcpy, strstr, sbrk, getenv, environ, getc_unlocked,
186 snprintf, vsnprintf])
188 # Link in zlib if we can. This allows us to read compressed debug
189 # sections. This is used only by readelf.c (objdump uses bfd for
190 # reading compressed sections).
191 AC_SEARCH_LIBS(zlibVersion, z, [AC_CHECK_HEADERS(zlib.h)])
195 # target-specific stuff:
197 # Canonicalize the secondary target names.
198 if test -n "$enable_targets"; then
199 for targ in `echo $enable_targets | sed 's/,/ /g'`
201 result=`$ac_config_sub $targ 2>/dev/null`
202 if test -n "$result"; then
203 canon_targets="$canon_targets $result"
205 # Allow targets that config.sub doesn't recognize, like "all".
206 canon_targets="$canon_targets $targ"
211 AC_CHECK_HEADER(iconv.h)
228 for targ in $target $canon_targets
230 if test "x$targ" = "xall"; then
232 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
233 BUILD_SRCONV='$(SRCONV_PROG)'
234 NLMCONV_DEFS="-DNLMCONV_I386 -DNLMCONV_ALPHA -DNLMCONV_POWERPC -DNLMCONV_SPARC"
235 BUILD_MISC="${BUILD_MISC} "'bin2c$(EXEEXT_FOR_BUILD)'
236 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
237 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
238 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
239 if test -z "$DLLTOOL_DEFAULT"; then
240 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_I386"
242 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
243 BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
247 i[3-7]86*-*-netware*)
249 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
250 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_I386"
253 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
254 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_ALPHA"
257 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
258 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_POWERPC"
261 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
262 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_SPARC"
266 *-*-hms*) BUILD_SRCONV='$(SRCONV_PROG)' ;;
270 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
271 if test -z "$DLLTOOL_DEFAULT"; then
272 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM_EPOC"
274 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM_EPOC -DDLLTOOL_ARM"
275 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
276 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
278 arm-wince-pe* | arm-*-wince)
279 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
280 if test -z "$DLLTOOL_DEFAULT"; then
281 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM_WINCE"
283 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM_WINCE -DDLLTOOL_ARM"
284 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
285 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
288 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
289 if test -z "$DLLTOOL_DEFAULT"; then
290 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM"
292 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
293 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
294 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
297 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
298 if test -z "$DLLTOOL_DEFAULT"; then
299 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM"
301 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
302 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
303 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
306 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
307 if test -z "$DLLTOOL_DEFAULT"; then
308 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MX86_64"
310 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MX86_64"
311 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
312 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
313 BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
316 i[3-7]86-*-pe* | i[3-7]86-*-cygwin* | i[3-7]86-*-mingw32** | i[3-7]86-*-netbsdpe*)
318 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
319 if test -z "$DLLTOOL_DEFAULT"; then
320 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_I386"
322 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
323 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
324 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
325 BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
330 BUILD_DLLTOOL='$(DLLTOOL_PROG)'
331 if test -z "$DLLTOOL_DEFAULT"; then
332 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_I386"
334 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
341 OBJDUMP_DEFS="-DAIX_WEAK_SUPPORT"
343 powerpc*-*-pe* | powerpc*-*-cygwin*)
344 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
345 if test -z "$DLLTOOL_DEFAULT"; then
346 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_PPC"
348 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_PPC"
349 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
350 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
352 powerpc*-*-linux* | powerpc*-*-elf* | powerpc*-*-eabi*)
353 BUILD_INSTALL_MISC="${BUILD_INSTALL_MISC} embedspu"
356 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
357 if test -z "$DLLTOOL_DEFAULT"; then
358 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_SH"
360 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_SH"
361 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
362 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
365 BUILD_MISC="${BUILD_MISC} "'bin2c$(EXEEXT_FOR_BUILD)'
368 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
369 if test -z "$DLLTOOL_DEFAULT"; then
370 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MIPS"
372 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MIPS"
373 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
374 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
377 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
378 if test -z "$DLLTOOL_DEFAULT"; then
379 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MCORE"
381 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE"
382 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
383 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
386 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
387 if test -z "$DLLTOOL_DEFAULT"; then
388 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MCORE_ELF"
390 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE_ELF"
393 OBJDUMP_DEFS="-DSKIP_ZEROES=256 -DSKIP_ZEROES_AT_END=0"
399 DLLTOOL_DEFS="$DLLTOOL_DEFS $DLLTOOL_DEFAULT"
401 if test "${with_windres+set}" = set; then
402 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
405 if test "${with_windmc+set}" = set; then
406 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
409 AC_SUBST(NLMCONV_DEFS)
410 AC_SUBST(BUILD_NLMCONV)
411 AC_SUBST(BUILD_SRCONV)
412 AC_SUBST(BUILD_DLLTOOL)
413 AC_SUBST(DLLTOOL_DEFS)
414 AC_SUBST(BUILD_WINDRES)
415 AC_SUBST(BUILD_WINDMC)
416 AC_SUBST(BUILD_DLLWRAP)
418 AC_SUBST(BUILD_INSTALL_MISC)
419 AC_SUBST(OBJDUMP_DEFS)
421 AC_DEFINE_UNQUOTED(TARGET, "${target}", [Configured target name.])
424 . $srcdir/../bfd/config.bfd
425 if test "x$targ_underscore" = "xyes"; then
430 AC_DEFINE_UNQUOTED(TARGET_PREPENDS_UNDERSCORE, $UNDERSCORE,
431 [Define to 1 if user symbol names have a leading underscore, 0 if not.])
434 for targ_alias in `echo $target_alias $enable_targets | sed 's/,/ /g'`
436 # Canonicalize the secondary target names.
437 result=`$ac_config_sub $targ_alias 2>/dev/null`
438 if test -n "$result"; then
444 . ${srcdir}/configure.tgt
447 EMULATION_VECTOR=$targ_emul_vector
451 AC_SUBST(EMULATION_VECTOR)
453 # Required for html and install-html
454 AC_SUBST(datarootdir)
458 AC_CONFIG_FILES(Makefile doc/Makefile po/Makefile.in:po/Make-in)