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})
16 AC_ARG_ENABLE(targets,
17 [ --enable-targets alternative target configurations],
18 [case "${enableval}" in
19 yes | "") AC_ERROR(enable-targets option must specify target names or 'all')
21 no) enable_targets= ;;
22 *) enable_targets=$enableval ;;
24 AC_ARG_ENABLE(commonbfdlib,
25 [ --enable-commonbfdlib build shared BFD/opcodes/libiberty library],
26 [case "${enableval}" in
27 yes) commonbfdlib=true ;;
28 no) commonbfdlib=false ;;
29 *) AC_MSG_ERROR([bad value ${enableval} for BFD commonbfdlib option]) ;;
34 AM_CONFIG_HEADER(config.h:config.in)
36 if test -z "$target" ; then
37 AC_MSG_ERROR(Unrecognized target system type; please check config.sub.)
39 if test -z "$host" ; then
40 AC_MSG_ERROR(Unrecognized host system type; please check config.sub.)
49 ALL_LINGUAS="fr tr ja es sv da zh_CN ru ro rw zh_TW fi vi"
50 ZW_GNU_GETTEXT_SISTER_DIR
54 AM_CONDITIONAL(GENINSRC_NEVER, false)
56 if test -n "$EXEEXT"; then
57 AC_DEFINE(HAVE_EXECUTABLE_SUFFIX, 1,
58 [Does the platform use an executable suffix?])
60 AC_DEFINE_UNQUOTED(EXECUTABLE_SUFFIX, "${EXEEXT}",
61 [Suffix used for executables, if any.])
63 # host-specific stuff:
67 . ${srcdir}/../bfd/configure.host
77 DEMANGLER_NAME=c++filt
79 *-*-go32* | *-*-msdos*)
80 DEMANGLER_NAME=cxxfilt
82 AC_SUBST(DEMANGLER_NAME)
84 AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h limits.h sys/param.h)
87 AC_CHECK_FUNCS(sbrk utimes setmode getc_unlocked strcoll)
88 AC_CHECK_FUNC([mkstemp],
89 AC_DEFINE([HAVE_MKSTEMP], 1,
90 [Define to 1 if you have the `mkstemp' function.]))
91 AC_CHECK_FUNC([mkdtemp],
92 AC_DEFINE([HAVE_MKDTEMP], 1,
93 [Define to 1 if you have the `mkdtemp' function.]))
95 # Check whether fopen64 is available and whether _LARGEFILE64_SOURCE
96 # needs to be defined for it
97 AC_MSG_CHECKING([for fopen64])
98 AC_CACHE_VAL(bu_cv_have_fopen64,
99 [AC_TRY_LINK([#include <stdio.h>], [FILE *f = fopen64 ("/tmp/foo","r");],
100 bu_cv_have_fopen64=yes,
101 [saved_CPPFLAGS=$CPPFLAGS
102 CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE"
103 AC_TRY_LINK([#include <stdio.h>], [FILE *f = fopen64 ("/tmp/foo","r");],
104 bu_cv_have_fopen64="need -D_LARGEFILE64_SOURCE",
105 bu_cv_have_fopen64=no)
106 CPPFLAGS=$saved_CPPFLAGS])])
107 AC_MSG_RESULT($bu_cv_have_fopen64)
108 if test "$bu_cv_have_fopen64" != no; then
109 AC_DEFINE([HAVE_FOPEN64], 1,
110 [Is fopen64 available?])
112 AC_MSG_CHECKING([for stat64])
113 AC_CACHE_VAL(bu_cv_have_stat64,
114 [AC_TRY_LINK([#include <sys/stat.h>], [struct stat64 st; stat64 ("/tmp/foo", &st);],
115 bu_cv_have_stat64=yes,
116 [saved_CPPFLAGS=$CPPFLAGS
117 CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE"
118 AC_TRY_LINK([#include <sys/stat.h>], [struct stat64 st; stat64 ("/tmp/foo", &st);],
119 bu_cv_have_stat64="need -D_LARGEFILE64_SOURCE",
120 bu_cv_have_stat64=no)
121 CPPFLAGS=$saved_CPPFLAGS])])
122 AC_MSG_RESULT($bu_cv_have_stat64)
123 if test "$bu_cv_have_stat64" != no; then
124 AC_DEFINE([HAVE_STAT64], 1,
125 [Is stat64 available?])
127 if test "$bu_cv_have_fopen64" = "need -D_LARGEFILE64_SOURCE" \
128 || test "$bu_cv_have_stat64" = "need -D_LARGEFILE64_SOURCE"; then
129 AC_DEFINE([_LARGEFILE64_SOURCE], 1,
131 CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE"
134 # Some systems have frexp only in -lm, not in -lc.
135 AC_SEARCH_LIBS(frexp, m)
137 AC_MSG_CHECKING(for time_t in time.h)
138 AC_CACHE_VAL(bu_cv_decl_time_t_time_h,
139 [AC_TRY_COMPILE([#include <time.h>], [time_t i;],
140 bu_cv_decl_time_t_time_h=yes, bu_cv_decl_time_t_time_h=no)])
141 AC_MSG_RESULT($bu_cv_decl_time_t_time_h)
142 if test $bu_cv_decl_time_t_time_h = yes; then
143 AC_DEFINE([HAVE_TIME_T_IN_TIME_H], 1,
144 [Is the type time_t defined in <time.h>?])
147 AC_MSG_CHECKING(for time_t in sys/types.h)
148 AC_CACHE_VAL(bu_cv_decl_time_t_types_h,
149 [AC_TRY_COMPILE([#include <sys/types.h>], [time_t i;],
150 bu_cv_decl_time_t_types_h=yes, bu_cv_decl_time_t_types_h=no)])
151 AC_MSG_RESULT($bu_cv_decl_time_t_types_h)
152 if test $bu_cv_decl_time_t_types_h = yes; then
153 AC_DEFINE([HAVE_TIME_T_IN_TYPES_H], 1,
154 [Is the type time_t defined in <sys/types.h>?])
157 AC_MSG_CHECKING(for a known getopt prototype in unistd.h)
158 AC_CACHE_VAL(bu_cv_decl_getopt_unistd_h,
159 [AC_TRY_COMPILE([#include <unistd.h>], [extern int getopt (int, char *const*, const char *);],
160 bu_cv_decl_getopt_unistd_h=yes, bu_cv_decl_getopt_unistd_h=no)])
161 AC_MSG_RESULT($bu_cv_decl_getopt_unistd_h)
162 if test $bu_cv_decl_getopt_unistd_h = yes; then
163 AC_DEFINE([HAVE_DECL_GETOPT], 1,
164 [Is the prototype for getopt in <unistd.h> in the expected format?])
167 # Under Next 3.2 <utime.h> apparently does not define struct utimbuf
169 AC_MSG_CHECKING([for utime.h])
170 AC_CACHE_VAL(bu_cv_header_utime_h,
171 [AC_TRY_COMPILE([#include <sys/types.h>
177 bu_cv_header_utime_h=yes, bu_cv_header_utime_h=no)])
178 AC_MSG_RESULT($bu_cv_header_utime_h)
179 if test $bu_cv_header_utime_h = yes; then
180 AC_DEFINE(HAVE_GOOD_UTIME_H, 1, [Does <utime.h> define struct utimbuf?])
183 AC_CHECK_DECLS([fprintf, stpcpy, strstr, sbrk, getenv, environ, getc_unlocked,
184 snprintf, vsnprintf])
188 # target-specific stuff:
190 # Canonicalize the secondary target names.
191 if test -n "$enable_targets"; then
192 for targ in `echo $enable_targets | sed 's/,/ /g'`
194 result=`$ac_config_sub $targ 2>/dev/null`
195 if test -n "$result"; then
196 canon_targets="$canon_targets $result"
198 # Allow targets that config.sub doesn't recognize, like "all".
199 canon_targets="$canon_targets $targ"
216 for targ in $target $canon_targets
218 if test "x$targ" = "xall"; then
220 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
221 BUILD_SRCONV='$(SRCONV_PROG)'
222 NLMCONV_DEFS="-DNLMCONV_I386 -DNLMCONV_ALPHA -DNLMCONV_POWERPC -DNLMCONV_SPARC"
226 i[3-7]86*-*-netware*)
228 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
229 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_I386"
232 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
233 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_ALPHA"
236 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
237 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_POWERPC"
240 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
241 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_SPARC"
245 *-*-hms*) BUILD_SRCONV='$(SRCONV_PROG)' ;;
249 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
250 if test -z "$DLLTOOL_DEFAULT"; then
251 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM_EPOC"
253 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM_EPOC -DDLLTOOL_ARM"
254 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
256 arm-wince-pe* | arm-*-wince)
257 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
258 if test -z "$DLLTOOL_DEFAULT"; then
259 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM_WINCE"
261 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM_WINCE -DDLLTOOL_ARM"
262 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
265 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
266 if test -z "$DLLTOOL_DEFAULT"; then
267 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM"
269 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
270 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
273 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
274 if test -z "$DLLTOOL_DEFAULT"; then
275 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM"
277 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
278 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
281 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
282 if test -z "$DLLTOOL_DEFAULT"; then
283 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MX86_64"
285 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MX86_64"
286 BUILD_WINDRES='$(WINDRES_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_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
303 BUILD_DLLTOOL='$(DLLTOOL_PROG)'
304 if test -z "$DLLTOOL_DEFAULT"; then
305 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_I386"
307 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
314 OBJDUMP_DEFS="-DAIX_WEAK_SUPPORT"
316 powerpc*-*-pe* | powerpc*-*-cygwin*)
317 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
318 if test -z "$DLLTOOL_DEFAULT"; then
319 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_PPC"
321 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_PPC"
322 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
324 powerpc*-*-linux* | powerpc*-*-elf*)
328 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
329 if test -z "$DLLTOOL_DEFAULT"; then
330 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_SH"
332 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_SH"
333 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
336 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
337 if test -z "$DLLTOOL_DEFAULT"; then
338 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MIPS"
340 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MIPS"
341 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
344 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
345 if test -z "$DLLTOOL_DEFAULT"; then
346 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MCORE"
348 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE"
349 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
352 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
353 if test -z "$DLLTOOL_DEFAULT"; then
354 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MCORE_ELF"
356 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE_ELF"
359 OBJDUMP_DEFS="-DSKIP_ZEROES=256 -DSKIP_ZEROES_AT_END=0"
365 DLLTOOL_DEFS="$DLLTOOL_DEFS $DLLTOOL_DEFAULT"
367 if test "${with_windres+set}" = set; then
368 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
371 AC_SUBST(NLMCONV_DEFS)
372 AC_SUBST(BUILD_NLMCONV)
373 AC_SUBST(BUILD_SRCONV)
374 AC_SUBST(BUILD_DLLTOOL)
375 AC_SUBST(DLLTOOL_DEFS)
376 AC_SUBST(BUILD_WINDRES)
377 AC_SUBST(BUILD_DLLWRAP)
379 AC_SUBST(OBJDUMP_DEFS)
381 AC_DEFINE_UNQUOTED(TARGET, "${target}", [Configured target name.])
384 . $srcdir/../bfd/config.bfd
385 if test "x$targ_underscore" = "xyes"; then
390 AC_DEFINE_UNQUOTED(TARGET_PREPENDS_UNDERSCORE, $UNDERSCORE,
391 [Define to 1 if user symbol names have a leading underscore, 0 if not.])
394 for targ_alias in `echo $target_alias $enable_targets | sed 's/,/ /g'`
396 # Canonicalize the secondary target names.
397 result=`$ac_config_sub $targ_alias 2>/dev/null`
398 if test -n "$result"; then
404 . ${srcdir}/configure.tgt
407 EMULATION_VECTOR=$targ_emul_vector
411 AC_SUBST(EMULATION_VECTOR)
413 # Required for html and install-html
414 AC_SUBST(datarootdir)
418 AC_OUTPUT(Makefile doc/Makefile po/Makefile.in:po/Make-in)