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]) ;;
32 # The location to which bugs should be reported.
34 AS_HELP_STRING([--with-bugurl=URL],
35 [Direct users to URL to report a bug]),
37 yes) AC_MSG_ERROR([bug URL not specified]) ;;
38 no) REPORT_BUGS_TO="" ;;
39 *) REPORT_BUGS_TO="<URL:$withval>" ;;
41 REPORT_BUGS_TO="<URL:http://www.sourceware.org/bugzilla/>"
43 AC_SUBST(REPORT_BUGS_TO)
47 AM_CONFIG_HEADER(config.h:config.in)
49 if test -z "$target" ; then
50 AC_MSG_ERROR(Unrecognized target system type; please check config.sub.)
52 if test -z "$host" ; then
53 AC_MSG_ERROR(Unrecognized host system type; please check config.sub.)
62 ALL_LINGUAS="fr tr ja es sv da zh_CN ru ro rw zh_TW fi vi"
63 ZW_GNU_GETTEXT_SISTER_DIR
67 AM_CONDITIONAL(GENINSRC_NEVER, false)
69 if test -n "$EXEEXT"; then
70 AC_DEFINE(HAVE_EXECUTABLE_SUFFIX, 1,
71 [Does the platform use an executable suffix?])
73 AC_DEFINE_UNQUOTED(EXECUTABLE_SUFFIX, "${EXEEXT}",
74 [Suffix used for executables, if any.])
76 # host-specific stuff:
80 . ${srcdir}/../bfd/configure.host
90 DEMANGLER_NAME=c++filt
92 *-*-go32* | *-*-msdos*)
93 DEMANGLER_NAME=cxxfilt
95 AC_SUBST(DEMANGLER_NAME)
97 AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h limits.h sys/param.h)
100 AC_CHECK_FUNCS(sbrk utimes setmode getc_unlocked strcoll)
101 AC_CHECK_FUNC([mkstemp],
102 AC_DEFINE([HAVE_MKSTEMP], 1,
103 [Define to 1 if you have the `mkstemp' function.]))
104 AC_CHECK_FUNC([mkdtemp],
105 AC_DEFINE([HAVE_MKDTEMP], 1,
106 [Define to 1 if you have the `mkdtemp' function.]))
108 # Check whether fopen64 is available and whether _LARGEFILE64_SOURCE
109 # needs to be defined for it
110 AC_MSG_CHECKING([for fopen64])
111 AC_CACHE_VAL(bu_cv_have_fopen64,
112 [AC_TRY_LINK([#include <stdio.h>], [FILE *f = fopen64 ("/tmp/foo","r");],
113 bu_cv_have_fopen64=yes,
114 [saved_CPPFLAGS=$CPPFLAGS
115 CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE"
116 AC_TRY_LINK([#include <stdio.h>], [FILE *f = fopen64 ("/tmp/foo","r");],
117 bu_cv_have_fopen64="need -D_LARGEFILE64_SOURCE",
118 bu_cv_have_fopen64=no)
119 CPPFLAGS=$saved_CPPFLAGS])])
120 AC_MSG_RESULT($bu_cv_have_fopen64)
121 if test "$bu_cv_have_fopen64" != no; then
122 AC_DEFINE([HAVE_FOPEN64], 1,
123 [Is fopen64 available?])
125 AC_MSG_CHECKING([for stat64])
126 AC_CACHE_VAL(bu_cv_have_stat64,
127 [AC_TRY_LINK([#include <sys/stat.h>], [struct stat64 st; stat64 ("/tmp/foo", &st);],
128 bu_cv_have_stat64=yes,
129 [saved_CPPFLAGS=$CPPFLAGS
130 CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE"
131 AC_TRY_LINK([#include <sys/stat.h>], [struct stat64 st; stat64 ("/tmp/foo", &st);],
132 bu_cv_have_stat64="need -D_LARGEFILE64_SOURCE",
133 bu_cv_have_stat64=no)
134 CPPFLAGS=$saved_CPPFLAGS])])
135 AC_MSG_RESULT($bu_cv_have_stat64)
136 if test "$bu_cv_have_stat64" != no; then
137 AC_DEFINE([HAVE_STAT64], 1,
138 [Is stat64 available?])
140 if test "$bu_cv_have_fopen64" = "need -D_LARGEFILE64_SOURCE" \
141 || test "$bu_cv_have_stat64" = "need -D_LARGEFILE64_SOURCE"; then
142 AC_DEFINE([_LARGEFILE64_SOURCE], 1,
144 CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE"
147 # Some systems have frexp only in -lm, not in -lc.
148 AC_SEARCH_LIBS(frexp, m)
150 AC_MSG_CHECKING(for time_t in time.h)
151 AC_CACHE_VAL(bu_cv_decl_time_t_time_h,
152 [AC_TRY_COMPILE([#include <time.h>], [time_t i;],
153 bu_cv_decl_time_t_time_h=yes, bu_cv_decl_time_t_time_h=no)])
154 AC_MSG_RESULT($bu_cv_decl_time_t_time_h)
155 if test $bu_cv_decl_time_t_time_h = yes; then
156 AC_DEFINE([HAVE_TIME_T_IN_TIME_H], 1,
157 [Is the type time_t defined in <time.h>?])
160 AC_MSG_CHECKING(for time_t in sys/types.h)
161 AC_CACHE_VAL(bu_cv_decl_time_t_types_h,
162 [AC_TRY_COMPILE([#include <sys/types.h>], [time_t i;],
163 bu_cv_decl_time_t_types_h=yes, bu_cv_decl_time_t_types_h=no)])
164 AC_MSG_RESULT($bu_cv_decl_time_t_types_h)
165 if test $bu_cv_decl_time_t_types_h = yes; then
166 AC_DEFINE([HAVE_TIME_T_IN_TYPES_H], 1,
167 [Is the type time_t defined in <sys/types.h>?])
170 AC_MSG_CHECKING(for a known getopt prototype in unistd.h)
171 AC_CACHE_VAL(bu_cv_decl_getopt_unistd_h,
172 [AC_TRY_COMPILE([#include <unistd.h>], [extern int getopt (int, char *const*, const char *);],
173 bu_cv_decl_getopt_unistd_h=yes, bu_cv_decl_getopt_unistd_h=no)])
174 AC_MSG_RESULT($bu_cv_decl_getopt_unistd_h)
175 if test $bu_cv_decl_getopt_unistd_h = yes; then
176 AC_DEFINE([HAVE_DECL_GETOPT], 1,
177 [Is the prototype for getopt in <unistd.h> in the expected format?])
180 # Under Next 3.2 <utime.h> apparently does not define struct utimbuf
182 AC_MSG_CHECKING([for utime.h])
183 AC_CACHE_VAL(bu_cv_header_utime_h,
184 [AC_TRY_COMPILE([#include <sys/types.h>
190 bu_cv_header_utime_h=yes, bu_cv_header_utime_h=no)])
191 AC_MSG_RESULT($bu_cv_header_utime_h)
192 if test $bu_cv_header_utime_h = yes; then
193 AC_DEFINE(HAVE_GOOD_UTIME_H, 1, [Does <utime.h> define struct utimbuf?])
196 AC_CHECK_DECLS([fprintf, stpcpy, strstr, sbrk, getenv, environ, getc_unlocked,
197 snprintf, vsnprintf])
201 # target-specific stuff:
203 # Canonicalize the secondary target names.
204 if test -n "$enable_targets"; then
205 for targ in `echo $enable_targets | sed 's/,/ /g'`
207 result=`$ac_config_sub $targ 2>/dev/null`
208 if test -n "$result"; then
209 canon_targets="$canon_targets $result"
211 # Allow targets that config.sub doesn't recognize, like "all".
212 canon_targets="$canon_targets $targ"
230 for targ in $target $canon_targets
232 if test "x$targ" = "xall"; then
234 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
235 BUILD_SRCONV='$(SRCONV_PROG)'
236 NLMCONV_DEFS="-DNLMCONV_I386 -DNLMCONV_ALPHA -DNLMCONV_POWERPC -DNLMCONV_SPARC"
237 BUILD_MISC="${BUILD_MISC} "'bin2c$(EXEEXT_FOR_BUILD)'
241 i[3-7]86*-*-netware*)
243 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
244 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_I386"
247 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
248 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_ALPHA"
251 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
252 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_POWERPC"
255 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
256 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_SPARC"
260 *-*-hms*) BUILD_SRCONV='$(SRCONV_PROG)' ;;
264 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
265 if test -z "$DLLTOOL_DEFAULT"; then
266 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM_EPOC"
268 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM_EPOC -DDLLTOOL_ARM"
269 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
271 arm-wince-pe* | arm-*-wince)
272 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
273 if test -z "$DLLTOOL_DEFAULT"; then
274 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM_WINCE"
276 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM_WINCE -DDLLTOOL_ARM"
277 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
280 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
281 if test -z "$DLLTOOL_DEFAULT"; then
282 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM"
284 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
285 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
288 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
289 if test -z "$DLLTOOL_DEFAULT"; then
290 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM"
292 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
293 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
296 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
297 if test -z "$DLLTOOL_DEFAULT"; then
298 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MX86_64"
300 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MX86_64"
301 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
302 BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
305 i[3-7]86-*-pe* | i[3-7]86-*-cygwin* | i[3-7]86-*-mingw32** | i[3-7]86-*-netbsdpe*)
307 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
308 if test -z "$DLLTOOL_DEFAULT"; then
309 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_I386"
311 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
312 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
313 BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
318 BUILD_DLLTOOL='$(DLLTOOL_PROG)'
319 if test -z "$DLLTOOL_DEFAULT"; then
320 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_I386"
322 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
329 OBJDUMP_DEFS="-DAIX_WEAK_SUPPORT"
331 powerpc*-*-pe* | powerpc*-*-cygwin*)
332 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
333 if test -z "$DLLTOOL_DEFAULT"; then
334 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_PPC"
336 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_PPC"
337 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
339 powerpc*-*-linux* | powerpc*-*-elf*)
340 BUILD_INSTALL_MISC="${BUILD_INSTALL_MISC} embedspu"
343 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
344 if test -z "$DLLTOOL_DEFAULT"; then
345 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_SH"
347 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_SH"
348 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
351 BUILD_MISC="${BUILD_MISC} "'bin2c$(EXEEXT_FOR_BUILD)'
354 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
355 if test -z "$DLLTOOL_DEFAULT"; then
356 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MIPS"
358 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MIPS"
359 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
362 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
363 if test -z "$DLLTOOL_DEFAULT"; then
364 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MCORE"
366 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE"
367 BUILD_WINDRES='$(WINDRES_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 AC_SUBST(NLMCONV_DEFS)
390 AC_SUBST(BUILD_NLMCONV)
391 AC_SUBST(BUILD_SRCONV)
392 AC_SUBST(BUILD_DLLTOOL)
393 AC_SUBST(DLLTOOL_DEFS)
394 AC_SUBST(BUILD_WINDRES)
395 AC_SUBST(BUILD_DLLWRAP)
397 AC_SUBST(BUILD_INSTALL_MISC)
398 AC_SUBST(OBJDUMP_DEFS)
400 AC_DEFINE_UNQUOTED(TARGET, "${target}", [Configured target name.])
403 . $srcdir/../bfd/config.bfd
404 if test "x$targ_underscore" = "xyes"; then
409 AC_DEFINE_UNQUOTED(TARGET_PREPENDS_UNDERSCORE, $UNDERSCORE,
410 [Define to 1 if user symbol names have a leading underscore, 0 if not.])
413 for targ_alias in `echo $target_alias $enable_targets | sed 's/,/ /g'`
415 # Canonicalize the secondary target names.
416 result=`$ac_config_sub $targ_alias 2>/dev/null`
417 if test -n "$result"; then
423 . ${srcdir}/configure.tgt
426 EMULATION_VECTOR=$targ_emul_vector
430 AC_SUBST(EMULATION_VECTOR)
432 # Required for html and install-html
433 AC_SUBST(datarootdir)
437 AC_OUTPUT(Makefile doc/Makefile po/Makefile.in:po/Make-in)