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="";
41 *) REPORT_BUGS_TO="<URL:$withval>"
42 REPORT_BUGS_TEXI="@uref{`echo $withval | sed 's/@/@@/g'`}"
45 REPORT_BUGS_TO="<URL:http://www.sourceware.org/bugzilla/>"
46 REPORT_BUGS_TEXI="@uref{http://www.sourceware.org/bugzilla/}"
48 AC_SUBST(REPORT_BUGS_TO)
49 AC_SUBST(REPORT_BUGS_TEXI)
53 AM_CONFIG_HEADER(config.h:config.in)
55 if test -z "$target" ; then
56 AC_MSG_ERROR(Unrecognized target system type; please check config.sub.)
58 if test -z "$host" ; then
59 AC_MSG_ERROR(Unrecognized host system type; please check config.sub.)
68 ALL_LINGUAS="fr tr ja es sv da zh_CN ru ro rw zh_TW fi vi"
69 ZW_GNU_GETTEXT_SISTER_DIR
73 AM_CONDITIONAL(GENINSRC_NEVER, false)
75 if test -n "$EXEEXT"; then
76 AC_DEFINE(HAVE_EXECUTABLE_SUFFIX, 1,
77 [Does the platform use an executable suffix?])
79 AC_DEFINE_UNQUOTED(EXECUTABLE_SUFFIX, "${EXEEXT}",
80 [Suffix used for executables, if any.])
82 # host-specific stuff:
86 . ${srcdir}/../bfd/configure.host
96 DEMANGLER_NAME=c++filt
98 *-*-go32* | *-*-msdos*)
99 DEMANGLER_NAME=cxxfilt
101 AC_SUBST(DEMANGLER_NAME)
103 AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h limits.h sys/param.h)
106 AC_CHECK_FUNCS(sbrk utimes setmode getc_unlocked strcoll)
107 AC_CHECK_FUNC([mkstemp],
108 AC_DEFINE([HAVE_MKSTEMP], 1,
109 [Define to 1 if you have the `mkstemp' function.]))
110 AC_CHECK_FUNC([mkdtemp],
111 AC_DEFINE([HAVE_MKDTEMP], 1,
112 [Define to 1 if you have the `mkdtemp' function.]))
114 # Check whether fopen64 is available and whether _LARGEFILE64_SOURCE
115 # needs to be defined for it
116 AC_MSG_CHECKING([for fopen64])
117 AC_CACHE_VAL(bu_cv_have_fopen64,
118 [AC_TRY_LINK([#include <stdio.h>], [FILE *f = fopen64 ("/tmp/foo","r");],
119 bu_cv_have_fopen64=yes,
120 [saved_CPPFLAGS=$CPPFLAGS
121 CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE"
122 AC_TRY_LINK([#include <stdio.h>], [FILE *f = fopen64 ("/tmp/foo","r");],
123 bu_cv_have_fopen64="need -D_LARGEFILE64_SOURCE",
124 bu_cv_have_fopen64=no)
125 CPPFLAGS=$saved_CPPFLAGS])])
126 AC_MSG_RESULT($bu_cv_have_fopen64)
127 if test "$bu_cv_have_fopen64" != no; then
128 AC_DEFINE([HAVE_FOPEN64], 1,
129 [Is fopen64 available?])
131 AC_MSG_CHECKING([for stat64])
132 AC_CACHE_VAL(bu_cv_have_stat64,
133 [AC_TRY_LINK([#include <sys/stat.h>], [struct stat64 st; stat64 ("/tmp/foo", &st);],
134 bu_cv_have_stat64=yes,
135 [saved_CPPFLAGS=$CPPFLAGS
136 CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE"
137 AC_TRY_LINK([#include <sys/stat.h>], [struct stat64 st; stat64 ("/tmp/foo", &st);],
138 bu_cv_have_stat64="need -D_LARGEFILE64_SOURCE",
139 bu_cv_have_stat64=no)
140 CPPFLAGS=$saved_CPPFLAGS])])
141 AC_MSG_RESULT($bu_cv_have_stat64)
142 if test "$bu_cv_have_stat64" != no; then
143 AC_DEFINE([HAVE_STAT64], 1,
144 [Is stat64 available?])
146 if test "$bu_cv_have_fopen64" = "need -D_LARGEFILE64_SOURCE" \
147 || test "$bu_cv_have_stat64" = "need -D_LARGEFILE64_SOURCE"; then
148 AC_DEFINE([_LARGEFILE64_SOURCE], 1,
150 CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE"
153 # Some systems have frexp only in -lm, not in -lc.
154 AC_SEARCH_LIBS(frexp, m)
156 AC_MSG_CHECKING(for time_t in time.h)
157 AC_CACHE_VAL(bu_cv_decl_time_t_time_h,
158 [AC_TRY_COMPILE([#include <time.h>], [time_t i;],
159 bu_cv_decl_time_t_time_h=yes, bu_cv_decl_time_t_time_h=no)])
160 AC_MSG_RESULT($bu_cv_decl_time_t_time_h)
161 if test $bu_cv_decl_time_t_time_h = yes; then
162 AC_DEFINE([HAVE_TIME_T_IN_TIME_H], 1,
163 [Is the type time_t defined in <time.h>?])
166 AC_MSG_CHECKING(for time_t in sys/types.h)
167 AC_CACHE_VAL(bu_cv_decl_time_t_types_h,
168 [AC_TRY_COMPILE([#include <sys/types.h>], [time_t i;],
169 bu_cv_decl_time_t_types_h=yes, bu_cv_decl_time_t_types_h=no)])
170 AC_MSG_RESULT($bu_cv_decl_time_t_types_h)
171 if test $bu_cv_decl_time_t_types_h = yes; then
172 AC_DEFINE([HAVE_TIME_T_IN_TYPES_H], 1,
173 [Is the type time_t defined in <sys/types.h>?])
176 AC_MSG_CHECKING(for a known getopt prototype in unistd.h)
177 AC_CACHE_VAL(bu_cv_decl_getopt_unistd_h,
178 [AC_TRY_COMPILE([#include <unistd.h>], [extern int getopt (int, char *const*, const char *);],
179 bu_cv_decl_getopt_unistd_h=yes, bu_cv_decl_getopt_unistd_h=no)])
180 AC_MSG_RESULT($bu_cv_decl_getopt_unistd_h)
181 if test $bu_cv_decl_getopt_unistd_h = yes; then
182 AC_DEFINE([HAVE_DECL_GETOPT], 1,
183 [Is the prototype for getopt in <unistd.h> in the expected format?])
186 # Under Next 3.2 <utime.h> apparently does not define struct utimbuf
188 AC_MSG_CHECKING([for utime.h])
189 AC_CACHE_VAL(bu_cv_header_utime_h,
190 [AC_TRY_COMPILE([#include <sys/types.h>
196 bu_cv_header_utime_h=yes, bu_cv_header_utime_h=no)])
197 AC_MSG_RESULT($bu_cv_header_utime_h)
198 if test $bu_cv_header_utime_h = yes; then
199 AC_DEFINE(HAVE_GOOD_UTIME_H, 1, [Does <utime.h> define struct utimbuf?])
202 AC_CHECK_DECLS([fprintf, stpcpy, strstr, sbrk, getenv, environ, getc_unlocked,
203 snprintf, vsnprintf])
207 # target-specific stuff:
209 # Canonicalize the secondary target names.
210 if test -n "$enable_targets"; then
211 for targ in `echo $enable_targets | sed 's/,/ /g'`
213 result=`$ac_config_sub $targ 2>/dev/null`
214 if test -n "$result"; then
215 canon_targets="$canon_targets $result"
217 # Allow targets that config.sub doesn't recognize, like "all".
218 canon_targets="$canon_targets $targ"
236 for targ in $target $canon_targets
238 if test "x$targ" = "xall"; then
240 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
241 BUILD_SRCONV='$(SRCONV_PROG)'
242 NLMCONV_DEFS="-DNLMCONV_I386 -DNLMCONV_ALPHA -DNLMCONV_POWERPC -DNLMCONV_SPARC"
243 BUILD_MISC="${BUILD_MISC} "'bin2c$(EXEEXT_FOR_BUILD)'
247 i[3-7]86*-*-netware*)
249 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
250 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_I386"
253 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
254 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_ALPHA"
257 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
258 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_POWERPC"
261 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
262 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_SPARC"
266 *-*-hms*) BUILD_SRCONV='$(SRCONV_PROG)' ;;
270 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
271 if test -z "$DLLTOOL_DEFAULT"; then
272 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM_EPOC"
274 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM_EPOC -DDLLTOOL_ARM"
275 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
277 arm-wince-pe* | arm-*-wince)
278 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
279 if test -z "$DLLTOOL_DEFAULT"; then
280 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM_WINCE"
282 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM_WINCE -DDLLTOOL_ARM"
283 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
286 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
287 if test -z "$DLLTOOL_DEFAULT"; then
288 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM"
290 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
291 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
294 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
295 if test -z "$DLLTOOL_DEFAULT"; then
296 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM"
298 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
299 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
302 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
303 if test -z "$DLLTOOL_DEFAULT"; then
304 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MX86_64"
306 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MX86_64"
307 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
308 BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
311 i[3-7]86-*-pe* | i[3-7]86-*-cygwin* | i[3-7]86-*-mingw32** | i[3-7]86-*-netbsdpe*)
313 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
314 if test -z "$DLLTOOL_DEFAULT"; then
315 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_I386"
317 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
318 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
319 BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
324 BUILD_DLLTOOL='$(DLLTOOL_PROG)'
325 if test -z "$DLLTOOL_DEFAULT"; then
326 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_I386"
328 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
335 OBJDUMP_DEFS="-DAIX_WEAK_SUPPORT"
337 powerpc*-*-pe* | powerpc*-*-cygwin*)
338 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
339 if test -z "$DLLTOOL_DEFAULT"; then
340 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_PPC"
342 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_PPC"
343 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
345 powerpc*-*-linux* | powerpc*-*-elf*)
346 BUILD_INSTALL_MISC="${BUILD_INSTALL_MISC} embedspu"
349 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
350 if test -z "$DLLTOOL_DEFAULT"; then
351 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_SH"
353 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_SH"
354 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
357 BUILD_MISC="${BUILD_MISC} "'bin2c$(EXEEXT_FOR_BUILD)'
360 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
361 if test -z "$DLLTOOL_DEFAULT"; then
362 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MIPS"
364 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MIPS"
365 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
368 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
369 if test -z "$DLLTOOL_DEFAULT"; then
370 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MCORE"
372 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE"
373 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
376 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
377 if test -z "$DLLTOOL_DEFAULT"; then
378 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MCORE_ELF"
380 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE_ELF"
383 OBJDUMP_DEFS="-DSKIP_ZEROES=256 -DSKIP_ZEROES_AT_END=0"
389 DLLTOOL_DEFS="$DLLTOOL_DEFS $DLLTOOL_DEFAULT"
391 if test "${with_windres+set}" = set; then
392 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
395 AC_SUBST(NLMCONV_DEFS)
396 AC_SUBST(BUILD_NLMCONV)
397 AC_SUBST(BUILD_SRCONV)
398 AC_SUBST(BUILD_DLLTOOL)
399 AC_SUBST(DLLTOOL_DEFS)
400 AC_SUBST(BUILD_WINDRES)
401 AC_SUBST(BUILD_DLLWRAP)
403 AC_SUBST(BUILD_INSTALL_MISC)
404 AC_SUBST(OBJDUMP_DEFS)
406 AC_DEFINE_UNQUOTED(TARGET, "${target}", [Configured target name.])
409 . $srcdir/../bfd/config.bfd
410 if test "x$targ_underscore" = "xyes"; then
415 AC_DEFINE_UNQUOTED(TARGET_PREPENDS_UNDERSCORE, $UNDERSCORE,
416 [Define to 1 if user symbol names have a leading underscore, 0 if not.])
419 for targ_alias in `echo $target_alias $enable_targets | sed 's/,/ /g'`
421 # Canonicalize the secondary target names.
422 result=`$ac_config_sub $targ_alias 2>/dev/null`
423 if test -n "$result"; then
429 . ${srcdir}/configure.tgt
432 EMULATION_VECTOR=$targ_emul_vector
436 AC_SUBST(EMULATION_VECTOR)
438 # Required for html and install-html
439 AC_SUBST(datarootdir)
443 AC_OUTPUT(Makefile doc/Makefile po/Makefile.in:po/Make-in)