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"
229 for targ in $target $canon_targets
231 if test "x$targ" = "xall"; then
233 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
234 BUILD_SRCONV='$(SRCONV_PROG)'
235 NLMCONV_DEFS="-DNLMCONV_I386 -DNLMCONV_ALPHA -DNLMCONV_POWERPC -DNLMCONV_SPARC"
236 BUILD_MISC="${BUILD_MISC} bin2c"
240 i[3-7]86*-*-netware*)
242 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
243 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_I386"
246 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
247 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_ALPHA"
250 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
251 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_POWERPC"
254 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
255 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_SPARC"
259 *-*-hms*) BUILD_SRCONV='$(SRCONV_PROG)' ;;
263 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
264 if test -z "$DLLTOOL_DEFAULT"; then
265 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM_EPOC"
267 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM_EPOC -DDLLTOOL_ARM"
268 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
270 arm-wince-pe* | arm-*-wince)
271 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
272 if test -z "$DLLTOOL_DEFAULT"; then
273 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM_WINCE"
275 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM_WINCE -DDLLTOOL_ARM"
276 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
279 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
280 if test -z "$DLLTOOL_DEFAULT"; then
281 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM"
283 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
284 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
287 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
288 if test -z "$DLLTOOL_DEFAULT"; then
289 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM"
291 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
292 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
295 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
296 if test -z "$DLLTOOL_DEFAULT"; then
297 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MX86_64"
299 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MX86_64"
300 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
301 BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
304 i[3-7]86-*-pe* | i[3-7]86-*-cygwin* | i[3-7]86-*-mingw32** | i[3-7]86-*-netbsdpe*)
306 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
307 if test -z "$DLLTOOL_DEFAULT"; then
308 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_I386"
310 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
311 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
312 BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
317 BUILD_DLLTOOL='$(DLLTOOL_PROG)'
318 if test -z "$DLLTOOL_DEFAULT"; then
319 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_I386"
321 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
328 OBJDUMP_DEFS="-DAIX_WEAK_SUPPORT"
330 powerpc*-*-pe* | powerpc*-*-cygwin*)
331 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
332 if test -z "$DLLTOOL_DEFAULT"; then
333 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_PPC"
335 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_PPC"
336 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
338 powerpc*-*-linux* | powerpc*-*-elf*)
339 BUILD_MISC="${BUILD_MISC} embedspu"
342 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
343 if test -z "$DLLTOOL_DEFAULT"; then
344 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_SH"
346 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_SH"
347 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
350 BUILD_MISC="${BUILD_MISC} bin2c"
353 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
354 if test -z "$DLLTOOL_DEFAULT"; then
355 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MIPS"
357 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MIPS"
358 BUILD_WINDRES='$(WINDRES_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)'
369 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
370 if test -z "$DLLTOOL_DEFAULT"; then
371 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MCORE_ELF"
373 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE_ELF"
376 OBJDUMP_DEFS="-DSKIP_ZEROES=256 -DSKIP_ZEROES_AT_END=0"
382 DLLTOOL_DEFS="$DLLTOOL_DEFS $DLLTOOL_DEFAULT"
384 if test "${with_windres+set}" = set; then
385 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
388 AC_SUBST(NLMCONV_DEFS)
389 AC_SUBST(BUILD_NLMCONV)
390 AC_SUBST(BUILD_SRCONV)
391 AC_SUBST(BUILD_DLLTOOL)
392 AC_SUBST(DLLTOOL_DEFS)
393 AC_SUBST(BUILD_WINDRES)
394 AC_SUBST(BUILD_DLLWRAP)
396 AC_SUBST(OBJDUMP_DEFS)
398 AC_DEFINE_UNQUOTED(TARGET, "${target}", [Configured target name.])
401 . $srcdir/../bfd/config.bfd
402 if test "x$targ_underscore" = "xyes"; then
407 AC_DEFINE_UNQUOTED(TARGET_PREPENDS_UNDERSCORE, $UNDERSCORE,
408 [Define to 1 if user symbol names have a leading underscore, 0 if not.])
411 for targ_alias in `echo $target_alias $enable_targets | sed 's/,/ /g'`
413 # Canonicalize the secondary target names.
414 result=`$ac_config_sub $targ_alias 2>/dev/null`
415 if test -n "$result"; then
421 . ${srcdir}/configure.tgt
424 EMULATION_VECTOR=$targ_emul_vector
428 AC_SUBST(EMULATION_VECTOR)
430 # Required for html and install-html
431 AC_SUBST(datarootdir)
435 AC_OUTPUT(Makefile doc/Makefile po/Makefile.in:po/Make-in)