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 AH_VERBATIM([00_CONFIG_H_CHECK],
48 [/* Check that config.h is #included before system headers
49 (this works only for glibc, but that should be enough). */
50 #if defined(__GLIBC__)
51 # error config.h must be #included before system headers
54 if test -z "$target" ; then
55 AC_MSG_ERROR(Unrecognized target system type; please check config.sub.)
57 if test -z "$host" ; then
58 AC_MSG_ERROR(Unrecognized host system type; please check config.sub.)
64 ALL_LINGUAS="bg da es fi fr id it ja ro ru rw sk sv tr uk vi zh_CN zh_TW"
65 ZW_GNU_GETTEXT_SISTER_DIR
69 AM_CONDITIONAL(GENINSRC_NEVER, false)
71 if test -n "$EXEEXT"; then
72 AC_DEFINE(HAVE_EXECUTABLE_SUFFIX, 1,
73 [Does the platform use an executable suffix?])
75 AC_DEFINE_UNQUOTED(EXECUTABLE_SUFFIX, "${EXEEXT}",
76 [Suffix used for executables, if any.])
78 # host-specific stuff:
82 . ${srcdir}/../bfd/configure.host
92 DEMANGLER_NAME=c++filt
94 *-*-go32* | *-*-msdos*)
95 DEMANGLER_NAME=cxxfilt
97 AC_SUBST(DEMANGLER_NAME)
99 AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h limits.h locale.h sys/param.h)
103 AC_CHECK_FUNCS(sbrk utimes setmode getc_unlocked strcoll setlocale)
104 AC_CHECK_FUNC([mkstemp],
105 AC_DEFINE([HAVE_MKSTEMP], 1,
106 [Define to 1 if you have the `mkstemp' function.]))
107 AC_CHECK_FUNC([mkdtemp],
108 AC_DEFINE([HAVE_MKDTEMP], 1,
109 [Define to 1 if you have the `mkdtemp' function.]))
111 # Some systems have frexp only in -lm, not in -lc.
112 AC_SEARCH_LIBS(frexp, m)
116 AC_MSG_CHECKING(for time_t in time.h)
117 AC_CACHE_VAL(bu_cv_decl_time_t_time_h,
118 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <time.h>], [time_t i;])],
119 bu_cv_decl_time_t_time_h=yes, bu_cv_decl_time_t_time_h=no)])
120 AC_MSG_RESULT($bu_cv_decl_time_t_time_h)
121 if test $bu_cv_decl_time_t_time_h = yes; then
122 AC_DEFINE([HAVE_TIME_T_IN_TIME_H], 1,
123 [Is the type time_t defined in <time.h>?])
126 AC_MSG_CHECKING(for time_t in sys/types.h)
127 AC_CACHE_VAL(bu_cv_decl_time_t_types_h,
128 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/types.h>], [time_t i;])],
129 bu_cv_decl_time_t_types_h=yes, bu_cv_decl_time_t_types_h=no)])
130 AC_MSG_RESULT($bu_cv_decl_time_t_types_h)
131 if test $bu_cv_decl_time_t_types_h = yes; then
132 AC_DEFINE([HAVE_TIME_T_IN_TYPES_H], 1,
133 [Is the type time_t defined in <sys/types.h>?])
136 AC_MSG_CHECKING(for a known getopt prototype in unistd.h)
137 AC_CACHE_VAL(bu_cv_decl_getopt_unistd_h,
138 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <unistd.h>], [extern int getopt (int, char *const*, const char *);])],
139 bu_cv_decl_getopt_unistd_h=yes, bu_cv_decl_getopt_unistd_h=no)])
140 AC_MSG_RESULT($bu_cv_decl_getopt_unistd_h)
141 if test $bu_cv_decl_getopt_unistd_h = yes; then
142 AC_DEFINE([HAVE_DECL_GETOPT], 1,
143 [Is the prototype for getopt in <unistd.h> in the expected format?])
146 # Under Next 3.2 <utime.h> apparently does not define struct utimbuf
148 AC_MSG_CHECKING([for utime.h])
149 AC_CACHE_VAL(bu_cv_header_utime_h,
150 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/types.h>
155 [struct utimbuf s;])],
156 bu_cv_header_utime_h=yes, bu_cv_header_utime_h=no)])
157 AC_MSG_RESULT($bu_cv_header_utime_h)
158 if test $bu_cv_header_utime_h = yes; then
159 AC_DEFINE(HAVE_GOOD_UTIME_H, 1, [Does <utime.h> define struct utimbuf?])
162 AC_CHECK_DECLS([fprintf, stpcpy, strstr, sbrk, getenv, environ, getc_unlocked,
163 snprintf, vsnprintf])
165 # Link in zlib if we can. This allows us to read compressed debug
166 # sections. This is used only by readelf.c (objdump uses bfd for
167 # reading compressed sections).
172 # target-specific stuff:
174 # Canonicalize the secondary target names.
175 if test -n "$enable_targets"; then
176 for targ in `echo $enable_targets | sed 's/,/ /g'`
178 result=`$ac_config_sub $targ 2>/dev/null`
179 if test -n "$result"; then
180 canon_targets="$canon_targets $result"
182 # Allow targets that config.sub doesn't recognize, like "all".
183 canon_targets="$canon_targets $targ"
188 AC_CHECK_HEADER(iconv.h)
204 OBJDUMP_PRIVATE_VECTORS=
205 OBJDUMP_PRIVATE_OFILES=
208 for targ in $target $canon_targets
210 if test "x$targ" = "xall"; then
212 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
213 BUILD_SRCONV='$(SRCONV_PROG)'
214 NLMCONV_DEFS="-DNLMCONV_I386 -DNLMCONV_ALPHA -DNLMCONV_POWERPC -DNLMCONV_SPARC"
215 BUILD_MISC="${BUILD_MISC} "'bin2c$(EXEEXT_FOR_BUILD)'
216 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
217 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
218 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
219 if test -z "$DLLTOOL_DEFAULT"; then
220 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_I386"
222 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
223 BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
224 od_vectors="$od_vectors objdump_private_desc_xcoff"
228 i[3-7]86*-*-netware*)
230 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
231 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_I386"
234 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
235 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_ALPHA"
238 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
239 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_POWERPC"
242 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
243 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_SPARC"
248 *-*-hms*) BUILD_SRCONV='$(SRCONV_PROG)' ;;
253 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
254 if test -z "$DLLTOOL_DEFAULT"; then
255 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM_EPOC"
257 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM_EPOC -DDLLTOOL_ARM"
258 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
259 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
261 arm-wince-pe* | arm-*-wince | arm*-*-cegcc* | arm*-*-mingw32ce*)
262 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
263 if test -z "$DLLTOOL_DEFAULT"; then
264 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM_WINCE"
266 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM_WINCE -DDLLTOOL_ARM"
267 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
268 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
271 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
272 if test -z "$DLLTOOL_DEFAULT"; then
273 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM"
275 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
276 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
277 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
280 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
281 if test -z "$DLLTOOL_DEFAULT"; then
282 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MX86_64"
284 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MX86_64"
285 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
286 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
287 BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
290 i[3-7]86-*-pe* | i[3-7]86-*-cygwin* | i[3-7]86-*-mingw32** | i[3-7]86-*-netbsdpe*)
292 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
293 if test -z "$DLLTOOL_DEFAULT"; then
294 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_I386"
296 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
297 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
298 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
299 BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
304 BUILD_DLLTOOL='$(DLLTOOL_PROG)'
305 if test -z "$DLLTOOL_DEFAULT"; then
306 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_I386"
308 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
317 OBJDUMP_DEFS="-DAIX_WEAK_SUPPORT"
319 powerpc*-*-pe* | powerpc*-*-cygwin*)
320 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
321 if test -z "$DLLTOOL_DEFAULT"; then
322 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_PPC"
324 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_PPC"
325 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
326 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
328 powerpc*-*-linux* | powerpc*-*-elf* | powerpc*-*-eabi*)
329 case "$BUILD_INSTALL_MISC" in
331 *) BUILD_INSTALL_MISC="${BUILD_INSTALL_MISC} embedspu"
335 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
336 if test -z "$DLLTOOL_DEFAULT"; then
337 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_SH"
339 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_SH"
340 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
341 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
344 BUILD_MISC="${BUILD_MISC} "'bin2c$(EXEEXT_FOR_BUILD)'
347 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
348 if test -z "$DLLTOOL_DEFAULT"; then
349 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MIPS"
351 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MIPS"
352 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
353 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
356 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
357 if test -z "$DLLTOOL_DEFAULT"; then
358 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MCORE"
360 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE"
361 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
362 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
365 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
366 if test -z "$DLLTOOL_DEFAULT"; then
367 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MCORE_ELF"
369 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE_ELF"
372 OBJDUMP_DEFS="-DSKIP_ZEROES=256 -DSKIP_ZEROES_AT_END=0"
376 # Add objdump private vectors.
379 od_vectors="$od_vectors objdump_private_desc_xcoff"
382 od_vectors="$od_vectors objdump_private_desc_mach_o"
388 # Uniq objdump private vector, build objdump target ofiles.
391 for i in $od_vectors ; do
396 OBJDUMP_PRIVATE_VECTORS="$OBJDUMP_PRIVATE_VECTORS &$i,"
398 objdump_private_desc_xcoff)
399 od_files="$od_files od-xcoff" ;;
400 objdump_private_desc_mach_o)
401 od_files="$od_files od-macho" ;;
402 *) AC_MSG_ERROR(*** unknown private vector $i) ;;
408 # Uniq objdump target ofiles
410 for i in $od_files ; do
415 OBJDUMP_PRIVATE_OFILES="$OBJDUMP_PRIVATE_OFILES $i.$objext"
420 DLLTOOL_DEFS="$DLLTOOL_DEFS $DLLTOOL_DEFAULT"
422 if test "${with_windres+set}" = set; then
423 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
426 if test "${with_windmc+set}" = set; then
427 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
430 OBJDUMP_DEFS="${OBJDUMP_DEFS} -DOBJDUMP_PRIVATE_VECTORS=\"${OBJDUMP_PRIVATE_VECTORS}\""
432 AC_SUBST(NLMCONV_DEFS)
433 AC_SUBST(BUILD_NLMCONV)
434 AC_SUBST(BUILD_SRCONV)
435 AC_SUBST(BUILD_DLLTOOL)
436 AC_SUBST(DLLTOOL_DEFS)
437 AC_SUBST(BUILD_WINDRES)
438 AC_SUBST(BUILD_WINDMC)
439 AC_SUBST(BUILD_DLLWRAP)
441 AC_SUBST(BUILD_INSTALL_MISC)
442 AC_SUBST(OBJDUMP_DEFS)
443 AC_SUBST(OBJDUMP_PRIVATE_OFILES)
445 AC_DEFINE_UNQUOTED(TARGET, "${target}", [Configured target name.])
448 . $srcdir/../bfd/config.bfd
449 if test "x$targ_underscore" = "xyes"; then
454 AC_DEFINE_UNQUOTED(TARGET_PREPENDS_UNDERSCORE, $UNDERSCORE,
455 [Define to 1 if user symbol names have a leading underscore, 0 if not.])
459 . ${srcdir}/configure.tgt
461 EMULATION_VECTOR=$targ_emul_vector
464 AC_SUBST(EMULATION_VECTOR)
466 # Required for html and install-html
467 AC_SUBST(datarootdir)
472 AC_CONFIG_FILES(Makefile doc/Makefile po/Makefile.in:po/Make-in)