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)
182 OBJDUMP_PRIVATE_VECTORS=
183 OBJDUMP_PRIVATE_OFILES=
186 for targ in $target $canon_targets
188 if test "x$targ" = "xall"; then
190 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
191 BUILD_SRCONV='$(SRCONV_PROG)'
192 NLMCONV_DEFS="-DNLMCONV_I386 -DNLMCONV_ALPHA -DNLMCONV_POWERPC -DNLMCONV_SPARC"
193 BUILD_MISC="${BUILD_MISC} "'bin2c$(EXEEXT_FOR_BUILD)'
194 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
195 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
196 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
197 if test -z "$DLLTOOL_DEFAULT"; then
198 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_I386"
200 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
201 BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
202 od_vectors="$od_vectors objdump_private_desc_xcoff"
206 i[3-7]86*-*-netware*)
208 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
209 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_I386"
212 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
213 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_ALPHA"
216 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
217 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_POWERPC"
220 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
221 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_SPARC"
226 *-*-hms*) BUILD_SRCONV='$(SRCONV_PROG)' ;;
231 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
232 if test -z "$DLLTOOL_DEFAULT"; then
233 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM_EPOC"
235 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM_EPOC -DDLLTOOL_ARM"
236 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
237 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
239 arm-wince-pe* | arm-*-wince | arm*-*-cegcc* | arm*-*-mingw32ce*)
240 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
241 if test -z "$DLLTOOL_DEFAULT"; then
242 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM_WINCE"
244 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM_WINCE -DDLLTOOL_ARM"
245 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
246 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
249 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
250 if test -z "$DLLTOOL_DEFAULT"; then
251 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM"
253 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
254 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
255 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
258 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
259 if test -z "$DLLTOOL_DEFAULT"; then
260 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MX86_64"
262 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MX86_64"
263 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
264 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
265 BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
268 i[3-7]86-*-pe* | i[3-7]86-*-cygwin* | i[3-7]86-*-mingw32** | i[3-7]86-*-netbsdpe*)
270 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
271 if test -z "$DLLTOOL_DEFAULT"; then
272 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_I386"
274 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
275 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
276 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
277 BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
282 BUILD_DLLTOOL='$(DLLTOOL_PROG)'
283 if test -z "$DLLTOOL_DEFAULT"; then
284 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_I386"
286 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
295 OBJDUMP_DEFS="-DAIX_WEAK_SUPPORT"
297 powerpc*-*-pe* | powerpc*-*-cygwin*)
298 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
299 if test -z "$DLLTOOL_DEFAULT"; then
300 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_PPC"
302 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_PPC"
303 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
304 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
306 powerpc*-*-linux* | powerpc*-*-elf* | powerpc*-*-eabi*)
307 case "$BUILD_INSTALL_MISC" in
309 *) 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"
354 # Add objdump private vectors.
357 od_vectors="$od_vectors objdump_private_desc_xcoff"
363 # Uniq objdump private vector, build objdump target ofiles.
366 for i in $od_vectors ; do
371 OBJDUMP_PRIVATE_VECTORS="$OBJDUMP_PRIVATE_VECTORS &$i,"
373 objdump_private_desc_xcoff)
374 od_files="$od_files od-xcoff" ;;
375 *) AC_MSG_ERROR(*** unknown private vector $i) ;;
381 # Uniq objdump target ofiles
383 for i in $od_files ; do
388 OBJDUMP_PRIVATE_OFILES="$OBJDUMP_PRIVATE_OFILES $i.$objext"
393 DLLTOOL_DEFS="$DLLTOOL_DEFS $DLLTOOL_DEFAULT"
395 if test "${with_windres+set}" = set; then
396 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
399 if test "${with_windmc+set}" = set; then
400 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
403 OBJDUMP_DEFS="${OBJDUMP_DEFS} -DOBJDUMP_PRIVATE_VECTORS=\"${OBJDUMP_PRIVATE_VECTORS}\""
405 AC_SUBST(NLMCONV_DEFS)
406 AC_SUBST(BUILD_NLMCONV)
407 AC_SUBST(BUILD_SRCONV)
408 AC_SUBST(BUILD_DLLTOOL)
409 AC_SUBST(DLLTOOL_DEFS)
410 AC_SUBST(BUILD_WINDRES)
411 AC_SUBST(BUILD_WINDMC)
412 AC_SUBST(BUILD_DLLWRAP)
414 AC_SUBST(BUILD_INSTALL_MISC)
415 AC_SUBST(OBJDUMP_DEFS)
416 AC_SUBST(OBJDUMP_PRIVATE_OFILES)
418 AC_DEFINE_UNQUOTED(TARGET, "${target}", [Configured target name.])
421 . $srcdir/../bfd/config.bfd
422 if test "x$targ_underscore" = "xyes"; then
427 AC_DEFINE_UNQUOTED(TARGET_PREPENDS_UNDERSCORE, $UNDERSCORE,
428 [Define to 1 if user symbol names have a leading underscore, 0 if not.])
432 . ${srcdir}/configure.tgt
434 EMULATION_VECTOR=$targ_emul_vector
437 AC_SUBST(EMULATION_VECTOR)
439 # Required for html and install-html
440 AC_SUBST(datarootdir)
445 AC_CONFIG_FILES(Makefile doc/Makefile po/Makefile.in:po/Make-in)