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
23 sparc-*-solaris*|i[3-7]86-*-solaris*)
25 # See comment in bfd/configure.in for the reason for this test.
26 # PR 9992/binutils: We have to duplicate the behaviour of bfd's
27 # configure script so that the utilities in this directory agree
28 # on the size of structures used to describe files.
29 if test "${target}" = "${host}" -a "$enable_largefile" != 'yes'; then
30 if test "$plugins" = "no"; then
40 AC_ARG_ENABLE(targets,
41 [ --enable-targets alternative target configurations],
42 [case "${enableval}" in
43 yes | "") AC_MSG_ERROR(enable-targets option must specify target names or 'all')
45 no) enable_targets= ;;
46 *) enable_targets=$enableval ;;
51 AC_CONFIG_HEADERS(config.h:config.in)
53 if test -z "$target" ; then
54 AC_MSG_ERROR(Unrecognized target system type; please check config.sub.)
56 if test -z "$host" ; then
57 AC_MSG_ERROR(Unrecognized host system type; please check config.sub.)
63 ALL_LINGUAS="da es fi fr id ja ro ru rw sk sv tr uk vi zh_CN zh_TW"
64 ZW_GNU_GETTEXT_SISTER_DIR
68 AM_CONDITIONAL(GENINSRC_NEVER, false)
70 if test -n "$EXEEXT"; then
71 AC_DEFINE(HAVE_EXECUTABLE_SUFFIX, 1,
72 [Does the platform use an executable suffix?])
74 AC_DEFINE_UNQUOTED(EXECUTABLE_SUFFIX, "${EXEEXT}",
75 [Suffix used for executables, if any.])
77 # host-specific stuff:
81 . ${srcdir}/../bfd/configure.host
91 DEMANGLER_NAME=c++filt
93 *-*-go32* | *-*-msdos*)
94 DEMANGLER_NAME=cxxfilt
96 AC_SUBST(DEMANGLER_NAME)
98 AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h limits.h sys/param.h)
101 AC_CHECK_FUNCS(sbrk utimes setmode getc_unlocked strcoll)
102 AC_CHECK_FUNC([mkstemp],
103 AC_DEFINE([HAVE_MKSTEMP], 1,
104 [Define to 1 if you have the `mkstemp' function.]))
105 AC_CHECK_FUNC([mkdtemp],
106 AC_DEFINE([HAVE_MKDTEMP], 1,
107 [Define to 1 if you have the `mkdtemp' function.]))
109 # Check whether fopen64 is available and whether _LARGEFILE64_SOURCE
110 # needs to be defined for it
111 AC_MSG_CHECKING([for fopen64])
112 AC_CACHE_VAL(bu_cv_have_fopen64,
113 [AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <stdio.h>], [FILE *f = fopen64 ("/tmp/foo","r");])],
114 bu_cv_have_fopen64=yes,
115 [saved_CPPFLAGS=$CPPFLAGS
116 CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE"
117 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <stdio.h>], [FILE *f = fopen64 ("/tmp/foo","r");])],
118 bu_cv_have_fopen64="need -D_LARGEFILE64_SOURCE",
119 bu_cv_have_fopen64=no)
120 CPPFLAGS=$saved_CPPFLAGS])])
121 AC_MSG_RESULT($bu_cv_have_fopen64)
122 if test "$bu_cv_have_fopen64" != no; then
123 AC_DEFINE([HAVE_FOPEN64], 1,
124 [Is fopen64 available?])
126 AC_MSG_CHECKING([for stat64])
127 AC_CACHE_VAL(bu_cv_have_stat64,
128 [AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <sys/stat.h>], [struct stat64 st; stat64 ("/tmp/foo", &st);])],
129 bu_cv_have_stat64=yes,
130 [saved_CPPFLAGS=$CPPFLAGS
131 CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE"
132 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <sys/stat.h>], [struct stat64 st; stat64 ("/tmp/foo", &st);])],
133 bu_cv_have_stat64="need -D_LARGEFILE64_SOURCE",
134 bu_cv_have_stat64=no)
135 CPPFLAGS=$saved_CPPFLAGS])])
136 AC_MSG_RESULT($bu_cv_have_stat64)
137 if test "$bu_cv_have_stat64" != no; then
138 AC_DEFINE([HAVE_STAT64], 1,
139 [Is stat64 available?])
141 if test "$bu_cv_have_fopen64" = "need -D_LARGEFILE64_SOURCE" \
142 || test "$bu_cv_have_stat64" = "need -D_LARGEFILE64_SOURCE"; then
143 AC_DEFINE([_LARGEFILE64_SOURCE], 1,
145 CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE"
148 # Some systems have frexp only in -lm, not in -lc.
149 AC_SEARCH_LIBS(frexp, m)
151 AC_MSG_CHECKING(for time_t in time.h)
152 AC_CACHE_VAL(bu_cv_decl_time_t_time_h,
153 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <time.h>], [time_t i;])],
154 bu_cv_decl_time_t_time_h=yes, bu_cv_decl_time_t_time_h=no)])
155 AC_MSG_RESULT($bu_cv_decl_time_t_time_h)
156 if test $bu_cv_decl_time_t_time_h = yes; then
157 AC_DEFINE([HAVE_TIME_T_IN_TIME_H], 1,
158 [Is the type time_t defined in <time.h>?])
161 AC_MSG_CHECKING(for time_t in sys/types.h)
162 AC_CACHE_VAL(bu_cv_decl_time_t_types_h,
163 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/types.h>], [time_t i;])],
164 bu_cv_decl_time_t_types_h=yes, bu_cv_decl_time_t_types_h=no)])
165 AC_MSG_RESULT($bu_cv_decl_time_t_types_h)
166 if test $bu_cv_decl_time_t_types_h = yes; then
167 AC_DEFINE([HAVE_TIME_T_IN_TYPES_H], 1,
168 [Is the type time_t defined in <sys/types.h>?])
171 AC_MSG_CHECKING(for a known getopt prototype in unistd.h)
172 AC_CACHE_VAL(bu_cv_decl_getopt_unistd_h,
173 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <unistd.h>], [extern int getopt (int, char *const*, const char *);])],
174 bu_cv_decl_getopt_unistd_h=yes, bu_cv_decl_getopt_unistd_h=no)])
175 AC_MSG_RESULT($bu_cv_decl_getopt_unistd_h)
176 if test $bu_cv_decl_getopt_unistd_h = yes; then
177 AC_DEFINE([HAVE_DECL_GETOPT], 1,
178 [Is the prototype for getopt in <unistd.h> in the expected format?])
181 # Under Next 3.2 <utime.h> apparently does not define struct utimbuf
183 AC_MSG_CHECKING([for utime.h])
184 AC_CACHE_VAL(bu_cv_header_utime_h,
185 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/types.h>
190 [struct utimbuf s;])],
191 bu_cv_header_utime_h=yes, bu_cv_header_utime_h=no)])
192 AC_MSG_RESULT($bu_cv_header_utime_h)
193 if test $bu_cv_header_utime_h = yes; then
194 AC_DEFINE(HAVE_GOOD_UTIME_H, 1, [Does <utime.h> define struct utimbuf?])
197 AC_CHECK_DECLS([fprintf, stpcpy, strstr, sbrk, getenv, environ, getc_unlocked,
198 snprintf, vsnprintf])
200 # Link in zlib if we can. This allows us to read compressed debug
201 # sections. This is used only by readelf.c (objdump uses bfd for
202 # reading compressed sections).
203 AC_SEARCH_LIBS(zlibVersion, z, [AC_CHECK_HEADERS(zlib.h)])
207 # target-specific stuff:
209 # Canonicalize the secondary target names.
210 if test -n "$enable_targets"; then
211 for targ in `echo $enable_targets | sed 's/,/ /g'`
213 result=`$ac_config_sub $targ 2>/dev/null`
214 if test -n "$result"; then
215 canon_targets="$canon_targets $result"
217 # Allow targets that config.sub doesn't recognize, like "all".
218 canon_targets="$canon_targets $targ"
223 AC_CHECK_HEADER(iconv.h)
240 for targ in $target $canon_targets
242 if test "x$targ" = "xall"; then
244 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
245 BUILD_SRCONV='$(SRCONV_PROG)'
246 NLMCONV_DEFS="-DNLMCONV_I386 -DNLMCONV_ALPHA -DNLMCONV_POWERPC -DNLMCONV_SPARC"
247 BUILD_MISC="${BUILD_MISC} "'bin2c$(EXEEXT_FOR_BUILD)'
248 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
249 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
250 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
251 if test -z "$DLLTOOL_DEFAULT"; then
252 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_I386"
254 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
255 BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
259 i[3-7]86*-*-netware*)
261 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
262 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_I386"
265 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
266 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_ALPHA"
269 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
270 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_POWERPC"
273 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
274 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_SPARC"
278 *-*-hms*) BUILD_SRCONV='$(SRCONV_PROG)' ;;
282 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
283 if test -z "$DLLTOOL_DEFAULT"; then
284 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM_EPOC"
286 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM_EPOC -DDLLTOOL_ARM"
287 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
288 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
290 arm-wince-pe* | arm-*-wince | arm*-*-cegcc* | arm*-*-mingw32ce*)
291 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
292 if test -z "$DLLTOOL_DEFAULT"; then
293 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM_WINCE"
295 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM_WINCE -DDLLTOOL_ARM"
296 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
297 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
300 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
301 if test -z "$DLLTOOL_DEFAULT"; then
302 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM"
304 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
305 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
306 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
309 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
310 if test -z "$DLLTOOL_DEFAULT"; then
311 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM"
313 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
314 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
315 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
318 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
319 if test -z "$DLLTOOL_DEFAULT"; then
320 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MX86_64"
322 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MX86_64"
323 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
324 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
325 BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
328 i[3-7]86-*-pe* | i[3-7]86-*-cygwin* | i[3-7]86-*-mingw32** | i[3-7]86-*-netbsdpe*)
330 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
331 if test -z "$DLLTOOL_DEFAULT"; then
332 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_I386"
334 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
335 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
336 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
337 BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
342 BUILD_DLLTOOL='$(DLLTOOL_PROG)'
343 if test -z "$DLLTOOL_DEFAULT"; then
344 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_I386"
346 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
355 OBJDUMP_DEFS="-DAIX_WEAK_SUPPORT"
357 powerpc*-*-pe* | powerpc*-*-cygwin*)
358 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
359 if test -z "$DLLTOOL_DEFAULT"; then
360 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_PPC"
362 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_PPC"
363 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
364 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
366 powerpc*-*-linux* | powerpc*-*-elf* | powerpc*-*-eabi*)
367 BUILD_INSTALL_MISC="${BUILD_INSTALL_MISC} embedspu"
370 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
371 if test -z "$DLLTOOL_DEFAULT"; then
372 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_SH"
374 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_SH"
375 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
376 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
379 BUILD_MISC="${BUILD_MISC} "'bin2c$(EXEEXT_FOR_BUILD)'
382 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
383 if test -z "$DLLTOOL_DEFAULT"; then
384 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MIPS"
386 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MIPS"
387 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
388 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
391 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
392 if test -z "$DLLTOOL_DEFAULT"; then
393 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MCORE"
395 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE"
396 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
397 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
400 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
401 if test -z "$DLLTOOL_DEFAULT"; then
402 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MCORE_ELF"
404 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE_ELF"
407 OBJDUMP_DEFS="-DSKIP_ZEROES=256 -DSKIP_ZEROES_AT_END=0"
413 DLLTOOL_DEFS="$DLLTOOL_DEFS $DLLTOOL_DEFAULT"
415 if test "${with_windres+set}" = set; then
416 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
419 if test "${with_windmc+set}" = set; then
420 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
423 AC_SUBST(NLMCONV_DEFS)
424 AC_SUBST(BUILD_NLMCONV)
425 AC_SUBST(BUILD_SRCONV)
426 AC_SUBST(BUILD_DLLTOOL)
427 AC_SUBST(DLLTOOL_DEFS)
428 AC_SUBST(BUILD_WINDRES)
429 AC_SUBST(BUILD_WINDMC)
430 AC_SUBST(BUILD_DLLWRAP)
432 AC_SUBST(BUILD_INSTALL_MISC)
433 AC_SUBST(OBJDUMP_DEFS)
435 AC_DEFINE_UNQUOTED(TARGET, "${target}", [Configured target name.])
438 . $srcdir/../bfd/config.bfd
439 if test "x$targ_underscore" = "xyes"; then
444 AC_DEFINE_UNQUOTED(TARGET_PREPENDS_UNDERSCORE, $UNDERSCORE,
445 [Define to 1 if user symbol names have a leading underscore, 0 if not.])
449 . ${srcdir}/configure.tgt
451 EMULATION_VECTOR=$targ_emul_vector
454 AC_SUBST(EMULATION_VECTOR)
456 # Required for html and install-html
457 AC_SUBST(datarootdir)
462 AC_CONFIG_FILES(Makefile doc/Makefile po/Makefile.in:po/Make-in)