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
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')
27 no) enable_targets= ;;
28 *) enable_targets=$enableval ;;
33 AC_CONFIG_HEADERS(config.h:config.in)
35 if test -z "$target" ; then
36 AC_MSG_ERROR(Unrecognized target system type; please check config.sub.)
38 if test -z "$host" ; then
39 AC_MSG_ERROR(Unrecognized host system type; please check config.sub.)
45 ALL_LINGUAS="da es fi fr id ja ro ru rw sk sv tr uk vi zh_CN zh_TW bg"
46 ZW_GNU_GETTEXT_SISTER_DIR
50 AM_CONDITIONAL(GENINSRC_NEVER, false)
52 if test -n "$EXEEXT"; then
53 AC_DEFINE(HAVE_EXECUTABLE_SUFFIX, 1,
54 [Does the platform use an executable suffix?])
56 AC_DEFINE_UNQUOTED(EXECUTABLE_SUFFIX, "${EXEEXT}",
57 [Suffix used for executables, if any.])
59 # host-specific stuff:
63 . ${srcdir}/../bfd/configure.host
73 DEMANGLER_NAME=c++filt
75 *-*-go32* | *-*-msdos*)
76 DEMANGLER_NAME=cxxfilt
78 AC_SUBST(DEMANGLER_NAME)
80 AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h limits.h sys/param.h)
83 AC_CHECK_FUNCS(sbrk utimes setmode getc_unlocked strcoll)
84 AC_CHECK_FUNC([mkstemp],
85 AC_DEFINE([HAVE_MKSTEMP], 1,
86 [Define to 1 if you have the `mkstemp' function.]))
87 AC_CHECK_FUNC([mkdtemp],
88 AC_DEFINE([HAVE_MKDTEMP], 1,
89 [Define to 1 if you have the `mkdtemp' function.]))
91 # Some systems have frexp only in -lm, not in -lc.
92 AC_SEARCH_LIBS(frexp, m)
94 AC_MSG_CHECKING(for time_t in time.h)
95 AC_CACHE_VAL(bu_cv_decl_time_t_time_h,
96 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <time.h>], [time_t i;])],
97 bu_cv_decl_time_t_time_h=yes, bu_cv_decl_time_t_time_h=no)])
98 AC_MSG_RESULT($bu_cv_decl_time_t_time_h)
99 if test $bu_cv_decl_time_t_time_h = yes; then
100 AC_DEFINE([HAVE_TIME_T_IN_TIME_H], 1,
101 [Is the type time_t defined in <time.h>?])
104 AC_MSG_CHECKING(for time_t in sys/types.h)
105 AC_CACHE_VAL(bu_cv_decl_time_t_types_h,
106 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/types.h>], [time_t i;])],
107 bu_cv_decl_time_t_types_h=yes, bu_cv_decl_time_t_types_h=no)])
108 AC_MSG_RESULT($bu_cv_decl_time_t_types_h)
109 if test $bu_cv_decl_time_t_types_h = yes; then
110 AC_DEFINE([HAVE_TIME_T_IN_TYPES_H], 1,
111 [Is the type time_t defined in <sys/types.h>?])
114 AC_MSG_CHECKING(for a known getopt prototype in unistd.h)
115 AC_CACHE_VAL(bu_cv_decl_getopt_unistd_h,
116 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <unistd.h>], [extern int getopt (int, char *const*, const char *);])],
117 bu_cv_decl_getopt_unistd_h=yes, bu_cv_decl_getopt_unistd_h=no)])
118 AC_MSG_RESULT($bu_cv_decl_getopt_unistd_h)
119 if test $bu_cv_decl_getopt_unistd_h = yes; then
120 AC_DEFINE([HAVE_DECL_GETOPT], 1,
121 [Is the prototype for getopt in <unistd.h> in the expected format?])
124 # Under Next 3.2 <utime.h> apparently does not define struct utimbuf
126 AC_MSG_CHECKING([for utime.h])
127 AC_CACHE_VAL(bu_cv_header_utime_h,
128 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/types.h>
133 [struct utimbuf s;])],
134 bu_cv_header_utime_h=yes, bu_cv_header_utime_h=no)])
135 AC_MSG_RESULT($bu_cv_header_utime_h)
136 if test $bu_cv_header_utime_h = yes; then
137 AC_DEFINE(HAVE_GOOD_UTIME_H, 1, [Does <utime.h> define struct utimbuf?])
140 AC_CHECK_DECLS([fprintf, stpcpy, strstr, sbrk, getenv, environ, getc_unlocked,
141 snprintf, vsnprintf])
143 # Link in zlib if we can. This allows us to read compressed debug
144 # sections. This is used only by readelf.c (objdump uses bfd for
145 # reading compressed sections).
146 AC_SEARCH_LIBS(zlibVersion, z, [AC_CHECK_HEADERS(zlib.h)])
150 # target-specific stuff:
152 # Canonicalize the secondary target names.
153 if test -n "$enable_targets"; then
154 for targ in `echo $enable_targets | sed 's/,/ /g'`
156 result=`$ac_config_sub $targ 2>/dev/null`
157 if test -n "$result"; then
158 canon_targets="$canon_targets $result"
160 # Allow targets that config.sub doesn't recognize, like "all".
161 canon_targets="$canon_targets $targ"
166 AC_CHECK_HEADER(iconv.h)
183 for targ in $target $canon_targets
185 if test "x$targ" = "xall"; then
187 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
188 BUILD_SRCONV='$(SRCONV_PROG)'
189 NLMCONV_DEFS="-DNLMCONV_I386 -DNLMCONV_ALPHA -DNLMCONV_POWERPC -DNLMCONV_SPARC"
190 BUILD_MISC="${BUILD_MISC} "'bin2c$(EXEEXT_FOR_BUILD)'
191 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
192 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
193 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
194 if test -z "$DLLTOOL_DEFAULT"; then
195 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_I386"
197 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
198 BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
202 i[3-7]86*-*-netware*)
204 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
205 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_I386"
208 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
209 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_ALPHA"
212 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
213 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_POWERPC"
216 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
217 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_SPARC"
221 *-*-hms*) BUILD_SRCONV='$(SRCONV_PROG)' ;;
225 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
226 if test -z "$DLLTOOL_DEFAULT"; then
227 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM_EPOC"
229 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM_EPOC -DDLLTOOL_ARM"
230 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
231 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
233 arm-wince-pe* | arm-*-wince | arm*-*-cegcc* | arm*-*-mingw32ce*)
234 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
235 if test -z "$DLLTOOL_DEFAULT"; then
236 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM_WINCE"
238 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM_WINCE -DDLLTOOL_ARM"
239 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
240 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
243 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
244 if test -z "$DLLTOOL_DEFAULT"; then
245 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM"
247 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
248 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
249 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
252 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
253 if test -z "$DLLTOOL_DEFAULT"; then
254 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM"
256 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
257 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
258 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
261 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
262 if test -z "$DLLTOOL_DEFAULT"; then
263 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MX86_64"
265 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MX86_64"
266 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
267 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
268 BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
271 i[3-7]86-*-pe* | i[3-7]86-*-cygwin* | i[3-7]86-*-mingw32** | i[3-7]86-*-netbsdpe*)
273 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
274 if test -z "$DLLTOOL_DEFAULT"; then
275 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_I386"
277 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
278 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
279 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
280 BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
285 BUILD_DLLTOOL='$(DLLTOOL_PROG)'
286 if test -z "$DLLTOOL_DEFAULT"; then
287 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_I386"
289 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
298 OBJDUMP_DEFS="-DAIX_WEAK_SUPPORT"
300 powerpc*-*-pe* | powerpc*-*-cygwin*)
301 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
302 if test -z "$DLLTOOL_DEFAULT"; then
303 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_PPC"
305 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_PPC"
306 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
307 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
309 powerpc*-*-linux* | powerpc*-*-elf* | powerpc*-*-eabi*)
310 BUILD_INSTALL_MISC="${BUILD_INSTALL_MISC} embedspu"
313 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
314 if test -z "$DLLTOOL_DEFAULT"; then
315 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_SH"
317 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_SH"
318 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
319 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
322 BUILD_MISC="${BUILD_MISC} "'bin2c$(EXEEXT_FOR_BUILD)'
325 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
326 if test -z "$DLLTOOL_DEFAULT"; then
327 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MIPS"
329 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MIPS"
330 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
331 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
334 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
335 if test -z "$DLLTOOL_DEFAULT"; then
336 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MCORE"
338 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE"
339 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
340 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
343 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
344 if test -z "$DLLTOOL_DEFAULT"; then
345 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MCORE_ELF"
347 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE_ELF"
350 OBJDUMP_DEFS="-DSKIP_ZEROES=256 -DSKIP_ZEROES_AT_END=0"
356 DLLTOOL_DEFS="$DLLTOOL_DEFS $DLLTOOL_DEFAULT"
358 if test "${with_windres+set}" = set; then
359 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
362 if test "${with_windmc+set}" = set; then
363 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
366 AC_SUBST(NLMCONV_DEFS)
367 AC_SUBST(BUILD_NLMCONV)
368 AC_SUBST(BUILD_SRCONV)
369 AC_SUBST(BUILD_DLLTOOL)
370 AC_SUBST(DLLTOOL_DEFS)
371 AC_SUBST(BUILD_WINDRES)
372 AC_SUBST(BUILD_WINDMC)
373 AC_SUBST(BUILD_DLLWRAP)
375 AC_SUBST(BUILD_INSTALL_MISC)
376 AC_SUBST(OBJDUMP_DEFS)
378 AC_DEFINE_UNQUOTED(TARGET, "${target}", [Configured target name.])
381 . $srcdir/../bfd/config.bfd
382 if test "x$targ_underscore" = "xyes"; then
387 AC_DEFINE_UNQUOTED(TARGET_PREPENDS_UNDERSCORE, $UNDERSCORE,
388 [Define to 1 if user symbol names have a leading underscore, 0 if not.])
392 . ${srcdir}/configure.tgt
394 EMULATION_VECTOR=$targ_emul_vector
397 AC_SUBST(EMULATION_VECTOR)
399 # Required for html and install-html
400 AC_SUBST(datarootdir)
405 AC_CONFIG_FILES(Makefile doc/Makefile po/Makefile.in:po/Make-in)