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 sparc-*-solaris*|i[3-7]86-*-solaris*)
23 # See comment in bfd/configure.in for the reason for this test.
24 # PR 9992/binutils: We have to duplicate the behaviour of bfd's
25 # configure script so that the utilities in this directory agree
26 # on the size of structures used to describe files.
27 if test "${target}" = "${host}" -a "$enable_largefile" != 'yes'; then
36 AC_ARG_ENABLE(targets,
37 [ --enable-targets alternative target configurations],
38 [case "${enableval}" in
39 yes | "") AC_MSG_ERROR(enable-targets option must specify target names or 'all')
41 no) enable_targets= ;;
42 *) enable_targets=$enableval ;;
47 AC_CONFIG_HEADERS(config.h:config.in)
49 if test -z "$target" ; then
50 AC_MSG_ERROR(Unrecognized target system type; please check config.sub.)
52 if test -z "$host" ; then
53 AC_MSG_ERROR(Unrecognized host system type; please check config.sub.)
59 ALL_LINGUAS="da es fi fr id ja ro ru rw sk sv tr uk vi zh_CN zh_TW"
60 ZW_GNU_GETTEXT_SISTER_DIR
64 AM_CONDITIONAL(GENINSRC_NEVER, false)
66 if test -n "$EXEEXT"; then
67 AC_DEFINE(HAVE_EXECUTABLE_SUFFIX, 1,
68 [Does the platform use an executable suffix?])
70 AC_DEFINE_UNQUOTED(EXECUTABLE_SUFFIX, "${EXEEXT}",
71 [Suffix used for executables, if any.])
73 # host-specific stuff:
77 . ${srcdir}/../bfd/configure.host
87 DEMANGLER_NAME=c++filt
89 *-*-go32* | *-*-msdos*)
90 DEMANGLER_NAME=cxxfilt
92 AC_SUBST(DEMANGLER_NAME)
94 AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h limits.h sys/param.h)
97 AC_CHECK_FUNCS(sbrk utimes setmode getc_unlocked strcoll)
98 AC_CHECK_FUNC([mkstemp],
99 AC_DEFINE([HAVE_MKSTEMP], 1,
100 [Define to 1 if you have the `mkstemp' function.]))
101 AC_CHECK_FUNC([mkdtemp],
102 AC_DEFINE([HAVE_MKDTEMP], 1,
103 [Define to 1 if you have the `mkdtemp' function.]))
105 # Check whether fopen64 is available and whether _LARGEFILE64_SOURCE
106 # needs to be defined for it
107 AC_MSG_CHECKING([for fopen64])
108 AC_CACHE_VAL(bu_cv_have_fopen64,
109 [AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <stdio.h>], [FILE *f = fopen64 ("/tmp/foo","r");])],
110 bu_cv_have_fopen64=yes,
111 [saved_CPPFLAGS=$CPPFLAGS
112 CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE"
113 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <stdio.h>], [FILE *f = fopen64 ("/tmp/foo","r");])],
114 bu_cv_have_fopen64="need -D_LARGEFILE64_SOURCE",
115 bu_cv_have_fopen64=no)
116 CPPFLAGS=$saved_CPPFLAGS])])
117 AC_MSG_RESULT($bu_cv_have_fopen64)
118 if test "$bu_cv_have_fopen64" != no; then
119 AC_DEFINE([HAVE_FOPEN64], 1,
120 [Is fopen64 available?])
122 AC_MSG_CHECKING([for stat64])
123 AC_CACHE_VAL(bu_cv_have_stat64,
124 [AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <sys/stat.h>], [struct stat64 st; stat64 ("/tmp/foo", &st);])],
125 bu_cv_have_stat64=yes,
126 [saved_CPPFLAGS=$CPPFLAGS
127 CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE"
128 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <sys/stat.h>], [struct stat64 st; stat64 ("/tmp/foo", &st);])],
129 bu_cv_have_stat64="need -D_LARGEFILE64_SOURCE",
130 bu_cv_have_stat64=no)
131 CPPFLAGS=$saved_CPPFLAGS])])
132 AC_MSG_RESULT($bu_cv_have_stat64)
133 if test "$bu_cv_have_stat64" != no; then
134 AC_DEFINE([HAVE_STAT64], 1,
135 [Is stat64 available?])
137 if test "$bu_cv_have_fopen64" = "need -D_LARGEFILE64_SOURCE" \
138 || test "$bu_cv_have_stat64" = "need -D_LARGEFILE64_SOURCE"; then
139 AC_DEFINE([_LARGEFILE64_SOURCE], 1,
141 CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE"
144 # Some systems have frexp only in -lm, not in -lc.
145 AC_SEARCH_LIBS(frexp, m)
147 AC_MSG_CHECKING(for time_t in time.h)
148 AC_CACHE_VAL(bu_cv_decl_time_t_time_h,
149 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <time.h>], [time_t i;])],
150 bu_cv_decl_time_t_time_h=yes, bu_cv_decl_time_t_time_h=no)])
151 AC_MSG_RESULT($bu_cv_decl_time_t_time_h)
152 if test $bu_cv_decl_time_t_time_h = yes; then
153 AC_DEFINE([HAVE_TIME_T_IN_TIME_H], 1,
154 [Is the type time_t defined in <time.h>?])
157 AC_MSG_CHECKING(for time_t in sys/types.h)
158 AC_CACHE_VAL(bu_cv_decl_time_t_types_h,
159 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/types.h>], [time_t i;])],
160 bu_cv_decl_time_t_types_h=yes, bu_cv_decl_time_t_types_h=no)])
161 AC_MSG_RESULT($bu_cv_decl_time_t_types_h)
162 if test $bu_cv_decl_time_t_types_h = yes; then
163 AC_DEFINE([HAVE_TIME_T_IN_TYPES_H], 1,
164 [Is the type time_t defined in <sys/types.h>?])
167 AC_MSG_CHECKING(for a known getopt prototype in unistd.h)
168 AC_CACHE_VAL(bu_cv_decl_getopt_unistd_h,
169 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <unistd.h>], [extern int getopt (int, char *const*, const char *);])],
170 bu_cv_decl_getopt_unistd_h=yes, bu_cv_decl_getopt_unistd_h=no)])
171 AC_MSG_RESULT($bu_cv_decl_getopt_unistd_h)
172 if test $bu_cv_decl_getopt_unistd_h = yes; then
173 AC_DEFINE([HAVE_DECL_GETOPT], 1,
174 [Is the prototype for getopt in <unistd.h> in the expected format?])
177 # Under Next 3.2 <utime.h> apparently does not define struct utimbuf
179 AC_MSG_CHECKING([for utime.h])
180 AC_CACHE_VAL(bu_cv_header_utime_h,
181 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/types.h>
186 [struct utimbuf s;])],
187 bu_cv_header_utime_h=yes, bu_cv_header_utime_h=no)])
188 AC_MSG_RESULT($bu_cv_header_utime_h)
189 if test $bu_cv_header_utime_h = yes; then
190 AC_DEFINE(HAVE_GOOD_UTIME_H, 1, [Does <utime.h> define struct utimbuf?])
193 AC_CHECK_DECLS([fprintf, stpcpy, strstr, sbrk, getenv, environ, getc_unlocked,
194 snprintf, vsnprintf])
196 # Link in zlib if we can. This allows us to read compressed debug
197 # sections. This is used only by readelf.c (objdump uses bfd for
198 # reading compressed sections).
199 AC_SEARCH_LIBS(zlibVersion, z, [AC_CHECK_HEADERS(zlib.h)])
203 # target-specific stuff:
205 # Canonicalize the secondary target names.
206 if test -n "$enable_targets"; then
207 for targ in `echo $enable_targets | sed 's/,/ /g'`
209 result=`$ac_config_sub $targ 2>/dev/null`
210 if test -n "$result"; then
211 canon_targets="$canon_targets $result"
213 # Allow targets that config.sub doesn't recognize, like "all".
214 canon_targets="$canon_targets $targ"
219 AC_CHECK_HEADER(iconv.h)
236 for targ in $target $canon_targets
238 if test "x$targ" = "xall"; then
240 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
241 BUILD_SRCONV='$(SRCONV_PROG)'
242 NLMCONV_DEFS="-DNLMCONV_I386 -DNLMCONV_ALPHA -DNLMCONV_POWERPC -DNLMCONV_SPARC"
243 BUILD_MISC="${BUILD_MISC} "'bin2c$(EXEEXT_FOR_BUILD)'
244 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
245 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
246 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
247 if test -z "$DLLTOOL_DEFAULT"; then
248 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_I386"
250 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
251 BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
255 i[3-7]86*-*-netware*)
257 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
258 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_I386"
261 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
262 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_ALPHA"
265 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
266 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_POWERPC"
269 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
270 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_SPARC"
274 *-*-hms*) BUILD_SRCONV='$(SRCONV_PROG)' ;;
278 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
279 if test -z "$DLLTOOL_DEFAULT"; then
280 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM_EPOC"
282 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM_EPOC -DDLLTOOL_ARM"
283 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
284 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
286 arm-wince-pe* | arm-*-wince)
287 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
288 if test -z "$DLLTOOL_DEFAULT"; then
289 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM_WINCE"
291 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM_WINCE -DDLLTOOL_ARM"
292 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
293 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
296 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
297 if test -z "$DLLTOOL_DEFAULT"; then
298 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM"
300 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
301 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
302 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
305 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
306 if test -z "$DLLTOOL_DEFAULT"; then
307 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM"
309 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
310 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
311 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
314 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
315 if test -z "$DLLTOOL_DEFAULT"; then
316 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MX86_64"
318 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MX86_64"
319 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
320 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
321 BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
324 i[3-7]86-*-pe* | i[3-7]86-*-cygwin* | i[3-7]86-*-mingw32** | i[3-7]86-*-netbsdpe*)
326 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
327 if test -z "$DLLTOOL_DEFAULT"; then
328 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_I386"
330 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
331 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
332 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
333 BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
338 BUILD_DLLTOOL='$(DLLTOOL_PROG)'
339 if test -z "$DLLTOOL_DEFAULT"; then
340 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_I386"
342 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
351 OBJDUMP_DEFS="-DAIX_WEAK_SUPPORT"
353 powerpc*-*-pe* | powerpc*-*-cygwin*)
354 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
355 if test -z "$DLLTOOL_DEFAULT"; then
356 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_PPC"
358 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_PPC"
359 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
360 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
362 powerpc*-*-linux* | powerpc*-*-elf* | powerpc*-*-eabi*)
363 BUILD_INSTALL_MISC="${BUILD_INSTALL_MISC} embedspu"
366 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
367 if test -z "$DLLTOOL_DEFAULT"; then
368 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_SH"
370 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_SH"
371 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
372 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
375 BUILD_MISC="${BUILD_MISC} "'bin2c$(EXEEXT_FOR_BUILD)'
378 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
379 if test -z "$DLLTOOL_DEFAULT"; then
380 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MIPS"
382 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MIPS"
383 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
384 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
387 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
388 if test -z "$DLLTOOL_DEFAULT"; then
389 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MCORE"
391 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE"
392 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
393 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
396 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
397 if test -z "$DLLTOOL_DEFAULT"; then
398 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MCORE_ELF"
400 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE_ELF"
403 OBJDUMP_DEFS="-DSKIP_ZEROES=256 -DSKIP_ZEROES_AT_END=0"
409 DLLTOOL_DEFS="$DLLTOOL_DEFS $DLLTOOL_DEFAULT"
411 if test "${with_windres+set}" = set; then
412 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
415 if test "${with_windmc+set}" = set; then
416 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
419 AC_SUBST(NLMCONV_DEFS)
420 AC_SUBST(BUILD_NLMCONV)
421 AC_SUBST(BUILD_SRCONV)
422 AC_SUBST(BUILD_DLLTOOL)
423 AC_SUBST(DLLTOOL_DEFS)
424 AC_SUBST(BUILD_WINDRES)
425 AC_SUBST(BUILD_WINDMC)
426 AC_SUBST(BUILD_DLLWRAP)
428 AC_SUBST(BUILD_INSTALL_MISC)
429 AC_SUBST(OBJDUMP_DEFS)
431 AC_DEFINE_UNQUOTED(TARGET, "${target}", [Configured target name.])
434 . $srcdir/../bfd/config.bfd
435 if test "x$targ_underscore" = "xyes"; then
440 AC_DEFINE_UNQUOTED(TARGET_PREPENDS_UNDERSCORE, $UNDERSCORE,
441 [Define to 1 if user symbol names have a leading underscore, 0 if not.])
444 for targ_alias in `echo $target_alias $enable_targets | sed 's/,/ /g'`
446 # Canonicalize the secondary target names.
447 result=`$ac_config_sub $targ_alias 2>/dev/null`
448 if test -n "$result"; then
454 . ${srcdir}/configure.tgt
457 EMULATION_VECTOR=$targ_emul_vector
461 AC_SUBST(EMULATION_VECTOR)
463 # Required for html and install-html
464 AC_SUBST(datarootdir)
469 AC_CONFIG_FILES(Makefile doc/Makefile po/Makefile.in:po/Make-in)