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 ;;
31 AC_ARG_ENABLE(deterministic-archives,
32 [AS_HELP_STRING([--enable-deterministic-archives],
33 [ar and ranlib default to -D behavior])], [
34 if test "${enableval}" = no; then
35 default_ar_deterministic=0
37 default_ar_deterministic=1
38 fi], [default_ar_deterministic=0])
40 AC_DEFINE_UNQUOTED(DEFAULT_AR_DETERMINISTIC, $default_ar_deterministic,
41 [Should ar and ranlib use -D behavior by default?])
45 AC_CONFIG_HEADERS(config.h:config.in)
47 if test -z "$target" ; then
48 AC_MSG_ERROR(Unrecognized target system type; please check config.sub.)
50 if test -z "$host" ; then
51 AC_MSG_ERROR(Unrecognized host system type; please check config.sub.)
57 ALL_LINGUAS="da es fi fr id ja ro ru rw sk sv tr uk vi zh_CN zh_TW bg"
58 ZW_GNU_GETTEXT_SISTER_DIR
62 AM_CONDITIONAL(GENINSRC_NEVER, false)
64 if test -n "$EXEEXT"; then
65 AC_DEFINE(HAVE_EXECUTABLE_SUFFIX, 1,
66 [Does the platform use an executable suffix?])
68 AC_DEFINE_UNQUOTED(EXECUTABLE_SUFFIX, "${EXEEXT}",
69 [Suffix used for executables, if any.])
71 # host-specific stuff:
75 . ${srcdir}/../bfd/configure.host
85 DEMANGLER_NAME=c++filt
87 *-*-go32* | *-*-msdos*)
88 DEMANGLER_NAME=cxxfilt
90 AC_SUBST(DEMANGLER_NAME)
92 AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h limits.h sys/param.h)
95 AC_CHECK_FUNCS(sbrk utimes setmode getc_unlocked strcoll)
96 AC_CHECK_FUNC([mkstemp],
97 AC_DEFINE([HAVE_MKSTEMP], 1,
98 [Define to 1 if you have the `mkstemp' function.]))
99 AC_CHECK_FUNC([mkdtemp],
100 AC_DEFINE([HAVE_MKDTEMP], 1,
101 [Define to 1 if you have the `mkdtemp' function.]))
103 # Some systems have frexp only in -lm, not in -lc.
104 AC_SEARCH_LIBS(frexp, m)
106 AC_MSG_CHECKING(for time_t in time.h)
107 AC_CACHE_VAL(bu_cv_decl_time_t_time_h,
108 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <time.h>], [time_t i;])],
109 bu_cv_decl_time_t_time_h=yes, bu_cv_decl_time_t_time_h=no)])
110 AC_MSG_RESULT($bu_cv_decl_time_t_time_h)
111 if test $bu_cv_decl_time_t_time_h = yes; then
112 AC_DEFINE([HAVE_TIME_T_IN_TIME_H], 1,
113 [Is the type time_t defined in <time.h>?])
116 AC_MSG_CHECKING(for time_t in sys/types.h)
117 AC_CACHE_VAL(bu_cv_decl_time_t_types_h,
118 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/types.h>], [time_t i;])],
119 bu_cv_decl_time_t_types_h=yes, bu_cv_decl_time_t_types_h=no)])
120 AC_MSG_RESULT($bu_cv_decl_time_t_types_h)
121 if test $bu_cv_decl_time_t_types_h = yes; then
122 AC_DEFINE([HAVE_TIME_T_IN_TYPES_H], 1,
123 [Is the type time_t defined in <sys/types.h>?])
126 AC_MSG_CHECKING(for a known getopt prototype in unistd.h)
127 AC_CACHE_VAL(bu_cv_decl_getopt_unistd_h,
128 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <unistd.h>], [extern int getopt (int, char *const*, const char *);])],
129 bu_cv_decl_getopt_unistd_h=yes, bu_cv_decl_getopt_unistd_h=no)])
130 AC_MSG_RESULT($bu_cv_decl_getopt_unistd_h)
131 if test $bu_cv_decl_getopt_unistd_h = yes; then
132 AC_DEFINE([HAVE_DECL_GETOPT], 1,
133 [Is the prototype for getopt in <unistd.h> in the expected format?])
136 # Under Next 3.2 <utime.h> apparently does not define struct utimbuf
138 AC_MSG_CHECKING([for utime.h])
139 AC_CACHE_VAL(bu_cv_header_utime_h,
140 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/types.h>
145 [struct utimbuf s;])],
146 bu_cv_header_utime_h=yes, bu_cv_header_utime_h=no)])
147 AC_MSG_RESULT($bu_cv_header_utime_h)
148 if test $bu_cv_header_utime_h = yes; then
149 AC_DEFINE(HAVE_GOOD_UTIME_H, 1, [Does <utime.h> define struct utimbuf?])
152 AC_CHECK_DECLS([fprintf, stpcpy, strstr, sbrk, getenv, environ, getc_unlocked,
153 snprintf, vsnprintf])
155 # Link in zlib if we can. This allows us to read compressed debug
156 # sections. This is used only by readelf.c (objdump uses bfd for
157 # reading compressed sections).
162 # target-specific stuff:
164 # Canonicalize the secondary target names.
165 if test -n "$enable_targets"; then
166 for targ in `echo $enable_targets | sed 's/,/ /g'`
168 result=`$ac_config_sub $targ 2>/dev/null`
169 if test -n "$result"; then
170 canon_targets="$canon_targets $result"
172 # Allow targets that config.sub doesn't recognize, like "all".
173 canon_targets="$canon_targets $targ"
178 AC_CHECK_HEADER(iconv.h)
194 OBJDUMP_PRIVATE_VECTORS=
195 OBJDUMP_PRIVATE_OFILES=
198 for targ in $target $canon_targets
200 if test "x$targ" = "xall"; then
202 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
203 BUILD_SRCONV='$(SRCONV_PROG)'
204 NLMCONV_DEFS="-DNLMCONV_I386 -DNLMCONV_ALPHA -DNLMCONV_POWERPC -DNLMCONV_SPARC"
205 BUILD_MISC="${BUILD_MISC} "'bin2c$(EXEEXT_FOR_BUILD)'
206 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
207 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
208 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
209 if test -z "$DLLTOOL_DEFAULT"; then
210 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_I386"
212 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
213 BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
214 od_vectors="$od_vectors objdump_private_desc_xcoff"
218 i[3-7]86*-*-netware*)
220 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
221 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_I386"
224 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
225 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_ALPHA"
228 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
229 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_POWERPC"
232 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
233 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_SPARC"
238 *-*-hms*) BUILD_SRCONV='$(SRCONV_PROG)' ;;
243 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
244 if test -z "$DLLTOOL_DEFAULT"; then
245 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM_EPOC"
247 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM_EPOC -DDLLTOOL_ARM"
248 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
249 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
251 arm-wince-pe* | arm-*-wince | arm*-*-cegcc* | arm*-*-mingw32ce*)
252 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
253 if test -z "$DLLTOOL_DEFAULT"; then
254 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM_WINCE"
256 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM_WINCE -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_ARM"
265 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
266 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
267 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
270 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
271 if test -z "$DLLTOOL_DEFAULT"; then
272 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MX86_64"
274 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MX86_64"
275 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
276 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
277 BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
280 i[3-7]86-*-pe* | i[3-7]86-*-cygwin* | i[3-7]86-*-mingw32** | i[3-7]86-*-netbsdpe*)
282 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
283 if test -z "$DLLTOOL_DEFAULT"; then
284 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_I386"
286 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
287 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
288 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
289 BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
294 BUILD_DLLTOOL='$(DLLTOOL_PROG)'
295 if test -z "$DLLTOOL_DEFAULT"; then
296 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_I386"
298 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
307 OBJDUMP_DEFS="-DAIX_WEAK_SUPPORT"
309 powerpc*-*-pe* | powerpc*-*-cygwin*)
310 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
311 if test -z "$DLLTOOL_DEFAULT"; then
312 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_PPC"
314 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_PPC"
315 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
316 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
318 powerpc*-*-linux* | powerpc*-*-elf* | powerpc*-*-eabi*)
319 case "$BUILD_INSTALL_MISC" in
321 *) BUILD_INSTALL_MISC="${BUILD_INSTALL_MISC} embedspu"
325 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
326 if test -z "$DLLTOOL_DEFAULT"; then
327 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_SH"
329 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_SH"
330 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
331 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
334 BUILD_MISC="${BUILD_MISC} "'bin2c$(EXEEXT_FOR_BUILD)'
337 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
338 if test -z "$DLLTOOL_DEFAULT"; then
339 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MIPS"
341 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MIPS"
342 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
343 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
346 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
347 if test -z "$DLLTOOL_DEFAULT"; then
348 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MCORE"
350 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE"
351 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
352 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
355 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
356 if test -z "$DLLTOOL_DEFAULT"; then
357 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MCORE_ELF"
359 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE_ELF"
362 OBJDUMP_DEFS="-DSKIP_ZEROES=256 -DSKIP_ZEROES_AT_END=0"
366 # Add objdump private vectors.
369 od_vectors="$od_vectors objdump_private_desc_xcoff"
372 od_vectors="$od_vectors objdump_private_desc_mach_o"
378 # Uniq objdump private vector, build objdump target ofiles.
381 for i in $od_vectors ; do
386 OBJDUMP_PRIVATE_VECTORS="$OBJDUMP_PRIVATE_VECTORS &$i,"
388 objdump_private_desc_xcoff)
389 od_files="$od_files od-xcoff" ;;
390 objdump_private_desc_mach_o)
391 od_files="$od_files od-macho" ;;
392 *) AC_MSG_ERROR(*** unknown private vector $i) ;;
398 # Uniq objdump target ofiles
400 for i in $od_files ; do
405 OBJDUMP_PRIVATE_OFILES="$OBJDUMP_PRIVATE_OFILES $i.$objext"
410 DLLTOOL_DEFS="$DLLTOOL_DEFS $DLLTOOL_DEFAULT"
412 if test "${with_windres+set}" = set; then
413 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
416 if test "${with_windmc+set}" = set; then
417 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
420 OBJDUMP_DEFS="${OBJDUMP_DEFS} -DOBJDUMP_PRIVATE_VECTORS=\"${OBJDUMP_PRIVATE_VECTORS}\""
422 AC_SUBST(NLMCONV_DEFS)
423 AC_SUBST(BUILD_NLMCONV)
424 AC_SUBST(BUILD_SRCONV)
425 AC_SUBST(BUILD_DLLTOOL)
426 AC_SUBST(DLLTOOL_DEFS)
427 AC_SUBST(BUILD_WINDRES)
428 AC_SUBST(BUILD_WINDMC)
429 AC_SUBST(BUILD_DLLWRAP)
431 AC_SUBST(BUILD_INSTALL_MISC)
432 AC_SUBST(OBJDUMP_DEFS)
433 AC_SUBST(OBJDUMP_PRIVATE_OFILES)
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)