1 dnl Process this file with autoconf to produce a configure script.
10 BFD_VERSION=`sed -n -e 's/^.._INIT_AUTOMAKE.*,[ ]*\([^ ]*\)[ ]*).*/\1/p' < ${srcdir}/../bfd/configure.in`
12 AM_INIT_AUTOMAKE(binutils, ${BFD_VERSION})
18 AC_ARG_ENABLE(targets,
19 [ --enable-targets alternative target configurations],
20 [case "${enableval}" in
21 yes | "") AC_ERROR(enable-targets option must specify target names or 'all')
23 no) enable_targets= ;;
24 *) enable_targets=$enableval ;;
26 AC_ARG_ENABLE(commonbfdlib,
27 [ --enable-commonbfdlib build shared BFD/opcodes/libiberty library],
28 [case "${enableval}" in
29 yes) commonbfdlib=true ;;
30 no) commonbfdlib=false ;;
31 *) AC_MSG_ERROR([bad value ${enableval} for BFD commonbfdlib option]) ;;
36 AM_CONFIG_HEADER(config.h:config.in)
38 if test -z "$target" ; then
39 AC_MSG_ERROR(Unrecognized target system type; please check config.sub.)
41 if test -z "$host" ; then
42 AC_MSG_ERROR(Unrecognized host system type; please check config.sub.)
48 ALL_LINGUAS="fr tr ja es sv da zh_CN ru ro rw zh_TW fi vi uk"
49 ZW_GNU_GETTEXT_SISTER_DIR
53 AM_CONDITIONAL(GENINSRC_NEVER, false)
55 if test -n "$EXEEXT"; then
56 AC_DEFINE(HAVE_EXECUTABLE_SUFFIX, 1,
57 [Does the platform use an executable suffix?])
59 AC_DEFINE_UNQUOTED(EXECUTABLE_SUFFIX, "${EXEEXT}",
60 [Suffix used for executables, if any.])
62 # host-specific stuff:
66 . ${srcdir}/../bfd/configure.host
76 DEMANGLER_NAME=c++filt
78 *-*-go32* | *-*-msdos*)
79 DEMANGLER_NAME=cxxfilt
81 AC_SUBST(DEMANGLER_NAME)
83 AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h limits.h sys/param.h)
86 AC_CHECK_FUNCS(sbrk utimes setmode getc_unlocked strcoll)
87 AC_CHECK_FUNC([mkstemp],
88 AC_DEFINE([HAVE_MKSTEMP], 1,
89 [Define to 1 if you have the `mkstemp' function.]))
90 AC_CHECK_FUNC([mkdtemp],
91 AC_DEFINE([HAVE_MKDTEMP], 1,
92 [Define to 1 if you have the `mkdtemp' function.]))
94 # Check whether fopen64 is available and whether _LARGEFILE64_SOURCE
95 # needs to be defined for it
96 AC_MSG_CHECKING([for fopen64])
97 AC_CACHE_VAL(bu_cv_have_fopen64,
98 [AC_TRY_LINK([#include <stdio.h>], [FILE *f = fopen64 ("/tmp/foo","r");],
99 bu_cv_have_fopen64=yes,
100 [saved_CPPFLAGS=$CPPFLAGS
101 CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE"
102 AC_TRY_LINK([#include <stdio.h>], [FILE *f = fopen64 ("/tmp/foo","r");],
103 bu_cv_have_fopen64="need -D_LARGEFILE64_SOURCE",
104 bu_cv_have_fopen64=no)
105 CPPFLAGS=$saved_CPPFLAGS])])
106 AC_MSG_RESULT($bu_cv_have_fopen64)
107 if test "$bu_cv_have_fopen64" != no; then
108 AC_DEFINE([HAVE_FOPEN64], 1,
109 [Is fopen64 available?])
111 AC_MSG_CHECKING([for stat64])
112 AC_CACHE_VAL(bu_cv_have_stat64,
113 [AC_TRY_LINK([#include <sys/stat.h>], [struct stat64 st; stat64 ("/tmp/foo", &st);],
114 bu_cv_have_stat64=yes,
115 [saved_CPPFLAGS=$CPPFLAGS
116 CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE"
117 AC_TRY_LINK([#include <sys/stat.h>], [struct stat64 st; stat64 ("/tmp/foo", &st);],
118 bu_cv_have_stat64="need -D_LARGEFILE64_SOURCE",
119 bu_cv_have_stat64=no)
120 CPPFLAGS=$saved_CPPFLAGS])])
121 AC_MSG_RESULT($bu_cv_have_stat64)
122 if test "$bu_cv_have_stat64" != no; then
123 AC_DEFINE([HAVE_STAT64], 1,
124 [Is stat64 available?])
126 if test "$bu_cv_have_fopen64" = "need -D_LARGEFILE64_SOURCE" \
127 || test "$bu_cv_have_stat64" = "need -D_LARGEFILE64_SOURCE"; then
128 AC_DEFINE([_LARGEFILE64_SOURCE], 1,
130 CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE"
133 # Some systems have frexp only in -lm, not in -lc.
134 AC_SEARCH_LIBS(frexp, m)
136 AC_MSG_CHECKING(for time_t in time.h)
137 AC_CACHE_VAL(bu_cv_decl_time_t_time_h,
138 [AC_TRY_COMPILE([#include <time.h>], [time_t i;],
139 bu_cv_decl_time_t_time_h=yes, bu_cv_decl_time_t_time_h=no)])
140 AC_MSG_RESULT($bu_cv_decl_time_t_time_h)
141 if test $bu_cv_decl_time_t_time_h = yes; then
142 AC_DEFINE([HAVE_TIME_T_IN_TIME_H], 1,
143 [Is the type time_t defined in <time.h>?])
146 AC_MSG_CHECKING(for time_t in sys/types.h)
147 AC_CACHE_VAL(bu_cv_decl_time_t_types_h,
148 [AC_TRY_COMPILE([#include <sys/types.h>], [time_t i;],
149 bu_cv_decl_time_t_types_h=yes, bu_cv_decl_time_t_types_h=no)])
150 AC_MSG_RESULT($bu_cv_decl_time_t_types_h)
151 if test $bu_cv_decl_time_t_types_h = yes; then
152 AC_DEFINE([HAVE_TIME_T_IN_TYPES_H], 1,
153 [Is the type time_t defined in <sys/types.h>?])
156 AC_MSG_CHECKING(for a known getopt prototype in unistd.h)
157 AC_CACHE_VAL(bu_cv_decl_getopt_unistd_h,
158 [AC_TRY_COMPILE([#include <unistd.h>], [extern int getopt (int, char *const*, const char *);],
159 bu_cv_decl_getopt_unistd_h=yes, bu_cv_decl_getopt_unistd_h=no)])
160 AC_MSG_RESULT($bu_cv_decl_getopt_unistd_h)
161 if test $bu_cv_decl_getopt_unistd_h = yes; then
162 AC_DEFINE([HAVE_DECL_GETOPT], 1,
163 [Is the prototype for getopt in <unistd.h> in the expected format?])
166 # Under Next 3.2 <utime.h> apparently does not define struct utimbuf
168 AC_MSG_CHECKING([for utime.h])
169 AC_CACHE_VAL(bu_cv_header_utime_h,
170 [AC_TRY_COMPILE([#include <sys/types.h>
176 bu_cv_header_utime_h=yes, bu_cv_header_utime_h=no)])
177 AC_MSG_RESULT($bu_cv_header_utime_h)
178 if test $bu_cv_header_utime_h = yes; then
179 AC_DEFINE(HAVE_GOOD_UTIME_H, 1, [Does <utime.h> define struct utimbuf?])
182 AC_CHECK_DECLS([fprintf, stpcpy, strstr, sbrk, getenv, environ, getc_unlocked,
183 snprintf, vsnprintf])
187 # target-specific stuff:
189 # Canonicalize the secondary target names.
190 if test -n "$enable_targets"; then
191 for targ in `echo $enable_targets | sed 's/,/ /g'`
193 result=`$ac_config_sub $targ 2>/dev/null`
194 if test -n "$result"; then
195 canon_targets="$canon_targets $result"
197 # Allow targets that config.sub doesn't recognize, like "all".
198 canon_targets="$canon_targets $targ"
203 AC_CHECK_HEADER(iconv.h)
220 for targ in $target $canon_targets
222 if test "x$targ" = "xall"; then
224 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
225 BUILD_SRCONV='$(SRCONV_PROG)'
226 NLMCONV_DEFS="-DNLMCONV_I386 -DNLMCONV_ALPHA -DNLMCONV_POWERPC -DNLMCONV_SPARC"
227 BUILD_MISC="${BUILD_MISC} "'bin2c$(EXEEXT_FOR_BUILD)'
231 i[3-7]86*-*-netware*)
233 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
234 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_I386"
237 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
238 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_ALPHA"
241 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
242 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_POWERPC"
245 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
246 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_SPARC"
250 *-*-hms*) BUILD_SRCONV='$(SRCONV_PROG)' ;;
254 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
255 if test -z "$DLLTOOL_DEFAULT"; then
256 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM_EPOC"
258 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM_EPOC -DDLLTOOL_ARM"
259 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
260 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
262 arm-wince-pe* | arm-*-wince)
263 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
264 if test -z "$DLLTOOL_DEFAULT"; then
265 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM_WINCE"
267 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM_WINCE -DDLLTOOL_ARM"
268 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
269 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
272 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
273 if test -z "$DLLTOOL_DEFAULT"; then
274 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM"
276 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
277 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
278 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
281 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
282 if test -z "$DLLTOOL_DEFAULT"; then
283 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM"
285 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
286 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
287 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
290 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
291 if test -z "$DLLTOOL_DEFAULT"; then
292 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MX86_64"
294 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MX86_64"
295 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
296 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
297 BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
300 i[3-7]86-*-pe* | i[3-7]86-*-cygwin* | i[3-7]86-*-mingw32** | i[3-7]86-*-netbsdpe*)
302 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
303 if test -z "$DLLTOOL_DEFAULT"; then
304 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_I386"
306 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
307 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
308 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
309 BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
314 BUILD_DLLTOOL='$(DLLTOOL_PROG)'
315 if test -z "$DLLTOOL_DEFAULT"; then
316 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_I386"
318 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
325 OBJDUMP_DEFS="-DAIX_WEAK_SUPPORT"
327 powerpc*-*-pe* | powerpc*-*-cygwin*)
328 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
329 if test -z "$DLLTOOL_DEFAULT"; then
330 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_PPC"
332 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_PPC"
333 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
334 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
336 powerpc*-*-linux* | powerpc*-*-elf*)
337 BUILD_INSTALL_MISC="${BUILD_INSTALL_MISC} embedspu"
340 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
341 if test -z "$DLLTOOL_DEFAULT"; then
342 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_SH"
344 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_SH"
345 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
346 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
349 BUILD_MISC="${BUILD_MISC} "'bin2c$(EXEEXT_FOR_BUILD)'
352 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
353 if test -z "$DLLTOOL_DEFAULT"; then
354 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MIPS"
356 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MIPS"
357 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
358 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
361 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
362 if test -z "$DLLTOOL_DEFAULT"; then
363 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MCORE"
365 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE"
366 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
367 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
370 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
371 if test -z "$DLLTOOL_DEFAULT"; then
372 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MCORE_ELF"
374 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE_ELF"
377 OBJDUMP_DEFS="-DSKIP_ZEROES=256 -DSKIP_ZEROES_AT_END=0"
383 DLLTOOL_DEFS="$DLLTOOL_DEFS $DLLTOOL_DEFAULT"
385 if test "${with_windres+set}" = set; then
386 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
389 if test "${with_windmc+set}" = set; then
390 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
393 AC_SUBST(NLMCONV_DEFS)
394 AC_SUBST(BUILD_NLMCONV)
395 AC_SUBST(BUILD_SRCONV)
396 AC_SUBST(BUILD_DLLTOOL)
397 AC_SUBST(DLLTOOL_DEFS)
398 AC_SUBST(BUILD_WINDRES)
399 AC_SUBST(BUILD_WINDMC)
400 AC_SUBST(BUILD_DLLWRAP)
402 AC_SUBST(BUILD_INSTALL_MISC)
403 AC_SUBST(OBJDUMP_DEFS)
405 AC_DEFINE_UNQUOTED(TARGET, "${target}", [Configured target name.])
408 . $srcdir/../bfd/config.bfd
409 if test "x$targ_underscore" = "xyes"; then
414 AC_DEFINE_UNQUOTED(TARGET_PREPENDS_UNDERSCORE, $UNDERSCORE,
415 [Define to 1 if user symbol names have a leading underscore, 0 if not.])
418 for targ_alias in `echo $target_alias $enable_targets | sed 's/,/ /g'`
420 # Canonicalize the secondary target names.
421 result=`$ac_config_sub $targ_alias 2>/dev/null`
422 if test -n "$result"; then
428 . ${srcdir}/configure.tgt
431 EMULATION_VECTOR=$targ_emul_vector
435 AC_SUBST(EMULATION_VECTOR)
437 # Required for html and install-html
438 AC_SUBST(datarootdir)
442 AC_OUTPUT(Makefile doc/Makefile po/Makefile.in:po/Make-in)